@@ -48,15 +48,15 @@ discard block |
||
48 | 48 | $this->email->to($user_email); |
49 | 49 | $this->email->cc($_SESSION['ldap']['email']); |
50 | 50 | $this->email->subject('Private Drive Access Request'); |
51 | - $this->email->message('Access to a private drive has been requested for ' . $user . ' by ' . $requester . '. |
|
52 | - This request is currently waiting for approval by ' . $approver . '. |
|
51 | + $this->email->message('Access to a private drive has been requested for '.$user.' by '.$requester.'. |
|
52 | + This request is currently waiting for approval by ' . $approver.'. |
|
53 | 53 | |
54 | 54 | You can check the status of the request at the following link: |
55 | 55 | https://intranet.cant-col.ac.uk/dashboard/computing-support/private-drive/check |
56 | 56 | |
57 | 57 | If this request was made by mistake; you can cancel the request using the same link. |
58 | 58 | |
59 | - Folder path: ' . $path . ' |
|
59 | + Folder path: ' . $path.' |
|
60 | 60 | Access level: ' . $access); |
61 | 61 | $this->email->send(); |
62 | 62 | |
@@ -66,13 +66,13 @@ discard block |
||
66 | 66 | $this->email->from('[email protected]', 'Private Drive Access'); |
67 | 67 | $this->email->to($faculty_email); |
68 | 68 | $this->email->subject('Private Drive Access Request'); |
69 | - $this->email->message('Access to a private drive has been requested for ' . $user . ' by ' . $requester . '. |
|
69 | + $this->email->message('Access to a private drive has been requested for '.$user.' by '.$requester.'. |
|
70 | 70 | You have been marked as the approver for this request. |
71 | 71 | |
72 | 72 | Please approve or reject this request using the following link: |
73 | 73 | https://intranet.cant-col.ac.uk/dashboard/computing-support/private-drive/check |
74 | 74 | |
75 | - Folder path: ' . $path . ' |
|
75 | + Folder path: ' . $path.' |
|
76 | 76 | Access level: ' . $access); |
77 | 77 | $this->email->send(); |
78 | 78 | |
@@ -143,7 +143,7 @@ discard block |
||
143 | 143 | $id = $_GET['id']; |
144 | 144 | $this->private_drive_model->cancel($id); |
145 | 145 | |
146 | - $function = 'private_drive_CANCEL_' . $id; |
|
146 | + $function = 'private_drive_CANCEL_'.$id; |
|
147 | 147 | $this->user_model->function_log($function); |
148 | 148 | |
149 | 149 | redirect($_SERVER['HTTP_REFERER']); |
@@ -175,16 +175,16 @@ discard block |
||
175 | 175 | $this->email->to($requester_email); |
176 | 176 | $this->email->cc($user_email); |
177 | 177 | $this->email->subject('Private Drive Access Request Rejected'); |
178 | - $this->email->message('Access to a private drive has been requested for ' . $get_request[0]['user'] . ' by ' . $get_request[0]['requester'] . ' has been rejected by ' . $get_request[0]['approver'] . '. |
|
178 | + $this->email->message('Access to a private drive has been requested for '.$get_request[0]['user'].' by '.$get_request[0]['requester'].' has been rejected by '.$get_request[0]['approver'].'. |
|
179 | 179 | |
180 | 180 | You can view the status of this request and others like it using the below link: |
181 | 181 | https://intranet.cant-col.ac.uk/dashboard/computing-support/private-drive/check |
182 | 182 | |
183 | - Folder path: ' . $get_request[0]['path'] . ' |
|
183 | + Folder path: ' . $get_request[0]['path'].' |
|
184 | 184 | Access level: ' . $get_request[0]['access']); |
185 | 185 | $this->email->send(); |
186 | 186 | |
187 | - $function = 'private_drive_FH_REJECT_' . $id; |
|
187 | + $function = 'private_drive_FH_REJECT_'.$id; |
|
188 | 188 | $this->user_model->function_log($function); |
189 | 189 | |
190 | 190 | redirect($_SERVER['HTTP_REFERER']); |
@@ -211,18 +211,18 @@ discard block |
||
211 | 211 | $this->email->to('[email protected]'); |
212 | 212 | $this->email->cc('[email protected]'); |
213 | 213 | $this->email->subject('Private Drive Access Request Approved'); |
214 | - $this->email->message('Access to a private drive has been requested for ' . $get_request[0]['user'] . ' by ' . $get_request[0]['requester'] . ' has been approved by ' . $get_request[0]['approver'] . '. |
|
214 | + $this->email->message('Access to a private drive has been requested for '.$get_request[0]['user'].' by '.$get_request[0]['requester'].' has been approved by '.$get_request[0]['approver'].'. |
|
215 | 215 | |
216 | 216 | This request needs to be actioned |
217 | 217 | |
218 | 218 | View the details of the request at the following link: |
219 | 219 | https://intranet.cant-col.ac.uk/dashboard/computing-support/private-drive/pending |
220 | 220 | |
221 | - Folder path: ' . $get_request[0]['path'] . ' |
|
221 | + Folder path: ' . $get_request[0]['path'].' |
|
222 | 222 | Access level: ' . $get_request[0]['access']); |
223 | 223 | $this->email->send(); |
224 | 224 | |
225 | - $function = 'private_drive_FH_APPROVED_' . $id; |
|
225 | + $function = 'private_drive_FH_APPROVED_'.$id; |
|
226 | 226 | $this->user_model->function_log($function); |
227 | 227 | |
228 | 228 | redirect($_SERVER['HTTP_REFERER']); |
@@ -254,16 +254,16 @@ discard block |
||
254 | 254 | $this->email->to($requester_email); |
255 | 255 | $this->email->cc($user_email); |
256 | 256 | $this->email->subject('Private Drive Access Request Rejected'); |
257 | - $this->email->message('Access to a private drive has been requested for ' . $get_request[0]['user'] . ' by ' . $get_request[0]['requester'] . ' and approved by ' . $get_request[0]['approver'] . ' has been rejected by Computing Support. |
|
257 | + $this->email->message('Access to a private drive has been requested for '.$get_request[0]['user'].' by '.$get_request[0]['requester'].' and approved by '.$get_request[0]['approver'].' has been rejected by Computing Support. |
|
258 | 258 | |
259 | 259 | You can view the status of this request and others like it using the below link: |
260 | 260 | https://intranet.cant-col.ac.uk/dashboard/computing-support/private-drive/check |
261 | 261 | |
262 | - Folder path: ' . $get_request[0]['path'] . ' |
|
262 | + Folder path: ' . $get_request[0]['path'].' |
|
263 | 263 | Access level: ' . $get_request[0]['access']); |
264 | 264 | $this->email->send(); |
265 | 265 | |
266 | - $function = 'private_drive_CS_REJECT_' . $id; |
|
266 | + $function = 'private_drive_CS_REJECT_'.$id; |
|
267 | 267 | $this->user_model->function_log($function); |
268 | 268 | |
269 | 269 | redirect($_SERVER['HTTP_REFERER']); |
@@ -296,18 +296,18 @@ discard block |
||
296 | 296 | $this->email->to($requester_email); |
297 | 297 | $this->email->cc($user_email); |
298 | 298 | $this->email->subject('Private Drive Access Request Actioned'); |
299 | - $this->email->message('Access to a private drive has been requested for ' . $get_request[0]['user'] . ' by ' . $get_request[0]['requester'] . ' and approved by ' . $get_request[0]['approver'] . ' has been actioned by Computing Support. |
|
299 | + $this->email->message('Access to a private drive has been requested for '.$get_request[0]['user'].' by '.$get_request[0]['requester'].' and approved by '.$get_request[0]['approver'].' has been actioned by Computing Support. |
|
300 | 300 | |
301 | 301 | For the permissions to be applied, you must log out and on again. |
302 | 302 | |
303 | 303 | You can view your other requests at the following link. |
304 | 304 | https://intranet.cant-col.ac.uk/dashboard/computing-support/private-drive/check |
305 | 305 | |
306 | - Folder path: ' . $get_request[0]['path'] . ' |
|
306 | + Folder path: ' . $get_request[0]['path'].' |
|
307 | 307 | Access level: ' . $get_request[0]['access']); |
308 | 308 | $this->email->send(); |
309 | 309 | |
310 | - $function = 'private_drive_CS_APPROVED_' . $id; |
|
310 | + $function = 'private_drive_CS_APPROVED_'.$id; |
|
311 | 311 | $this->user_model->function_log($function); |
312 | 312 | |
313 | 313 | redirect($_SERVER['HTTP_REFERER']); |
@@ -52,7 +52,7 @@ discard block |
||
52 | 52 | $this->load->view('computing-support/room-move/complete'); |
53 | 53 | $this->load->view('templates/footer'); |
54 | 54 | |
55 | - if ($furniture == "No Furniture"){ |
|
55 | + if ($furniture == "No Furniture") { |
|
56 | 56 | |
57 | 57 | $to_add = array('[email protected]', '[email protected]', '[email protected]'); |
58 | 58 | |
@@ -165,7 +165,7 @@ discard block |
||
165 | 165 | $staff_involved_un6 = $user_un6; |
166 | 166 | $staff_involved_email6 = $this->room_move_model->get_email_username($staff_involved_un6); |
167 | 167 | |
168 | - $staff_involved_un7= $user_un7; |
|
168 | + $staff_involved_un7 = $user_un7; |
|
169 | 169 | $staff_involved_email7 = $this->room_move_model->get_email_username($staff_involved_un7); |
170 | 170 | |
171 | 171 | $staff_involved_un8 = $user_un8; |
@@ -256,7 +256,7 @@ discard block |
||
256 | 256 | $id = $_GET['id']; |
257 | 257 | $this->room_move_model->cancel($id); |
258 | 258 | |
259 | - $function = 'room_move_CANCEL_' . $id; |
|
259 | + $function = 'room_move_CANCEL_'.$id; |
|
260 | 260 | $this->user_model->function_log($function); |
261 | 261 | |
262 | 262 | $get_request = $this->room_move_model->get_request($id); |
@@ -282,7 +282,7 @@ discard block |
||
282 | 282 | $staff_involved_un6 = $get_request[0]['staff_involved_un6']; |
283 | 283 | $staff_involved_email6 = $this->room_move_model->get_email_username($staff_involved_un6); |
284 | 284 | |
285 | - $staff_involved_un7= $get_request[0]['staff_involved_un7']; |
|
285 | + $staff_involved_un7 = $get_request[0]['staff_involved_un7']; |
|
286 | 286 | $staff_involved_email7 = $this->room_move_model->get_email_username($staff_involved_un7); |
287 | 287 | |
288 | 288 | $staff_involved_un8 = $get_request[0]['staff_involved_un8']; |
@@ -328,7 +328,7 @@ discard block |
||
328 | 328 | $id = $_GET['id']; |
329 | 329 | $this->room_move_model->eh_reject($id); |
330 | 330 | |
331 | - $function = 'room_move_EH_REJECT_' . $id; |
|
331 | + $function = 'room_move_EH_REJECT_'.$id; |
|
332 | 332 | $this->user_model->function_log($function); |
333 | 333 | |
334 | 334 | $get_request = $this->room_move_model->get_request($id); |
@@ -354,7 +354,7 @@ discard block |
||
354 | 354 | $staff_involved_un6 = $get_request[0]['staff_involved_un6']; |
355 | 355 | $staff_involved_email6 = $this->room_move_model->get_email_username($staff_involved_un6); |
356 | 356 | |
357 | - $staff_involved_un7= $get_request[0]['staff_involved_un7']; |
|
357 | + $staff_involved_un7 = $get_request[0]['staff_involved_un7']; |
|
358 | 358 | $staff_involved_email7 = $this->room_move_model->get_email_username($staff_involved_un7); |
359 | 359 | |
360 | 360 | $staff_involved_un8 = $get_request[0]['staff_involved_un8']; |
@@ -402,7 +402,7 @@ discard block |
||
402 | 402 | $id = $_GET['id']; |
403 | 403 | $this->room_move_model->eh_approve($id); |
404 | 404 | |
405 | - $function = 'room_move_EH_APPROVED_' . $id; |
|
405 | + $function = 'room_move_EH_APPROVED_'.$id; |
|
406 | 406 | $this->user_model->function_log($function); |
407 | 407 | |
408 | 408 | $get_request = $this->room_move_model->get_request($id); |
@@ -444,7 +444,7 @@ discard block |
||
444 | 444 | $reason = $_GET['reason']; |
445 | 445 | $this->room_move_model->cs_reject($id); |
446 | 446 | |
447 | - $function = 'room_move_CS_REJECT_' . $id; |
|
447 | + $function = 'room_move_CS_REJECT_'.$id; |
|
448 | 448 | $this->user_model->function_log($function); |
449 | 449 | |
450 | 450 | $get_request = $this->room_move_model->get_request($id); |
@@ -470,7 +470,7 @@ discard block |
||
470 | 470 | $staff_involved_un6 = $get_request[0]['staff_involved_un6']; |
471 | 471 | $staff_involved_email6 = $this->room_move_model->get_email_username($staff_involved_un6); |
472 | 472 | |
473 | - $staff_involved_un7= $get_request[0]['staff_involved_un7']; |
|
473 | + $staff_involved_un7 = $get_request[0]['staff_involved_un7']; |
|
474 | 474 | $staff_involved_email7 = $this->room_move_model->get_email_username($staff_involved_un7); |
475 | 475 | |
476 | 476 | $staff_involved_un8 = $get_request[0]['staff_involved_un8']; |
@@ -518,7 +518,7 @@ discard block |
||
518 | 518 | $id = $_GET['id']; |
519 | 519 | $this->room_move_model->cs_approve($id); |
520 | 520 | |
521 | - $function = 'room_move_CS_APPROVED_' . $id; |
|
521 | + $function = 'room_move_CS_APPROVED_'.$id; |
|
522 | 522 | $this->user_model->function_log($function); |
523 | 523 | |
524 | 524 | $get_request = $this->room_move_model->get_request($id); |
@@ -544,7 +544,7 @@ discard block |
||
544 | 544 | $staff_involved_un6 = $get_request[0]['staff_involved_un6']; |
545 | 545 | $staff_involved_email6 = $this->room_move_model->get_email_username($staff_involved_un6); |
546 | 546 | |
547 | - $staff_involved_un7= $get_request[0]['staff_involved_un7']; |
|
547 | + $staff_involved_un7 = $get_request[0]['staff_involved_un7']; |
|
548 | 548 | $staff_involved_email7 = $this->room_move_model->get_email_username($staff_involved_un7); |
549 | 549 | |
550 | 550 | $staff_involved_un8 = $get_request[0]['staff_involved_un8']; |
@@ -591,7 +591,7 @@ discard block |
||
591 | 591 | $id = $_GET['id']; |
592 | 592 | $this->room_move_model->cs_complete($id); |
593 | 593 | |
594 | - $function = 'room_move_CS_COMPLETE_' . $id; |
|
594 | + $function = 'room_move_CS_COMPLETE_'.$id; |
|
595 | 595 | $this->user_model->function_log($function); |
596 | 596 | |
597 | 597 | $get_request = $this->room_move_model->get_request($id); |
@@ -617,7 +617,7 @@ discard block |
||
617 | 617 | $staff_involved_un6 = $get_request[0]['staff_involved_un6']; |
618 | 618 | $staff_involved_email6 = $this->room_move_model->get_email_username($staff_involved_un6); |
619 | 619 | |
620 | - $staff_involved_un7= $get_request[0]['staff_involved_un7']; |
|
620 | + $staff_involved_un7 = $get_request[0]['staff_involved_un7']; |
|
621 | 621 | $staff_involved_email7 = $this->room_move_model->get_email_username($staff_involved_un7); |
622 | 622 | |
623 | 623 | $staff_involved_un8 = $get_request[0]['staff_involved_un8']; |
@@ -72,7 +72,7 @@ discard block |
||
72 | 72 | $crud = new grocery_CRUD(); |
73 | 73 | $crud->set_table('disposals'); |
74 | 74 | $crud->set_subject('disposals', 'Disposals'); |
75 | - $crud->display_as('sn','Serial Number'); |
|
75 | + $crud->display_as('sn', 'Serial Number'); |
|
76 | 76 | $crud->unset_columns('id'); |
77 | 77 | $crud->unset_add(); |
78 | 78 | $crud->unset_read(); |
@@ -98,7 +98,7 @@ discard block |
||
98 | 98 | $crud->set_table('disposals_current'); |
99 | 99 | $crud->set_subject('disposals', 'Disposals'); |
100 | 100 | $crud->set_primary_key('id'); |
101 | - $crud->display_as('sn','Serial Number'); |
|
101 | + $crud->display_as('sn', 'Serial Number'); |
|
102 | 102 | $crud->unset_columns('id'); |
103 | 103 | $crud->unset_add(); |
104 | 104 | $crud->unset_read(); |
@@ -33,7 +33,7 @@ discard block |
||
33 | 33 | $this->email->to($_SESSION['ldap']['email']); |
34 | 34 | $this->email->subject('Mobile Phone Policy'); |
35 | 35 | $this->email->message( |
36 | - 'Name: ' . $_SESSION['ldap']['fll_name']. ' |
|
36 | + 'Name: '.$_SESSION['ldap']['fll_name'].' |
|
37 | 37 | |
38 | 38 | Has accepted the Canterbury College mobile phone policy. |
39 | 39 | |
@@ -66,11 +66,11 @@ discard block |
||
66 | 66 | $this->email->to('[email protected]'); |
67 | 67 | $this->email->subject('Mobile Phone Policy Accepted'); |
68 | 68 | $this->email->message( |
69 | - 'Name: ' . $_SESSION['ldap']['full_name'] . ' |
|
69 | + 'Name: '.$_SESSION['ldap']['full_name'].' |
|
70 | 70 | |
71 | 71 | Has accepted the Canterbury College mobile phone policy. |
72 | 72 | |
73 | - ' . date("d/m/Y") . ' ' . date("h:i")); |
|
73 | + ' . date("d/m/Y").' '.date("h:i")); |
|
74 | 74 | $this->email->send(); |
75 | 75 | |
76 | 76 | $function = 'mobile_policy_accepted'; |
@@ -16,7 +16,7 @@ discard block |
||
16 | 16 | |
17 | 17 | $data['faculty'] = $this->temporary_account_model->get_faculty(); |
18 | 18 | $data['department'] = $this->temporary_account_model->get_department(); |
19 | - $data['tempid'] = "tempuser" . $this->temporary_account_model->get_next_temp(); |
|
19 | + $data['tempid'] = "tempuser".$this->temporary_account_model->get_next_temp(); |
|
20 | 20 | |
21 | 21 | //validation |
22 | 22 | $this->form_validation->set_rules('faculty', 'Faculty', 'trim|required'); |
@@ -46,10 +46,10 @@ discard block |
||
46 | 46 | $this->email->from('[email protected]', 'Temporary Logon Account Request'); |
47 | 47 | $this->email->to('[email protected]'); |
48 | 48 | $this->email->subject('Temporary Logon Account Request'); |
49 | - $this->email->message('A temporary network account has been requested by ' . $_SESSION['ldap']['full_name'] |
|
50 | - . ' for ' . $this->input->post('requester') |
|
49 | + $this->email->message('A temporary network account has been requested by '.$_SESSION['ldap']['full_name'] |
|
50 | + . ' for '.$this->input->post('requester') |
|
51 | 51 | . '' |
52 | - . 'the user will be: ' . $this->input->post('first_name') . ' ' . $this->input->post('last_name') |
|
52 | + . 'the user will be: '.$this->input->post('first_name').' '.$this->input->post('last_name') |
|
53 | 53 | . '' |
54 | 54 | . 'Approve https://intranet.cant-col.ac.uk/dashboard/computing-support/temporary-account/approve'); |
55 | 55 | $this->email->send(); |
@@ -118,7 +118,7 @@ discard block |
||
118 | 118 | $id = $_GET['id']; |
119 | 119 | $this->temporary_account_model->cancel($id); |
120 | 120 | |
121 | - $function = 'temp_account_CANCEL_' . $id; |
|
121 | + $function = 'temp_account_CANCEL_'.$id; |
|
122 | 122 | $this->user_model->function_log($function); |
123 | 123 | |
124 | 124 | redirect($_SERVER['HTTP_REFERER']); |
@@ -138,7 +138,7 @@ discard block |
||
138 | 138 | $id = $_GET['id']; |
139 | 139 | $this->temporary_account_model->reject($id); |
140 | 140 | |
141 | - $function = 'temp_account_REJECT_' . $id; |
|
141 | + $function = 'temp_account_REJECT_'.$id; |
|
142 | 142 | $this->user_model->function_log($function); |
143 | 143 | |
144 | 144 | redirect($_SERVER['HTTP_REFERER']); |
@@ -159,7 +159,7 @@ discard block |
||
159 | 159 | $id = $_GET['id']; |
160 | 160 | //$this->temporary_account_model->approve($id); |
161 | 161 | |
162 | - $function = 'temp_account_APPROVED_' . $id; |
|
162 | + $function = 'temp_account_APPROVED_'.$id; |
|
163 | 163 | $this->user_model->function_log($function); |
164 | 164 | |
165 | 165 | $data['AD'] = $this->temporary_account_model->get_account($id); |
@@ -174,12 +174,12 @@ discard block |
||
174 | 174 | |
175 | 175 | //Format dd-mm-yyyy |
176 | 176 | //Expiry is beginning of day (thats why +1 day |
177 | - $dateFromForm = date('d-m-Y', strtotime($data['AD'][0]['expiry']. ' +1 day')); |
|
177 | + $dateFromForm = date('d-m-Y', strtotime($data['AD'][0]['expiry'].' +1 day')); |
|
178 | 178 | |
179 | 179 | //Format hh:mm:ss |
180 | 180 | $timeFromForm = "00:00:00"; |
181 | 181 | |
182 | - $dateWithTime = $dateFromForm . " " . $timeFromForm; |
|
182 | + $dateWithTime = $dateFromForm." ".$timeFromForm; |
|
183 | 183 | |
184 | 184 | function convertDateToUnix($input) { |
185 | 185 | $format = 'd-m-Y H:i:s'; |
@@ -196,7 +196,7 @@ discard block |
||
196 | 196 | //$WIN = convertUnixtoWin($UNIX); |
197 | 197 | |
198 | 198 | //Create Unicode password |
199 | - $passwordWithQuotes = '"' . $data['AD'][0]['password'] . '"'; |
|
199 | + $passwordWithQuotes = '"'.$data['AD'][0]['password'].'"'; |
|
200 | 200 | $ldaprecord["unicodepwd"] = iconv('UTF-8', 'UTF-16LE', $passwordWithQuotes); |
201 | 201 | |
202 | 202 | //Build Active Directory record |
@@ -205,20 +205,20 @@ discard block |
||
205 | 205 | $ldaprecord["sn"] = $data['AD'][0]['last_name']; |
206 | 206 | $ldaprecord["mail"] = $data['AD'][0]['email']; |
207 | 207 | $ldaprecord["sAMAccountName"] = $data['AD'][0]['username']; |
208 | - $ldaprecord["displayName"] = $data['AD'][0]['first_name'] . " " . $data['AD'][0]['last_name']; |
|
208 | + $ldaprecord["displayName"] = $data['AD'][0]['first_name']." ".$data['AD'][0]['last_name']; |
|
209 | 209 | $ldaprecord["l"] = "Canterbury"; |
210 | - $ldaprecord["description"] = "Temp account created by dashboard for " . $ldaprecord["displayName"]; |
|
210 | + $ldaprecord["description"] = "Temp account created by dashboard for ".$ldaprecord["displayName"]; |
|
211 | 211 | //$ldaprecord["accountExpires"] = $WIN; |
212 | 212 | $ldaprecord["UserAccountControl"] = "512"; //512 - Enabled Account |
213 | - $ldaprecord['userPrincipalName'] = $data['AD'][0]['username'] . '@cant-col.ac.uk'; |
|
213 | + $ldaprecord['userPrincipalName'] = $data['AD'][0]['username'].'@cant-col.ac.uk'; |
|
214 | 214 | $ldaprecord['objectclass'][0] = "top"; |
215 | 215 | $ldaprecord['objectclass'][1] = "person"; |
216 | 216 | $ldaprecord['objectclass'][2] = "organizationalPerson"; |
217 | 217 | $ldaprecord['objectclass'][3] = "user"; |
218 | - $dn = 'CN=' . $ldaprecord["cn"] . ',OU=Temp Accounts,OU=Students,OU=Accounts,DC=cant-col,DC=ac,DC=uk'; |
|
218 | + $dn = 'CN='.$ldaprecord["cn"].',OU=Temp Accounts,OU=Students,OU=Accounts,DC=cant-col,DC=ac,DC=uk'; |
|
219 | 219 | |
220 | 220 | // Connect to Active Directory |
221 | - $ds = ldap_connect('ldaps://' . $AD_server); |
|
221 | + $ds = ldap_connect('ldaps://'.$AD_server); |
|
222 | 222 | |
223 | 223 | if ($ds) { |
224 | 224 | ldap_set_option($ds, LDAP_OPT_PROTOCOL_VERSION, 3); |
@@ -44,11 +44,11 @@ |
||
44 | 44 | $this->email->from('[email protected]', 'Address Book Update'); |
45 | 45 | $this->email->to('[email protected]'); |
46 | 46 | $this->email->subject('Address Book Update'); |
47 | - $this->email->message('A global address book update request been made by ' . $_SESSION['ldap']['full_name'] . ' |
|
48 | - Change name to: ' . $name . ' |
|
49 | - Change Faculty to: ' . $faculty[0]['faculty'] . ' |
|
50 | - Change Department to: ' . $department[0]['subfaculty'] . ' |
|
51 | - Change Room to : ' . $room . ' |
|
47 | + $this->email->message('A global address book update request been made by '.$_SESSION['ldap']['full_name'].' |
|
48 | + Change name to: ' . $name.' |
|
49 | + Change Faculty to: ' . $faculty[0]['faculty'].' |
|
50 | + Change Department to: ' . $department[0]['subfaculty'].' |
|
51 | + Change Room to : ' . $room.' |
|
52 | 52 | Change Telephone to : ' . $phone.' |
53 | 53 | Change Position to : ' . $position); |
54 | 54 |
@@ -37,7 +37,7 @@ discard block |
||
37 | 37 | !empty($entries[$x]['samaccountname'][0]) && |
38 | 38 | !empty($entries[$x]['sn'][0]) && |
39 | 39 | !empty($entries[$x]['mail'][0])) { |
40 | - $ad_users[] = array('first_name' => trim($entries[$x]['givenname'][0]), 'last_name' => trim($entries[$x]['sn'][0]), 'full_name' => trim($entries[$x]['givenname'][0]).' '. trim($entries[$x]['sn'][0]), 'username' => trim($entries[$x]['samaccountname'][0]), 'email' => trim($entries[$x]['mail'][0])); |
|
40 | + $ad_users[] = array('first_name' => trim($entries[$x]['givenname'][0]), 'last_name' => trim($entries[$x]['sn'][0]), 'full_name' => trim($entries[$x]['givenname'][0]).' '.trim($entries[$x]['sn'][0]), 'username' => trim($entries[$x]['samaccountname'][0]), 'email' => trim($entries[$x]['mail'][0])); |
|
41 | 41 | } |
42 | 42 | } |
43 | 43 | } |
@@ -49,7 +49,7 @@ discard block |
||
49 | 49 | !empty($entries[$x]['samaccountname'][0]) && |
50 | 50 | !empty($entries[$x]['sn'][0]) && |
51 | 51 | !empty($entries[$x]['mail'][0])) { |
52 | - $ad_users[] = array('first_name' => trim($entries[$x]['givenname'][0]), 'last_name' => trim($entries[$x]['sn'][0]), 'full_name' => trim($entries[$x]['givenname'][0]).' '. trim($entries[$x]['sn'][0]), 'username' => trim($entries[$x]['samaccountname'][0]), 'email' => trim($entries[$x]['mail'][0])); |
|
52 | + $ad_users[] = array('first_name' => trim($entries[$x]['givenname'][0]), 'last_name' => trim($entries[$x]['sn'][0]), 'full_name' => trim($entries[$x]['givenname'][0]).' '.trim($entries[$x]['sn'][0]), 'username' => trim($entries[$x]['samaccountname'][0]), 'email' => trim($entries[$x]['mail'][0])); |
|
53 | 53 | } |
54 | 54 | } |
55 | 55 | } |
@@ -61,7 +61,7 @@ discard block |
||
61 | 61 | !empty($entries[$x]['samaccountname'][0]) && |
62 | 62 | !empty($entries[$x]['sn'][0]) && |
63 | 63 | !empty($entries[$x]['mail'][0])) { |
64 | - $ad_users[] = array('first_name' => trim($entries[$x]['givenname'][0]), 'last_name' => trim($entries[$x]['sn'][0]), 'full_name' => trim($entries[$x]['givenname'][0]).' '. trim($entries[$x]['sn'][0]), 'username' => trim($entries[$x]['samaccountname'][0]), 'email' => trim($entries[$x]['mail'][0])); |
|
64 | + $ad_users[] = array('first_name' => trim($entries[$x]['givenname'][0]), 'last_name' => trim($entries[$x]['sn'][0]), 'full_name' => trim($entries[$x]['givenname'][0]).' '.trim($entries[$x]['sn'][0]), 'username' => trim($entries[$x]['samaccountname'][0]), 'email' => trim($entries[$x]['mail'][0])); |
|
65 | 65 | } |
66 | 66 | } |
67 | 67 | } |
@@ -73,7 +73,7 @@ discard block |
||
73 | 73 | !empty($entries[$x]['samaccountname'][0]) && |
74 | 74 | !empty($entries[$x]['sn'][0]) && |
75 | 75 | !empty($entries[$x]['mail'][0])) { |
76 | - $ad_users[] = array('first_name' => trim($entries[$x]['givenname'][0]), 'last_name' => trim($entries[$x]['sn'][0]), 'full_name' => trim($entries[$x]['givenname'][0]).' '. trim($entries[$x]['sn'][0]), 'username' => trim($entries[$x]['samaccountname'][0]), 'email' => trim($entries[$x]['mail'][0])); |
|
76 | + $ad_users[] = array('first_name' => trim($entries[$x]['givenname'][0]), 'last_name' => trim($entries[$x]['sn'][0]), 'full_name' => trim($entries[$x]['givenname'][0]).' '.trim($entries[$x]['sn'][0]), 'username' => trim($entries[$x]['samaccountname'][0]), 'email' => trim($entries[$x]['mail'][0])); |
|
77 | 77 | } |
78 | 78 | } |
79 | 79 | } |
@@ -85,7 +85,7 @@ discard block |
||
85 | 85 | !empty($entries[$x]['samaccountname'][0]) && |
86 | 86 | !empty($entries[$x]['sn'][0]) && |
87 | 87 | !empty($entries[$x]['mail'][0])) { |
88 | - $ad_users[] = array('first_name' => trim($entries[$x]['givenname'][0]), 'last_name' => trim($entries[$x]['sn'][0]), 'full_name' => trim($entries[$x]['givenname'][0]).' '. trim($entries[$x]['sn'][0]), 'username' => trim($entries[$x]['samaccountname'][0]), 'email' => trim($entries[$x]['mail'][0])); |
|
88 | + $ad_users[] = array('first_name' => trim($entries[$x]['givenname'][0]), 'last_name' => trim($entries[$x]['sn'][0]), 'full_name' => trim($entries[$x]['givenname'][0]).' '.trim($entries[$x]['sn'][0]), 'username' => trim($entries[$x]['samaccountname'][0]), 'email' => trim($entries[$x]['mail'][0])); |
|
89 | 89 | } |
90 | 90 | } |
91 | 91 | } |
@@ -27,7 +27,7 @@ discard block |
||
27 | 27 | * @version 1.5.6 |
28 | 28 | * @link http://www.grocerycrud.com/documentation |
29 | 29 | */ |
30 | -class Grocery_crud_model extends CI_Model { |
|
30 | +class Grocery_crud_model extends CI_Model { |
|
31 | 31 | |
32 | 32 | protected $primary_key = null; |
33 | 33 | protected $table_name = null; |
@@ -47,37 +47,37 @@ discard block |
||
47 | 47 | |
48 | 48 | function get_list() |
49 | 49 | { |
50 | - if($this->table_name === null) |
|
50 | + if ($this->table_name === null) |
|
51 | 51 | return false; |
52 | 52 | |
53 | 53 | $select = "`{$this->table_name}`.*"; |
54 | 54 | |
55 | 55 | //set_relation special queries |
56 | - if(!empty($this->relation)) |
|
56 | + if (!empty($this->relation)) |
|
57 | 57 | { |
58 | - foreach($this->relation as $relation) |
|
58 | + foreach ($this->relation as $relation) |
|
59 | 59 | { |
60 | - list($field_name , $related_table , $related_field_title) = $relation; |
|
60 | + list($field_name, $related_table, $related_field_title) = $relation; |
|
61 | 61 | $unique_join_name = $this->_unique_join_name($field_name); |
62 | 62 | $unique_field_name = $this->_unique_field_name($field_name); |
63 | 63 | |
64 | - if(strstr($related_field_title,'{')) |
|
64 | + if (strstr($related_field_title, '{')) |
|
65 | 65 | { |
66 | - $related_field_title = str_replace(" "," ",$related_field_title); |
|
67 | - $select .= ", CONCAT('".str_replace(array('{','}'),array("',COALESCE({$unique_join_name}.",", ''),'"),str_replace("'","\\'",$related_field_title))."') as $unique_field_name"; |
|
66 | + $related_field_title = str_replace(" ", " ", $related_field_title); |
|
67 | + $select .= ", CONCAT('".str_replace(array('{', '}'), array("',COALESCE({$unique_join_name}.", ", ''),'"), str_replace("'", "\\'", $related_field_title))."') as $unique_field_name"; |
|
68 | 68 | } |
69 | 69 | else |
70 | 70 | { |
71 | 71 | $select .= ", $unique_join_name.$related_field_title AS $unique_field_name"; |
72 | 72 | } |
73 | 73 | |
74 | - if($this->field_exists($related_field_title)) |
|
74 | + if ($this->field_exists($related_field_title)) |
|
75 | 75 | $select .= ", `{$this->table_name}`.$related_field_title AS '{$this->table_name}.$related_field_title'"; |
76 | 76 | } |
77 | 77 | } |
78 | 78 | |
79 | 79 | //set_relation_n_n special queries. We prefer sub queries from a simple join for the relation_n_n as it is faster and more stable on big tables. |
80 | - if(!empty($this->relation_n_n)) |
|
80 | + if (!empty($this->relation_n_n)) |
|
81 | 81 | { |
82 | 82 | $select = $this->relation_n_n_queries($select); |
83 | 83 | } |
@@ -106,20 +106,20 @@ discard block |
||
106 | 106 | protected function relation_n_n_queries($select) |
107 | 107 | { |
108 | 108 | $this_table_primary_key = $this->get_primary_key(); |
109 | - foreach($this->relation_n_n as $relation_n_n) |
|
109 | + foreach ($this->relation_n_n as $relation_n_n) |
|
110 | 110 | { |
111 | 111 | list($field_name, $relation_table, $selection_table, $primary_key_alias_to_this_table, |
112 | - $primary_key_alias_to_selection_table, $title_field_selection_table, $priority_field_relation_table) = array_values((array)$relation_n_n); |
|
112 | + $primary_key_alias_to_selection_table, $title_field_selection_table, $priority_field_relation_table) = array_values((array) $relation_n_n); |
|
113 | 113 | |
114 | 114 | $primary_key_selection_table = $this->get_primary_key($selection_table); |
115 | 115 | |
116 | 116 | $field = ""; |
117 | - $use_template = strpos($title_field_selection_table,'{') !== false; |
|
117 | + $use_template = strpos($title_field_selection_table, '{') !== false; |
|
118 | 118 | $field_name_hash = $this->_unique_field_name($title_field_selection_table); |
119 | - if($use_template) |
|
119 | + if ($use_template) |
|
120 | 120 | { |
121 | 121 | $title_field_selection_table = str_replace(" ", " ", $title_field_selection_table); |
122 | - $field .= "CONCAT('".str_replace(array('{','}'),array("',COALESCE(",", ''),'"),str_replace("'","\\'",$title_field_selection_table))."')"; |
|
122 | + $field .= "CONCAT('".str_replace(array('{', '}'), array("',COALESCE(", ", ''),'"), str_replace("'", "\\'", $title_field_selection_table))."')"; |
|
123 | 123 | } |
124 | 124 | else |
125 | 125 | { |
@@ -135,29 +135,29 @@ discard block |
||
135 | 135 | return $select; |
136 | 136 | } |
137 | 137 | |
138 | - function order_by($order_by , $direction) |
|
138 | + function order_by($order_by, $direction) |
|
139 | 139 | { |
140 | - $this->db->order_by( $order_by , $direction ); |
|
140 | + $this->db->order_by($order_by, $direction); |
|
141 | 141 | } |
142 | 142 | |
143 | 143 | function where($key, $value = NULL, $escape = TRUE) |
144 | 144 | { |
145 | - $this->db->where( $key, $value, $escape); |
|
145 | + $this->db->where($key, $value, $escape); |
|
146 | 146 | } |
147 | 147 | |
148 | 148 | function or_where($key, $value = NULL, $escape = TRUE) |
149 | 149 | { |
150 | - $this->db->or_where( $key, $value, $escape); |
|
150 | + $this->db->or_where($key, $value, $escape); |
|
151 | 151 | } |
152 | 152 | |
153 | 153 | function having($key, $value = NULL, $escape = TRUE) |
154 | 154 | { |
155 | - $this->db->having( $key, $value, $escape); |
|
155 | + $this->db->having($key, $value, $escape); |
|
156 | 156 | } |
157 | 157 | |
158 | 158 | function or_having($key, $value = NULL, $escape = TRUE) |
159 | 159 | { |
160 | - $this->db->or_having( $key, $value, $escape); |
|
160 | + $this->db->or_having($key, $value, $escape); |
|
161 | 161 | } |
162 | 162 | |
163 | 163 | function like($field, $match = '', $side = 'both') |
@@ -172,18 +172,18 @@ discard block |
||
172 | 172 | |
173 | 173 | function limit($value, $offset = '') |
174 | 174 | { |
175 | - $this->db->limit( $value , $offset ); |
|
175 | + $this->db->limit($value, $offset); |
|
176 | 176 | } |
177 | 177 | |
178 | 178 | function get_total_results() |
179 | 179 | { |
180 | 180 | //set_relation_n_n special queries. We prefer sub queries from a simple join for the relation_n_n as it is faster and more stable on big tables. |
181 | - if(!empty($this->relation_n_n)) |
|
181 | + if (!empty($this->relation_n_n)) |
|
182 | 182 | { |
183 | 183 | $select = "{$this->table_name}.*"; |
184 | 184 | $select = $this->relation_n_n_queries($select); |
185 | 185 | |
186 | - $this->db->select($select,false); |
|
186 | + $this->db->select($select, false); |
|
187 | 187 | } |
188 | 188 | |
189 | 189 | return $this->db->get($this->table_name)->num_rows(); |
@@ -191,7 +191,7 @@ discard block |
||
191 | 191 | |
192 | 192 | function set_basic_table($table_name = null) |
193 | 193 | { |
194 | - if( !($this->db->table_exists($table_name)) ) |
|
194 | + if (!($this->db->table_exists($table_name))) |
|
195 | 195 | return false; |
196 | 196 | |
197 | 197 | $this->table_name = $table_name; |
@@ -202,21 +202,21 @@ discard block |
||
202 | 202 | function get_edit_values($primary_key_value) |
203 | 203 | { |
204 | 204 | $primary_key_field = $this->get_primary_key(); |
205 | - $this->db->where($primary_key_field,$primary_key_value); |
|
205 | + $this->db->where($primary_key_field, $primary_key_value); |
|
206 | 206 | $result = $this->db->get($this->table_name)->row(); |
207 | 207 | return $result; |
208 | 208 | } |
209 | 209 | |
210 | - function join_relation($field_name , $related_table , $related_field_title) |
|
210 | + function join_relation($field_name, $related_table, $related_field_title) |
|
211 | 211 | { |
212 | 212 | $related_primary_key = $this->get_primary_key($related_table); |
213 | 213 | |
214 | - if($related_primary_key !== false) |
|
214 | + if ($related_primary_key !== false) |
|
215 | 215 | { |
216 | 216 | $unique_name = $this->_unique_join_name($field_name); |
217 | - $this->db->join( $related_table.' as '.$unique_name , "$unique_name.$related_primary_key = {$this->table_name}.$field_name",'left'); |
|
217 | + $this->db->join($related_table.' as '.$unique_name, "$unique_name.$related_primary_key = {$this->table_name}.$field_name", 'left'); |
|
218 | 218 | |
219 | - $this->relation[$field_name] = array($field_name , $related_table , $related_field_title); |
|
219 | + $this->relation[$field_name] = array($field_name, $related_table, $related_field_title); |
|
220 | 220 | |
221 | 221 | return true; |
222 | 222 | } |
@@ -231,15 +231,15 @@ discard block |
||
231 | 231 | |
232 | 232 | protected function _unique_join_name($field_name) |
233 | 233 | { |
234 | - return 'j'.substr(md5($field_name),0,8); //This j is because is better for a string to begin with a letter and not with a number |
|
234 | + return 'j'.substr(md5($field_name), 0, 8); //This j is because is better for a string to begin with a letter and not with a number |
|
235 | 235 | } |
236 | 236 | |
237 | 237 | protected function _unique_field_name($field_name) |
238 | 238 | { |
239 | - return 's'.substr(md5($field_name),0,8); //This s is because is better for a string to begin with a letter and not with a number |
|
239 | + return 's'.substr(md5($field_name), 0, 8); //This s is because is better for a string to begin with a letter and not with a number |
|
240 | 240 | } |
241 | 241 | |
242 | - function get_relation_array($field_name , $related_table , $related_field_title, $where_clause, $order_by, $limit = null, $search_like = null) |
|
242 | + function get_relation_array($field_name, $related_table, $related_field_title, $where_clause, $order_by, $limit = null, $search_like = null) |
|
243 | 243 | { |
244 | 244 | $relation_array = array(); |
245 | 245 | $field_name_hash = $this->_unique_field_name($field_name); |
@@ -248,27 +248,27 @@ discard block |
||
248 | 248 | |
249 | 249 | $select = "$related_table.$related_primary_key, "; |
250 | 250 | |
251 | - if(strstr($related_field_title,'{')) |
|
251 | + if (strstr($related_field_title, '{')) |
|
252 | 252 | { |
253 | 253 | $related_field_title = str_replace(" ", " ", $related_field_title); |
254 | - $select .= "CONCAT('".str_replace(array('{','}'),array("',COALESCE(",", ''),'"),str_replace("'","\\'",$related_field_title))."') as $field_name_hash"; |
|
254 | + $select .= "CONCAT('".str_replace(array('{', '}'), array("',COALESCE(", ", ''),'"), str_replace("'", "\\'", $related_field_title))."') as $field_name_hash"; |
|
255 | 255 | } |
256 | 256 | else |
257 | 257 | { |
258 | 258 | $select .= "$related_table.$related_field_title as $field_name_hash"; |
259 | 259 | } |
260 | 260 | |
261 | - $this->db->select($select,false); |
|
262 | - if($where_clause !== null) |
|
261 | + $this->db->select($select, false); |
|
262 | + if ($where_clause !== null) |
|
263 | 263 | $this->db->where($where_clause); |
264 | 264 | |
265 | - if($where_clause !== null) |
|
265 | + if ($where_clause !== null) |
|
266 | 266 | $this->db->where($where_clause); |
267 | 267 | |
268 | - if($limit !== null) |
|
268 | + if ($limit !== null) |
|
269 | 269 | $this->db->limit($limit); |
270 | 270 | |
271 | - if($search_like !== null) |
|
271 | + if ($search_like !== null) |
|
272 | 272 | $this->db->having("$field_name_hash LIKE '%".$this->db->escape_like_str($search_like)."%'"); |
273 | 273 | |
274 | 274 | $order_by !== null |
@@ -277,7 +277,7 @@ discard block |
||
277 | 277 | |
278 | 278 | $results = $this->db->get($related_table)->result(); |
279 | 279 | |
280 | - foreach($results as $row) |
|
280 | + foreach ($results as $row) |
|
281 | 281 | { |
282 | 282 | $relation_array[$row->$related_primary_key] = $row->$field_name_hash; |
283 | 283 | } |
@@ -285,14 +285,14 @@ discard block |
||
285 | 285 | return $relation_array; |
286 | 286 | } |
287 | 287 | |
288 | - function get_ajax_relation_array($search, $field_name , $related_table , $related_field_title, $where_clause, $order_by) |
|
288 | + function get_ajax_relation_array($search, $field_name, $related_table, $related_field_title, $where_clause, $order_by) |
|
289 | 289 | { |
290 | - return $this->get_relation_array($field_name , $related_table , $related_field_title, $where_clause, $order_by, 10 , $search); |
|
290 | + return $this->get_relation_array($field_name, $related_table, $related_field_title, $where_clause, $order_by, 10, $search); |
|
291 | 291 | } |
292 | 292 | |
293 | - function get_relation_total_rows($field_name , $related_table , $related_field_title, $where_clause) |
|
293 | + function get_relation_total_rows($field_name, $related_table, $related_field_title, $where_clause) |
|
294 | 294 | { |
295 | - if($where_clause !== null) |
|
295 | + if ($where_clause !== null) |
|
296 | 296 | $this->db->where($where_clause); |
297 | 297 | |
298 | 298 | return $this->db->count_all_results($related_table); |
@@ -302,24 +302,24 @@ discard block |
||
302 | 302 | { |
303 | 303 | $select = ""; |
304 | 304 | $related_field_title = $field_info->title_field_selection_table; |
305 | - $use_template = strpos($related_field_title,'{') !== false;; |
|
305 | + $use_template = strpos($related_field_title, '{') !== false; ; |
|
306 | 306 | $field_name_hash = $this->_unique_field_name($related_field_title); |
307 | - if($use_template) |
|
307 | + if ($use_template) |
|
308 | 308 | { |
309 | 309 | $related_field_title = str_replace(" ", " ", $related_field_title); |
310 | - $select .= "CONCAT('".str_replace(array('{','}'),array("',COALESCE(",", ''),'"),str_replace("'","\\'",$related_field_title))."') as $field_name_hash"; |
|
310 | + $select .= "CONCAT('".str_replace(array('{', '}'), array("',COALESCE(", ", ''),'"), str_replace("'", "\\'", $related_field_title))."') as $field_name_hash"; |
|
311 | 311 | } |
312 | 312 | else |
313 | 313 | { |
314 | 314 | $select .= "$related_field_title as $field_name_hash"; |
315 | 315 | } |
316 | - $this->db->select('*, '.$select,false); |
|
316 | + $this->db->select('*, '.$select, false); |
|
317 | 317 | |
318 | 318 | $selection_primary_key = $this->get_primary_key($field_info->selection_table); |
319 | 319 | |
320 | - if(empty($field_info->priority_field_relation_table)) |
|
320 | + if (empty($field_info->priority_field_relation_table)) |
|
321 | 321 | { |
322 | - if(!$use_template){ |
|
322 | + if (!$use_template) { |
|
323 | 323 | $this->db->order_by("{$field_info->selection_table}.{$field_info->title_field_selection_table}"); |
324 | 324 | } |
325 | 325 | } |
@@ -335,7 +335,7 @@ discard block |
||
335 | 335 | $results = $this->db->get($field_info->relation_table)->result(); |
336 | 336 | |
337 | 337 | $results_array = array(); |
338 | - foreach($results as $row) |
|
338 | + foreach ($results as $row) |
|
339 | 339 | { |
340 | 340 | $results_array[$row->{$field_info->primary_key_alias_to_selection_table}] = $row->{$field_name_hash}; |
341 | 341 | } |
@@ -349,50 +349,50 @@ discard block |
||
349 | 349 | |
350 | 350 | $select = ""; |
351 | 351 | $related_field_title = $field_info->title_field_selection_table; |
352 | - $use_template = strpos($related_field_title,'{') !== false; |
|
352 | + $use_template = strpos($related_field_title, '{') !== false; |
|
353 | 353 | $field_name_hash = $this->_unique_field_name($related_field_title); |
354 | 354 | |
355 | - if($use_template) |
|
355 | + if ($use_template) |
|
356 | 356 | { |
357 | 357 | $related_field_title = str_replace(" ", " ", $related_field_title); |
358 | - $select .= "CONCAT('".str_replace(array('{','}'),array("',COALESCE(",", ''),'"),str_replace("'","\\'",$related_field_title))."') as $field_name_hash"; |
|
358 | + $select .= "CONCAT('".str_replace(array('{', '}'), array("',COALESCE(", ", ''),'"), str_replace("'", "\\'", $related_field_title))."') as $field_name_hash"; |
|
359 | 359 | } |
360 | 360 | else |
361 | 361 | { |
362 | 362 | $select .= "$related_field_title as $field_name_hash"; |
363 | 363 | } |
364 | - $this->db->select('*, '.$select,false); |
|
364 | + $this->db->select('*, '.$select, false); |
|
365 | 365 | |
366 | - if($use_where_clause){ |
|
366 | + if ($use_where_clause) { |
|
367 | 367 | $this->db->where($field_info->where_clause); |
368 | 368 | } |
369 | 369 | |
370 | 370 | $selection_primary_key = $this->get_primary_key($field_info->selection_table); |
371 | - if(!$use_template) |
|
371 | + if (!$use_template) |
|
372 | 372 | $this->db->order_by("{$field_info->selection_table}.{$field_info->title_field_selection_table}"); |
373 | 373 | $results = $this->db->get($field_info->selection_table)->result(); |
374 | 374 | |
375 | 375 | $results_array = array(); |
376 | - foreach($results as $row) |
|
376 | + foreach ($results as $row) |
|
377 | 377 | { |
378 | - if(!isset($selected_values[$row->$selection_primary_key])) |
|
378 | + if (!isset($selected_values[$row->$selection_primary_key])) |
|
379 | 379 | $results_array[$row->$selection_primary_key] = $row->{$field_name_hash}; |
380 | 380 | } |
381 | 381 | |
382 | 382 | return $results_array; |
383 | 383 | } |
384 | 384 | |
385 | - function db_relation_n_n_update($field_info, $post_data ,$main_primary_key) |
|
385 | + function db_relation_n_n_update($field_info, $post_data, $main_primary_key) |
|
386 | 386 | { |
387 | 387 | $this->db->where($field_info->primary_key_alias_to_this_table, $main_primary_key); |
388 | - if(!empty($post_data)) |
|
389 | - $this->db->where_not_in($field_info->primary_key_alias_to_selection_table , $post_data); |
|
388 | + if (!empty($post_data)) |
|
389 | + $this->db->where_not_in($field_info->primary_key_alias_to_selection_table, $post_data); |
|
390 | 390 | $this->db->delete($field_info->relation_table); |
391 | 391 | |
392 | 392 | $counter = 0; |
393 | - if(!empty($post_data)) |
|
393 | + if (!empty($post_data)) |
|
394 | 394 | { |
395 | - foreach($post_data as $primary_key_value) |
|
395 | + foreach ($post_data as $primary_key_value) |
|
396 | 396 | { |
397 | 397 | $where_array = array( |
398 | 398 | $field_info->primary_key_alias_to_this_table => $main_primary_key, |
@@ -402,16 +402,16 @@ discard block |
||
402 | 402 | $this->db->where($where_array); |
403 | 403 | $count = $this->db->from($field_info->relation_table)->count_all_results(); |
404 | 404 | |
405 | - if($count == 0) |
|
405 | + if ($count == 0) |
|
406 | 406 | { |
407 | - if(!empty($field_info->priority_field_relation_table)) |
|
407 | + if (!empty($field_info->priority_field_relation_table)) |
|
408 | 408 | $where_array[$field_info->priority_field_relation_table] = $counter; |
409 | 409 | |
410 | 410 | $this->db->insert($field_info->relation_table, $where_array); |
411 | 411 | |
412 | - }elseif($count >= 1 && !empty($field_info->priority_field_relation_table)) |
|
412 | + }elseif ($count >= 1 && !empty($field_info->priority_field_relation_table)) |
|
413 | 413 | { |
414 | - $this->db->update( $field_info->relation_table, array($field_info->priority_field_relation_table => $counter) , $where_array); |
|
414 | + $this->db->update($field_info->relation_table, array($field_info->priority_field_relation_table => $counter), $where_array); |
|
415 | 415 | } |
416 | 416 | |
417 | 417 | $counter++; |
@@ -428,21 +428,21 @@ discard block |
||
428 | 428 | function get_field_types_basic_table() |
429 | 429 | { |
430 | 430 | $db_field_types = array(); |
431 | - foreach($this->db->query("SHOW COLUMNS FROM `{$this->table_name}`")->result() as $db_field_type) |
|
431 | + foreach ($this->db->query("SHOW COLUMNS FROM `{$this->table_name}`")->result() as $db_field_type) |
|
432 | 432 | { |
433 | - $type = explode("(",$db_field_type->Type); |
|
433 | + $type = explode("(", $db_field_type->Type); |
|
434 | 434 | $db_type = $type[0]; |
435 | 435 | |
436 | - if(isset($type[1])) |
|
436 | + if (isset($type[1])) |
|
437 | 437 | { |
438 | - if(substr($type[1],-1) == ')') |
|
438 | + if (substr($type[1], -1) == ')') |
|
439 | 439 | { |
440 | - $length = substr($type[1],0,-1); |
|
440 | + $length = substr($type[1], 0, -1); |
|
441 | 441 | } |
442 | 442 | else |
443 | 443 | { |
444 | - list($length) = explode(" ",$type[1]); |
|
445 | - $length = substr($length,0,-1); |
|
444 | + list($length) = explode(" ", $type[1]); |
|
445 | + $length = substr($length, 0, -1); |
|
446 | 446 | } |
447 | 447 | } |
448 | 448 | else |
@@ -456,10 +456,10 @@ discard block |
||
456 | 456 | } |
457 | 457 | |
458 | 458 | $results = $this->db->field_data($this->table_name); |
459 | - foreach($results as $num => $row) |
|
459 | + foreach ($results as $num => $row) |
|
460 | 460 | { |
461 | - $row = (array)$row; |
|
462 | - $results[$num] = (object)( array_merge($row, $db_field_types[$row['name']]) ); |
|
461 | + $row = (array) $row; |
|
462 | + $results[$num] = (object) (array_merge($row, $db_field_types[$row['name']])); |
|
463 | 463 | } |
464 | 464 | |
465 | 465 | return $results; |
@@ -475,13 +475,13 @@ discard block |
||
475 | 475 | function db_update($post_array, $primary_key_value) |
476 | 476 | { |
477 | 477 | $primary_key_field = $this->get_primary_key(); |
478 | - return $this->db->update($this->table_name,$post_array, array( $primary_key_field => $primary_key_value)); |
|
478 | + return $this->db->update($this->table_name, $post_array, array($primary_key_field => $primary_key_value)); |
|
479 | 479 | } |
480 | 480 | |
481 | 481 | function db_insert($post_array) |
482 | 482 | { |
483 | - $insert = $this->db->insert($this->table_name,$post_array); |
|
484 | - if($insert) |
|
483 | + $insert = $this->db->insert($this->table_name, $post_array); |
|
484 | + if ($insert) |
|
485 | 485 | { |
486 | 486 | return $this->db->insert_id(); |
487 | 487 | } |
@@ -492,12 +492,12 @@ discard block |
||
492 | 492 | { |
493 | 493 | $primary_key_field = $this->get_primary_key(); |
494 | 494 | |
495 | - if($primary_key_field === false) |
|
495 | + if ($primary_key_field === false) |
|
496 | 496 | return false; |
497 | 497 | |
498 | 498 | $this->db->limit(1); |
499 | - $this->db->delete($this->table_name,array( $primary_key_field => $primary_key_value)); |
|
500 | - if( $this->db->affected_rows() != 1) |
|
499 | + $this->db->delete($this->table_name, array($primary_key_field => $primary_key_value)); |
|
500 | + if ($this->db->affected_rows() != 1) |
|
501 | 501 | return false; |
502 | 502 | else |
503 | 503 | return true; |
@@ -505,7 +505,7 @@ discard block |
||
505 | 505 | |
506 | 506 | function db_file_delete($field_name, $filename) |
507 | 507 | { |
508 | - if( $this->db->update($this->table_name,array($field_name => ''),array($field_name => $filename)) ) |
|
508 | + if ($this->db->update($this->table_name, array($field_name => ''), array($field_name => $filename))) |
|
509 | 509 | { |
510 | 510 | return true; |
511 | 511 | } |
@@ -515,31 +515,31 @@ discard block |
||
515 | 515 | } |
516 | 516 | } |
517 | 517 | |
518 | - function field_exists($field,$table_name = null) |
|
518 | + function field_exists($field, $table_name = null) |
|
519 | 519 | { |
520 | - if(empty($table_name)) |
|
520 | + if (empty($table_name)) |
|
521 | 521 | { |
522 | 522 | $table_name = $this->table_name; |
523 | 523 | } |
524 | - return $this->db->field_exists($field,$table_name); |
|
524 | + return $this->db->field_exists($field, $table_name); |
|
525 | 525 | } |
526 | 526 | |
527 | 527 | function get_primary_key($table_name = null) |
528 | 528 | { |
529 | - if($table_name == null) |
|
529 | + if ($table_name == null) |
|
530 | 530 | { |
531 | - if(isset($this->primary_keys[$this->table_name])) |
|
531 | + if (isset($this->primary_keys[$this->table_name])) |
|
532 | 532 | { |
533 | 533 | return $this->primary_keys[$this->table_name]; |
534 | 534 | } |
535 | 535 | |
536 | - if(empty($this->primary_key)) |
|
536 | + if (empty($this->primary_key)) |
|
537 | 537 | { |
538 | 538 | $fields = $this->get_field_types_basic_table(); |
539 | 539 | |
540 | - foreach($fields as $field) |
|
540 | + foreach ($fields as $field) |
|
541 | 541 | { |
542 | - if($field->primary_key == 1) |
|
542 | + if ($field->primary_key == 1) |
|
543 | 543 | { |
544 | 544 | return $field->name; |
545 | 545 | } |
@@ -554,16 +554,16 @@ discard block |
||
554 | 554 | } |
555 | 555 | else |
556 | 556 | { |
557 | - if(isset($this->primary_keys[$table_name])) |
|
557 | + if (isset($this->primary_keys[$table_name])) |
|
558 | 558 | { |
559 | 559 | return $this->primary_keys[$table_name]; |
560 | 560 | } |
561 | 561 | |
562 | 562 | $fields = $this->get_field_types($table_name); |
563 | 563 | |
564 | - foreach($fields as $field) |
|
564 | + foreach ($fields as $field) |
|
565 | 565 | { |
566 | - if($field->primary_key == 1) |
|
566 | + if ($field->primary_key == 1) |
|
567 | 567 | { |
568 | 568 | return $field->name; |
569 | 569 | } |
@@ -13,7 +13,7 @@ discard block |
||
13 | 13 | |
14 | 14 | $ldap = ldap_connect($this->config->item('ldapserver')); |
15 | 15 | |
16 | - $ldaprdn = $this->config->item('ldapshortdomain') . $username; |
|
16 | + $ldaprdn = $this->config->item('ldapshortdomain').$username; |
|
17 | 17 | |
18 | 18 | ldap_set_option($ldap, LDAP_OPT_PROTOCOL_VERSION, 3); |
19 | 19 | ldap_set_option($ldap, LDAP_OPT_REFERRALS, 0); |
@@ -135,7 +135,7 @@ discard block |
||
135 | 135 | $two_hour_login = strtotime("-2 hours"); |
136 | 136 | $current_timestamp = date("Y-m-d H:i:s", time()); |
137 | 137 | $login_count = 1; |
138 | - $browser = $this->agent->browser() . ' ' . $this->agent->version(); |
|
138 | + $browser = $this->agent->browser().' '.$this->agent->version(); |
|
139 | 139 | |
140 | 140 | if ($query->num_rows() > 0) { |
141 | 141 | |
@@ -235,8 +235,8 @@ discard block |
||
235 | 235 | |
236 | 236 | $iv = mcrypt_create_iv(IV_SIZE, MCRYPT_DEV_URANDOM); |
237 | 237 | $crypt = mcrypt_encrypt(MCRYPT_RIJNDAEL_128, $key, $encrypt_item, MCRYPT_MODE_CBC, $iv); |
238 | - $combo = $iv . $crypt; |
|
239 | - $output = base64_encode($iv . $crypt); |
|
238 | + $combo = $iv.$crypt; |
|
239 | + $output = base64_encode($iv.$crypt); |
|
240 | 240 | |
241 | 241 | return $output; |
242 | 242 | } |