Passed
Push — master ( 000527...89a5ea )
by William
03:18
created
dashboard/application/models/computing-support/New_account_model.php 2 patches
Spacing   +14 added lines, -14 removed lines patch added patch discarded remove patch
@@ -9,14 +9,14 @@  discard block
 block discarded – undo
9 9
     public function create($first_name, $last_name, $ern, $position, $faculty, $department, $room, $ext, $con_start, $con_end, $password, $site) {
10 10
 
11 11
         $firstchar = substr($this->input->post('first_name'), 0, 1);
12
-        $builtUsername = strtolower($firstchar) . strtolower($this->input->post('last_name'));
12
+        $builtUsername = strtolower($firstchar).strtolower($this->input->post('last_name'));
13 13
         //check user name is new
14 14
 
15
-        $username = $this->config->item('ldapshortdomain') . $builtUsername;
15
+        $username = $this->config->item('ldapshortdomain').$builtUsername;
16 16
         // specify the LDAP server to connect to
17 17
         $conn = ldap_connect($this->config->item('ldapserver')) or die("Oh no can't create LDAP connection");
18 18
         // bind to the LDAP server specified above
19
-        if (!ldap_bind($conn, $this->config->item('ldapbindun'),"@".$this->config->item('ldapdomain'), $this->config->item('ldapbindpass')))
19
+        if (!ldap_bind($conn, $this->config->item('ldapbindun'), "@".$this->config->item('ldapdomain'), $this->config->item('ldapbindpass')))
20 20
             echo "Invalid credentials.";
21 21
         // Search for user in directory
22 22
         $cred = explode('\\', $username);
@@ -27,7 +27,7 @@  discard block
 block discarded – undo
27 27
         $info = ldap_count_entries($conn, $result);
28 28
 
29 29
         if ($info != 0) {
30
-            $builtUsername = $builtUsername . "2";
30
+            $builtUsername = $builtUsername."2";
31 31
         }
32 32
 
33 33
 
@@ -38,17 +38,17 @@  discard block
 block discarded – undo
38 38
         $this->email->message('A new staff account has been requested by yourself
39 39
                       
40 40
         Account Details:
41
-        Name: ' . $this->input->post('first_name') . ' ' . $this->input->post('last_name') . '
42
-        Position: ' . $this->input->post('position') . '
43
-        ERN: ' . $this->input->post('ern') . '
44
-        Faculty: ' . $this->input->post('faculty') . '
45
-        Department: ' . $this->input->post('department') . '
46
-        Room: ' . $this->input->post('room') . '
47
-        Phone: ' . $this->input->post('ext') . '
48
-        Site: ' . $this->input->post('site') . '
41
+        Name: ' . $this->input->post('first_name').' '.$this->input->post('last_name').'
42
+        Position: ' . $this->input->post('position').'
43
+        ERN: ' . $this->input->post('ern').'
44
+        Faculty: ' . $this->input->post('faculty').'
45
+        Department: ' . $this->input->post('department').'
46
+        Room: ' . $this->input->post('room').'
47
+        Phone: ' . $this->input->post('ext').'
48
+        Site: ' . $this->input->post('site').'
49 49
                            
50
-        Username: ' . $builtUsername . '
51
-        Password: ' . $this->input->post('password') . '
50
+        Username: ' . $builtUsername.'
51
+        Password: ' . $this->input->post('password').'
52 52
 
53 53
 
54 54
         If this account was made by mistake please contact Computing Support.
Please login to merge, or discard this patch.
Braces   +3 added lines, -2 removed lines patch added patch discarded remove patch
@@ -16,8 +16,9 @@
 block discarded – undo
16 16
         // specify the LDAP server to connect to
17 17
         $conn = ldap_connect($this->config->item('ldapserver')) or die("Oh no can't create LDAP connection");
18 18
         // bind to the LDAP server specified above
19
-        if (!ldap_bind($conn, $this->config->item('ldapbindun'),"@".$this->config->item('ldapdomain'), $this->config->item('ldapbindpass')))
20
-            echo "Invalid credentials.";
19
+        if (!ldap_bind($conn, $this->config->item('ldapbindun'),"@".$this->config->item('ldapdomain'), $this->config->item('ldapbindpass'))) {
20
+                    echo "Invalid credentials.";
21
+        }
21 22
         // Search for user in directory
22 23
         $cred = explode('\\', $username);
23 24
         list($domain, $user) = $cred;
Please login to merge, or discard this patch.
dashboard/application/models/computing-support/Address_book_Model.php 1 patch
Indentation   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -55,7 +55,7 @@  discard block
 block discarded – undo
55 55
         
56 56
         $this->db->select('faculty');
57 57
         $this->db->where('cat_id', $faculty);
58
-	$this->db->from('faculty');
58
+    $this->db->from('faculty');
59 59
         return $this->db->get()->result_array();
60 60
     }
61 61
     
@@ -63,7 +63,7 @@  discard block
 block discarded – undo
63 63
         
64 64
         $this->db->select('subfaculty');
65 65
         $this->db->where('cat_key', $department);
66
-	$this->db->from('facultysub');
66
+    $this->db->from('facultysub');
67 67
         return $this->db->get()->result_array();
68 68
     }
