@@ -67,8 +67,10 @@ |
||
| 67 | 67 | $name = $ui->getAttribute('user_fullname'); |
| 68 | 68 | if ($name): |
| 69 | 69 | echo $name; |
| 70 | - else : |
|
| 70 | + else { |
|
| 71 | + : |
|
| 71 | 72 | echo $ownerName; |
| 73 | + } |
|
| 72 | 74 | endif; |
| 73 | 75 | ?> |
| 74 | 76 | </div><br> |
@@ -1,4 +1,6 @@ discard block |
||
| 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 |
@@ -241,9 +243,11 @@ discard block |
||
| 241 | 243 | $segment .= $uri_array_original[$i].'/'; |
| 242 | 244 | |
| 243 | 245 | // If replace value is an array |
| 244 | - if (! in_array($i, $skip_key, TRUE) && is_array($value)) // Skip link if replace value is null |
|
| 246 | + if (! in_array($i, $skip_key, TRUE) && is_array($value)) { |
|
| 247 | + // Skip link if replace value is null |
|
| 245 | 248 | { |
| 246 | 249 | $number_added_value_array = count($value); |
| 250 | + } |
|
| 247 | 251 | |
| 248 | 252 | foreach ($value as $pair_values) |
| 249 | 253 | { |
@@ -253,8 +257,7 @@ discard block |
||
| 253 | 257 | if ($number_pv_array == 1) |
| 254 | 258 | { |
| 255 | 259 | $val_name = $pv_array[0]; |
| 256 | - } |
|
| 257 | - else |
|
| 260 | + } else |
|
| 258 | 261 | { |
| 259 | 262 | $val_name = $pv_array[1]; |
| 260 | 263 | } |
@@ -292,12 +295,10 @@ discard block |
||
| 292 | 295 | if ($number_pv_array == 1 || $val_url == $uri_array_original[$i]) |
| 293 | 296 | { |
| 294 | 297 | $new_segment_url = $segment; |
| 295 | - } |
|
| 296 | - else if ($val_url[0] == '/') |
|
| 298 | + } else if ($val_url[0] == '/') |
|
| 297 | 299 | { |
| 298 | 300 | $new_segment_url = base_url().substr($val_url, 1); |
| 299 | - } |
|
| 300 | - else |
|
| 301 | + } else |
|
| 301 | 302 | { |
| 302 | 303 | $new_segment_url = $segment.$val_url; |
| 303 | 304 | } |
@@ -305,14 +306,15 @@ discard block |
||
| 305 | 306 | $str_link[] = $new_segment_url; |
| 306 | 307 | $str_name[] = ucwords($val_name); |
| 307 | 308 | } |
| 308 | - } |
|
| 309 | - else if (! in_array($i, $skip_key, TRUE)) // If value is NOT an array |
|
| 309 | + } else if (! in_array($i, $skip_key, TRUE)) { |
|
| 310 | + // If value is NOT an array |
|
| 310 | 311 | { |
| 311 | 312 | // Add multilanguage |
| 312 | 313 | if ($CI->config->item('multilang')) |
| 313 | 314 | { |
| 314 | 315 | if ($CI->lang->line($value)) { |
| 315 | 316 | $value = ucwords($CI->lang->line($value)); |
| 317 | + } |
|
| 316 | 318 | } |
| 317 | 319 | } |
| 318 | 320 | |
@@ -47,8 +47,9 @@ discard block |
||
| 47 | 47 | |
| 48 | 48 | function get_list() |
| 49 | 49 | { |
| 50 | - if($this->table_name === null) |
|
| 51 | - return false; |
|
| 50 | + if($this->table_name === null) { |
|
| 51 | + return false; |
|
| 52 | + } |
|
| 52 | 53 | |
| 53 | 54 | $select = "`{$this->table_name}`.*"; |
| 54 | 55 | |
@@ -65,14 +66,14 @@ discard block |
||
| 65 | 66 | { |
| 66 | 67 | $related_field_title = str_replace(" "," ",$related_field_title); |
| 67 | 68 | $select .= ", CONCAT('".str_replace(array('{','}'),array("',COALESCE({$unique_join_name}.",", ''),'"),str_replace("'","\\'",$related_field_title))."') as $unique_field_name"; |
| 68 | - } |
|
| 69 | - else |
|
| 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)) |
|
| 75 | - $select .= ", `{$this->table_name}`.$related_field_title AS '{$this->table_name}.$related_field_title'"; |
|
| 74 | + if($this->field_exists($related_field_title)) { |
|
| 75 | + $select .= ", `{$this->table_name}`.$related_field_title AS '{$this->table_name}.$related_field_title'"; |
|
| 76 | + } |
|
| 76 | 77 | } |
| 77 | 78 | } |
| 78 | 79 | |
@@ -120,8 +121,7 @@ discard block |
||
| 120 | 121 | { |
| 121 | 122 | $title_field_selection_table = str_replace(" ", " ", $title_field_selection_table); |
| 122 | 123 | $field .= "CONCAT('".str_replace(array('{','}'),array("',COALESCE(",", ''),'"),str_replace("'","\\'",$title_field_selection_table))."')"; |
| 123 | - } |
|
| 124 | - else |
|
| 124 | + } else |
|
| 125 | 125 | { |
| 126 | 126 | $field .= "$selection_table.$title_field_selection_table"; |
| 127 | 127 | } |
@@ -191,8 +191,9 @@ discard block |
||
| 191 | 191 | |
| 192 | 192 | function set_basic_table($table_name = null) |
| 193 | 193 | { |
| 194 | - if( !($this->db->table_exists($table_name)) ) |
|
| 195 | - return false; |
|
| 194 | + if( !($this->db->table_exists($table_name)) ) { |
|
| 195 | + return false; |
|
| 196 | + } |
|
| 196 | 197 | |
| 197 | 198 | $this->table_name = $table_name; |
| 198 | 199 | |
@@ -252,24 +253,27 @@ discard block |
||
| 252 | 253 | { |
| 253 | 254 | $related_field_title = str_replace(" ", " ", $related_field_title); |
| 254 | 255 | $select .= "CONCAT('".str_replace(array('{','}'),array("',COALESCE(",", ''),'"),str_replace("'","\\'",$related_field_title))."') as $field_name_hash"; |
| 255 | - } |
|
| 256 | - else |
|
| 256 | + } else |
|
| 257 | 257 | { |
| 258 | 258 | $select .= "$related_table.$related_field_title as $field_name_hash"; |
| 259 | 259 | } |
| 260 | 260 | |
| 261 | 261 | $this->db->select($select,false); |
| 262 | - if($where_clause !== null) |
|
| 263 | - $this->db->where($where_clause); |
|
| 262 | + if($where_clause !== null) { |
|
| 263 | + $this->db->where($where_clause); |
|
| 264 | + } |
|
| 264 | 265 | |
| 265 | - if($where_clause !== null) |
|
| 266 | - $this->db->where($where_clause); |
|
| 266 | + if($where_clause !== null) { |
|
| 267 | + $this->db->where($where_clause); |
|
| 268 | + } |
|
| 267 | 269 | |
| 268 | - if($limit !== null) |
|
| 269 | - $this->db->limit($limit); |
|
| 270 | + if($limit !== null) { |
|
| 271 | + $this->db->limit($limit); |
|
| 272 | + } |
|
| 270 | 273 | |
| 271 | - if($search_like !== null) |
|
| 272 | - $this->db->having("$field_name_hash LIKE '%".$this->db->escape_like_str($search_like)."%'"); |
|
| 274 | + if($search_like !== null) { |
|
| 275 | + $this->db->having("$field_name_hash LIKE '%".$this->db->escape_like_str($search_like)."%'"); |
|
| 276 | + } |
|
| 273 | 277 | |
| 274 | 278 | $order_by !== null |
| 275 | 279 | ? $this->db->order_by($order_by) |
@@ -292,8 +296,9 @@ discard block |
||
| 292 | 296 | |
| 293 | 297 | function get_relation_total_rows($field_name , $related_table , $related_field_title, $where_clause) |
| 294 | 298 | { |
| 295 | - if($where_clause !== null) |
|
| 296 | - $this->db->where($where_clause); |
|
| 299 | + if($where_clause !== null) { |
|
| 300 | + $this->db->where($where_clause); |
|
| 301 | + } |
|
| 297 | 302 | |
| 298 | 303 | return $this->db->count_all_results($related_table); |
| 299 | 304 | } |
@@ -308,8 +313,7 @@ discard block |
||
| 308 | 313 | { |
| 309 | 314 | $related_field_title = str_replace(" ", " ", $related_field_title); |
| 310 | 315 | $select .= "CONCAT('".str_replace(array('{','}'),array("',COALESCE(",", ''),'"),str_replace("'","\\'",$related_field_title))."') as $field_name_hash"; |
| 311 | - } |
|
| 312 | - else |
|
| 316 | + } else |
|
| 313 | 317 | { |
| 314 | 318 | $select .= "$related_field_title as $field_name_hash"; |
| 315 | 319 | } |
@@ -322,8 +326,7 @@ discard block |
||
| 322 | 326 | if(!$use_template){ |
| 323 | 327 | $this->db->order_by("{$field_info->selection_table}.{$field_info->title_field_selection_table}"); |
| 324 | 328 | } |
| 325 | - } |
|
| 326 | - else |
|
| 329 | + } else |
|
| 327 | 330 | { |
| 328 | 331 | $this->db->order_by("{$field_info->relation_table}.{$field_info->priority_field_relation_table}"); |
| 329 | 332 | } |
@@ -356,8 +359,7 @@ discard block |
||
| 356 | 359 | { |
| 357 | 360 | $related_field_title = str_replace(" ", " ", $related_field_title); |
| 358 | 361 | $select .= "CONCAT('".str_replace(array('{','}'),array("',COALESCE(",", ''),'"),str_replace("'","\\'",$related_field_title))."') as $field_name_hash"; |
| 359 | - } |
|
| 360 | - else |
|
| 362 | + } else |
|
| 361 | 363 | { |
| 362 | 364 | $select .= "$related_field_title as $field_name_hash"; |
| 363 | 365 | } |
@@ -368,15 +370,17 @@ discard block |
||
| 368 | 370 | } |
| 369 | 371 | |
| 370 | 372 | $selection_primary_key = $this->get_primary_key($field_info->selection_table); |
| 371 | - if(!$use_template) |
|
| 372 | - $this->db->order_by("{$field_info->selection_table}.{$field_info->title_field_selection_table}"); |
|
| 373 | + if(!$use_template) { |
|
| 374 | + $this->db->order_by("{$field_info->selection_table}.{$field_info->title_field_selection_table}"); |
|
| 375 | + } |
|
| 373 | 376 | $results = $this->db->get($field_info->selection_table)->result(); |
| 374 | 377 | |
| 375 | 378 | $results_array = array(); |
| 376 | 379 | foreach($results as $row) |
| 377 | 380 | { |
| 378 | - if(!isset($selected_values[$row->$selection_primary_key])) |
|
| 379 | - $results_array[$row->$selection_primary_key] = $row->{$field_name_hash}; |
|
| 381 | + if(!isset($selected_values[$row->$selection_primary_key])) { |
|
| 382 | + $results_array[$row->$selection_primary_key] = $row->{$field_name_hash}; |
|
| 383 | + } |
|
| 380 | 384 | } |
| 381 | 385 | |
| 382 | 386 | return $results_array; |
@@ -385,8 +389,9 @@ discard block |
||
| 385 | 389 | function db_relation_n_n_update($field_info, $post_data ,$main_primary_key) |
| 386 | 390 | { |
| 387 | 391 | $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); |
|
| 392 | + if(!empty($post_data)) { |
|
| 393 | + $this->db->where_not_in($field_info->primary_key_alias_to_selection_table , $post_data); |
|
| 394 | + } |
|
| 390 | 395 | $this->db->delete($field_info->relation_table); |
| 391 | 396 | |
| 392 | 397 | $counter = 0; |
@@ -404,12 +409,13 @@ discard block |
||
| 404 | 409 | |
| 405 | 410 | if($count == 0) |
| 406 | 411 | { |
| 407 | - if(!empty($field_info->priority_field_relation_table)) |
|
| 408 | - $where_array[$field_info->priority_field_relation_table] = $counter; |
|
| 412 | + if(!empty($field_info->priority_field_relation_table)) { |
|
| 413 | + $where_array[$field_info->priority_field_relation_table] = $counter; |
|
| 414 | + } |
|
| 409 | 415 | |
| 410 | 416 | $this->db->insert($field_info->relation_table, $where_array); |
| 411 | 417 | |
| 412 | - }elseif($count >= 1 && !empty($field_info->priority_field_relation_table)) |
|
| 418 | + } elseif($count >= 1 && !empty($field_info->priority_field_relation_table)) |
|
| 413 | 419 | { |
| 414 | 420 | $this->db->update( $field_info->relation_table, array($field_info->priority_field_relation_table => $counter) , $where_array); |
| 415 | 421 | } |
@@ -438,14 +444,12 @@ discard block |
||
| 438 | 444 | if(substr($type[1],-1) == ')') |
| 439 | 445 | { |
| 440 | 446 | $length = substr($type[1],0,-1); |
| 441 | - } |
|
| 442 | - else |
|
| 447 | + } else |
|
| 443 | 448 | { |
| 444 | 449 | list($length) = explode(" ",$type[1]); |
| 445 | 450 | $length = substr($length,0,-1); |
| 446 | 451 | } |
| 447 | - } |
|
| 448 | - else |
|
| 452 | + } else |
|
| 449 | 453 | { |
| 450 | 454 | $length = ''; |
| 451 | 455 | } |
@@ -492,15 +496,17 @@ discard block |
||
| 492 | 496 | { |
| 493 | 497 | $primary_key_field = $this->get_primary_key(); |
| 494 | 498 | |
| 495 | - if($primary_key_field === false) |
|
| 496 | - return false; |
|
| 499 | + if($primary_key_field === false) { |
|
| 500 | + return false; |
|
| 501 | + } |
|
| 497 | 502 | |
| 498 | 503 | $this->db->limit(1); |
| 499 | 504 | $this->db->delete($this->table_name,array( $primary_key_field => $primary_key_value)); |
| 500 | - if( $this->db->affected_rows() != 1) |
|
| 501 | - return false; |
|
| 502 | - else |
|
| 503 | - return true; |
|
| 505 | + if( $this->db->affected_rows() != 1) { |
|
| 506 | + return false; |
|
| 507 | + } else { |
|
| 508 | + return true; |
|
| 509 | + } |
|
| 504 | 510 | } |
| 505 | 511 | |
| 506 | 512 | function db_file_delete($field_name, $filename) |
@@ -508,8 +514,7 @@ discard block |
||
| 508 | 514 | if( $this->db->update($this->table_name,array($field_name => ''),array($field_name => $filename)) ) |
| 509 | 515 | { |
| 510 | 516 | return true; |
| 511 | - } |
|
| 512 | - else |
|
| 517 | + } else |
|
| 513 | 518 | { |
| 514 | 519 | return false; |
| 515 | 520 | } |
@@ -546,13 +551,11 @@ discard block |
||
| 546 | 551 | } |
| 547 | 552 | |
| 548 | 553 | return false; |
| 549 | - } |
|
| 550 | - else |
|
| 554 | + } else |
|
| 551 | 555 | { |
| 552 | 556 | return $this->primary_key; |
| 553 | 557 | } |
| 554 | - } |
|
| 555 | - else |
|
| 558 | + } else |
|
| 556 | 559 | { |
| 557 | 560 | if(isset($this->primary_keys[$table_name])) |
| 558 | 561 | { |
@@ -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"]; |
@@ -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; |
@@ -23,7 +23,7 @@ |
||
| 23 | 23 | </tr> |
| 24 | 24 | </thead> |
| 25 | 25 | <tbody> |
| 26 | - <?php foreach ($status as $status_item): if ($status_item['category'] == 'network') {}else {
|
|
| 26 | + <?php foreach ($status as $status_item): if ($status_item['category'] == 'network') {} else {
|
|
| 27 | 27 | $sid = $status_item['id'];?> |
| 28 | 28 | <tr> |
| 29 | 29 | <td> <i class="fa <?= $status_item['icon'];?>" aria-hidden="true"></i> <?= $status_item['name'];?></td> |
@@ -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; |
@@ -69,7 +69,7 @@ |
||
| 69 | 69 | </tbody> |
| 70 | 70 | </table> |
| 71 | 71 | </div> |
| 72 | -<?php }else{?> |
|
| 72 | +<?php } else{?> |
|
| 73 | 73 | <br/> |
| 74 | 74 | <?php echo $this->l('list_no_items'); ?> |
| 75 | 75 | <br/> |