Passed
Push — master ( fb547d...d3b3ea )
by William
02:49
created
dashboard/application/controllers/computing-support/Temporary_account.php 1 patch
Spacing   +15 added lines, -15 removed lines patch added patch discarded remove patch
@@ -17,7 +17,7 @@  discard block
 block discarded – undo
17 17
         $data = array();
18 18
         $data['faculty'] = $this->temporary_account_model->get_faculty();
19 19
         $data['department'] = $this->temporary_account_model->get_department();
20
-        $data['tempid'] = "tempuser" . $this->temporary_account_model->get_next_temp();
20
+        $data['tempid'] = "tempuser".$this->temporary_account_model->get_next_temp();
21 21
 
22 22
         //validation
23 23
         $this->form_validation->set_rules('faculty', 'Faculty', 'trim|required');
@@ -47,10 +47,10 @@  discard block
 block discarded – undo
47 47
                 $this->email->from('[email protected]', 'Temporary Logon Account Request');
48 48
                 $this->email->to('[email protected]');
49 49
                 $this->email->subject('Temporary Logon Account Request');
50
-                $this->email->message('A temporary network account has been requested by ' . $_SESSION['ldap']['full_name']
51
-                        . ' for ' . $this->input->post('requester')
50
+                $this->email->message('A temporary network account has been requested by '.$_SESSION['ldap']['full_name']
51
+                        . ' for '.$this->input->post('requester')
52 52
                         . ''
53
-                        . 'the user will be: ' . $this->input->post('first_name') . ' ' . $this->input->post('last_name')
53
+                        . 'the user will be: '.$this->input->post('first_name').' '.$this->input->post('last_name')
54 54
                         . ''
55 55
                         . 'Approve https://intranet.cant-col.ac.uk/dashboard/computing-support/temporary-account/approve');
56 56
                 $this->email->send();
@@ -123,7 +123,7 @@  discard block
 block discarded – undo
123 123
                 $id = $_GET['id'];
124 124
                 $this->temporary_account_model->cancel($id);
125 125
 
126
-                $function = 'temp_account_CANCEL_' . $id;
126
+                $function = 'temp_account_CANCEL_'.$id;
127 127
                 $this->user_model->function_log($function);
128 128
 
129 129
                 redirect($_SERVER['HTTP_REFERER']);
@@ -143,7 +143,7 @@  discard block
 block discarded – undo
143 143
                 $id = $_GET['id'];
144 144
                 $this->temporary_account_model->reject($id);
145 145
 
146
-                $function = 'temp_account_REJECT_' . $id;
146
+                $function = 'temp_account_REJECT_'.$id;
147 147
                 $this->user_model->function_log($function);
148 148
 
149 149
                 redirect($_SERVER['HTTP_REFERER']);
@@ -164,7 +164,7 @@  discard block
 block discarded – undo
164 164
                 $id = $_GET['id'];
165 165
                 //$this->temporary_account_model->approve($id);
166 166
 
167
-                $function = 'temp_account_APPROVED_' . $id;
167
+                $function = 'temp_account_APPROVED_'.$id;
168 168
                 $this->user_model->function_log($function);
169 169
         
170 170
                     $data = array();
@@ -180,12 +180,12 @@  discard block
 block discarded – undo
180 180
 
181 181
                     //Format dd-mm-yyyy
182 182
                     //Expiry is beginning of day (thats why +1 day
183
-                    $dateFromForm = date('d-m-Y', strtotime($data['AD'][0]['expiry']. ' +1 day'));
183
+                    $dateFromForm = date('d-m-Y', strtotime($data['AD'][0]['expiry'].' +1 day'));
184 184
 
185 185
                     //Format hh:mm:ss
186 186
                     $timeFromForm = "00:00:00";
187 187
 
188
-                    $dateWithTime = $dateFromForm . " " . $timeFromForm;
188
+                    $dateWithTime = $dateFromForm." ".$timeFromForm;
189 189
 
190 190
                     function convertDateToUnix($input) {
191 191
                         $format = 'd-m-Y H:i:s';
@@ -202,7 +202,7 @@  discard block
 block discarded – undo
202 202
                     //$WIN = convertUnixtoWin($UNIX);
203 203
 
204 204
                     //Create Unicode password
205
-                    $passwordWithQuotes = '"' . $data['AD'][0]['password'] . '"';
205
+                    $passwordWithQuotes = '"'.$data['AD'][0]['password'].'"';
206 206
                     $ldaprecord["unicodepwd"] = iconv('UTF-8', 'UTF-16LE', $passwordWithQuotes);
207 207
 
208 208
                     //Build Active Directory record     
@@ -211,20 +211,20 @@  discard block
 block discarded – undo
211 211
                     $ldaprecord["sn"] = $data['AD'][0]['last_name'];
212 212
                     $ldaprecord["mail"] = $data['AD'][0]['email'];
213 213
                     $ldaprecord["sAMAccountName"] = $data['AD'][0]['username'];
214
-                    $ldaprecord["displayName"] = $data['AD'][0]['first_name'] . " " . $data['AD'][0]['last_name'];
214
+                    $ldaprecord["displayName"] = $data['AD'][0]['first_name']." ".$data['AD'][0]['last_name'];
215 215
                     $ldaprecord["l"] = "Canterbury";
216
-                    $ldaprecord["description"] = "Temp account created by dashboard for " . $ldaprecord["displayName"];
216
+                    $ldaprecord["description"] = "Temp account created by dashboard for ".$ldaprecord["displayName"];
217 217
                     //$ldaprecord["accountExpires"] = $WIN;
218 218
                     $ldaprecord["UserAccountControl"] = "512"; //512 - Enabled Account
219
-                    $ldaprecord['userPrincipalName'] = $data['AD'][0]['username'] . '@cant-col.ac.uk';
219
+                    $ldaprecord['userPrincipalName'] = $data['AD'][0]['username'].'@cant-col.ac.uk';
220 220
                     $ldaprecord['objectclass'][0] = "top";
221 221
                     $ldaprecord['objectclass'][1] = "person";
222 222
                     $ldaprecord['objectclass'][2] = "organizationalPerson";
223 223
                     $ldaprecord['objectclass'][3] = "user";
224
-                    $dn = 'CN=' . $ldaprecord["cn"] . ',OU=Temp Accounts,OU=Students,OU=Accounts,DC=cant-col,DC=ac,DC=uk';
224
+                    $dn = 'CN='.$ldaprecord["cn"].',OU=Temp Accounts,OU=Students,OU=Accounts,DC=cant-col,DC=ac,DC=uk';
225 225
 
226 226
                     // Connect to Active Directory
227
-                    $ds = ldap_connect('ldaps://' . $AD_server);
227
+                    $ds = ldap_connect('ldaps://'.$AD_server);
228 228
 
229 229
                     if ($ds) {
230 230
                         ldap_set_option($ds, LDAP_OPT_PROTOCOL_VERSION, 3);
Please login to merge, or discard this patch.
dashboard/application/helpers/breadcrumb_helper.php 1 patch
Braces   +12 added lines, -10 removed lines patch added patch discarded remove patch
@@ -1,4 +1,6 @@  discard block
 block discarded – undo
1
-<?php  if ( ! defined('BASEPATH')) exit('No direct script access allowed');
1
+<?php  if ( ! defined('BASEPATH')) {
2
+    exit('No direct script access allowed');
3
+}
2 4
 
3 5
 /**
4 6
  * Breadcrumb helper
@@ -242,9 +244,11 @@  discard block
 block discarded – undo
242 244
                 $segment .= $uri_array_original[$i].'/';
243 245
 
244 246
                 // If replace value is an array
245
-                if (! in_array($i, $skip_key, TRUE) && is_array($value)) // Skip link if replace value is null
247
+                if (! in_array($i, $skip_key, TRUE) && is_array($value)) {
248
+                    // Skip link if replace value is null
246 249
                 {
247 250
                     $number_added_value_array = count($value);
251
+                }
248 252
 
249 253
                     foreach ($value as $pair_values)
250 254
                     {
@@ -254,8 +258,7 @@  discard block
 block discarded – undo
254 258
                         if ($number_pv_array == 1)
255 259
                         {
256 260
                             $val_name = $pv_array[0];
257
-                        }
258
-                        else
261
+                        } else
259 262
                         {
260 263
                             $val_name = $pv_array[1];
261 264
                         }
@@ -293,12 +296,10 @@  discard block
 block discarded – undo
293 296
                         if ($number_pv_array == 1 || $val_url == $uri_array_original[$i])
294 297
                         {
295 298
                             $new_segment_url = $segment;
296
-                        }
297
-                        else if ($val_url[0] == '/')
299
+                        } else if ($val_url[0] == '/')
298 300
                         {
299 301
                             $new_segment_url = base_url().substr($val_url, 1);
300
-                        }
301
-                        else
302
+                        } else
302 303
                         {
303 304
                             $new_segment_url = $segment.$val_url;
304 305
                         }
@@ -308,14 +309,15 @@  discard block
 block discarded – undo
308 309
                         $str_name = array();
309 310
                         $str_name[] = ucwords($val_name);
310 311
                     }
311
-                }
312
-                else if (! in_array($i, $skip_key, TRUE)) // If value is NOT an array
312
+                } else if (! in_array($i, $skip_key, TRUE)) {
313
+                    // If value is NOT an array
313 314
                 {
314 315
                     // Add multilanguage
315 316
                     if ($CI->config->item('multilang'))
316 317
                     {
317 318
                         if ($CI->lang->line($value)) {
318 319
                             $value = ucwords($CI->lang->line($value));
320
+                }
319 321
                         }
320 322
                     }
321 323
 
Please login to merge, or discard this patch.