69 69
 }
Please login to merge, or discard this patch.
dashboard/application/models/computing-support/Private_drive_model.php 1 patch
Indentation   +5 added lines, -5 removed lines patch added patch discarded remove patch
@@ -70,7 +70,7 @@  discard block
 block discarded – undo
70 70
     public function cancel($id) {
71 71
             
72 72
         $this->db->where('id', $id);
73
-	$this->db->from('private_drive');
73
+    $this->db->from('private_drive');
74 74
         $data = array(
75 75
             'status' => '5',
76 76
             'canceled_by' => $_SESSION['ldap']['full_name'],
@@ -82,7 +82,7 @@  discard block
 block discarded – undo
82 82
     public function fh_reject($id) {
83 83
             
84 84
         $this->db->where('id', $id);
85
-	$this->db->from('private_drive');
85
+    $this->db->from('private_drive');
86 86
         $data = array(
87 87
             'status' => '3',
88 88
             'approved_at' => date("Y-m-d H:i:s", time()),
@@ -93,7 +93,7 @@  discard block
 block discarded – undo
93 93
     public function fh_approve($id) {
94 94
             
95 95
         $this->db->where('id', $id);
96
-	$this->db->from('private_drive');
96
+    $this->db->from('private_drive');
97 97
         $data = array(
98 98
             'status' => '1',
99 99
             'approved_at' => date("Y-m-d H:i:s", time()),
@@ -105,7 +105,7 @@  discard block
 block discarded – undo
105 105
     public function cs_reject($id) {
106 106
             
107 107
         $this->db->where('id', $id);
108
-	$this->db->from('private_drive');
108
+    $this->db->from('private_drive');
109 109
         $data = array(
110 110
             'status' => '4',
111 111
             'actioned_at' => date("Y-m-d H:i:s", time()),
@@ -117,7 +117,7 @@  discard block
 block discarded – undo
117 117
     public function cs_approve($id) {
118 118
             
119 119
         $this->db->where('id', $id);
120
-	$this->db->from('private_drive');
120
+    $this->db->from('private_drive');
121 121
         $data = array(
122 122
             'status' => '2',
123 123
             'actioned_at' => date("Y-m-d H:i:s", time()),
Please login to merge, or discard this patch.
dashboard/application/models/computing-support/Ownership_model.php 1 patch
Indentation   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -54,7 +54,7 @@  discard block
 block discarded – undo
54 54
     public function approve($id) {
55 55
             
56 56
         $this->db->where('id', $id);
57
-	$this->db->from('ownership');
57
+    $this->db->from('ownership');
58 58
         $data = array(
59 59
             'status' => '3',
60 60
             'transfer' => date("Y-m-d H:i:s", time()),
@@ -67,7 +67,7 @@  discard block
 block discarded – undo
67 67
     public function reject($id) {
68 68
             
69 69
         $this->db->where('id', $id);
70
-	$this->db->from('ownership');
70
+    $this->db->from('ownership');
71 71
         $data = array(
72 72
             'status' => '2',
73 73
             'transfer' => date("Y-m-d H:i:s", time()),
@@ -80,7 +80,7 @@  discard block
 block discarded – undo
80 80
     public function cancel($id) {
81 81
             
82 82
         $this->db->where('id', $id);
83
-	$this->db->from('ownership');
83
+    $this->db->from('ownership');
84 84
         $data = array(
85 85
             'status' => '4',
86 86
         );
@@ -91,7 +91,7 @@  discard block
 block discarded – undo
91 91
     public function terms($id) {
92 92
             
93 93
         $this->db->where('id', $id);
94
-	$this->db->from('ownership');
94
+    $this->db->from('ownership');
95 95
         $data = array(
96 96
             'status' => '1',
97 97
             'policy_accepted' => date("Y-m-d H:i:s", time()),
Please login to merge, or discard this patch.
dashboard/application/models/computing-support/Temporary_account_model.php 3 patches
Indentation   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -146,7 +146,7 @@  discard block
 block discarded – undo
146 146
     public function cancel($id) {
147 147
             
148 148
         $this->db->where('id', $id);
149
-	$this->db->from('temporary_account');
149
+    $this->db->from('temporary_account');
150 150
         $data = array(
151 151
             'status' => '3',
152 152
         );
@@ -156,7 +156,7 @@  discard block
 block discarded – undo
156 156
     public function reject($id) {
157 157
             
158 158
         $this->db->where('id', $id);
159
-	$this->db->from('temporary_account');
159
+    $this->db->from('temporary_account');
160 160
         $data = array(
161 161
             'status' => '2',
162 162
             'status_at' => date("Y-m-d H:i:s", time()),
@@ -168,7 +168,7 @@  discard block
 block discarded – undo
168 168
     public function approve($id) {
169 169
             
170 170
         $this->db->where('id', $id);
171
-	$this->db->from('temporary_account');
171
+    $this->db->from('temporary_account');
172 172
         $data = array(
173 173
             'status' => '1',
174 174
             'status_at' => date("Y-m-d H:i:s", time()),
@@ -181,7 +181,7 @@  discard block
 block discarded – undo
181 181
     public function created_account($id) {
182 182
             
183 183
         $this->db->where('id', $id);
184
-	$this->db->from('temporary_account');
184
+    $this->db->from('temporary_account');
185 185
         $data = array(
186 186
             'created' => '1',
187 187
         );
Please login to merge, or discard this patch.
Spacing   +5 added lines, -5 removed lines patch added patch discarded remove patch
@@ -10,14 +10,14 @@  discard block
 block discarded – undo
10 10
     public function create($logged, $faculty, $department, $requester, $first_name, $last_name, $email, $username, $expiry) {
11 11
         
12 12
         $firstchar = substr($this->input->post('first_name'), 0, 1);
13
-        $builtUsername = strtolower($firstchar) . strtolower($this->input->post('last_name'));
13
+        $builtUsername = strtolower($firstchar).strtolower($this->input->post('last_name'));
14 14
         
15 15
         //check user name is new
16
-        $username = $this->config->item('ldapshortdomain') . $builtUsername;
16
+        $username = $this->config->item('ldapshortdomain').$builtUsername;
17 17
         // specify the LDAP server to connect to
18 18
         $conn = ldap_connect($this->config->item('ldapserver')) or die("Oh no can't create LDAP connection");
19 19
         // bind to the LDAP server specified above
20
-        if (!ldap_bind($conn, $this->config->item('ldapbindun'),"@".$this->config->item('ldapdomain'), $this->config->item('ldapbindpass')))
20
+        if (!ldap_bind($conn, $this->config->item('ldapbindun'), "@".$this->config->item('ldapdomain'), $this->config->item('ldapbindpass')))
21 21
             echo "Invalid credentials.";
22 22
         // Search for user in directory
23 23
         $cred = explode('\\', $username);
@@ -28,7 +28,7 @@  discard block
 block discarded – undo
28 28
         $info = ldap_count_entries($conn, $result);
29 29
 
30 30
         if ($info != 0) {
31
-            $builtUsername = $builtUsername . "2";
31
+            $builtUsername = $builtUsername."2";
32 32
         }
33 33
 
34 34
         function randomPassword() {
@@ -49,7 +49,7 @@  discard block
 block discarded – undo
49 49
 
50 50
         //Format hh:mm:ss
51 51
         $timeFromForm = "00:00:00";
52
-        $dateWithTime = $dateFromForm . " " . $timeFromForm;
52
+        $dateWithTime = $dateFromForm." ".$timeFromForm;
53 53
 
54 54
         function convertDateToUnix($input) {
55 55
             $format = 'd-m-Y H:i:s';
Please login to merge, or discard this patch.
Braces   +3 added lines, -2 removed lines patch added patch discarded remove patch
@@ -16,8 +16,9 @@
 block discarded – undo
16 16
         // specify the LDAP server to connect to
17 17
         $conn = ldap_connect($this->config->item('ldapserver')) or die("Oh no can't create LDAP connection");
18 18
         // bind to the LDAP server specified above
19
-        if (!ldap_bind($conn, $this->config->item('ldapbindun'),"@".$this->config->item('ldapdomain'), $this->config->item('ldapbindpass')))
20
-            echo "Invalid credentials.";
19
+        if (!ldap_bind($conn, $this->config->item('ldapbindun'),"@".$this->config->item('ldapdomain'), $this->config->item('ldapbindpass'))) {
20
+                    echo "Invalid credentials.";
21
+        }
21 22
         // Search for user in directory
22 23
         $cred = explode('\\', $username);
23 24
         list($domain, $user) = $cred;
Please login to merge, or discard this patch.
dashboard/application/models/computing-support/Status_model.php 1 patch
Indentation   +14 added lines, -14 removed lines patch added patch discarded remove patch
@@ -3,7 +3,7 @@  discard block
 block discarded – undo
3 3
 class Status_model extends CI_Model {
4 4
     
5 5
     public function __construct() {
6
-	parent::__construct();		
6
+    parent::__construct();		
7 7
     }
8 8
     
9 9
     public function view() {
@@ -18,7 +18,7 @@  discard block
 block discarded – undo
18 18
         
19 19
         $data = array(
20 20
             'id', 'name', 'status', 'url', 'auto_status'
21
-	);
21
+    );
22 22
             
23 23
         $query = $this->db->get('status');
24 24
         return $query->result_array();
@@ -59,9 +59,9 @@  discard block
 block discarded – undo
59 59
         $data = array(
60 60
             'sid' => $service_id,
61 61
             'auto_status' => $service_status
62
-	);	
62
+    );	
63 63
         
64
-	return $this->db->insert('status_logs', $data);
64
+    return $this->db->insert('status_logs', $data);
65 65
     }
66 66
     
67 67
     public function percentage($sid) {
@@ -70,7 +70,7 @@  discard block
 block discarded – undo
70 70
         $this->db->where('sid', $sid);
71 71
         $this->db->order_by('id', 'DESC');
72 72
         $this->db->limit('5000');
73
-	$this->db->from('status_logs');
73
+    $this->db->from('status_logs');
74 74
         $total = $this->db->get()->num_rows();
75 75
         
76 76
         $this->db->select('sid');
@@ -78,7 +78,7 @@  discard block
 block discarded – undo
78 78
         $this->db->where('auto_status', 1);
79 79
         $this->db->order_by('id', 'DESC');
80 80
         $this->db->limit('5000');
81
-	$this->db->from('status_logs');
81
+    $this->db->from('status_logs');
82 82
         $up = $this->db->get()->num_rows();
83 83
         
84 84
         if (empty($total)) { 
@@ -99,7 +99,7 @@  discard block
 block discarded – undo
99 99
             
100 100
         $this->db->select('sid');
101 101
         $this->db->where('sid', $sid);
102
-	$this->db->from('status_logs');
102
+    $this->db->from('status_logs');
103 103
         $this->db->delete();
104 104
         
105 105
     }
@@ -108,7 +108,7 @@  discard block
 block discarded – undo
108 108
         
109 109
         $this->db->select();
110 110
         $this->db->where('id', $sid);
111
-	$this->db->from('status');
111
+    $this->db->from('status');
112 112
         $query = $this->db->get();
113 113
         return $query->result_array();
114 114
     }
@@ -129,10 +129,10 @@  discard block
 block discarded – undo
129 129
             'auto_status'   => $status,
130 130
             'last_update'   => date("Y-m-d H:i:s", time()),
131 131
             'by'   => $username,
132
-	);
132
+    );
133 133
         
134 134
         $this->db->where('id', $id);
135
-	return $this->db->update('status', $data);
135
+    return $this->db->update('status', $data);
136 136
     }
137 137
 
138 138
     public function create($name, $icon, $url, $category, $status) {
@@ -146,21 +146,21 @@  discard block
 block discarded – undo
146 146
             'auto_status'   => $status,
147 147
             'last_update'   => date("Y-m-d H:i:s", time()),
148 148
             'by'   => $username,
149
-	);
149
+    );
150 150
         
151
-	return $this->db->insert('status', $data);
151
+    return $this->db->insert('status', $data);
152 152
     }
153 153
     
154 154
     public function delete($sid) {
155 155
             
156 156
         $this->db->select('sid');
157 157
         $this->db->where('sid', $sid);
158
-	$this->db->from('status_logs');
158
+    $this->db->from('status_logs');
159 159
         $this->db->delete();
160 160
         
161 161
         $this->db->select('id');
162 162
         $this->db->where('id', $sid);
163
-	$this->db->from('status');
163
+    $this->db->from('status');
164 164
         $this->db->delete();
165 165
         
166 166
     }
Please login to merge, or discard this patch.
dashboard/application/views/errors/cli/error_general.php 1 patch
Indentation   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -2,7 +2,7 @@
 block discarded – undo
2 2
 defined('BASEPATH') OR exit('No direct script access allowed');
3 3
 
4 4
 echo "\nERROR: ",
5
-	$heading,
6
-	"\n\n",
7
-	$message,
8
-	"\n\n";
9 5
\ No newline at end of file
6
+    $heading,
7
+    "\n\n",
8
+    $message,
9
+    "\n\n";
10 10
\ No newline at end of file
Please login to merge, or discard this patch.
dashboard/application/views/errors/cli/error_db.php 1 patch
Indentation   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -2,7 +2,7 @@
 block discarded – undo
2 2
 defined('BASEPATH') OR exit('No direct script access allowed');
3 3
 
4 4
 echo "\nDatabase error: ",
5
-	$heading,
6
-	"\n\n",
7
-	$message,
8
-	"\n\n";
9 5
\ No newline at end of file
6
+    $heading,
7
+    "\n\n",
8
+    $message,
9
+    "\n\n";
10 10
\ No newline at end of file
Please login to merge, or discard this patch.
dashboard/application/views/templates/table_assets.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -1,8 +1,8 @@
 block discarded – undo
1 1
 <?php defined('BASEPATH') OR exit('No direct script access allowed'); ?>
2 2
 
3
-<?php foreach($css_files as $file): ?>
3
+<?php foreach ($css_files as $file): ?>
4 4
     <link type="text/css" rel="stylesheet" href="<?= $file; ?>" />
5 5
 <?php endforeach; ?>
6
-<?php foreach($js_files as $file): ?>
6
+<?php foreach ($js_files as $file): ?>
7 7
     <script src="<?= $file; ?>"></script>
8 8
 <?php endforeach; ?>
9 9
\ No newline at end of file
Please login to merge, or discard this patch.