@@ -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,7 +66,7 @@ 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 | |
@@ -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 | } |
@@ -242,20 +242,20 @@ |
||
| 242 | 242 | } |
| 243 | 243 | |
| 244 | 244 | function ip_is_private($ip) { |
| 245 | - $safe_ip = array( |
|
| 246 | - $this->config->item('safeipone'), |
|
| 247 | - $this->config->item('safeiptwo'), |
|
| 248 | - $this->config->item('safeipthree'), |
|
| 249 | - $this->config->item('safeipfour'), |
|
| 250 | - $this->config->item('safeipfive'), |
|
| 251 | - $this->config->item('safeipsix'), |
|
| 252 | - $this->config->item('safeipseven'), |
|
| 253 | - $this->config->item('safeipeight'), |
|
| 254 | - $this->config->item('safeipnine'), |
|
| 255 | - $this->config->item('safeipten'), |
|
| 256 | - ); |
|
| 245 | + $safe_ip = array( |
|
| 246 | + $this->config->item('safeipone'), |
|
| 247 | + $this->config->item('safeiptwo'), |
|
| 248 | + $this->config->item('safeipthree'), |
|
| 249 | + $this->config->item('safeipfour'), |
|
| 250 | + $this->config->item('safeipfive'), |
|
| 251 | + $this->config->item('safeipsix'), |
|
| 252 | + $this->config->item('safeipseven'), |
|
| 253 | + $this->config->item('safeipeight'), |
|
| 254 | + $this->config->item('safeipnine'), |
|
| 255 | + $this->config->item('safeipten'), |
|
| 256 | + ); |
|
| 257 | 257 | |
| 258 | - if (in_array($_SERVER['REMOTE_ADDR'], $safe_ip)) { |
|
| 258 | + if (in_array($_SERVER['REMOTE_ADDR'], $safe_ip)) { |
|
| 259 | 259 | return true; |
| 260 | 260 | } else { |
| 261 | 261 | return false; |
@@ -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 | } |
@@ -73,8 +73,9 @@ |
||
| 73 | 73 | ldap_sort($ldap, $result, "sn"); |
| 74 | 74 | $info = ldap_get_entries($ldap, $result); |
| 75 | 75 | for ($i = 0; $i < $info["count"]; $i++) { |
| 76 | - if ($info['count'] > 1) |
|
| 77 | - break; |
|
| 76 | + if ($info['count'] > 1) { |
|
| 77 | + break; |
|
| 78 | + } |
|
| 78 | 79 | |
| 79 | 80 | //clean |
| 80 | 81 | $groups = $info[$i]["memberof"]; |
@@ -12,7 +12,7 @@ |
||
| 12 | 12 | 'last_name' => $this->input->post('last_name'), |
| 13 | 13 | 'email' => $this->input->post('email'), |
| 14 | 14 | 'postcode' => $this->input->post('postcode'), |
| 15 | - 'date_birth' => $this->input->post('dob_d') .'/'. $this->input->post('dob_m') .'/'. $this->input->post('dob_y'), |
|
| 15 | + 'date_birth' => $this->input->post('dob_d').'/'.$this->input->post('dob_m').'/'.$this->input->post('dob_y'), |
|
| 16 | 16 | 'current_school' => $this->input->post('current'), |
| 17 | 17 | 'current_other' => $this->input->post('current_other'), |
| 18 | 18 | 'subject_interest' => implode(', ', $this->input->post('subject')), |
@@ -93,16 +93,16 @@ discard block |
||
| 93 | 93 | |
| 94 | 94 | public function check_status() { |
| 95 | 95 | $this->db->where('requester_un', $_SESSION['username']) |
| 96 | - ->or_where('staff_involved_un', $_SESSION['username']) |
|
| 97 | - ->or_where('staff_involved_un2', $_SESSION['ldap']['full_name']) |
|
| 98 | - ->or_where('staff_involved_un3', $_SESSION['ldap']['full_name']) |
|
| 99 | - ->or_where('staff_involved_un4', $_SESSION['ldap']['full_name']) |
|
| 100 | - ->or_where('staff_involved_un5', $_SESSION['ldap']['full_name']) |
|
| 101 | - ->or_where('staff_involved_un6', $_SESSION['ldap']['full_name']) |
|
| 102 | - ->or_where('staff_involved_un7', $_SESSION['ldap']['full_name']) |
|
| 103 | - ->or_where('staff_involved_un8', $_SESSION['ldap']['full_name']) |
|
| 104 | - ->or_where('staff_involved_un9', $_SESSION['ldap']['full_name']) |
|
| 105 | - ->or_where('staff_involved_un10', $_SESSION['ldap']['full_name']); |
|
| 96 | + ->or_where('staff_involved_un', $_SESSION['username']) |
|
| 97 | + ->or_where('staff_involved_un2', $_SESSION['ldap']['full_name']) |
|
| 98 | + ->or_where('staff_involved_un3', $_SESSION['ldap']['full_name']) |
|
| 99 | + ->or_where('staff_involved_un4', $_SESSION['ldap']['full_name']) |
|
| 100 | + ->or_where('staff_involved_un5', $_SESSION['ldap']['full_name']) |
|
| 101 | + ->or_where('staff_involved_un6', $_SESSION['ldap']['full_name']) |
|
| 102 | + ->or_where('staff_involved_un7', $_SESSION['ldap']['full_name']) |
|
| 103 | + ->or_where('staff_involved_un8', $_SESSION['ldap']['full_name']) |
|
| 104 | + ->or_where('staff_involved_un9', $_SESSION['ldap']['full_name']) |
|
| 105 | + ->or_where('staff_involved_un10', $_SESSION['ldap']['full_name']); |
|
| 106 | 106 | $query = $this->db->get('room_move'); |
| 107 | 107 | return $query->result_array(); |
| 108 | 108 | } |
@@ -130,7 +130,7 @@ discard block |
||
| 130 | 130 | public function cancel($id) { |
| 131 | 131 | |
| 132 | 132 | $this->db->where('id', $id); |
| 133 | - $this->db->from('room_move'); |
|
| 133 | + $this->db->from('room_move'); |
|
| 134 | 134 | $data = array( |
| 135 | 135 | 'status' => '4', |
| 136 | 136 | 'canceled_by' => $_SESSION['ldap']['full_name'], |
@@ -142,7 +142,7 @@ discard block |
||
| 142 | 142 | public function eh_reject($id) { |
| 143 | 143 | |
| 144 | 144 | $this->db->where('id', $id); |
| 145 | - $this->db->from('room_move'); |
|
| 145 | + $this->db->from('room_move'); |
|
| 146 | 146 | $data = array( |
| 147 | 147 | 'status' => '2', |
| 148 | 148 | 'estates_at' => date("Y-m-d H:i:s", time()), |
@@ -154,7 +154,7 @@ discard block |
||
| 154 | 154 | public function eh_approve($id) { |
| 155 | 155 | |
| 156 | 156 | $this->db->where('id', $id); |
| 157 | - $this->db->from('room_move'); |
|
| 157 | + $this->db->from('room_move'); |
|
| 158 | 158 | $data = array( |
| 159 | 159 | 'status' => '1', |
| 160 | 160 | 'estates_at' => date("Y-m-d H:i:s", time()), |
@@ -167,7 +167,7 @@ discard block |
||
| 167 | 167 | public function cs_reject($id) { |
| 168 | 168 | |
| 169 | 169 | $this->db->where('id', $id); |
| 170 | - $this->db->from('room_move'); |
|
| 170 | + $this->db->from('room_move'); |
|
| 171 | 171 | $data = array( |
| 172 | 172 | 'status' => '3', |
| 173 | 173 | 'cs_at' => date("Y-m-d H:i:s", time()), |
@@ -179,7 +179,7 @@ discard block |
||
| 179 | 179 | public function cs_approve($id) { |
| 180 | 180 | |
| 181 | 181 | $this->db->where('id', $id); |
| 182 | - $this->db->from('room_move'); |
|
| 182 | + $this->db->from('room_move'); |
|
| 183 | 183 | $data = array( |
| 184 | 184 | 'status' => '5', |
| 185 | 185 | 'cs_at' => date("Y-m-d H:i:s", time()), |
@@ -192,7 +192,7 @@ discard block |
||
| 192 | 192 | public function cs_complete($id) { |
| 193 | 193 | |
| 194 | 194 | $this->db->where('id', $id); |
| 195 | - $this->db->from('room_move'); |
|
| 195 | + $this->db->from('room_move'); |
|
| 196 | 196 | $data = array( |
| 197 | 197 | 'status' => '6', |
| 198 | 198 | 'completed_at' => date("Y-m-d H:i:s", time()), |
@@ -39,7 +39,7 @@ |
||
| 39 | 39 | $user_un10 = $user_un10[1]; |
| 40 | 40 | } else { $user_un10 = NULL; } |
| 41 | 41 | |
| 42 | - if ($furniture == "No Furniture"){ |
|
| 42 | + if ($furniture == "No Furniture") { |
|
| 43 | 43 | $status = "1"; |
| 44 | 44 | } else { |
| 45 | 45 | $status = "0"; |
@@ -9,14 +9,14 @@ discard block |
||
| 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 |
||
| 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 |
||
| 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. |
@@ -16,8 +16,9 @@ |
||
| 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; |
@@ -55,7 +55,7 @@ discard block |
||
| 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 |
||
| 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 | } |