@@ -28,7 +28,7 @@ discard block |
||
28 | 28 | |
29 | 29 | function curPage() |
30 | 30 | { |
31 | - parse_str(substr($_SERVER["REQUEST_URI"], strpos($_SERVER["REQUEST_URI"], "?")+1), $result); |
|
31 | + parse_str(substr($_SERVER["REQUEST_URI"], strpos($_SERVER["REQUEST_URI"], "?") + 1), $result); |
|
32 | 32 | return $result['page']; |
33 | 33 | } |
34 | 34 | |
@@ -86,7 +86,7 @@ discard block |
||
86 | 86 | |
87 | 87 | function IsInArray($pages, $table) |
88 | 88 | { |
89 | - foreach($pages as $page) { |
|
89 | + foreach ($pages as $page) { |
|
90 | 90 | if (in_array($page, $table)) { |
91 | 91 | return true; |
92 | 92 | } |
@@ -84,7 +84,7 @@ discard block |
||
84 | 84 | prefix_table("nested_tree"), |
85 | 85 | array( |
86 | 86 | 'renewal_period' => mysqli_escape_string($link, stripslashes(($_POST['renewal_period']))) |
87 | - ), |
|
87 | + ), |
|
88 | 88 | "id=%i", |
89 | 89 | $id[1] |
90 | 90 | ); |
@@ -103,7 +103,7 @@ discard block |
||
103 | 103 | prefix_table("nested_tree"), |
104 | 104 | array( |
105 | 105 | 'parent_id' => $_POST['newparent_id'] |
106 | - ), |
|
106 | + ), |
|
107 | 107 | "id=%i", |
108 | 108 | $id[1] |
109 | 109 | ); |
@@ -138,7 +138,7 @@ discard block |
||
138 | 138 | 'type' => 'complex', |
139 | 139 | 'intitule' => $id[1], |
140 | 140 | 'valeur' => $_POST['changer_complexite'] |
141 | - ) |
|
141 | + ) |
|
142 | 142 | ); |
143 | 143 | } else { |
144 | 144 | //update DB |
@@ -146,7 +146,7 @@ discard block |
||
146 | 146 | prefix_table("misc"), |
147 | 147 | array( |
148 | 148 | 'valeur' => $_POST['changer_complexite'] |
149 | - ), |
|
149 | + ), |
|
150 | 150 | "type=%s AND intitule = %i", |
151 | 151 | "complex", |
152 | 152 | $id[1] |
@@ -220,7 +220,7 @@ discard block |
||
220 | 220 | 'valeur' => $folder->id.', '.$folder->parent_id.', '. |
221 | 221 | $folder->title.', '.$folder->nleft.', '.$folder->nright.', '. |
222 | 222 | $folder->nlevel.', 0, 0, 0, 0' |
223 | - ) |
|
223 | + ) |
|
224 | 224 | ); |
225 | 225 | |
226 | 226 | //array for delete folder |
@@ -476,7 +476,7 @@ discard block |
||
476 | 476 | 'renewal_period' => $renewalPeriod, |
477 | 477 | 'bloquer_creation' => isset($dataReceived['block_creation']) && $dataReceived['block_creation'] == 1 ? '1' : $parentBloquerCreation, |
478 | 478 | 'bloquer_modification' => isset($dataReceived['block_modif']) && $dataReceived['block_modif'] == 1 ? '1' : $parentBloquerModification |
479 | - ) |
|
479 | + ) |
|
480 | 480 | ); |
481 | 481 | $newId = DB::insertId(); |
482 | 482 | |
@@ -728,7 +728,7 @@ discard block |
||
728 | 728 | 'tree_id' => $val[0], |
729 | 729 | 'fonction_id' => $val[1], |
730 | 730 | 'authorized' => 1 |
731 | - ) |
|
731 | + ) |
|
732 | 732 | ); |
733 | 733 | } else { |
734 | 734 | //Update DB |
@@ -737,20 +737,20 @@ discard block |
||
737 | 737 | prefix_table("rights"), |
738 | 738 | array( |
739 | 739 | 'authorized' => 0 |
740 | - ), |
|
741 | - "id = %i AND fonction_id=%i", |
|
742 | - $val[0], |
|
743 | - $val[1] |
|
740 | + ), |
|
741 | + "id = %i AND fonction_id=%i", |
|
742 | + $val[0], |
|
743 | + $val[1] |
|
744 | 744 | ); |
745 | 745 | } else { |
746 | 746 | DB::update( |
747 | 747 | prefix_table("rights"), |
748 | 748 | array( |
749 | 749 | 'authorized' => 1 |
750 | - ), |
|
751 | - "id = %i AND fonction_id=%i", |
|
752 | - $val[0], |
|
753 | - $val[1] |
|
750 | + ), |
|
751 | + "id = %i AND fonction_id=%i", |
|
752 | + $val[0], |
|
753 | + $val[1] |
|
754 | 754 | ); |
755 | 755 | } |
756 | 756 | } |
@@ -941,7 +941,7 @@ discard block |
||
941 | 941 | 'renewal_period' => $nodeInfo->renewal_period, |
942 | 942 | 'bloquer_creation' => $nodeInfo->bloquer_creation, |
943 | 943 | 'bloquer_modification' => $nodeInfo->bloquer_modification |
944 | - ) |
|
944 | + ) |
|
945 | 945 | ); |
946 | 946 | $newFolderId = DB::insertId(); |
947 | 947 | |
@@ -1121,7 +1121,7 @@ discard block |
||
1121 | 1121 | 'extension' => $record2['extension'], |
1122 | 1122 | 'type' => $record2['type'], |
1123 | 1123 | 'file' => $record2['file'] |
1124 | - ) |
|
1124 | + ) |
|
1125 | 1125 | ); |
1126 | 1126 | } |
1127 | 1127 | // Add this duplicate in logs |
@@ -209,7 +209,7 @@ discard block |
||
209 | 209 | } |
210 | 210 | |
211 | 211 | foreach ($folders as $folder) { |
212 | - if (($folder->parent_id > 0 || $folder->parent_id == 0) && $folder->title != $_SESSION['user_id'] ) { |
|
212 | + if (($folder->parent_id > 0 || $folder->parent_id == 0) && $folder->title != $_SESSION['user_id']) { |
|
213 | 213 | //Store the deleted folder (recycled bin) |
214 | 214 | if ($pf === false) { |
215 | 215 | DB::insert( |
@@ -265,12 +265,12 @@ discard block |
||
265 | 265 | ); |
266 | 266 | |
267 | 267 | //Actualize the variable |
268 | - $_SESSION['nb_folders'] --; |
|
268 | + $_SESSION['nb_folders']--; |
|
269 | 269 | } |
270 | 270 | } |
271 | 271 | |
272 | 272 | // delete folder from SESSION |
273 | - if(($key = array_search($_POST['id'], $_SESSION['groupes_visibles'])) !== false) { |
|
273 | + if (($key = array_search($_POST['id'], $_SESSION['groupes_visibles'])) !== false) { |
|
274 | 274 | unset($folders[$key]); |
275 | 275 | } |
276 | 276 | |
@@ -280,7 +280,7 @@ discard block |
||
280 | 280 | |
281 | 281 | // delete folders |
282 | 282 | $folderForDel = array_unique($folderForDel); |
283 | - foreach ($folderForDel as $fol){ |
|
283 | + foreach ($folderForDel as $fol) { |
|
284 | 284 | DB::delete(prefix_table("nested_tree"), "id = %i", $fol); |
285 | 285 | } |
286 | 286 | |
@@ -346,7 +346,7 @@ discard block |
||
346 | 346 | ); |
347 | 347 | |
348 | 348 | // delete folder from SESSION |
349 | - if(($key = array_search($item['id'], $_SESSION['groupes_visibles'])) !== false) { |
|
349 | + if (($key = array_search($item['id'], $_SESSION['groupes_visibles'])) !== false) { |
|
350 | 350 | unset($_SESSION['groupes_visibles'][$item['id']]); |
351 | 351 | } |
352 | 352 | |
@@ -355,13 +355,13 @@ discard block |
||
355 | 355 | } |
356 | 356 | |
357 | 357 | //Actualize the variable |
358 | - $_SESSION['nb_folders'] --; |
|
358 | + $_SESSION['nb_folders']--; |
|
359 | 359 | } |
360 | 360 | } |
361 | 361 | |
362 | 362 | // delete folders |
363 | - $folderForDel=array_unique($folderForDel); |
|
364 | - foreach ($folderForDel as $fol){ |
|
363 | + $folderForDel = array_unique($folderForDel); |
|
364 | + foreach ($folderForDel as $fol) { |
|
365 | 365 | DB::delete(prefix_table("nested_tree"), "id = %i", $fol); |
366 | 366 | } |
367 | 367 | } |
@@ -506,7 +506,7 @@ discard block |
||
506 | 506 | && $_SESSION['settings']['subfolder_rights_as_parent'] == 1 |
507 | 507 | && $_SESSION['is_admin'] !== 0 |
508 | 508 | || ($isPersonal != 1 && $parentId === "0") |
509 | - ){ |
|
509 | + ) { |
|
510 | 510 | //Get user's rights |
511 | 511 | @identifyUserRights( |
512 | 512 | $_SESSION['groupes_visibles'].';'.$newId, |
@@ -582,7 +582,7 @@ discard block |
||
582 | 582 | } |
583 | 583 | } |
584 | 584 | } |
585 | - else{ |
|
585 | + else { |
|
586 | 586 | $error = $LANG['error_not_allowed_to']; |
587 | 587 | } |
588 | 588 | } |
@@ -625,7 +625,7 @@ discard block |
||
625 | 625 | if (isset($_SESSION['settings']['duplicate_folder']) && $_SESSION['settings']['duplicate_folder'] == 0) { |
626 | 626 | $data = DB::queryfirstrow( |
627 | 627 | "SELECT id, title FROM ".prefix_table("nested_tree")." WHERE title = %s", $title); |
628 | - if (!empty($data['id']) && $dataReceived['id'] != $data['id'] && $title != $data['title'] ) { |
|
628 | + if (!empty($data['id']) && $dataReceived['id'] != $data['id'] && $title != $data['title']) { |
|
629 | 629 | echo '[ { "error" : "error_group_exist" } ]'; |
630 | 630 | break; |
631 | 631 | } |
@@ -732,7 +732,7 @@ discard block |
||
732 | 732 | ); |
733 | 733 | } else { |
734 | 734 | //Update DB |
735 | - if ($data['authorized']==1) { |
|
735 | + if ($data['authorized'] == 1) { |
|
736 | 736 | DB::update( |
737 | 737 | prefix_table("rights"), |
738 | 738 | array( |
@@ -832,10 +832,10 @@ discard block |
||
832 | 832 | // Get through each subfolder |
833 | 833 | $folders = $tree->getDescendants($_POST['id'], false); |
834 | 834 | foreach ($folders as $folder) { |
835 | - if($subfolders === "") { |
|
835 | + if ($subfolders === "") { |
|
836 | 836 | $subfolders = $folder->id; |
837 | 837 | } else { |
838 | - $subfolders .= ";" . $folder->id; |
|
838 | + $subfolders .= ";".$folder->id; |
|
839 | 839 | } |
840 | 840 | } |
841 | 841 | |
@@ -869,7 +869,7 @@ discard block |
||
869 | 869 | if (in_array($t->id, $_SESSION['groupes_visibles'])) { |
870 | 870 | if (!is_numeric($t->title)) { |
871 | 871 | $ident = " "; |
872 | - for ($x=1; $x<$t->nlevel; $x++) { |
|
872 | + for ($x = 1; $x < $t->nlevel; $x++) { |
|
873 | 873 | $ident .= " "; |
874 | 874 | } |
875 | 875 | |
@@ -970,7 +970,7 @@ discard block |
||
970 | 970 | && isset($_SESSION['settings']['subfolder_rights_as_parent']) |
971 | 971 | && $_SESSION['settings']['subfolder_rights_as_parent'] == 1 |
972 | 972 | && $_SESSION['is_admin'] !== 0 |
973 | - ){ |
|
973 | + ) { |
|
974 | 974 | //Get user's rights |
975 | 975 | @identifyUserRights( |
976 | 976 | $_SESSION['groupes_visibles'].';'.$newFolderId, |
@@ -581,8 +581,7 @@ |
||
581 | 581 | $prev_level = $t->nlevel; |
582 | 582 | } |
583 | 583 | } |
584 | - } |
|
585 | - else{ |
|
584 | + } else{ |
|
586 | 585 | $error = $LANG['error_not_allowed_to']; |
587 | 586 | } |
588 | 587 | } |
@@ -46,7 +46,7 @@ discard block |
||
46 | 46 | //Paging |
47 | 47 | $sLimit = ""; |
48 | 48 | if (isset($_GET['iDisplayStart']) && $_GET['iDisplayLength'] != '-1') { |
49 | - $sLimit = "LIMIT ". mysqli_real_escape_string($link, filter_var($_GET['iDisplayStart'], FILTER_SANITIZE_NUMBER_INT)) .", ". mysqli_real_escape_string($link, filter_var($_GET['iDisplayLength'], FILTER_SANITIZE_NUMBER_INT)) ; |
|
49 | + $sLimit = "LIMIT ".mysqli_real_escape_string($link, filter_var($_GET['iDisplayStart'], FILTER_SANITIZE_NUMBER_INT)).", ".mysqli_real_escape_string($link, filter_var($_GET['iDisplayLength'], FILTER_SANITIZE_NUMBER_INT)); |
|
50 | 50 | } |
51 | 51 | } |
52 | 52 | |
@@ -57,13 +57,13 @@ discard block |
||
57 | 57 | //Ordering |
58 | 58 | if (isset($_GET['iSortCol_0']) && isset($_GET['sSortDir_0']) && in_array(strtoupper($_GET['sSortDir_0']), $aSortTypes)) { |
59 | 59 | $sOrder = "ORDER BY "; |
60 | - for ($i=0; $i<intval($_GET['iSortingCols']); $i++) { |
|
60 | + for ($i = 0; $i < intval($_GET['iSortingCols']); $i++) { |
|
61 | 61 | if ( |
62 | - $_GET[ 'bSortable_'.filter_var($_GET['iSortCol_'.$i], FILTER_SANITIZE_NUMBER_INT)] == "true" && |
|
62 | + $_GET['bSortable_'.filter_var($_GET['iSortCol_'.$i], FILTER_SANITIZE_NUMBER_INT)] == "true" && |
|
63 | 63 | preg_match("#^(asc|desc)\$#i", $_GET['sSortDir_'.$i]) |
64 | 64 | ) { |
65 | - $sOrder .= "".$aColumns[ filter_var($_GET['iSortCol_'.$i], FILTER_SANITIZE_NUMBER_INT) ]." " |
|
66 | - .mysqli_escape_string($link, $_GET['sSortDir_'.$i]) .", "; |
|
65 | + $sOrder .= "".$aColumns[filter_var($_GET['iSortCol_'.$i], FILTER_SANITIZE_NUMBER_INT)]." " |
|
66 | + .mysqli_escape_string($link, $_GET['sSortDir_'.$i]).", "; |
|
67 | 67 | } |
68 | 68 | } |
69 | 69 | |
@@ -82,7 +82,7 @@ discard block |
||
82 | 82 | $sWhere = "WHERE l.type = 'user_connection'"; |
83 | 83 | if ($_GET['sSearch'] != "") { |
84 | 84 | $sWhere .= " AND ("; |
85 | - for ($i=0; $i<count($aColumns); $i++) { |
|
85 | + for ($i = 0; $i < count($aColumns); $i++) { |
|
86 | 86 | $sWhere .= $aColumns[$i]." LIKE %ss_".$i." OR "; |
87 | 87 | } |
88 | 88 | $sWhere = substr_replace($sWhere, "", -3).") "; |
@@ -139,7 +139,7 @@ discard block |
||
139 | 139 | $sOutput .= '"'.date($_SESSION['settings']['date_format']." ".$_SESSION['settings']['time_format'], $record['date']).'", '; |
140 | 140 | |
141 | 141 | //col2 |
142 | - $sOutput .= '"'.str_replace(array(CHR(10),CHR(13)),array(' ',' '),htmlspecialchars(stripslashes($record['label']), ENT_QUOTES)).'", '; |
|
142 | + $sOutput .= '"'.str_replace(array(CHR(10), CHR(13)), array(' ', ' '), htmlspecialchars(stripslashes($record['label']), ENT_QUOTES)).'", '; |
|
143 | 143 | |
144 | 144 | //col3 |
145 | 145 | $sOutput .= '"'.htmlspecialchars(stripslashes($record['login']), ENT_QUOTES).'"'; |
@@ -163,13 +163,13 @@ discard block |
||
163 | 163 | //Ordering |
164 | 164 | if (isset($_GET['iSortCol_0']) && isset($_GET['sSortDir_0']) && in_array(strtoupper($_GET['sSortDir_0']), $aSortTypes)) { |
165 | 165 | $sOrder = "ORDER BY "; |
166 | - for ($i=0; $i<intval($_GET['iSortingCols']); $i++) { |
|
166 | + for ($i = 0; $i < intval($_GET['iSortingCols']); $i++) { |
|
167 | 167 | if ( |
168 | - $_GET[ 'bSortable_'.filter_var($_GET['iSortCol_'.$i], FILTER_SANITIZE_NUMBER_INT)] == "true" && |
|
168 | + $_GET['bSortable_'.filter_var($_GET['iSortCol_'.$i], FILTER_SANITIZE_NUMBER_INT)] == "true" && |
|
169 | 169 | preg_match("#^(asc|desc)\$#i", $_GET['sSortDir_'.$i]) |
170 | 170 | ) { |
171 | - $sOrder .= "".$aColumns[ filter_var($_GET['iSortCol_'.$i], FILTER_SANITIZE_NUMBER_INT) ]." " |
|
172 | - .mysqli_escape_string($link, $_GET['sSortDir_'.$i]) .", "; |
|
171 | + $sOrder .= "".$aColumns[filter_var($_GET['iSortCol_'.$i], FILTER_SANITIZE_NUMBER_INT)]." " |
|
172 | + .mysqli_escape_string($link, $_GET['sSortDir_'.$i]).", "; |
|
173 | 173 | } |
174 | 174 | } |
175 | 175 | |
@@ -183,7 +183,7 @@ discard block |
||
183 | 183 | $sWhere = " WHERE l.type = 'error'"; |
184 | 184 | if ($_GET['sSearch'] != "") { |
185 | 185 | $sWhere .= " AND ("; |
186 | - for ($i=0; $i<count($aColumns); $i++) { |
|
186 | + for ($i = 0; $i < count($aColumns); $i++) { |
|
187 | 187 | $sWhere .= $aColumns[$i]." LIKE %ss_".$i." OR "; |
188 | 188 | } |
189 | 189 | $sWhere = substr_replace($sWhere, "", -3).") "; |
@@ -238,7 +238,7 @@ discard block |
||
238 | 238 | $sOutput .= '"'.date($_SESSION['settings']['date_format']." ".$_SESSION['settings']['time_format'], $record['date']).'", '; |
239 | 239 | |
240 | 240 | //col2 |
241 | - $sOutput .= '"'.str_replace(array(CHR(10),CHR(13)),array(' ',' '),htmlspecialchars(stripslashes($record['label']), ENT_QUOTES)).'", '; |
|
241 | + $sOutput .= '"'.str_replace(array(CHR(10), CHR(13)), array(' ', ' '), htmlspecialchars(stripslashes($record['label']), ENT_QUOTES)).'", '; |
|
242 | 242 | |
243 | 243 | //col3 |
244 | 244 | $sOutput .= '"'.htmlspecialchars(stripslashes($record['login']), ENT_QUOTES).'"'; |
@@ -262,13 +262,13 @@ discard block |
||
262 | 262 | //Ordering |
263 | 263 | if (isset($_GET['iSortCol_0']) && isset($_GET['sSortDir_0']) && in_array(strtoupper($_GET['sSortDir_0']), $aSortTypes)) { |
264 | 264 | $sOrder = "ORDER BY "; |
265 | - for ($i=0; $i<intval($_GET['iSortingCols']); $i++) { |
|
265 | + for ($i = 0; $i < intval($_GET['iSortingCols']); $i++) { |
|
266 | 266 | if ( |
267 | - $_GET[ 'bSortable_'.filter_var($_GET['iSortCol_'.$i], FILTER_SANITIZE_NUMBER_INT)] == "true" && |
|
267 | + $_GET['bSortable_'.filter_var($_GET['iSortCol_'.$i], FILTER_SANITIZE_NUMBER_INT)] == "true" && |
|
268 | 268 | preg_match("#^(asc|desc)\$#i", $_GET['sSortDir_'.$i]) |
269 | 269 | ) { |
270 | - $sOrder .= "".$aColumns[ filter_var($_GET['iSortCol_'.$i], FILTER_SANITIZE_NUMBER_INT) ]." " |
|
271 | - .mysqli_escape_string($link, $_GET['sSortDir_'.$i]) .", "; |
|
270 | + $sOrder .= "".$aColumns[filter_var($_GET['iSortCol_'.$i], FILTER_SANITIZE_NUMBER_INT)]." " |
|
271 | + .mysqli_escape_string($link, $_GET['sSortDir_'.$i]).", "; |
|
272 | 272 | } |
273 | 273 | } |
274 | 274 | |
@@ -282,7 +282,7 @@ discard block |
||
282 | 282 | $sWhere = " WHERE l.action = 'at_shown'"; |
283 | 283 | if ($_GET['sSearch'] != "") { |
284 | 284 | $sWhere .= " AND ("; |
285 | - for ($i=0; $i<count($aColumns); $i++) { |
|
285 | + for ($i = 0; $i < count($aColumns); $i++) { |
|
286 | 286 | $sWhere .= $aColumns[$i]." LIKE %ss_".$i." OR "; |
287 | 287 | } |
288 | 288 | $sWhere = substr_replace($sWhere, "", -3).") "; |
@@ -339,7 +339,7 @@ discard block |
||
339 | 339 | $sOutput .= '"'.date($_SESSION['settings']['date_format']." ".$_SESSION['settings']['time_format'], $record['date']).'", '; |
340 | 340 | |
341 | 341 | //col2 |
342 | - $sOutput .= '"'.str_replace(array(CHR(10),CHR(13)),array(' ',' '),htmlspecialchars(stripslashes($record['label']), ENT_QUOTES)).'", '; |
|
342 | + $sOutput .= '"'.str_replace(array(CHR(10), CHR(13)), array(' ', ' '), htmlspecialchars(stripslashes($record['label']), ENT_QUOTES)).'", '; |
|
343 | 343 | |
344 | 344 | //col3 |
345 | 345 | $sOutput .= '"'.htmlspecialchars(stripslashes($record['login']), ENT_QUOTES).'"'; |
@@ -363,13 +363,13 @@ discard block |
||
363 | 363 | //Ordering |
364 | 364 | if (isset($_GET['iSortCol_0']) && isset($_GET['sSortDir_0']) && in_array(strtoupper($_GET['sSortDir_0']), $aSortTypes)) { |
365 | 365 | $sOrder = "ORDER BY "; |
366 | - for ($i=0; $i<intval($_GET['iSortingCols']); $i++) { |
|
366 | + for ($i = 0; $i < intval($_GET['iSortingCols']); $i++) { |
|
367 | 367 | if ( |
368 | - $_GET[ 'bSortable_'.filter_var($_GET['iSortCol_'.$i], FILTER_SANITIZE_NUMBER_INT)] == "true" && |
|
368 | + $_GET['bSortable_'.filter_var($_GET['iSortCol_'.$i], FILTER_SANITIZE_NUMBER_INT)] == "true" && |
|
369 | 369 | preg_match("#^(asc|desc)\$#i", $_GET['sSortDir_'.$i]) |
370 | 370 | ) { |
371 | - $sOrder .= "".$aColumns[ filter_var($_GET['iSortCol_'.$i], FILTER_SANITIZE_NUMBER_INT) ]." " |
|
372 | - .mysqli_escape_string($link, $_GET['sSortDir_'.$i]) .", "; |
|
371 | + $sOrder .= "".$aColumns[filter_var($_GET['iSortCol_'.$i], FILTER_SANITIZE_NUMBER_INT)]." " |
|
372 | + .mysqli_escape_string($link, $_GET['sSortDir_'.$i]).", "; |
|
373 | 373 | } |
374 | 374 | } |
375 | 375 | |
@@ -383,7 +383,7 @@ discard block |
||
383 | 383 | $sWhere = " WHERE l.action = 'at_copy'"; |
384 | 384 | if ($_GET['sSearch'] != "") { |
385 | 385 | $sWhere .= " AND ("; |
386 | - for ($i=0; $i<count($aColumns); $i++) { |
|
386 | + for ($i = 0; $i < count($aColumns); $i++) { |
|
387 | 387 | $sWhere .= $aColumns[$i]." LIKE %ss_".$i." OR "; |
388 | 388 | } |
389 | 389 | $sWhere = substr_replace($sWhere, "", -3).") "; |
@@ -464,13 +464,13 @@ discard block |
||
464 | 464 | //Ordering |
465 | 465 | if (isset($_GET['iSortCol_0']) && isset($_GET['sSortDir_0']) && in_array(strtoupper($_GET['sSortDir_0']), $aSortTypes)) { |
466 | 466 | $sOrder = "ORDER BY "; |
467 | - for ($i=0; $i<intval($_GET['iSortingCols']); $i++) { |
|
467 | + for ($i = 0; $i < intval($_GET['iSortingCols']); $i++) { |
|
468 | 468 | if ( |
469 | - $_GET[ 'bSortable_'.filter_var($_GET['iSortCol_'.$i], FILTER_SANITIZE_NUMBER_INT)] == "true" && |
|
469 | + $_GET['bSortable_'.filter_var($_GET['iSortCol_'.$i], FILTER_SANITIZE_NUMBER_INT)] == "true" && |
|
470 | 470 | preg_match("#^(asc|desc)\$#i", $_GET['sSortDir_'.$i]) |
471 | 471 | ) { |
472 | - $sOrder .= "".$aColumns[ filter_var($_GET['iSortCol_'.$i], FILTER_SANITIZE_NUMBER_INT) ]." " |
|
473 | - .mysqli_escape_string($link, $_GET['sSortDir_'.$i]) .", "; |
|
472 | + $sOrder .= "".$aColumns[filter_var($_GET['iSortCol_'.$i], FILTER_SANITIZE_NUMBER_INT)]." " |
|
473 | + .mysqli_escape_string($link, $_GET['sSortDir_'.$i]).", "; |
|
474 | 474 | } |
475 | 475 | } |
476 | 476 | |
@@ -486,7 +486,7 @@ discard block |
||
486 | 486 | $sWhere = "WHERE l.type = 'admin_action'"; |
487 | 487 | if ($_GET['sSearch'] != "") { |
488 | 488 | $sWhere .= " AND ("; |
489 | - for ($i=0; $i<count($aColumns); $i++) { |
|
489 | + for ($i = 0; $i < count($aColumns); $i++) { |
|
490 | 490 | $sWhere .= $aColumns[$i]." LIKE %ss_".$i." OR "; |
491 | 491 | } |
492 | 492 | $sWhere = substr_replace($sWhere, "", -3); |
@@ -565,13 +565,13 @@ discard block |
||
565 | 565 | //Ordering |
566 | 566 | if (isset($_GET['iSortCol_0']) && isset($_GET['sSortDir_0']) && in_array(strtoupper($_GET['sSortDir_0']), $aSortTypes)) { |
567 | 567 | $sOrder = "ORDER BY "; |
568 | - for ($i=0; $i<intval($_GET['iSortingCols']); $i++) { |
|
568 | + for ($i = 0; $i < intval($_GET['iSortingCols']); $i++) { |
|
569 | 569 | if ( |
570 | - $_GET[ 'bSortable_'.filter_var($_GET['iSortCol_'.$i], FILTER_SANITIZE_NUMBER_INT)] == "true" && |
|
570 | + $_GET['bSortable_'.filter_var($_GET['iSortCol_'.$i], FILTER_SANITIZE_NUMBER_INT)] == "true" && |
|
571 | 571 | preg_match("#^(asc|desc)\$#i", $_GET['sSortDir_'.$i]) |
572 | 572 | ) { |
573 | - $sOrder .= "".$aColumns[ filter_var($_GET['iSortCol_'.$i], FILTER_SANITIZE_NUMBER_INT) ]." " |
|
574 | - .mysqli_escape_string($link, $_GET['sSortDir_'.$i]) .", "; |
|
573 | + $sOrder .= "".$aColumns[filter_var($_GET['iSortCol_'.$i], FILTER_SANITIZE_NUMBER_INT)]." " |
|
574 | + .mysqli_escape_string($link, $_GET['sSortDir_'.$i]).", "; |
|
575 | 575 | } |
576 | 576 | } |
577 | 577 | |
@@ -587,7 +587,7 @@ discard block |
||
587 | 587 | $sWhere = ""; |
588 | 588 | if ($_GET['sSearch'] != "") { |
589 | 589 | $sWhere .= " WHERE ("; |
590 | - for ($i=1; $i<count($aColumns)-1; $i++) { |
|
590 | + for ($i = 1; $i < count($aColumns) - 1; $i++) { |
|
591 | 591 | $sWhere .= $aColumns[$i]." LIKE %ss_".$i." OR "; |
592 | 592 | } |
593 | 593 | $sWhere = substr_replace($sWhere, "", -3); |
@@ -658,9 +658,9 @@ discard block |
||
658 | 658 | |
659 | 659 | //col5 |
660 | 660 | if ($record['perso'] == 1) { |
661 | - $sOutput_item .= '"'. htmlspecialchars(stripslashes($LANG['yes']), ENT_QUOTES). '"'; |
|
661 | + $sOutput_item .= '"'.htmlspecialchars(stripslashes($LANG['yes']), ENT_QUOTES).'"'; |
|
662 | 662 | } else { |
663 | - $sOutput_item .= '"'. htmlspecialchars(stripslashes($LANG['no']), ENT_QUOTES). '"'; |
|
663 | + $sOutput_item .= '"'.htmlspecialchars(stripslashes($LANG['no']), ENT_QUOTES).'"'; |
|
664 | 664 | } |
665 | 665 | |
666 | 666 | //Finish the line |
@@ -684,13 +684,13 @@ discard block |
||
684 | 684 | //Ordering |
685 | 685 | if (isset($_GET['iSortCol_0']) && isset($_GET['sSortDir_0']) && in_array(strtoupper($_GET['sSortDir_0']), $aSortTypes)) { |
686 | 686 | $sOrder = "ORDER BY "; |
687 | - for ($i=0; $i<intval($_GET['iSortingCols']); $i++) { |
|
687 | + for ($i = 0; $i < intval($_GET['iSortingCols']); $i++) { |
|
688 | 688 | if ( |
689 | - $_GET[ 'bSortable_'.filter_var($_GET['iSortCol_'.$i], FILTER_SANITIZE_NUMBER_INT)] == "true" && |
|
689 | + $_GET['bSortable_'.filter_var($_GET['iSortCol_'.$i], FILTER_SANITIZE_NUMBER_INT)] == "true" && |
|
690 | 690 | preg_match("#^(asc|desc)\$#i", $_GET['sSortDir_'.$i]) |
691 | 691 | ) { |
692 | - $sOrder .= "".$aColumns[ filter_var($_GET['iSortCol_'.$i], FILTER_SANITIZE_NUMBER_INT) ]." " |
|
693 | - .mysqli_escape_string($link, $_GET['sSortDir_'.$i]) .", "; |
|
692 | + $sOrder .= "".$aColumns[filter_var($_GET['iSortCol_'.$i], FILTER_SANITIZE_NUMBER_INT)]." " |
|
693 | + .mysqli_escape_string($link, $_GET['sSortDir_'.$i]).", "; |
|
694 | 694 | } |
695 | 695 | } |
696 | 696 | |
@@ -704,7 +704,7 @@ discard block |
||
704 | 704 | $sWhere = " WHERE l.type = 'failed_auth'"; |
705 | 705 | if ($_GET['sSearch'] != "") { |
706 | 706 | $sWhere .= " AND ("; |
707 | - for ($i=0; $i<count($aColumns); $i++) { |
|
707 | + for ($i = 0; $i < count($aColumns); $i++) { |
|
708 | 708 | $sWhere .= $aColumns[$i]." LIKE %ss_".$i." OR "; |
709 | 709 | } |
710 | 710 | $sWhere = substr_replace($sWhere, "", -3).") "; |
@@ -757,7 +757,7 @@ discard block |
||
757 | 757 | $sOutput .= '"'.date($_SESSION['settings']['date_format']." ".$_SESSION['settings']['time_format'], $record['auth_date']).'", '; |
758 | 758 | |
759 | 759 | //col2 |
760 | - $sOutput .= '"'.str_replace(array(CHR(10),CHR(13)),array(' ',' '),htmlspecialchars(stripslashes($record['label']), ENT_QUOTES)).'", '; |
|
760 | + $sOutput .= '"'.str_replace(array(CHR(10), CHR(13)), array(' ', ' '), htmlspecialchars(stripslashes($record['label']), ENT_QUOTES)).'", '; |
|
761 | 761 | |
762 | 762 | //col3 |
763 | 763 | $sOutput .= '"'.htmlspecialchars(stripslashes($record['who']), ENT_QUOTES).'"'; |
@@ -46,20 +46,20 @@ discard block |
||
46 | 46 | //Paging |
47 | 47 | $sLimit = ""; |
48 | 48 | if (isset($_GET['iDisplayStart']) && $_GET['iDisplayLength'] != '-1') { |
49 | - $sLimit = "LIMIT ". filter_var($_GET['iDisplayStart'], FILTER_SANITIZE_NUMBER_INT) .", ". filter_var($_GET['iDisplayLength'], FILTER_SANITIZE_NUMBER_INT).""; |
|
49 | + $sLimit = "LIMIT ".filter_var($_GET['iDisplayStart'], FILTER_SANITIZE_NUMBER_INT).", ".filter_var($_GET['iDisplayLength'], FILTER_SANITIZE_NUMBER_INT).""; |
|
50 | 50 | } |
51 | 51 | |
52 | 52 | //Ordering |
53 | 53 | |
54 | 54 | if (isset($_GET['iSortCol_0']) && in_array($_GET['iSortCol_0'], $aSortTypes)) { |
55 | 55 | $sOrder = "ORDER BY "; |
56 | - for ($i=0; $i<intval($_GET['iSortingCols']); $i++) { |
|
56 | + for ($i = 0; $i < intval($_GET['iSortingCols']); $i++) { |
|
57 | 57 | if ( |
58 | - $_GET[ 'bSortable_'.filter_var($_GET['iSortCol_'.$i], FILTER_SANITIZE_NUMBER_INT)] == "true" && |
|
58 | + $_GET['bSortable_'.filter_var($_GET['iSortCol_'.$i], FILTER_SANITIZE_NUMBER_INT)] == "true" && |
|
59 | 59 | preg_match("#^(asc|desc)\$#i", $_GET['sSortDir_'.$i]) |
60 | 60 | ) { |
61 | - $sOrder .= "".$aColumns[ filter_var($_GET['iSortCol_'.$i], FILTER_SANITIZE_NUMBER_INT) ]." " |
|
62 | - .mysqli_escape_string($link, $_GET['sSortDir_'.$i]) .", "; |
|
61 | + $sOrder .= "".$aColumns[filter_var($_GET['iSortCol_'.$i], FILTER_SANITIZE_NUMBER_INT)]." " |
|
62 | + .mysqli_escape_string($link, $_GET['sSortDir_'.$i]).", "; |
|
63 | 63 | } |
64 | 64 | } |
65 | 65 | |
@@ -77,7 +77,7 @@ discard block |
||
77 | 77 | */ |
78 | 78 | if ($_GET['sSearch'] != "") { |
79 | 79 | $sWhere = " WHERE "; |
80 | - for ($i=0; $i<count($aColumns); $i++) { |
|
80 | + for ($i = 0; $i < count($aColumns); $i++) { |
|
81 | 81 | $sWhere .= $aColumns[$i]." LIKE %ss_".$i." OR "; |
82 | 82 | } |
83 | 83 | $sWhere = substr_replace($sWhere, "", -3); |
@@ -64,7 +64,7 @@ discard block |
||
64 | 64 | //Paging |
65 | 65 | $sLimit = ""; |
66 | 66 | if (isset($_GET['length']) && $_GET['length'] != '-1') { |
67 | - $sLimit = "LIMIT ". filter_var($_GET['start'], FILTER_SANITIZE_NUMBER_INT) .", ". filter_var($_GET['length'], FILTER_SANITIZE_NUMBER_INT).""; |
|
67 | + $sLimit = "LIMIT ".filter_var($_GET['start'], FILTER_SANITIZE_NUMBER_INT).", ".filter_var($_GET['length'], FILTER_SANITIZE_NUMBER_INT).""; |
|
68 | 68 | } |
69 | 69 | |
70 | 70 | //Ordering |
@@ -73,8 +73,8 @@ discard block |
||
73 | 73 | if ( |
74 | 74 | preg_match("#^(asc|desc)\$#i", $_GET['order'][0]['column']) |
75 | 75 | ) { |
76 | - $sOrder .= "".$aColumns[ filter_var($_GET['order'][0]['column'], FILTER_SANITIZE_NUMBER_INT) ]." " |
|
77 | - .mysqli_escape_string($link, $_GET['order'][0]['column']) .", "; |
|
76 | + $sOrder .= "".$aColumns[filter_var($_GET['order'][0]['column'], FILTER_SANITIZE_NUMBER_INT)]." " |
|
77 | + .mysqli_escape_string($link, $_GET['order'][0]['column']).", "; |
|
78 | 78 | } |
79 | 79 | |
80 | 80 | $sOrder = substr_replace($sOrder, "", -2); |
@@ -285,9 +285,9 @@ discard block |
||
285 | 285 | //col11 |
286 | 286 | if ($_SESSION['is_admin'] === "1" || $_SESSION['user_can_manage_all_users'] == 1) { |
287 | 287 | if ($record['can_manage_all_users'] === "1") { |
288 | - $sOutput .= '"<i class=\"fa fa-toggle-on mi-green\" style=\"cursor:pointer;\" tp=\"' . $record['id'] . '-can_manage_all_users-0\"></i>"'; |
|
288 | + $sOutput .= '"<i class=\"fa fa-toggle-on mi-green\" style=\"cursor:pointer;\" tp=\"'.$record['id'].'-can_manage_all_users-0\"></i>"'; |
|
289 | 289 | } else { |
290 | - $sOutput .= '"<i class=\"fa fa-toggle-off\" style=\"cursor:pointer;\" tp=\"' . $record['id'] . '-can_manage_all_users-1\"></i>"'; |
|
290 | + $sOutput .= '"<i class=\"fa fa-toggle-off\" style=\"cursor:pointer;\" tp=\"'.$record['id'].'-can_manage_all_users-1\"></i>"'; |
|
291 | 291 | } |
292 | 292 | } else { |
293 | 293 | $sOutput .= '""'; |
@@ -307,7 +307,7 @@ discard block |
||
307 | 307 | //Finish the line |
308 | 308 | $sOutput .= '],'; |
309 | 309 | |
310 | - $iFilteredTotal ++; |
|
310 | + $iFilteredTotal++; |
|
311 | 311 | } |
312 | 312 | } |
313 | 313 |
@@ -90,13 +90,16 @@ discard block |
||
90 | 90 | * on very large tables, and MySQL's regex functionality is very limited |
91 | 91 | */ |
92 | 92 | if (isset($_GET['letter']) && $_GET['letter'] != "" && $_GET['letter'] != "None") { |
93 | - if (empty($sWhere)) $sWhere = " WHERE "; |
|
93 | + if (empty($sWhere)) { |
|
94 | + $sWhere = " WHERE "; |
|
95 | + } |
|
94 | 96 | $sWhere .= $aColumns[1]." LIKE '".filter_var($_GET['letter'], FILTER_SANITIZE_STRING)."%' OR "; |
95 | 97 | $sWhere .= $aColumns[2]." LIKE '".filter_var($_GET['letter'], FILTER_SANITIZE_STRING)."%' OR "; |
96 | 98 | $sWhere .= $aColumns[3]." LIKE '".filter_var($_GET['letter'], FILTER_SANITIZE_STRING)."%' "; |
97 | -} |
|
98 | -elseif (isset($_GET['search']['value']) && $_GET['search']['value'] != "") { |
|
99 | - if (empty($sWhere)) $sWhere = " WHERE "; |
|
99 | +} elseif (isset($_GET['search']['value']) && $_GET['search']['value'] != "") { |
|
100 | + if (empty($sWhere)) { |
|
101 | + $sWhere = " WHERE "; |
|
102 | + } |
|
100 | 103 | $sWhere .= $aColumns[1]." LIKE '".filter_var($_GET['search']['value'], FILTER_SANITIZE_STRING)."%' OR "; |
101 | 104 | $sWhere .= $aColumns[2]." LIKE '".filter_var($_GET['search']['value'], FILTER_SANITIZE_STRING)."%' OR "; |
102 | 105 | $sWhere .= $aColumns[3]." LIKE '".filter_var($_GET['search']['value'], FILTER_SANITIZE_STRING)."%' "; |
@@ -104,8 +107,11 @@ discard block |
||
104 | 107 | |
105 | 108 | // enlarge the query in case of Manager |
106 | 109 | if (!$_SESSION['is_admin'] && !$_SESSION['user_can_manage_all_users']) { |
107 | - if (empty($sWhere)) $sWhere = " WHERE "; |
|
108 | - else $sWhere .= " AND "; |
|
110 | + if (empty($sWhere)) { |
|
111 | + $sWhere = " WHERE "; |
|
112 | + } else { |
|
113 | + $sWhere .= " AND "; |
|
114 | + } |
|
109 | 115 | $sWhere .= "isAdministratedByRole IN (".implode(",", array_filter($_SESSION['user_roles'])).")"; |
110 | 116 | } |
111 | 117 | db::debugmode(false); |
@@ -213,8 +219,9 @@ discard block |
||
213 | 219 | } else { |
214 | 220 | $sOutput .= '"'; |
215 | 221 | } |
216 | - if ($record['id'] != API_USER_ID && $record['id'] != OTV_USER_ID) |
|
217 | - $sOutput .= '<span class=\"fa fa-external-link tip\" style=\"cursor:pointer;\" onclick=\"user_edit(\''.$record['id'].'\')\" title=\"'.$LANG['edit'].' ['.$record['id'].']'.'\"></span>'; |
|
222 | + if ($record['id'] != API_USER_ID && $record['id'] != OTV_USER_ID) { |
|
223 | + $sOutput .= '<span class=\"fa fa-external-link tip\" style=\"cursor:pointer;\" onclick=\"user_edit(\''.$record['id'].'\')\" title=\"'.$LANG['edit'].' ['.$record['id'].']'.'\"></span>'; |
|
224 | + } |
|
218 | 225 | |
219 | 226 | // pwd change |
220 | 227 | $sOutput .= ' <span class=\"fa fa-key tip\" style=\"cursor:pointer;\" onclick=\"mdp_user(\''.$record['id'].'\')\" title=\"'.addcslashes($LANG['change_password'], '"\\/').'\"></span>'; |
@@ -229,8 +236,9 @@ discard block |
||
229 | 236 | $sOutput .= ' <span class=\"fa fa-qrcode mi-green tip\" style=\"cursor:pointer;\" onclick=\"user_action_ga_code(\''.$record['id'].'\')\" title=\"'.addcslashes($LANG['user_ga_code'], '"\\/').'\"></span>'; |
230 | 237 | } |
231 | 238 | |
232 | - if ($record['admin'] !== "1") |
|
233 | - $sOutput .= ' <span class=\"fa fa-sitemap tip\" style=\"cursor:pointer;\" onclick=\"user_folders_rights(\''.$record['id'].'\')\" title=\"'.$LANG['user_folders_rights'].' ['.$record['id'].']'.'\"></span>'; |
|
239 | + if ($record['admin'] !== "1") { |
|
240 | + $sOutput .= ' <span class=\"fa fa-sitemap tip\" style=\"cursor:pointer;\" onclick=\"user_folders_rights(\''.$record['id'].'\')\" title=\"'.$LANG['user_folders_rights'].' ['.$record['id'].']'.'\"></span>'; |
|
241 | + } |
|
234 | 242 | |
235 | 243 | $sOutput .= '",'; |
236 | 244 | |
@@ -265,21 +273,30 @@ discard block |
||
265 | 273 | |
266 | 274 | //col9 |
267 | 275 | if ($_SESSION['user_can_manage_all_users'] === "1" || $_SESSION['is_admin'] === "1") { |
268 | - if ($record['admin'] === "1") $sOutput .= '"<i class=\"fa fa-toggle-on mi-green\" style=\"cursor:pointer;\" tp=\"'.$record['id'].'-admin-0\"></i>"'; |
|
269 | - else $sOutput .= '"<i class=\"fa fa-toggle-off\" style=\"cursor:pointer;\" tp=\"'.$record['id'].'-admin-1\"></i>"'; |
|
276 | + if ($record['admin'] === "1") { |
|
277 | + $sOutput .= '"<i class=\"fa fa-toggle-on mi-green\" style=\"cursor:pointer;\" tp=\"'.$record['id'].'-admin-0\"></i>"'; |
|
278 | + } else { |
|
279 | + $sOutput .= '"<i class=\"fa fa-toggle-off\" style=\"cursor:pointer;\" tp=\"'.$record['id'].'-admin-1\"></i>"'; |
|
280 | + } |
|
270 | 281 | } else { |
271 | 282 | $sOutput .= '""'; |
272 | 283 | } |
273 | 284 | $sOutput .= ','; |
274 | 285 | |
275 | 286 | //col10 |
276 | - if ($record['gestionnaire'] === "1") $sOutput .= '"<i class=\"fa fa-toggle-on mi-green\" style=\"cursor:pointer;\" tp=\"'.$record['id'].'-gestionnaire-0\"></i>"'; |
|
277 | - else $sOutput .= '"<i class=\"fa fa-toggle-off\" style=\"cursor:pointer;\" tp=\"'.$record['id'].'-gestionnaire-1\"></i>"'; |
|
287 | + if ($record['gestionnaire'] === "1") { |
|
288 | + $sOutput .= '"<i class=\"fa fa-toggle-on mi-green\" style=\"cursor:pointer;\" tp=\"'.$record['id'].'-gestionnaire-0\"></i>"'; |
|
289 | + } else { |
|
290 | + $sOutput .= '"<i class=\"fa fa-toggle-off\" style=\"cursor:pointer;\" tp=\"'.$record['id'].'-gestionnaire-1\"></i>"'; |
|
291 | + } |
|
278 | 292 | $sOutput .= ','; |
279 | 293 | |
280 | 294 | //col11 |
281 | - if ($record['read_only'] === "1") $sOutput .= '"<i class=\"fa fa-toggle-on mi-green\" style=\"cursor:pointer;\" tp=\"'.$record['id'].'-read_only-0\"></i>"'; |
|
282 | - else $sOutput .= '"<i class=\"fa fa-toggle-off\" style=\"cursor:pointer;\" tp=\"'.$record['id'].'-read_only-1\"></i>"'; |
|
295 | + if ($record['read_only'] === "1") { |
|
296 | + $sOutput .= '"<i class=\"fa fa-toggle-on mi-green\" style=\"cursor:pointer;\" tp=\"'.$record['id'].'-read_only-0\"></i>"'; |
|
297 | + } else { |
|
298 | + $sOutput .= '"<i class=\"fa fa-toggle-off\" style=\"cursor:pointer;\" tp=\"'.$record['id'].'-read_only-1\"></i>"'; |
|
299 | + } |
|
283 | 300 | $sOutput .= ','; |
284 | 301 | |
285 | 302 | //col11 |
@@ -295,13 +312,19 @@ discard block |
||
295 | 312 | $sOutput .= ','; |
296 | 313 | |
297 | 314 | //col12 |
298 | - if ($record['can_create_root_folder'] === "1") $sOutput .= '"<i class=\"fa fa-toggle-on mi-green\" style=\"cursor:pointer;\" tp=\"'.$record['id'].'-can_create_root_folder-0\"></i>"'; |
|
299 | - else $sOutput .= '"<i class=\"fa fa-toggle-off\" style=\"cursor:pointer;\" tp=\"'.$record['id'].'-can_create_root_folder-1\"></i>"'; |
|
315 | + if ($record['can_create_root_folder'] === "1") { |
|
316 | + $sOutput .= '"<i class=\"fa fa-toggle-on mi-green\" style=\"cursor:pointer;\" tp=\"'.$record['id'].'-can_create_root_folder-0\"></i>"'; |
|
317 | + } else { |
|
318 | + $sOutput .= '"<i class=\"fa fa-toggle-off\" style=\"cursor:pointer;\" tp=\"'.$record['id'].'-can_create_root_folder-1\"></i>"'; |
|
319 | + } |
|
300 | 320 | $sOutput .= ','; |
301 | 321 | |
302 | 322 | //col13 |
303 | - if ($record['personal_folder'] === "1") $sOutput .= '"<i class=\"fa fa-toggle-on mi-green\" style=\"cursor:pointer;\" tp=\"'.$record['id'].'-personal_folder-0\"></i>"'; |
|
304 | - else $sOutput .= '"<i class=\"fa fa-toggle-off\" style=\"cursor:pointer;\" tp=\"'.$record['id'].'-personal_folder-1\"></i>"'; |
|
323 | + if ($record['personal_folder'] === "1") { |
|
324 | + $sOutput .= '"<i class=\"fa fa-toggle-on mi-green\" style=\"cursor:pointer;\" tp=\"'.$record['id'].'-personal_folder-0\"></i>"'; |
|
325 | + } else { |
|
326 | + $sOutput .= '"<i class=\"fa fa-toggle-off\" style=\"cursor:pointer;\" tp=\"'.$record['id'].'-personal_folder-1\"></i>"'; |
|
327 | + } |
|
305 | 328 | |
306 | 329 | |
307 | 330 | //Finish the line |
@@ -312,7 +335,9 @@ discard block |
||
312 | 335 | } |
313 | 336 | |
314 | 337 | if (count($rows) > 0) { |
315 | - if (strrchr($sOutput, "[") != '[') $sOutput = substr_replace($sOutput, "", -1); |
|
338 | + if (strrchr($sOutput, "[") != '[') { |
|
339 | + $sOutput = substr_replace($sOutput, "", -1); |
|
340 | + } |
|
316 | 341 | $sOutput .= '] }'; |
317 | 342 | } else { |
318 | 343 | $sOutput .= '[] }'; |
@@ -55,15 +55,15 @@ |
||
55 | 55 | |
56 | 56 | if (isset($_GET['iSortCol_0']) && in_array($_GET['iSortCol_0'], $aSortTypes)) { |
57 | 57 | $sOrder = "ORDER BY "; |
58 | - for ($i=0; $i<intval($_GET['iSortingCols']); $i++) { |
|
59 | - if ( |
|
60 | - $_GET[ 'bSortable_'.filter_var($_GET['iSortCol_'.$i], FILTER_SANITIZE_NUMBER_INT)] == "true" && |
|
61 | - preg_match("#^(asc|desc)\$#i", $_GET['sSortDir_'.$i]) |
|
62 | - ) { |
|
63 | - $sOrder .= "".$aColumns[ filter_var($_GET['iSortCol_'.$i], FILTER_SANITIZE_NUMBER_INT) ]." " |
|
64 | - .mysqli_escape_string($link, $_GET['sSortDir_'.$i]) .", "; |
|
65 | - } |
|
66 | - } |
|
58 | + for ($i=0; $i<intval($_GET['iSortingCols']); $i++) { |
|
59 | + if ( |
|
60 | + $_GET[ 'bSortable_'.filter_var($_GET['iSortCol_'.$i], FILTER_SANITIZE_NUMBER_INT)] == "true" && |
|
61 | + preg_match("#^(asc|desc)\$#i", $_GET['sSortDir_'.$i]) |
|
62 | + ) { |
|
63 | + $sOrder .= "".$aColumns[ filter_var($_GET['iSortCol_'.$i], FILTER_SANITIZE_NUMBER_INT) ]." " |
|
64 | + .mysqli_escape_string($link, $_GET['sSortDir_'.$i]) .", "; |
|
65 | + } |
|
66 | + } |
|
67 | 67 | |
68 | 68 | $sOrder = substr_replace($sOrder, "", -2); |
69 | 69 | if ($sOrder == "ORDER BY") { |
@@ -48,20 +48,20 @@ discard block |
||
48 | 48 | //Paging |
49 | 49 | $sLimit = ""; |
50 | 50 | if (isset($_GET['iDisplayStart']) && $_GET['iDisplayLength'] != '-1') { |
51 | - $sLimit = "LIMIT ". filter_var($_GET['iDisplayStart'], FILTER_SANITIZE_NUMBER_INT) .", ". filter_var($_GET['iDisplayLength'], FILTER_SANITIZE_NUMBER_INT).""; |
|
51 | + $sLimit = "LIMIT ".filter_var($_GET['iDisplayStart'], FILTER_SANITIZE_NUMBER_INT).", ".filter_var($_GET['iDisplayLength'], FILTER_SANITIZE_NUMBER_INT).""; |
|
52 | 52 | } |
53 | 53 | |
54 | 54 | //Ordering |
55 | 55 | |
56 | 56 | if (isset($_GET['iSortCol_0']) && in_array($_GET['iSortCol_0'], $aSortTypes)) { |
57 | 57 | $sOrder = "ORDER BY "; |
58 | - for ($i=0; $i<intval($_GET['iSortingCols']); $i++) { |
|
58 | + for ($i = 0; $i < intval($_GET['iSortingCols']); $i++) { |
|
59 | 59 | if ( |
60 | - $_GET[ 'bSortable_'.filter_var($_GET['iSortCol_'.$i], FILTER_SANITIZE_NUMBER_INT)] == "true" && |
|
60 | + $_GET['bSortable_'.filter_var($_GET['iSortCol_'.$i], FILTER_SANITIZE_NUMBER_INT)] == "true" && |
|
61 | 61 | preg_match("#^(asc|desc)\$#i", $_GET['sSortDir_'.$i]) |
62 | 62 | ) { |
63 | - $sOrder .= "".$aColumns[ filter_var($_GET['iSortCol_'.$i], FILTER_SANITIZE_NUMBER_INT) ]." " |
|
64 | - .mysqli_escape_string($link, $_GET['sSortDir_'.$i]) .", "; |
|
63 | + $sOrder .= "".$aColumns[filter_var($_GET['iSortCol_'.$i], FILTER_SANITIZE_NUMBER_INT)]." " |
|
64 | + .mysqli_escape_string($link, $_GET['sSortDir_'.$i]).", "; |
|
65 | 65 | } |
66 | 66 | } |
67 | 67 | |
@@ -80,7 +80,7 @@ discard block |
||
80 | 80 | $sWhere = " WHERE ((timestamp != '' AND session_end >= '".time()."')"; |
81 | 81 | if ($_GET['sSearch'] != "") { |
82 | 82 | $sWhere .= " AND ("; |
83 | - for ($i=0; $i<count($aColumns); $i++) { |
|
83 | + for ($i = 0; $i < count($aColumns); $i++) { |
|
84 | 84 | $sWhere .= $aColumns[$i]." LIKE %ss_".$aColumns[$i]." OR "; |
85 | 85 | } |
86 | 86 | $sWhere = substr_replace($sWhere, "", -3); |
@@ -142,7 +142,7 @@ discard block |
||
142 | 142 | $time_diff = intval(time() - $reccord['timestamp']); |
143 | 143 | $hoursDiff = round($time_diff / 3600, 0, PHP_ROUND_HALF_DOWN); |
144 | 144 | $minutesDiffRemainder = floor($time_diff % 3600 / 60); |
145 | - $sOutput_item .= '"'.$hoursDiff . 'h ' . $minutesDiffRemainder . 'm" '; |
|
145 | + $sOutput_item .= '"'.$hoursDiff.'h '.$minutesDiffRemainder.'m" '; |
|
146 | 146 | |
147 | 147 | |
148 | 148 | //Finish the line |
@@ -46,20 +46,20 @@ discard block |
||
46 | 46 | //Paging |
47 | 47 | $sLimit = ""; |
48 | 48 | if (isset($_GET['iDisplayStart']) && $_GET['iDisplayLength'] != '-1') { |
49 | - $sLimit = "LIMIT ". filter_var($_GET['iDisplayStart'], FILTER_SANITIZE_NUMBER_INT) .", ". filter_var($_GET['iDisplayLength'], FILTER_SANITIZE_NUMBER_INT).""; |
|
49 | + $sLimit = "LIMIT ".filter_var($_GET['iDisplayStart'], FILTER_SANITIZE_NUMBER_INT).", ".filter_var($_GET['iDisplayLength'], FILTER_SANITIZE_NUMBER_INT).""; |
|
50 | 50 | } |
51 | 51 | |
52 | 52 | //Ordering |
53 | 53 | |
54 | 54 | if (isset($_GET['iSortCol_0']) && in_array($_GET['iSortCol_0'], $aSortTypes)) { |
55 | 55 | $sOrder = "ORDER BY "; |
56 | - for ($i=0; $i<intval($_GET['iSortingCols']); $i++) { |
|
56 | + for ($i = 0; $i < intval($_GET['iSortingCols']); $i++) { |
|
57 | 57 | if ( |
58 | - $_GET[ 'bSortable_'.filter_var($_GET['iSortCol_'.$i], FILTER_SANITIZE_NUMBER_INT)] == "true" && |
|
58 | + $_GET['bSortable_'.filter_var($_GET['iSortCol_'.$i], FILTER_SANITIZE_NUMBER_INT)] == "true" && |
|
59 | 59 | preg_match("#^(asc|desc)\$#i", $_GET['sSortDir_'.$i]) |
60 | 60 | ) { |
61 | - $sOrder .= "".$aColumns[ filter_var($_GET['iSortCol_'.$i], FILTER_SANITIZE_NUMBER_INT) ]." " |
|
62 | - .mysqli_escape_string($link, $_GET['sSortDir_'.$i]) .", "; |
|
61 | + $sOrder .= "".$aColumns[filter_var($_GET['iSortCol_'.$i], FILTER_SANITIZE_NUMBER_INT)]." " |
|
62 | + .mysqli_escape_string($link, $_GET['sSortDir_'.$i]).", "; |
|
63 | 63 | } |
64 | 64 | } |
65 | 65 | |
@@ -77,7 +77,7 @@ discard block |
||
77 | 77 | */ |
78 | 78 | if ($_GET['sSearch'] != "") { |
79 | 79 | $sWhere = " WHERE "; |
80 | - for ($i=0; $i<count($aColumns); $i++) { |
|
80 | + for ($i = 0; $i < count($aColumns); $i++) { |
|
81 | 81 | $sWhere .= $aColumns[$i]." LIKE %ss_".$i." OR "; |
82 | 82 | } |
83 | 83 | $sWhere = substr_replace($sWhere, "", -3); |
@@ -144,17 +144,19 @@ discard block |
||
144 | 144 | ); |
145 | 145 | |
146 | 146 | //col7 |
147 | - if (isset($data3['bloquer_creation']) && $data3['bloquer_creation'] == 1) |
|
148 | - $sOutput .= '"<i class=\"fa fa-toggle-on mi-green\" style=\"cursor:pointer;\" tp=\"'.$t->id.'-modif_droit_autorisation_sans_complexite-0\"></i>"'; |
|
149 | - else |
|
150 | - $sOutput .= '"<i class=\"fa fa-toggle-off\" style=\"cursor:pointer;\" tp=\"'.$t->id.'-modif_droit_autorisation_sans_complexite-1\"></i>"'; |
|
147 | + if (isset($data3['bloquer_creation']) && $data3['bloquer_creation'] == 1) { |
|
148 | + $sOutput .= '"<i class=\"fa fa-toggle-on mi-green\" style=\"cursor:pointer;\" tp=\"'.$t->id.'-modif_droit_autorisation_sans_complexite-0\"></i>"'; |
|
149 | + } else { |
|
150 | + $sOutput .= '"<i class=\"fa fa-toggle-off\" style=\"cursor:pointer;\" tp=\"'.$t->id.'-modif_droit_autorisation_sans_complexite-1\"></i>"'; |
|
151 | + } |
|
151 | 152 | $sOutput .= ','; |
152 | 153 | |
153 | 154 | //col8 |
154 | - if (isset($data3['bloquer_modification']) && $data3['bloquer_modification'] == 1) |
|
155 | - $sOutput .= '"<i class=\"fa fa-toggle-on mi-green\" style=\"cursor:pointer;\" tp=\"'.$t->id.'-modif_droit_modification_sans_complexite-0\"></i>'; |
|
156 | - else |
|
157 | - $sOutput .= '"<i class=\"fa fa-toggle-off\" style=\"cursor:pointer;\" tp=\"'.$t->id.'-modif_droit_modification_sans_complexite-1\"></i>'; |
|
155 | + if (isset($data3['bloquer_modification']) && $data3['bloquer_modification'] == 1) { |
|
156 | + $sOutput .= '"<i class=\"fa fa-toggle-on mi-green\" style=\"cursor:pointer;\" tp=\"'.$t->id.'-modif_droit_modification_sans_complexite-0\"></i>'; |
|
157 | + } else { |
|
158 | + $sOutput .= '"<i class=\"fa fa-toggle-off\" style=\"cursor:pointer;\" tp=\"'.$t->id.'-modif_droit_modification_sans_complexite-1\"></i>'; |
|
159 | + } |
|
158 | 160 | $sOutput .= '<input type=\"hidden\" id=\"parent_id_'.$t->id.'\" value=\"'.$t->parent_id.'\" /><input type=\"hidden\" id=\"renewal_id_'.$t->id.'\" value=\"'.$node_data['valeur'].'\" /><input type=\"hidden\" id=\"block_creation_'.$t->id.'\" value=\"'.$node_data['bloquer_creation'].'\" /><input type=\"hidden\" id=\"block_modif_'.$t->id.'\" value=\"'.$node_data['bloquer_modification'].'\" />"'; |
159 | 161 | |
160 | 162 | //Finish the line |
@@ -166,7 +168,9 @@ discard block |
||
166 | 168 | } |
167 | 169 | |
168 | 170 | if (count($treeDesc) > 0) { |
169 | - if (strrchr($sOutput, "[") != '[') $sOutput = substr_replace($sOutput, "", -1); |
|
171 | + if (strrchr($sOutput, "[") != '[') { |
|
172 | + $sOutput = substr_replace($sOutput, "", -1); |
|
173 | + } |
|
170 | 174 | $sOutput .= ']}'; |
171 | 175 | } else { |
172 | 176 | $sOutput .= '[] }'; |
@@ -46,20 +46,20 @@ discard block |
||
46 | 46 | //Paging |
47 | 47 | $sLimit = ""; |
48 | 48 | if (isset($_GET['iDisplayStart']) && $_GET['iDisplayLength'] != '-1') { |
49 | - $sLimit = "LIMIT ". filter_var($_GET['iDisplayStart'], FILTER_SANITIZE_NUMBER_INT) .", ". filter_var($_GET['iDisplayLength'], FILTER_SANITIZE_NUMBER_INT).""; |
|
49 | + $sLimit = "LIMIT ".filter_var($_GET['iDisplayStart'], FILTER_SANITIZE_NUMBER_INT).", ".filter_var($_GET['iDisplayLength'], FILTER_SANITIZE_NUMBER_INT).""; |
|
50 | 50 | } |
51 | 51 | |
52 | 52 | //Ordering |
53 | 53 | |
54 | 54 | if (isset($_GET['iSortCol_0']) && in_array($_GET['iSortCol_0'], $aSortTypes)) { |
55 | 55 | $sOrder = "ORDER BY "; |
56 | - for ($i=0; $i<intval($_GET['iSortingCols']); $i++) { |
|
56 | + for ($i = 0; $i < intval($_GET['iSortingCols']); $i++) { |
|
57 | 57 | if ( |
58 | - $_GET[ 'bSortable_'.filter_var($_GET['iSortCol_'.$i], FILTER_SANITIZE_NUMBER_INT)] == "true" && |
|
58 | + $_GET['bSortable_'.filter_var($_GET['iSortCol_'.$i], FILTER_SANITIZE_NUMBER_INT)] == "true" && |
|
59 | 59 | preg_match("#^(asc|desc)\$#i", $_GET['sSortDir_'.$i]) |
60 | 60 | ) { |
61 | - $sOrder .= "".$aColumns[ filter_var($_GET['iSortCol_'.$i], FILTER_SANITIZE_NUMBER_INT) ]." " |
|
62 | - .mysqli_escape_string($link, $_GET['sSortDir_'.$i]) .", "; |
|
61 | + $sOrder .= "".$aColumns[filter_var($_GET['iSortCol_'.$i], FILTER_SANITIZE_NUMBER_INT)]." " |
|
62 | + .mysqli_escape_string($link, $_GET['sSortDir_'.$i]).", "; |
|
63 | 63 | } |
64 | 64 | } |
65 | 65 | |
@@ -77,7 +77,7 @@ discard block |
||
77 | 77 | */ |
78 | 78 | if ($_GET['sSearch'] != "") { |
79 | 79 | $sWhere = " WHERE ("; |
80 | - for ($i=0; $i<count($aColumns); $i++) { |
|
80 | + for ($i = 0; $i < count($aColumns); $i++) { |
|
81 | 81 | $sWhere .= $aColumns[$i]." LIKE %ss_".$aColumns[$i]." OR "; |
82 | 82 | } |
83 | 83 | $sWhere = substr_replace($sWhere, "", -3).") "; |
@@ -125,7 +125,7 @@ discard block |
||
125 | 125 | $time_diff = intval(time() - $record['timestamp']); |
126 | 126 | $hoursDiff = round($time_diff / 3600, 0, PHP_ROUND_HALF_DOWN); |
127 | 127 | $minutesDiffRemainder = floor($time_diff % 3600 / 60); |
128 | - $sOutput_item .= '"'.$hoursDiff . "h " . $minutesDiffRemainder . "m".'", '; |
|
128 | + $sOutput_item .= '"'.$hoursDiff."h ".$minutesDiffRemainder."m".'", '; |
|
129 | 129 | |
130 | 130 | //col3 |
131 | 131 | $sOutput_item .= '"'.htmlspecialchars(stripslashes($record['name']), ENT_QUOTES).' '.htmlspecialchars(stripslashes($record['lastname']), ENT_QUOTES).' ['.htmlspecialchars(stripslashes($record['login']), ENT_QUOTES).']", '; |