@@ -37,12 +37,12 @@ discard block |
||
| 37 | 37 | } |
| 38 | 38 | |
| 39 | 39 | // Do checks |
| 40 | -require_once $SETTINGS['cpassman_dir'] . '/includes/config/include.php'; |
|
| 41 | -require_once $SETTINGS['cpassman_dir'] . '/sources/checks.php'; |
|
| 40 | +require_once $SETTINGS['cpassman_dir'].'/includes/config/include.php'; |
|
| 41 | +require_once $SETTINGS['cpassman_dir'].'/sources/checks.php'; |
|
| 42 | 42 | if (checkUser($_SESSION['user_id'], $_SESSION['key'], 'items', $SETTINGS) === false) { |
| 43 | 43 | // Not allowed page |
| 44 | 44 | $_SESSION['error']['code'] = ERR_NOT_ALLOWED; |
| 45 | - include $SETTINGS['cpassman_dir'] . '/error.php'; |
|
| 45 | + include $SETTINGS['cpassman_dir'].'/error.php'; |
|
| 46 | 46 | exit; |
| 47 | 47 | } |
| 48 | 48 | |
@@ -55,8 +55,8 @@ discard block |
||
| 55 | 55 | date_default_timezone_set('UTC'); |
| 56 | 56 | } |
| 57 | 57 | |
| 58 | -require_once $SETTINGS['cpassman_dir'] . '/includes/language/' . $_SESSION['user_language'] . '.php'; |
|
| 59 | -require_once $SETTINGS['cpassman_dir'] . '/includes/config/settings.php'; |
|
| 58 | +require_once $SETTINGS['cpassman_dir'].'/includes/language/'.$_SESSION['user_language'].'.php'; |
|
| 59 | +require_once $SETTINGS['cpassman_dir'].'/includes/config/settings.php'; |
|
| 60 | 60 | header('Content-type: text/html; charset=utf-8'); |
| 61 | 61 | header('Cache-Control: no-cache, must-revalidate'); |
| 62 | 62 | require_once 'main.functions.php'; |
@@ -78,7 +78,7 @@ discard block |
||
| 78 | 78 | } |
| 79 | 79 | |
| 80 | 80 | // Connect to mysql server |
| 81 | -require_once $SETTINGS['cpassman_dir'] . '/includes/libraries/Database/Meekrodb/db.class.php'; |
|
| 81 | +require_once $SETTINGS['cpassman_dir'].'/includes/libraries/Database/Meekrodb/db.class.php'; |
|
| 82 | 82 | if (defined('DB_PASSWD_CLEAR') === false) { |
| 83 | 83 | define('DB_PASSWD_CLEAR', defuseReturnDecrypted(DB_PASSWD, $SETTINGS)); |
| 84 | 84 | } |
@@ -90,7 +90,7 @@ discard block |
||
| 90 | 90 | DB::$encoding = DB_ENCODING; |
| 91 | 91 | |
| 92 | 92 | // Class loader |
| 93 | -require_once $SETTINGS['cpassman_dir'] . '/sources/SplClassLoader.php'; |
|
| 93 | +require_once $SETTINGS['cpassman_dir'].'/sources/SplClassLoader.php'; |
|
| 94 | 94 | |
| 95 | 95 | // Load Tree |
| 96 | 96 | $tree = new SplClassLoader('Tree\NestedTree', '../includes/libraries'); |
@@ -98,7 +98,7 @@ discard block |
||
| 98 | 98 | $tree = new Tree\NestedTree\NestedTree(prefixTable('nested_tree'), 'id', 'parent_id', 'title'); |
| 99 | 99 | |
| 100 | 100 | // Superglobal library |
| 101 | -require_once $SETTINGS['cpassman_dir'] . '/includes/libraries/protect/SuperGlobal/SuperGlobal.php'; |
|
| 101 | +require_once $SETTINGS['cpassman_dir'].'/includes/libraries/protect/SuperGlobal/SuperGlobal.php'; |
|
| 102 | 102 | $superGlobal = new protect\SuperGlobal\SuperGlobal(); |
| 103 | 103 | |
| 104 | 104 | // Prepare POST variables |
@@ -306,7 +306,7 @@ discard block |
||
| 306 | 306 | // About special settings |
| 307 | 307 | $dataFolderSettings = DB::queryFirstRow( |
| 308 | 308 | 'SELECT bloquer_creation, bloquer_modification, personal_folder |
| 309 | - FROM ' . prefixTable('nested_tree') . ' |
|
| 309 | + FROM ' . prefixTable('nested_tree').' |
|
| 310 | 310 | WHERE id = %i', |
| 311 | 311 | $post_folder_id |
| 312 | 312 | ); |
@@ -323,7 +323,7 @@ discard block |
||
| 323 | 323 | // Get folder complexity |
| 324 | 324 | $folderComplexity = DB::queryfirstrow( |
| 325 | 325 | 'SELECT valeur |
| 326 | - FROM ' . prefixTable('misc') . ' |
|
| 326 | + FROM ' . prefixTable('misc').' |
|
| 327 | 327 | WHERE type = %s AND intitule = %i', |
| 328 | 328 | 'complex', |
| 329 | 329 | $post_folder_id |
@@ -348,7 +348,7 @@ discard block |
||
| 348 | 348 | $itemExists = 0; |
| 349 | 349 | $newID = ''; |
| 350 | 350 | $data = DB::queryfirstrow( |
| 351 | - 'SELECT * FROM ' . prefixTable('items') . ' |
|
| 351 | + 'SELECT * FROM '.prefixTable('items').' |
|
| 352 | 352 | WHERE label = %s AND inactif = %i', |
| 353 | 353 | $post_label, |
| 354 | 354 | 0 |
@@ -474,7 +474,7 @@ discard block |
||
| 474 | 474 | // should we encrypt the data |
| 475 | 475 | $dataTmp = DB::queryFirstRow( |
| 476 | 476 | 'SELECT encrypted_data |
| 477 | - FROM ' . prefixTable('categories') . ' |
|
| 477 | + FROM ' . prefixTable('categories').' |
|
| 478 | 478 | WHERE id = %i', |
| 479 | 479 | $field_data[0] |
| 480 | 480 | ); |
@@ -530,7 +530,7 @@ discard block |
||
| 530 | 530 | ) { |
| 531 | 531 | DB::queryFirstRow( |
| 532 | 532 | 'SELECT * |
| 533 | - FROM ' . prefixTable('templates') . ' |
|
| 533 | + FROM ' . prefixTable('templates').' |
|
| 534 | 534 | WHERE item_id = %i', |
| 535 | 535 | $newID |
| 536 | 536 | ); |
@@ -599,11 +599,11 @@ discard block |
||
| 599 | 599 | ) { |
| 600 | 600 | foreach ($post_restricted_to as $userRest) { |
| 601 | 601 | if (empty($userRest) === false) { |
| 602 | - $dataTmp = DB::queryfirstrow('SELECT login FROM ' . prefixTable('users') . ' WHERE id= %i', $userRest); |
|
| 602 | + $dataTmp = DB::queryfirstrow('SELECT login FROM '.prefixTable('users').' WHERE id= %i', $userRest); |
|
| 603 | 603 | if (empty($listOfRestricted)) { |
| 604 | 604 | $listOfRestricted = $dataTmp['login']; |
| 605 | 605 | } else { |
| 606 | - $listOfRestricted .= ';' . $dataTmp['login']; |
|
| 606 | + $listOfRestricted .= ';'.$dataTmp['login']; |
|
| 607 | 607 | } |
| 608 | 608 | } |
| 609 | 609 | } |
@@ -617,11 +617,11 @@ discard block |
||
| 617 | 617 | if (empty($data['restricted_to']) === false) { |
| 618 | 618 | foreach (explode(';', $data['restricted_to']) as $userRest) { |
| 619 | 619 | if (empty($userRest) === false) { |
| 620 | - $dataTmp = DB::queryfirstrow('SELECT login FROM ' . prefixTable('users') . ' WHERE id= ' . $userRest); |
|
| 620 | + $dataTmp = DB::queryfirstrow('SELECT login FROM '.prefixTable('users').' WHERE id= '.$userRest); |
|
| 621 | 621 | if (empty($oldRestrictionList) === true) { |
| 622 | 622 | $oldRestrictionList = $dataTmp['login']; |
| 623 | 623 | } else { |
| 624 | - $oldRestrictionList .= ';' . $dataTmp['login']; |
|
| 624 | + $oldRestrictionList .= ';'.$dataTmp['login']; |
|
| 625 | 625 | } |
| 626 | 626 | } |
| 627 | 627 | } |
@@ -684,7 +684,7 @@ discard block |
||
| 684 | 684 | if (empty($post_uploaded_file_id) === false) { |
| 685 | 685 | $rows = DB::query( |
| 686 | 686 | 'SELECT id |
| 687 | - FROM ' . prefixTable('files') . ' |
|
| 687 | + FROM ' . prefixTable('files').' |
|
| 688 | 688 | WHERE id_item = %s', |
| 689 | 689 | $post_uploaded_file_id |
| 690 | 690 | ); |
@@ -724,14 +724,14 @@ discard block |
||
| 724 | 724 | langHdl('email_subject'), |
| 725 | 725 | str_replace( |
| 726 | 726 | array('#label', '#link'), |
| 727 | - array($path, $SETTINGS['email_server_url'] . '/index.php?page=items&group=' . $post_folder_id . '&id=' . $newID . $txt['email_body3']), |
|
| 727 | + array($path, $SETTINGS['email_server_url'].'/index.php?page=items&group='.$post_folder_id.'&id='.$newID.$txt['email_body3']), |
|
| 728 | 728 | langHdl('new_item_email_body') |
| 729 | 729 | ), |
| 730 | 730 | $emailAddress, |
| 731 | 731 | $SETTINGS, |
| 732 | 732 | str_replace( |
| 733 | 733 | array('#label', '#link'), |
| 734 | - array($path, $SETTINGS['email_server_url'] . '/index.php?page=items&group=' . $post_folder_id . '&id=' . $newID . $txt['email_body3']), |
|
| 734 | + array($path, $SETTINGS['email_server_url'].'/index.php?page=items&group='.$post_folder_id.'&id='.$newID.$txt['email_body3']), |
|
| 735 | 735 | langHdl('new_item_email_body') |
| 736 | 736 | ) |
| 737 | 737 | ); |
@@ -894,7 +894,7 @@ discard block |
||
| 894 | 894 | // About special settings |
| 895 | 895 | $dataFolderSettings = DB::queryFirstRow( |
| 896 | 896 | 'SELECT bloquer_creation, bloquer_modification, personal_folder |
| 897 | - FROM ' . prefixTable('nested_tree') . ' |
|
| 897 | + FROM ' . prefixTable('nested_tree').' |
|
| 898 | 898 | WHERE id = %i', |
| 899 | 899 | $post_folder_id |
| 900 | 900 | ); |
@@ -910,7 +910,7 @@ discard block |
||
| 910 | 910 | // Get folder complexity |
| 911 | 911 | $folderComplexity = DB::queryfirstrow( |
| 912 | 912 | 'SELECT valeur |
| 913 | - FROM ' . prefixTable('misc') . ' |
|
| 913 | + FROM ' . prefixTable('misc').' |
|
| 914 | 914 | WHERE type = %s AND intitule = %i', |
| 915 | 915 | 'complex', |
| 916 | 916 | $post_folder_id |
@@ -949,8 +949,8 @@ discard block |
||
| 949 | 949 | // Get all informations for this item |
| 950 | 950 | $dataItem = DB::queryfirstrow( |
| 951 | 951 | 'SELECT * |
| 952 | - FROM ' . prefixTable('items') . ' as i |
|
| 953 | - INNER JOIN ' . prefixTable('log_items') . ' as l ON (l.id_item = i.id) |
|
| 952 | + FROM ' . prefixTable('items').' as i |
|
| 953 | + INNER JOIN ' . prefixTable('log_items').' as l ON (l.id_item = i.id) |
|
| 954 | 954 | WHERE i.id=%i AND l.action = %s', |
| 955 | 955 | $post_item_id, |
| 956 | 956 | 'at_creation' |
@@ -960,7 +960,7 @@ discard block |
||
| 960 | 960 | //db::debugmode(true); |
| 961 | 961 | DB::query( |
| 962 | 962 | 'SELECT * |
| 963 | - FROM ' . prefixTable('sharekeys_items') . ' |
|
| 963 | + FROM ' . prefixTable('sharekeys_items').' |
|
| 964 | 964 | WHERE object_id = %i AND user_id = %s', |
| 965 | 965 | $post_item_id, |
| 966 | 966 | $_SESSION['user_id'] |
@@ -1008,9 +1008,9 @@ discard block |
||
| 1008 | 1008 | 'SELECT i.id as id, i.label as label, i.description as description, i.pw as pw, i.url as url, i.id_tree as id_tree, i.perso as perso, i.login as login, |
| 1009 | 1009 | i.inactif as inactif, i.restricted_to as restricted_to, i.anyone_can_modify as anyone_can_modify, i.email as email, i.notification as notification, |
| 1010 | 1010 | u.login as user_login, u.email as user_email |
| 1011 | - FROM ' . prefixTable('items') . ' as i |
|
| 1012 | - INNER JOIN ' . prefixTable('log_items') . ' as l ON (i.id=l.id_item) |
|
| 1013 | - INNER JOIN ' . prefixTable('users') . ' as u ON (u.id=l.id_user) |
|
| 1011 | + FROM ' . prefixTable('items').' as i |
|
| 1012 | + INNER JOIN ' . prefixTable('log_items').' as l ON (i.id=l.id_item) |
|
| 1013 | + INNER JOIN ' . prefixTable('users').' as u ON (u.id=l.id_user) |
|
| 1014 | 1014 | WHERE i.id=%i', |
| 1015 | 1015 | $post_item_id |
| 1016 | 1016 | ); |
@@ -1018,7 +1018,7 @@ discard block |
||
| 1018 | 1018 | // Should we log a password change? |
| 1019 | 1019 | $userKey = DB::queryFirstRow( |
| 1020 | 1020 | 'SELECT share_key |
| 1021 | - FROM ' . prefixTable('sharekeys_items') . ' |
|
| 1021 | + FROM ' . prefixTable('sharekeys_items').' |
|
| 1022 | 1022 | WHERE user_id = %i AND object_id = %i', |
| 1023 | 1023 | $_SESSION['user_id'], |
| 1024 | 1024 | $post_item_id |
@@ -1077,7 +1077,7 @@ discard block |
||
| 1077 | 1077 | // Get list of tags |
| 1078 | 1078 | $itemTags = DB::queryFirstColumn( |
| 1079 | 1079 | 'SELECT tag |
| 1080 | - FROM ' . prefixTable('tags') . ' |
|
| 1080 | + FROM ' . prefixTable('tags').' |
|
| 1081 | 1081 | WHERE item_id = %i', |
| 1082 | 1082 | $post_item_id |
| 1083 | 1083 | ); |
@@ -1120,7 +1120,7 @@ discard block |
||
| 1120 | 1120 | $_SESSION['user_id'], |
| 1121 | 1121 | 'at_modification', |
| 1122 | 1122 | $_SESSION['login'], |
| 1123 | - 'at_tag : ' . implode(' ', $itemTags) . ' => ' . $post_tags |
|
| 1123 | + 'at_tag : '.implode(' ', $itemTags).' => '.$post_tags |
|
| 1124 | 1124 | ); |
| 1125 | 1125 | } |
| 1126 | 1126 | |
@@ -1157,8 +1157,8 @@ discard block |
||
| 1157 | 1157 | 'SELECT c.id AS id, c.title AS title, i.data AS data, i.data_iv AS data_iv, |
| 1158 | 1158 | i.encryption_type AS encryption_type, c.encrypted_data AS encrypted_data, |
| 1159 | 1159 | c.masked AS masked, i.id AS field_item_id |
| 1160 | - FROM ' . prefixTable('categories_items') . ' AS i |
|
| 1161 | - INNER JOIN ' . prefixTable('categories') . ' AS c ON (i.field_id=c.id) |
|
| 1160 | + FROM ' . prefixTable('categories_items').' AS i |
|
| 1161 | + INNER JOIN ' . prefixTable('categories').' AS c ON (i.field_id=c.id) |
|
| 1162 | 1162 | WHERE i.field_id = %i AND i.item_id = %i', |
| 1163 | 1163 | $field['id'], |
| 1164 | 1164 | $post_item_id |
@@ -1172,7 +1172,7 @@ discard block |
||
| 1172 | 1172 | // Perform new query |
| 1173 | 1173 | $dataTmpCat = DB::queryFirstRow( |
| 1174 | 1174 | 'SELECT id, title, encrypted_data, masked |
| 1175 | - FROM ' . prefixTable('categories') . ' |
|
| 1175 | + FROM ' . prefixTable('categories').' |
|
| 1176 | 1176 | WHERE id = %i', |
| 1177 | 1177 | $field['id'] |
| 1178 | 1178 | ); |
@@ -1244,7 +1244,7 @@ discard block |
||
| 1244 | 1244 | $_SESSION['user_id'], |
| 1245 | 1245 | 'at_modification', |
| 1246 | 1246 | $_SESSION['login'], |
| 1247 | - 'at_field : ' . $dataTmpCat['title'] . ' : ' . $field['value'] |
|
| 1247 | + 'at_field : '.$dataTmpCat['title'].' : '.$field['value'] |
|
| 1248 | 1248 | ); |
| 1249 | 1249 | } else { |
| 1250 | 1250 | // compare the old and new value |
@@ -1252,7 +1252,7 @@ discard block |
||
| 1252 | 1252 | // Get user sharekey for this field |
| 1253 | 1253 | $userKey = DB::queryFirstRow( |
| 1254 | 1254 | 'SELECT share_key |
| 1255 | - FROM ' . prefixTable('sharekeys_fields') . ' |
|
| 1255 | + FROM ' . prefixTable('sharekeys_fields').' |
|
| 1256 | 1256 | WHERE user_id = %i AND object_id = %i', |
| 1257 | 1257 | $_SESSION['user_id'], |
| 1258 | 1258 | $dataTmpCat['field_item_id'] |
@@ -1322,7 +1322,7 @@ discard block |
||
| 1322 | 1322 | $_SESSION['user_id'], |
| 1323 | 1323 | 'at_modification', |
| 1324 | 1324 | $_SESSION['login'], |
| 1325 | - 'at_field : ' . $dataTmpCat['title'] . ' => ' . $oldVal |
|
| 1325 | + 'at_field : '.$dataTmpCat['title'].' => '.$oldVal |
|
| 1326 | 1326 | ); |
| 1327 | 1327 | } |
| 1328 | 1328 | } |
@@ -1347,7 +1347,7 @@ discard block |
||
| 1347 | 1347 | ) { |
| 1348 | 1348 | DB::queryFirstRow( |
| 1349 | 1349 | 'SELECT * |
| 1350 | - FROM ' . prefixTable('templates') . ' |
|
| 1350 | + FROM ' . prefixTable('templates').' |
|
| 1351 | 1351 | WHERE item_id = %i', |
| 1352 | 1352 | $post_item_id |
| 1353 | 1353 | ); |
@@ -1390,7 +1390,7 @@ discard block |
||
| 1390 | 1390 | // check if elem exists in Table. If not add it or update it. |
| 1391 | 1391 | DB::query( |
| 1392 | 1392 | 'SELECT * |
| 1393 | - FROM ' . prefixTable('automatic_del') . ' |
|
| 1393 | + FROM ' . prefixTable('automatic_del').' |
|
| 1394 | 1394 | WHERE item_id = %i', |
| 1395 | 1395 | $post_item_id |
| 1396 | 1396 | ); |
@@ -1417,7 +1417,7 @@ discard block |
||
| 1417 | 1417 | // Store updates performed |
| 1418 | 1418 | array_push( |
| 1419 | 1419 | $arrayOfChanges, |
| 1420 | - langHdl('automatic_deletion_engaged') . ': ' . langHdl('enabled') |
|
| 1420 | + langHdl('automatic_deletion_engaged').': '.langHdl('enabled') |
|
| 1421 | 1421 | ); |
| 1422 | 1422 | |
| 1423 | 1423 | // update LOG |
@@ -1460,7 +1460,7 @@ discard block |
||
| 1460 | 1460 | // Store updates performed |
| 1461 | 1461 | array_push( |
| 1462 | 1462 | $arrayOfChanges, |
| 1463 | - langHdl('automatic_deletion_engaged') . ': ' . langHdl('disabled') |
|
| 1463 | + langHdl('automatic_deletion_engaged').': '.langHdl('disabled') |
|
| 1464 | 1464 | ); |
| 1465 | 1465 | |
| 1466 | 1466 | // update LOG |
@@ -1493,7 +1493,7 @@ discard block |
||
| 1493 | 1493 | if (empty($userId) === false) { |
| 1494 | 1494 | $dataTmp = DB::queryfirstrow( |
| 1495 | 1495 | 'SELECT id, name, lastname |
| 1496 | - FROM ' . prefixTable('users') . ' |
|
| 1496 | + FROM ' . prefixTable('users').' |
|
| 1497 | 1497 | WHERE id= %i', |
| 1498 | 1498 | $userId |
| 1499 | 1499 | ); |
@@ -1501,7 +1501,7 @@ discard block |
||
| 1501 | 1501 | // Add to array |
| 1502 | 1502 | array_push( |
| 1503 | 1503 | $arrayOfUsersRestriction, |
| 1504 | - $dataTmp['name'] . ' ' . $dataTmp['lastname'] |
|
| 1504 | + $dataTmp['name'].' '.$dataTmp['lastname'] |
|
| 1505 | 1505 | ); |
| 1506 | 1506 | array_push( |
| 1507 | 1507 | $arrayOfUsersIdRestriction, |
@@ -1532,8 +1532,8 @@ discard block |
||
| 1532 | 1532 | // get values before deleting them |
| 1533 | 1533 | $rows = DB::query( |
| 1534 | 1534 | 'SELECT t.title, t.id AS id |
| 1535 | - FROM ' . prefixTable('roles_title') . ' as t |
|
| 1536 | - INNER JOIN ' . prefixTable('restriction_to_roles') . ' as r ON (t.id=r.role_id) |
|
| 1535 | + FROM ' . prefixTable('roles_title').' as t |
|
| 1536 | + INNER JOIN ' . prefixTable('restriction_to_roles').' as r ON (t.id=r.role_id) |
|
| 1537 | 1537 | WHERE r.item_id = %i |
| 1538 | 1538 | ORDER BY t.title ASC', |
| 1539 | 1539 | $post_item_id |
@@ -1567,7 +1567,7 @@ discard block |
||
| 1567 | 1567 | ); |
| 1568 | 1568 | $dataTmp = DB::queryfirstrow( |
| 1569 | 1569 | 'SELECT title |
| 1570 | - FROM ' . prefixTable('roles_title') . ' |
|
| 1570 | + FROM ' . prefixTable('roles_title').' |
|
| 1571 | 1571 | WHERE id = %i', |
| 1572 | 1572 | $role |
| 1573 | 1573 | ); |
@@ -1608,8 +1608,8 @@ discard block |
||
| 1608 | 1608 | $_SESSION['user_id'], |
| 1609 | 1609 | 'at_modification', |
| 1610 | 1610 | $_SESSION['login'], |
| 1611 | - 'at_restriction : ' . (count($diffUsersRestiction) > 0 ? |
|
| 1612 | - implode(', ', $arrayOfUsersRestriction) . (count($diffRolesRestiction) > 0 ? ', ' : '') : '') . (count($diffRolesRestiction) > 0 ? implode(', ', $arrayOfRestrictionRoles) : '') |
|
| 1611 | + 'at_restriction : '.(count($diffUsersRestiction) > 0 ? |
|
| 1612 | + implode(', ', $arrayOfUsersRestriction).(count($diffRolesRestiction) > 0 ? ', ' : '') : '').(count($diffRolesRestiction) > 0 ? implode(', ', $arrayOfRestrictionRoles) : '') |
|
| 1613 | 1613 | ); |
| 1614 | 1614 | } |
| 1615 | 1615 | |
@@ -1629,7 +1629,7 @@ discard block |
||
| 1629 | 1629 | $_SESSION['user_id'], |
| 1630 | 1630 | 'at_modification', |
| 1631 | 1631 | $_SESSION['login'], |
| 1632 | - 'at_label : ' . $data['label'] . ' => ' . $post_label |
|
| 1632 | + 'at_label : '.$data['label'].' => '.$post_label |
|
| 1633 | 1633 | ); |
| 1634 | 1634 | } |
| 1635 | 1635 | // LOGIN |
@@ -1648,7 +1648,7 @@ discard block |
||
| 1648 | 1648 | $_SESSION['user_id'], |
| 1649 | 1649 | 'at_modification', |
| 1650 | 1650 | $_SESSION['login'], |
| 1651 | - 'at_login : ' . $data['login'] . ' => ' . $post_login |
|
| 1651 | + 'at_login : '.$data['login'].' => '.$post_login |
|
| 1652 | 1652 | ); |
| 1653 | 1653 | } |
| 1654 | 1654 | |
@@ -1667,7 +1667,7 @@ discard block |
||
| 1667 | 1667 | $_SESSION['user_id'], |
| 1668 | 1668 | 'at_modification', |
| 1669 | 1669 | $_SESSION['login'], |
| 1670 | - 'at_email : ' . $data['email'] . ' => ' . $post_email |
|
| 1670 | + 'at_email : '.$data['email'].' => '.$post_email |
|
| 1671 | 1671 | ); |
| 1672 | 1672 | } |
| 1673 | 1673 | // URL |
@@ -1686,7 +1686,7 @@ discard block |
||
| 1686 | 1686 | $_SESSION['user_id'], |
| 1687 | 1687 | 'at_modification', |
| 1688 | 1688 | $_SESSION['login'], |
| 1689 | - 'at_url : ' . $data['url'] . ' => ' . $post_url |
|
| 1689 | + 'at_url : '.$data['url'].' => '.$post_url |
|
| 1690 | 1690 | ); |
| 1691 | 1691 | } |
| 1692 | 1692 | // DESCRIPTION |
@@ -1711,7 +1711,7 @@ discard block |
||
| 1711 | 1711 | // FOLDER |
| 1712 | 1712 | if ((int) $data['id_tree'] !== (int) $post_folder_id) { |
| 1713 | 1713 | // Get name of folders |
| 1714 | - $dataTmp = DB::query('SELECT title FROM ' . prefixTable('nested_tree') . ' WHERE id IN %li', array($data['id_tree'], $post_folder_id)); |
|
| 1714 | + $dataTmp = DB::query('SELECT title FROM '.prefixTable('nested_tree').' WHERE id IN %li', array($data['id_tree'], $post_folder_id)); |
|
| 1715 | 1715 | |
| 1716 | 1716 | // Store updates performed |
| 1717 | 1717 | array_push( |
@@ -1727,7 +1727,7 @@ discard block |
||
| 1727 | 1727 | $_SESSION['user_id'], |
| 1728 | 1728 | 'at_modification', |
| 1729 | 1729 | $_SESSION['login'], |
| 1730 | - 'at_category : ' . $dataTmp[0]['title'] . ' => ' . $dataTmp[1]['title'] |
|
| 1730 | + 'at_category : '.$dataTmp[0]['title'].' => '.$dataTmp[1]['title'] |
|
| 1731 | 1731 | ); |
| 1732 | 1732 | } |
| 1733 | 1733 | // ANYONE_CAN_MODIFY |
@@ -1735,7 +1735,7 @@ discard block |
||
| 1735 | 1735 | // Store updates performed |
| 1736 | 1736 | array_push( |
| 1737 | 1737 | $arrayOfChanges, |
| 1738 | - langHdl('at_anyoneconmodify') . ': ' . ((int) $post_anyone_can_modify === 0 ? langHdl('disabled') : langHdl('enabled')) |
|
| 1738 | + langHdl('at_anyoneconmodify').': '.((int) $post_anyone_can_modify === 0 ? langHdl('disabled') : langHdl('enabled')) |
|
| 1739 | 1739 | ); |
| 1740 | 1740 | |
| 1741 | 1741 | // Log |
@@ -1746,15 +1746,15 @@ discard block |
||
| 1746 | 1746 | $_SESSION['user_id'], |
| 1747 | 1747 | 'at_modification', |
| 1748 | 1748 | $_SESSION['login'], |
| 1749 | - 'at_anyoneconmodify : ' . ((int) $post_anyone_can_modify === 0 ? 'disabled' : 'enabled') |
|
| 1749 | + 'at_anyoneconmodify : '.((int) $post_anyone_can_modify === 0 ? 'disabled' : 'enabled') |
|
| 1750 | 1750 | ); |
| 1751 | 1751 | } |
| 1752 | 1752 | |
| 1753 | 1753 | // Reload new values |
| 1754 | 1754 | $dataItem = DB::queryfirstrow( |
| 1755 | 1755 | 'SELECT * |
| 1756 | - FROM ' . prefixTable('items') . ' as i |
|
| 1757 | - INNER JOIN ' . prefixTable('log_items') . ' as l ON (l.id_item = i.id) |
|
| 1756 | + FROM ' . prefixTable('items').' as i |
|
| 1757 | + INNER JOIN ' . prefixTable('log_items').' as l ON (l.id_item = i.id) |
|
| 1758 | 1758 | WHERE i.id = %i AND l.action = %s', |
| 1759 | 1759 | $post_item_id, |
| 1760 | 1760 | 'at_creation' |
@@ -1763,8 +1763,8 @@ discard block |
||
| 1763 | 1763 | $history = ''; |
| 1764 | 1764 | $rows = DB::query( |
| 1765 | 1765 | 'SELECT l.date as date, l.action as action, l.raison as raison, u.login as login |
| 1766 | - FROM ' . prefixTable('log_items') . ' as l |
|
| 1767 | - LEFT JOIN ' . prefixTable('users') . ' as u ON (l.id_user=u.id) |
|
| 1766 | + FROM ' . prefixTable('log_items').' as l |
|
| 1767 | + LEFT JOIN ' . prefixTable('users').' as u ON (l.id_user=u.id) |
|
| 1768 | 1768 | WHERE l.action <> %s AND id_item=%s', |
| 1769 | 1769 | 'at_shown', |
| 1770 | 1770 | $post_item_id |
@@ -1773,14 +1773,14 @@ discard block |
||
| 1773 | 1773 | if ($record['raison'] === NULL) continue; |
| 1774 | 1774 | $reason = explode(':', $record['raison']); |
| 1775 | 1775 | if (count($reason) > 0) { |
| 1776 | - $sentence = date($SETTINGS['date_format'] . ' ' . $SETTINGS['time_format'], (int) $record['date']) . ' - ' |
|
| 1777 | - . $record['login'] . ' - ' . langHdl($record['action']) . ' - ' |
|
| 1778 | - . (empty($record['raison']) === false ? (count($reason) > 1 ? langHdl(trim($reason[0])) . ' : ' . $reason[1] |
|
| 1776 | + $sentence = date($SETTINGS['date_format'].' '.$SETTINGS['time_format'], (int) $record['date']).' - ' |
|
| 1777 | + . $record['login'].' - '.langHdl($record['action']).' - ' |
|
| 1778 | + . (empty($record['raison']) === false ? (count($reason) > 1 ? langHdl(trim($reason[0])).' : '.$reason[1] |
|
| 1779 | 1779 | : langHdl(trim($reason[0]))) : ''); |
| 1780 | 1780 | if (empty($history)) { |
| 1781 | 1781 | $history = $sentence; |
| 1782 | 1782 | } else { |
| 1783 | - $history .= '<br />' . $sentence; |
|
| 1783 | + $history .= '<br />'.$sentence; |
|
| 1784 | 1784 | } |
| 1785 | 1785 | } |
| 1786 | 1786 | } |
@@ -1902,7 +1902,7 @@ discard block |
||
| 1902 | 1902 | ) { |
| 1903 | 1903 | // load the original record into an array |
| 1904 | 1904 | $originalRecord = DB::queryfirstrow( |
| 1905 | - 'SELECT * FROM ' . prefixTable('items') . ' |
|
| 1905 | + 'SELECT * FROM '.prefixTable('items').' |
|
| 1906 | 1906 | WHERE id = %i', |
| 1907 | 1907 | $post_item_id |
| 1908 | 1908 | ); |
@@ -1921,7 +1921,7 @@ discard block |
||
| 1921 | 1921 | |
| 1922 | 1922 | // Load the destination folder record into an array |
| 1923 | 1923 | $dataDestination = DB::queryfirstrow( |
| 1924 | - 'SELECT personal_folder FROM ' . prefixTable('nested_tree') . ' |
|
| 1924 | + 'SELECT personal_folder FROM '.prefixTable('nested_tree').' |
|
| 1925 | 1925 | WHERE id = %i', |
| 1926 | 1926 | $post_dest_id |
| 1927 | 1927 | ); |
@@ -1929,7 +1929,7 @@ discard block |
||
| 1929 | 1929 | // Get the ITEM object key for the user |
| 1930 | 1930 | $userKey = DB::queryFirstRow( |
| 1931 | 1931 | 'SELECT share_key |
| 1932 | - FROM ' . prefixTable('sharekeys_items') . ' |
|
| 1932 | + FROM ' . prefixTable('sharekeys_items').' |
|
| 1933 | 1933 | WHERE user_id = %i AND object_id = %i', |
| 1934 | 1934 | $_SESSION['user_id'], |
| 1935 | 1935 | $post_item_id |
@@ -2001,7 +2001,7 @@ discard block |
||
| 2001 | 2001 | // Manage Custom Fields |
| 2002 | 2002 | $rows = DB::query( |
| 2003 | 2003 | 'SELECT * |
| 2004 | - FROM ' . prefixTable('categories_items') . ' |
|
| 2004 | + FROM ' . prefixTable('categories_items').' |
|
| 2005 | 2005 | WHERE item_id = %i', |
| 2006 | 2006 | $post_item_id |
| 2007 | 2007 | ); |
@@ -2049,15 +2049,15 @@ discard block |
||
| 2049 | 2049 | $rows = DB::query( |
| 2050 | 2050 | 'SELECT f.id AS id, f.file AS file, f.name AS name, f.status AS status, f.extension AS extension, |
| 2051 | 2051 | f.size AS size, f.type AS type, s.share_key AS share_key |
| 2052 | - FROM ' . prefixTable('files') . ' AS f |
|
| 2053 | - INNER JOIN ' . prefixTable('sharekeys_files') . ' AS s ON (f.id = s.object_id) |
|
| 2052 | + FROM ' . prefixTable('files').' AS f |
|
| 2053 | + INNER JOIN ' . prefixTable('sharekeys_files').' AS s ON (f.id = s.object_id) |
|
| 2054 | 2054 | WHERE s.user_id = %i AND f.id_item = %i', |
| 2055 | 2055 | $_SESSION['user_id'], |
| 2056 | 2056 | $post_item_id |
| 2057 | 2057 | ); |
| 2058 | 2058 | foreach ($rows as $record) { |
| 2059 | 2059 | // Check if file still exists |
| 2060 | - if (file_exists($SETTINGS['path_to_upload_folder'] . DIRECTORY_SEPARATOR . TP_FILE_PREFIX . base64_decode($record['file'])) === true) { |
|
| 2060 | + if (file_exists($SETTINGS['path_to_upload_folder'].DIRECTORY_SEPARATOR.TP_FILE_PREFIX.base64_decode($record['file'])) === true) { |
|
| 2061 | 2061 | // Step1 - decrypt the file |
| 2062 | 2062 | $fileContent = decryptFile( |
| 2063 | 2063 | $record['file'], |
@@ -2066,8 +2066,8 @@ discard block |
||
| 2066 | 2066 | ); |
| 2067 | 2067 | |
| 2068 | 2068 | // Step2 - create file |
| 2069 | - $newFileName = md5(time() . '_' . $record['id']) . '.' . $record['extension']; |
|
| 2070 | - $outstream = fopen($SETTINGS['path_to_upload_folder'] . DIRECTORY_SEPARATOR . $newFileName, 'ab'); |
|
| 2069 | + $newFileName = md5(time().'_'.$record['id']).'.'.$record['extension']; |
|
| 2070 | + $outstream = fopen($SETTINGS['path_to_upload_folder'].DIRECTORY_SEPARATOR.$newFileName, 'ab'); |
|
| 2071 | 2071 | if ($outstream === false) { |
| 2072 | 2072 | echo prepareExchangedData( |
| 2073 | 2073 | array( |
@@ -2117,7 +2117,7 @@ discard block |
||
| 2117 | 2117 | |
| 2118 | 2118 | // ------------------------- |
| 2119 | 2119 | // Add specific restrictions |
| 2120 | - $rows = DB::query('SELECT * FROM ' . prefixTable('restriction_to_roles') . ' WHERE item_id = %i', $post_item_id); |
|
| 2120 | + $rows = DB::query('SELECT * FROM '.prefixTable('restriction_to_roles').' WHERE item_id = %i', $post_item_id); |
|
| 2121 | 2121 | foreach ($rows as $record) { |
| 2122 | 2122 | DB::insert( |
| 2123 | 2123 | prefixTable('restriction_to_roles'), |
@@ -2129,7 +2129,7 @@ discard block |
||
| 2129 | 2129 | } |
| 2130 | 2130 | |
| 2131 | 2131 | // Add Tags |
| 2132 | - $rows = DB::query('SELECT * FROM ' . prefixTable('tags') . ' WHERE item_id = %i', $post_item_id); |
|
| 2132 | + $rows = DB::query('SELECT * FROM '.prefixTable('tags').' WHERE item_id = %i', $post_item_id); |
|
| 2133 | 2133 | foreach ($rows as $record) { |
| 2134 | 2134 | DB::insert( |
| 2135 | 2135 | prefixTable('tags'), |
@@ -2159,7 +2159,7 @@ discard block |
||
| 2159 | 2159 | $_SESSION['login'] |
| 2160 | 2160 | ); |
| 2161 | 2161 | // reload cache table |
| 2162 | - include_once $SETTINGS['cpassman_dir'] . '/sources/main.functions.php'; |
|
| 2162 | + include_once $SETTINGS['cpassman_dir'].'/sources/main.functions.php'; |
|
| 2163 | 2163 | updateCacheTable('reload', $SETTINGS, null); |
| 2164 | 2164 | |
| 2165 | 2165 | echo (string) prepareExchangedData( |
@@ -2227,7 +2227,7 @@ discard block |
||
| 2227 | 2227 | // then we can show it |
| 2228 | 2228 | $item_deleted = DB::queryFirstRow( |
| 2229 | 2229 | 'SELECT * |
| 2230 | - FROM ' . prefixTable('log_items') . ' |
|
| 2230 | + FROM ' . prefixTable('log_items').' |
|
| 2231 | 2231 | WHERE id_item = %i AND action = %s |
| 2232 | 2232 | ORDER BY date DESC |
| 2233 | 2233 | LIMIT 0, 1', |
@@ -2238,7 +2238,7 @@ discard block |
||
| 2238 | 2238 | |
| 2239 | 2239 | $item_restored = DB::queryFirstRow( |
| 2240 | 2240 | 'SELECT * |
| 2241 | - FROM ' . prefixTable('log_items') . ' |
|
| 2241 | + FROM ' . prefixTable('log_items').' |
|
| 2242 | 2242 | WHERE id_item = %i AND action = %s |
| 2243 | 2243 | ORDER BY date DESC |
| 2244 | 2244 | LIMIT 0, 1', |
@@ -2262,8 +2262,8 @@ discard block |
||
| 2262 | 2262 | // Get all informations for this item |
| 2263 | 2263 | $dataItem = DB::queryfirstrow( |
| 2264 | 2264 | 'SELECT * |
| 2265 | - FROM ' . prefixTable('items') . ' as i |
|
| 2266 | - INNER JOIN ' . prefixTable('log_items') . ' as l ON (l.id_item = i.id) |
|
| 2265 | + FROM ' . prefixTable('items').' as i |
|
| 2266 | + INNER JOIN ' . prefixTable('log_items').' as l ON (l.id_item = i.id) |
|
| 2267 | 2267 | WHERE i.id = %i AND l.action = %s', |
| 2268 | 2268 | $post_id, |
| 2269 | 2269 | 'at_creation' |
@@ -2272,7 +2272,7 @@ discard block |
||
| 2272 | 2272 | // Notification |
| 2273 | 2273 | DB::queryfirstrow( |
| 2274 | 2274 | 'SELECT * |
| 2275 | - FROM ' . prefixTable('notification') . ' |
|
| 2275 | + FROM ' . prefixTable('notification').' |
|
| 2276 | 2276 | WHERE item_id = %i AND user_id = %i', |
| 2277 | 2277 | $post_id, |
| 2278 | 2278 | $_SESSION['user_id'] |
@@ -2319,13 +2319,13 @@ discard block |
||
| 2319 | 2319 | && (int) $SETTINGS['enable_email_notification_on_item_shown'] === 1 |
| 2320 | 2320 | && (int) $user['admin'] === 1 |
| 2321 | 2321 | ) { |
| 2322 | - $_SESSION['listNotificationEmails'] .= $user['email'] . ','; |
|
| 2322 | + $_SESSION['listNotificationEmails'] .= $user['email'].','; |
|
| 2323 | 2323 | } |
| 2324 | 2324 | } |
| 2325 | 2325 | |
| 2326 | 2326 | // manage case of API user |
| 2327 | 2327 | if ($dataItem['id_user'] === API_USER_ID) { |
| 2328 | - $arrData['author'] = 'API [' . $dataItem['description'] . ']'; |
|
| 2328 | + $arrData['author'] = 'API ['.$dataItem['description'].']'; |
|
| 2329 | 2329 | $arrData['id_user'] = API_USER_ID; |
| 2330 | 2330 | $arrData['author_email'] = ''; |
| 2331 | 2331 | $arrData['notification_status'] = false; |
@@ -2335,7 +2335,7 @@ discard block |
||
| 2335 | 2335 | $tags = array(); |
| 2336 | 2336 | $rows = DB::query( |
| 2337 | 2337 | 'SELECT tag |
| 2338 | - FROM ' . prefixTable('tags') . ' |
|
| 2338 | + FROM ' . prefixTable('tags').' |
|
| 2339 | 2339 | WHERE item_id = %i', |
| 2340 | 2340 | $post_id |
| 2341 | 2341 | ); |
@@ -2360,7 +2360,7 @@ discard block |
||
| 2360 | 2360 | // Check if user has a role that is accepted |
| 2361 | 2361 | $rows_tmp = DB::query( |
| 2362 | 2362 | 'SELECT role_id |
| 2363 | - FROM ' . prefixTable('restriction_to_roles') . ' |
|
| 2363 | + FROM ' . prefixTable('restriction_to_roles').' |
|
| 2364 | 2364 | WHERE item_id=%i', |
| 2365 | 2365 | $post_id |
| 2366 | 2366 | ); |
@@ -2374,7 +2374,7 @@ discard block |
||
| 2374 | 2374 | // Get the object key for the user |
| 2375 | 2375 | $userKey = DB::queryFirstRow( |
| 2376 | 2376 | 'SELECT share_key |
| 2377 | - FROM ' . prefixTable('sharekeys_items') . ' |
|
| 2377 | + FROM ' . prefixTable('sharekeys_items').' |
|
| 2378 | 2378 | WHERE user_id = %i AND object_id = %i', |
| 2379 | 2379 | $_SESSION['user_id'], |
| 2380 | 2380 | $post_id |
@@ -2459,8 +2459,8 @@ discard block |
||
| 2459 | 2459 | // Add restriction if item is restricted to roles |
| 2460 | 2460 | $rows = DB::query( |
| 2461 | 2461 | 'SELECT t.title, t.id |
| 2462 | - FROM ' . prefixTable('roles_title') . ' AS t |
|
| 2463 | - INNER JOIN ' . prefixTable('restriction_to_roles') . ' AS r ON (t.id=r.role_id) |
|
| 2462 | + FROM ' . prefixTable('roles_title').' AS t |
|
| 2463 | + INNER JOIN ' . prefixTable('restriction_to_roles').' AS r ON (t.id=r.role_id) |
|
| 2464 | 2464 | WHERE r.item_id = %i |
| 2465 | 2465 | ORDER BY t.title ASC', |
| 2466 | 2466 | $post_id |
@@ -2476,8 +2476,8 @@ discard block |
||
| 2476 | 2476 | $tmp = array(); |
| 2477 | 2477 | $rows = DB::query( |
| 2478 | 2478 | 'SELECT k.label, k.id |
| 2479 | - FROM ' . prefixTable('kb_items') . ' as i |
|
| 2480 | - INNER JOIN ' . prefixTable('kb') . ' as k ON (i.kb_id=k.id) |
|
| 2479 | + FROM ' . prefixTable('kb_items').' as i |
|
| 2480 | + INNER JOIN ' . prefixTable('kb').' as k ON (i.kb_id=k.id) |
|
| 2481 | 2481 | WHERE i.item_id = %i |
| 2482 | 2482 | ORDER BY k.label ASC', |
| 2483 | 2483 | $post_id |
@@ -2557,7 +2557,7 @@ discard block |
||
| 2557 | 2557 | $arrCatList = array(); |
| 2558 | 2558 | $rows_tmp = DB::query( |
| 2559 | 2559 | 'SELECT id_category |
| 2560 | - FROM ' . prefixTable('categories_folders') . ' |
|
| 2560 | + FROM ' . prefixTable('categories_folders').' |
|
| 2561 | 2561 | WHERE id_folder=%i', |
| 2562 | 2562 | $post_folder_id |
| 2563 | 2563 | ); |
@@ -2572,8 +2572,8 @@ discard block |
||
| 2572 | 2572 | 'SELECT i.id AS id, i.field_id AS field_id, i.data AS data, i.item_id AS item_id, |
| 2573 | 2573 | i.encryption_type AS encryption_type, c.encrypted_data, c.parent_id AS parent_id, |
| 2574 | 2574 | c.type as field_type, c.masked AS field_masked, c.role_visibility AS role_visibility |
| 2575 | - FROM ' . prefixTable('categories_items') . ' AS i |
|
| 2576 | - INNER JOIN ' . prefixTable('categories') . ' AS c ON (i.field_id=c.id) |
|
| 2575 | + FROM ' . prefixTable('categories_items').' AS i |
|
| 2576 | + INNER JOIN ' . prefixTable('categories').' AS c ON (i.field_id=c.id) |
|
| 2577 | 2577 | WHERE i.item_id=%i AND c.parent_id IN %ls', |
| 2578 | 2578 | $post_id, |
| 2579 | 2579 | $arrCatList |
@@ -2584,11 +2584,11 @@ discard block |
||
| 2584 | 2584 | //db::debugmode(true); |
| 2585 | 2585 | $userKey = DB::queryFirstRow( |
| 2586 | 2586 | 'SELECT share_key |
| 2587 | - FROM ' . prefixTable('sharekeys_fields') . ' |
|
| 2587 | + FROM ' . prefixTable('sharekeys_fields').' |
|
| 2588 | 2588 | WHERE user_id = %i AND object_id = %i', |
| 2589 | 2589 | $_SESSION['user_id'], |
| 2590 | 2590 | $row['id'] |
| 2591 | - );//db::debugmode(false); |
|
| 2591 | + ); //db::debugmode(false); |
|
| 2592 | 2592 | $fieldText = []; |
| 2593 | 2593 | if (DB::count() === 0) { |
| 2594 | 2594 | // Not encrypted |
@@ -2630,7 +2630,7 @@ discard block |
||
| 2630 | 2630 | if (isset($SETTINGS['item_creation_templates']) && (int) $SETTINGS['item_creation_templates'] === 1) { |
| 2631 | 2631 | $rows_tmp = DB::queryfirstrow( |
| 2632 | 2632 | 'SELECT category_id |
| 2633 | - FROM ' . prefixTable('templates') . ' |
|
| 2633 | + FROM ' . prefixTable('templates').' |
|
| 2634 | 2634 | WHERE item_id = %i', |
| 2635 | 2635 | $post_id |
| 2636 | 2636 | ); |
@@ -2655,7 +2655,7 @@ discard block |
||
| 2655 | 2655 | // Is the Item to be deleted? |
| 2656 | 2656 | $dataDelete = DB::queryfirstrow( |
| 2657 | 2657 | 'SELECT * |
| 2658 | - FROM ' . prefixTable('automatic_del') . ' |
|
| 2658 | + FROM ' . prefixTable('automatic_del').' |
|
| 2659 | 2659 | WHERE item_id = %i', |
| 2660 | 2660 | $post_id |
| 2661 | 2661 | ); |
@@ -2737,11 +2737,11 @@ discard block |
||
| 2737 | 2737 | if (empty($dataItem['restricted_to']) === false) { |
| 2738 | 2738 | foreach (explode(';', $dataItem['restricted_to']) as $userRest) { |
| 2739 | 2739 | if (empty($userRest) === false) { |
| 2740 | - $dataTmp = DB::queryfirstrow('SELECT login FROM ' . prefixTable('users') . ' WHERE id= ' . $userRest); |
|
| 2740 | + $dataTmp = DB::queryfirstrow('SELECT login FROM '.prefixTable('users').' WHERE id= '.$userRest); |
|
| 2741 | 2741 | if (empty($listOfRestricted)) { |
| 2742 | 2742 | $listOfRestricted = $dataTmp['login']; |
| 2743 | 2743 | } else { |
| 2744 | - $listOfRestricted .= ';' . $dataTmp['login']; |
|
| 2744 | + $listOfRestricted .= ';'.$dataTmp['login']; |
|
| 2745 | 2745 | } |
| 2746 | 2746 | } |
| 2747 | 2747 | } |
@@ -2798,8 +2798,8 @@ discard block |
||
| 2798 | 2798 | // Load item data |
| 2799 | 2799 | $dataItem = DB::queryFirstRow( |
| 2800 | 2800 | 'SELECT i.*, n.title AS folder_title |
| 2801 | - FROM ' . prefixTable('items') . ' AS i |
|
| 2802 | - INNER JOIN ' . prefixTable('nested_tree') . ' AS n ON (i.id_tree = n.id) |
|
| 2801 | + FROM ' . prefixTable('items').' AS i |
|
| 2802 | + INNER JOIN ' . prefixTable('nested_tree').' AS n ON (i.id_tree = n.id) |
|
| 2803 | 2803 | WHERE i.id = %i', |
| 2804 | 2804 | $post_id |
| 2805 | 2805 | ); |
@@ -2821,7 +2821,7 @@ discard block |
||
| 2821 | 2821 | // Check if user has a role that is accepted |
| 2822 | 2822 | $rows_tmp = DB::query( |
| 2823 | 2823 | 'SELECT role_id |
| 2824 | - FROM ' . prefixTable('restriction_to_roles') . ' |
|
| 2824 | + FROM ' . prefixTable('restriction_to_roles').' |
|
| 2825 | 2825 | WHERE item_id=%i', |
| 2826 | 2826 | $post_id |
| 2827 | 2827 | ); |
@@ -2867,7 +2867,7 @@ discard block |
||
| 2867 | 2867 | // launch query |
| 2868 | 2868 | $rows = DB::query( |
| 2869 | 2869 | 'SELECT id, name, file, extension, size |
| 2870 | - FROM ' . prefixTable('files') . ' |
|
| 2870 | + FROM ' . prefixTable('files').' |
|
| 2871 | 2871 | WHERE id_item = %i AND confirmed = 1', |
| 2872 | 2872 | $post_id |
| 2873 | 2873 | ); |
@@ -2876,7 +2876,7 @@ discard block |
||
| 2876 | 2876 | $attachments, |
| 2877 | 2877 | array( |
| 2878 | 2878 | 'icon' => fileFormatImage(strtolower($record['extension'])), |
| 2879 | - 'filename' => basename($record['name'], '.' . $record['extension']), |
|
| 2879 | + 'filename' => basename($record['name'], '.'.$record['extension']), |
|
| 2880 | 2880 | 'extension' => $record['extension'], |
| 2881 | 2881 | 'size' => formatSizeUnits((int) $record['size']), |
| 2882 | 2882 | 'is_image' => in_array(strtolower($record['extension']), TP_IMAGE_FILE_EXT) === true ? 1 : 0, |
@@ -2902,7 +2902,7 @@ discard block |
||
| 2902 | 2902 | array( |
| 2903 | 2903 | 'latest_items' => implode(';', $_SESSION['latest_items']), |
| 2904 | 2904 | ), |
| 2905 | - 'id=' . $_SESSION['user_id'] |
|
| 2905 | + 'id='.$_SESSION['user_id'] |
|
| 2906 | 2906 | ); |
| 2907 | 2907 | } |
| 2908 | 2908 | |
@@ -2911,8 +2911,8 @@ discard block |
||
| 2911 | 2911 | $listOptionsForRoles = array(); |
| 2912 | 2912 | $rows = DB::query( |
| 2913 | 2913 | 'SELECT r.role_id AS role_id, t.title AS title |
| 2914 | - FROM ' . prefixTable('roles_values') . ' AS r |
|
| 2915 | - INNER JOIN ' . prefixTable('roles_title') . ' AS t ON (r.role_id = t.id) |
|
| 2914 | + FROM ' . prefixTable('roles_values').' AS r |
|
| 2915 | + INNER JOIN ' . prefixTable('roles_title').' AS t ON (r.role_id = t.id) |
|
| 2916 | 2916 | WHERE r.folder_id = %i', |
| 2917 | 2917 | $dataItem['id_tree'] |
| 2918 | 2918 | ); |
@@ -2926,9 +2926,9 @@ discard block |
||
| 2926 | 2926 | ); |
| 2927 | 2927 | $rows2 = DB::query( |
| 2928 | 2928 | 'SELECT id, login, fonction_id, email, name, lastname |
| 2929 | - FROM ' . prefixTable('users') . ' |
|
| 2929 | + FROM ' . prefixTable('users').' |
|
| 2930 | 2930 | WHERE fonction_id LIKE %s', |
| 2931 | - '%' . $record['role_id'] . '%' |
|
| 2931 | + '%'.$record['role_id'].'%' |
|
| 2932 | 2932 | ); |
| 2933 | 2933 | foreach ($rows2 as $record2) { |
| 2934 | 2934 | foreach (explode(';', $record2['fonction_id']) as $role) { |
@@ -2941,7 +2941,7 @@ discard block |
||
| 2941 | 2941 | array( |
| 2942 | 2942 | 'id' => (int) $record2['id'], |
| 2943 | 2943 | 'login' => $record2['login'], |
| 2944 | - 'name' => $record2['name'] . ' ' . $record2['lastname'], |
|
| 2944 | + 'name' => $record2['name'].' '.$record2['lastname'], |
|
| 2945 | 2945 | 'email' => $record2['email'], |
| 2946 | 2946 | ) |
| 2947 | 2947 | ); |
@@ -2960,16 +2960,16 @@ discard block |
||
| 2960 | 2960 | $path = ''; |
| 2961 | 2961 | foreach ($arbo as $elem) { |
| 2962 | 2962 | if (empty($path) === true) { |
| 2963 | - $path = htmlspecialchars(stripslashes(htmlspecialchars_decode($elem->title, ENT_QUOTES)), ENT_QUOTES) . ' '; |
|
| 2963 | + $path = htmlspecialchars(stripslashes(htmlspecialchars_decode($elem->title, ENT_QUOTES)), ENT_QUOTES).' '; |
|
| 2964 | 2964 | } else { |
| 2965 | - $path .= '→ ' . htmlspecialchars(stripslashes(htmlspecialchars_decode($elem->title, ENT_QUOTES)), ENT_QUOTES); |
|
| 2965 | + $path .= '→ '.htmlspecialchars(stripslashes(htmlspecialchars_decode($elem->title, ENT_QUOTES)), ENT_QUOTES); |
|
| 2966 | 2966 | } |
| 2967 | 2967 | } |
| 2968 | 2968 | // Build text to show user |
| 2969 | 2969 | if (empty($path) === true) { |
| 2970 | 2970 | $path = addslashes($dataItem['label']); |
| 2971 | 2971 | } else { |
| 2972 | - $path = addslashes($dataItem['label']) . ' (' . $path . ')'; |
|
| 2972 | + $path = addslashes($dataItem['label']).' ('.$path.')'; |
|
| 2973 | 2973 | } |
| 2974 | 2974 | |
| 2975 | 2975 | // send back infos |
@@ -2983,7 +2983,7 @@ discard block |
||
| 2983 | 2983 | array( |
| 2984 | 2984 | addslashes($_SESSION['login']), |
| 2985 | 2985 | $path, |
| 2986 | - $SETTINGS['cpassman_url'] . '/index.php?page=items&group=' . $dataItem['id_tree'] . '&id=' . $dataItem['id'], |
|
| 2986 | + $SETTINGS['cpassman_url'].'/index.php?page=items&group='.$dataItem['id_tree'].'&id='.$dataItem['id'], |
|
| 2987 | 2987 | ), |
| 2988 | 2988 | langHdl('email_on_open_notification_mail') |
| 2989 | 2989 | ), |
@@ -2994,7 +2994,7 @@ discard block |
||
| 2994 | 2994 | } |
| 2995 | 2995 | |
| 2996 | 2996 | // has this item a change proposal |
| 2997 | - DB::query('SELECT * FROM ' . prefixTable('items_change') . ' WHERE item_id = %i', $post_id); |
|
| 2997 | + DB::query('SELECT * FROM '.prefixTable('items_change').' WHERE item_id = %i', $post_id); |
|
| 2998 | 2998 | $returnArray['has_change_proposal'] = DB::count(); |
| 2999 | 2999 | |
| 3000 | 3000 | // Setting |
@@ -3085,7 +3085,7 @@ discard block |
||
| 3085 | 3085 | // Load item data |
| 3086 | 3086 | $data = DB::queryFirstRow( |
| 3087 | 3087 | 'SELECT id_tree |
| 3088 | - FROM ' . prefixTable('items') . ' |
|
| 3088 | + FROM ' . prefixTable('items').' |
|
| 3089 | 3089 | WHERE id = %i', |
| 3090 | 3090 | $post_item_id |
| 3091 | 3091 | ); |
@@ -3155,13 +3155,13 @@ discard block |
||
| 3155 | 3155 | |
| 3156 | 3156 | // Check if user is allowed to access this folder |
| 3157 | 3157 | if (!in_array($post_folder_id, $_SESSION['groupes_visibles'])) { |
| 3158 | - echo '[{"error" : "' . langHdl('error_not_allowed_to') . '"}]'; |
|
| 3158 | + echo '[{"error" : "'.langHdl('error_not_allowed_to').'"}]'; |
|
| 3159 | 3159 | break; |
| 3160 | 3160 | } |
| 3161 | 3161 | |
| 3162 | 3162 | // Check if title doesn't contains html codes |
| 3163 | 3163 | if (preg_match_all('|<[^>]+>(.*)</[^>]+>|U', $title, $out)) { |
| 3164 | - echo '[ { "error" : "' . langHdl('error_html_codes') . '" } ]'; |
|
| 3164 | + echo '[ { "error" : "'.langHdl('error_html_codes').'" } ]'; |
|
| 3165 | 3165 | break; |
| 3166 | 3166 | } |
| 3167 | 3167 | // check that title is not numeric |
@@ -3172,9 +3172,9 @@ discard block |
||
| 3172 | 3172 | |
| 3173 | 3173 | // Check if duplicate folders name are allowed |
| 3174 | 3174 | if (isset($SETTINGS['duplicate_folder']) && $SETTINGS['duplicate_folder'] === '0') { |
| 3175 | - $data = DB::queryFirstRow('SELECT id, title FROM ' . prefixTable('nested_tree') . ' WHERE title = %s', $title); |
|
| 3175 | + $data = DB::queryFirstRow('SELECT id, title FROM '.prefixTable('nested_tree').' WHERE title = %s', $title); |
|
| 3176 | 3176 | if (empty($data['id']) === false && $dataReceived['folder'] !== $data['id']) { |
| 3177 | - echo '[ { "error" : "' . langHdl('error_group_exist') . '" } ]'; |
|
| 3177 | + echo '[ { "error" : "'.langHdl('error_group_exist').'" } ]'; |
|
| 3178 | 3178 | break; |
| 3179 | 3179 | } |
| 3180 | 3180 | } |
@@ -3182,7 +3182,7 @@ discard block |
||
| 3182 | 3182 | // query on folder |
| 3183 | 3183 | $data = DB::queryfirstrow( |
| 3184 | 3184 | 'SELECT parent_id, personal_folder |
| 3185 | - FROM ' . prefixTable('nested_tree') . ' |
|
| 3185 | + FROM ' . prefixTable('nested_tree').' |
|
| 3186 | 3186 | WHERE id = %i', |
| 3187 | 3187 | $post_folder_id |
| 3188 | 3188 | ); |
@@ -3192,20 +3192,20 @@ discard block |
||
| 3192 | 3192 | if ($_SESSION['is_admin'] !== 1 && $_SESSION['user_manager'] !== 1 && $data['personal_folder'] === '0') { |
| 3193 | 3193 | $data = DB::queryfirstrow( |
| 3194 | 3194 | 'SELECT valeur |
| 3195 | - FROM ' . prefixTable('misc') . ' |
|
| 3195 | + FROM ' . prefixTable('misc').' |
|
| 3196 | 3196 | WHERE intitule = %i AND type = %s', |
| 3197 | 3197 | $data['parent_id'], |
| 3198 | 3198 | 'complex' |
| 3199 | 3199 | ); |
| 3200 | 3200 | if (intval($dataReceived['complexity']) < intval($data['valeur'])) { |
| 3201 | - echo '[ { "error" : "' . langHdl('error_folder_complexity_lower_than_top_folder') . ' [<b>' . TP_PW_COMPLEXITY[$data['valeur']][1] . '</b>]"} ]'; |
|
| 3201 | + echo '[ { "error" : "'.langHdl('error_folder_complexity_lower_than_top_folder').' [<b>'.TP_PW_COMPLEXITY[$data['valeur']][1].'</b>]"} ]'; |
|
| 3202 | 3202 | break; |
| 3203 | 3203 | } |
| 3204 | 3204 | } |
| 3205 | 3205 | |
| 3206 | 3206 | // update Folders table |
| 3207 | 3207 | $tmp = DB::queryFirstRow( |
| 3208 | - 'SELECT title, parent_id, personal_folder FROM ' . prefixTable('nested_tree') . ' WHERE id = %i', |
|
| 3208 | + 'SELECT title, parent_id, personal_folder FROM '.prefixTable('nested_tree').' WHERE id = %i', |
|
| 3209 | 3209 | $dataReceived['folder'] |
| 3210 | 3210 | ); |
| 3211 | 3211 | if ($tmp['parent_id'] !== 0 || $tmp['title'] !== $_SESSION['user_id'] || $tmp['personal_folder'] !== 1) { |
@@ -3270,42 +3270,42 @@ discard block |
||
| 3270 | 3270 | in_array($post_target_folder_id, $_SESSION['groupes_visibles']) === false) && ($post_target_folder_id === '0' && |
| 3271 | 3271 | isset($SETTINGS['can_create_root_folder']) === true && (int) $SETTINGS['can_create_root_folder'] === 1) |
| 3272 | 3272 | ) { |
| 3273 | - $returnValues = '[{"error" : "' . langHdl('error_not_allowed_to') . '"}]'; |
|
| 3273 | + $returnValues = '[{"error" : "'.langHdl('error_not_allowed_to').'"}]'; |
|
| 3274 | 3274 | echo $returnValues; |
| 3275 | 3275 | break; |
| 3276 | 3276 | } |
| 3277 | 3277 | |
| 3278 | 3278 | $tmp_source = DB::queryFirstRow( |
| 3279 | 3279 | 'SELECT title, parent_id, personal_folder |
| 3280 | - FROM ' . prefixTable('nested_tree') . ' |
|
| 3280 | + FROM ' . prefixTable('nested_tree').' |
|
| 3281 | 3281 | WHERE id = %i', |
| 3282 | 3282 | $post_source_folder_id |
| 3283 | 3283 | ); |
| 3284 | 3284 | |
| 3285 | 3285 | $tmp_target = DB::queryFirstRow( |
| 3286 | 3286 | 'SELECT title, parent_id, personal_folder |
| 3287 | - FROM ' . prefixTable('nested_tree') . ' |
|
| 3287 | + FROM ' . prefixTable('nested_tree').' |
|
| 3288 | 3288 | WHERE id = %i', |
| 3289 | 3289 | $post_target_folder_id |
| 3290 | 3290 | ); |
| 3291 | 3291 | |
| 3292 | 3292 | // check if target is not a child of source |
| 3293 | 3293 | if ($tree->isChildOf($post_target_folder_id, $post_source_folder_id) === true) { |
| 3294 | - $returnValues = '[{"error" : "' . langHdl('error_not_allowed_to') . '"}]'; |
|
| 3294 | + $returnValues = '[{"error" : "'.langHdl('error_not_allowed_to').'"}]'; |
|
| 3295 | 3295 | echo $returnValues; |
| 3296 | 3296 | break; |
| 3297 | 3297 | } |
| 3298 | 3298 | |
| 3299 | 3299 | // check if source or target folder is PF. If Yes, then cancel operation |
| 3300 | 3300 | if ((int) $tmp_source['personal_folder'] === 1 || (int) $tmp_target['personal_folder'] === 1) { |
| 3301 | - $returnValues = '[{"error" : "' . langHdl('error_not_allowed_to') . '"}]'; |
|
| 3301 | + $returnValues = '[{"error" : "'.langHdl('error_not_allowed_to').'"}]'; |
|
| 3302 | 3302 | echo $returnValues; |
| 3303 | 3303 | break; |
| 3304 | 3304 | } |
| 3305 | 3305 | |
| 3306 | 3306 | // check if source or target folder is PF. If Yes, then cancel operation |
| 3307 | 3307 | if ($tmp_source['title'] === $_SESSION['user_id'] || $tmp_target['title'] === $_SESSION['user_id']) { |
| 3308 | - $returnValues = '[{"error" : "' . langHdl('error_not_allowed_to') . '"}]'; |
|
| 3308 | + $returnValues = '[{"error" : "'.langHdl('error_not_allowed_to').'"}]'; |
|
| 3309 | 3309 | echo $returnValues; |
| 3310 | 3310 | break; |
| 3311 | 3311 | } |
@@ -3427,7 +3427,7 @@ discard block |
||
| 3427 | 3427 | foreach ($_SESSION['user_roles'] as $role) { |
| 3428 | 3428 | $roleQ = DB::queryfirstrow( |
| 3429 | 3429 | 'SELECT allow_pw_change |
| 3430 | - FROM ' . prefixTable('roles_title') . ' |
|
| 3430 | + FROM ' . prefixTable('roles_title').' |
|
| 3431 | 3431 | WHERE id = %i', |
| 3432 | 3432 | $role |
| 3433 | 3433 | ); |
@@ -3452,11 +3452,11 @@ discard block |
||
| 3452 | 3452 | |
| 3453 | 3453 | foreach ($_SESSION['user_roles'] as $role) { |
| 3454 | 3454 | $access = DB::queryFirstRow( |
| 3455 | - 'SELECT type FROM ' . prefixTable('roles_values') . ' WHERE role_id = %i AND folder_id = %i', |
|
| 3455 | + 'SELECT type FROM '.prefixTable('roles_values').' WHERE role_id = %i AND folder_id = %i', |
|
| 3456 | 3456 | $role, |
| 3457 | 3457 | $post_id |
| 3458 | 3458 | ); |
| 3459 | - if (DB::count()>0) { |
|
| 3459 | + if (DB::count() > 0) { |
|
| 3460 | 3460 | if ($access['type'] === 'R') { |
| 3461 | 3461 | array_push($arrTmp, 10); |
| 3462 | 3462 | } elseif ($access['type'] === 'W') { |
@@ -3520,7 +3520,7 @@ discard block |
||
| 3520 | 3520 | } else { |
| 3521 | 3521 | DB::query( |
| 3522 | 3522 | 'SELECT * |
| 3523 | - FROM ' . prefixTable('items') . ' |
|
| 3523 | + FROM ' . prefixTable('items').' |
|
| 3524 | 3524 | WHERE inactif = %i', |
| 3525 | 3525 | 0 |
| 3526 | 3526 | ); |
@@ -3530,7 +3530,7 @@ discard block |
||
| 3530 | 3530 | |
| 3531 | 3531 | // Get folder complexity |
| 3532 | 3532 | $folderComplexity = DB::queryFirstRow( |
| 3533 | - 'SELECT valeur FROM ' . prefixTable('misc') . ' WHERE type = %s AND intitule = %i', |
|
| 3533 | + 'SELECT valeur FROM '.prefixTable('misc').' WHERE type = %s AND intitule = %i', |
|
| 3534 | 3534 | 'complex', |
| 3535 | 3535 | $post_id |
| 3536 | 3536 | ); |
@@ -3542,7 +3542,7 @@ discard block |
||
| 3542 | 3542 | if (isset($SETTINGS['item_extra_fields']) && (int) $SETTINGS['item_extra_fields'] === 1) { |
| 3543 | 3543 | $folderRow = DB::query( |
| 3544 | 3544 | 'SELECT id_category |
| 3545 | - FROM ' . prefixTable('categories_folders') . ' |
|
| 3545 | + FROM ' . prefixTable('categories_folders').' |
|
| 3546 | 3546 | WHERE id_folder = %i', |
| 3547 | 3547 | $post_id |
| 3548 | 3548 | ); |
@@ -3656,13 +3656,13 @@ discard block |
||
| 3656 | 3656 | // List all ITEMS |
| 3657 | 3657 | if ($folderIsPf === false) { |
| 3658 | 3658 | $where->add('i.inactif=%i', 0); |
| 3659 | - $where->add('l.date=%l', '(SELECT date FROM ' . prefixTable('log_items') . " WHERE action IN ('at_creation', 'at_modification') AND id_item=i.id ORDER BY date DESC LIMIT 1)"); |
|
| 3659 | + $where->add('l.date=%l', '(SELECT date FROM '.prefixTable('log_items')." WHERE action IN ('at_creation', 'at_modification') AND id_item=i.id ORDER BY date DESC LIMIT 1)"); |
|
| 3660 | 3660 | if (empty($limited_to_items) === false) { |
| 3661 | 3661 | $where->add('i.id IN %ls', explode(',', $limited_to_items)); |
| 3662 | 3662 | } |
| 3663 | 3663 | |
| 3664 | - $query_limit = ' LIMIT ' . |
|
| 3665 | - $start . ',' . |
|
| 3664 | + $query_limit = ' LIMIT '. |
|
| 3665 | + $start.','. |
|
| 3666 | 3666 | $post_nb_items_to_display_once; |
| 3667 | 3667 | //db::debugmode(true); |
| 3668 | 3668 | $rows = DB::query( |
@@ -3673,9 +3673,9 @@ discard block |
||
| 3673 | 3673 | MIN(l.action) AS log_action, |
| 3674 | 3674 | l.id_user AS log_user, |
| 3675 | 3675 | i.url AS link |
| 3676 | - FROM ' . prefixTable('items') . ' AS i |
|
| 3677 | - INNER JOIN ' . prefixTable('nested_tree') . ' AS n ON (i.id_tree = n.id) |
|
| 3678 | - INNER JOIN ' . prefixTable('log_items') . ' AS l ON (i.id = l.id_item) |
|
| 3676 | + FROM ' . prefixTable('items').' AS i |
|
| 3677 | + INNER JOIN ' . prefixTable('nested_tree').' AS n ON (i.id_tree = n.id) |
|
| 3678 | + INNER JOIN ' . prefixTable('log_items').' AS l ON (i.id = l.id_item) |
|
| 3679 | 3679 | WHERE %l |
| 3680 | 3680 | GROUP BY i.id, l.date, l.id_user, l.action |
| 3681 | 3681 | ORDER BY i.label ASC, l.date DESC' . $query_limit, |
@@ -3694,9 +3694,9 @@ discard block |
||
| 3694 | 3694 | MIN(l.action) AS log_action, |
| 3695 | 3695 | l.id_user AS log_user, |
| 3696 | 3696 | i.url AS link |
| 3697 | - FROM ' . prefixTable('items') . ' AS i |
|
| 3698 | - INNER JOIN ' . prefixTable('nested_tree') . ' AS n ON (i.id_tree = n.id) |
|
| 3699 | - INNER JOIN ' . prefixTable('log_items') . ' AS l ON (i.id = l.id_item) |
|
| 3697 | + FROM ' . prefixTable('items').' AS i |
|
| 3698 | + INNER JOIN ' . prefixTable('nested_tree').' AS n ON (i.id_tree = n.id) |
|
| 3699 | + INNER JOIN ' . prefixTable('log_items').' AS l ON (i.id = l.id_item) |
|
| 3700 | 3700 | WHERE %l |
| 3701 | 3701 | GROUP BY i.id, l.date, l.id_user, l.action |
| 3702 | 3702 | ORDER BY i.label ASC, l.date DESC', |
@@ -3726,7 +3726,7 @@ discard block |
||
| 3726 | 3726 | $item_is_restricted_to_role = false; |
| 3727 | 3727 | DB::queryfirstrow( |
| 3728 | 3728 | 'SELECT role_id |
| 3729 | - FROM ' . prefixTable('restriction_to_roles') . ' |
|
| 3729 | + FROM ' . prefixTable('restriction_to_roles').' |
|
| 3730 | 3730 | WHERE item_id = %i', |
| 3731 | 3731 | $record['id'] |
| 3732 | 3732 | ); |
@@ -3738,7 +3738,7 @@ discard block |
||
| 3738 | 3738 | $user_is_included_in_role = false; |
| 3739 | 3739 | DB::query( |
| 3740 | 3740 | 'SELECT role_id |
| 3741 | - FROM ' . prefixTable('restriction_to_roles') . ' |
|
| 3741 | + FROM ' . prefixTable('restriction_to_roles').' |
|
| 3742 | 3742 | WHERE item_id = %i AND role_id IN %ls', |
| 3743 | 3743 | $record['id'], |
| 3744 | 3744 | $_SESSION['user_roles'] |
@@ -3942,9 +3942,9 @@ discard block |
||
| 3942 | 3942 | if ((int) $start === 0) { |
| 3943 | 3943 | DB::query( |
| 3944 | 3944 | 'SELECT i.id |
| 3945 | - FROM ' . prefixTable('items') . ' as i |
|
| 3946 | - INNER JOIN ' . prefixTable('nested_tree') . ' as n ON (i.id_tree = n.id) |
|
| 3947 | - INNER JOIN ' . prefixTable('log_items') . ' as l ON (i.id = l.id_item) |
|
| 3945 | + FROM ' . prefixTable('items').' as i |
|
| 3946 | + INNER JOIN ' . prefixTable('nested_tree').' as n ON (i.id_tree = n.id) |
|
| 3947 | + INNER JOIN ' . prefixTable('log_items').' as l ON (i.id = l.id_item) |
|
| 3948 | 3948 | WHERE %l |
| 3949 | 3949 | ORDER BY i.label ASC, l.date DESC', |
| 3950 | 3950 | $where |
@@ -4008,8 +4008,8 @@ discard block |
||
| 4008 | 4008 | // Run query |
| 4009 | 4009 | $dataItem = DB::queryfirstrow( |
| 4010 | 4010 | 'SELECT i.pw AS pw, s.share_key AS share_key |
| 4011 | - FROM ' . prefixTable('items') . ' AS i |
|
| 4012 | - INNER JOIN ' . prefixTable('sharekeys_items') . ' AS s ON (s.object_id = i.id) |
|
| 4011 | + FROM ' . prefixTable('items').' AS i |
|
| 4012 | + INNER JOIN ' . prefixTable('sharekeys_items').' AS s ON (s.object_id = i.id) |
|
| 4013 | 4013 | WHERE user_id = %i AND i.id = %i', |
| 4014 | 4014 | $_SESSION['user_id'], |
| 4015 | 4015 | $post_item_id |
@@ -4052,7 +4052,7 @@ discard block |
||
| 4052 | 4052 | if (null !== $post_item_id && empty($post_item_id) === false) { |
| 4053 | 4053 | $dataItem = DB::queryfirstrow( |
| 4054 | 4054 | 'SELECT perso, anyone_can_modify |
| 4055 | - FROM ' . prefixTable('items') . ' |
|
| 4055 | + FROM ' . prefixTable('items').' |
|
| 4056 | 4056 | WHERE id=%i', |
| 4057 | 4057 | $post_item_id |
| 4058 | 4058 | ); |
@@ -4089,7 +4089,7 @@ discard block |
||
| 4089 | 4089 | */ |
| 4090 | 4090 | |
| 4091 | 4091 | // Lock Item (if already locked), go back and warn |
| 4092 | - $dataTmp = DB::queryFirstRow('SELECT timestamp, user_id FROM ' . prefixTable('items_edition') . ' WHERE item_id = %i', $post_item_id); |
|
| 4092 | + $dataTmp = DB::queryFirstRow('SELECT timestamp, user_id FROM '.prefixTable('items_edition').' WHERE item_id = %i', $post_item_id); |
|
| 4093 | 4093 | |
| 4094 | 4094 | // If token is taken for this Item and delay is passed then delete it. |
| 4095 | 4095 | if ( |
@@ -4100,7 +4100,7 @@ discard block |
||
| 4100 | 4100 | DB::delete(prefixTable('items_edition'), 'item_id = %i', $post_item_id); |
| 4101 | 4101 | //reload the previous data |
| 4102 | 4102 | $dataTmp = DB::queryFirstRow( |
| 4103 | - 'SELECT timestamp, user_id FROM ' . prefixTable('items_edition') . ' WHERE item_id = %i', |
|
| 4103 | + 'SELECT timestamp, user_id FROM '.prefixTable('items_edition').' WHERE item_id = %i', |
|
| 4104 | 4104 | $post_item_id |
| 4105 | 4105 | ); |
| 4106 | 4106 | } |
@@ -4140,7 +4140,7 @@ discard block |
||
| 4140 | 4140 | // do query on this folder |
| 4141 | 4141 | $data_this_folder = DB::queryFirstRow( |
| 4142 | 4142 | 'SELECT id, personal_folder, title |
| 4143 | - FROM ' . prefixTable('nested_tree') . ' |
|
| 4143 | + FROM ' . prefixTable('nested_tree').' |
|
| 4144 | 4144 | WHERE id = %s', |
| 4145 | 4145 | $post_groupe |
| 4146 | 4146 | ); |
@@ -4177,8 +4177,8 @@ discard block |
||
| 4177 | 4177 | $visibilite = ''; |
| 4178 | 4178 | $data = DB::queryFirstRow( |
| 4179 | 4179 | 'SELECT m.valeur, n.personal_folder |
| 4180 | - FROM ' . prefixTable('misc') . ' AS m |
|
| 4181 | - INNER JOIN ' . prefixTable('nested_tree') . ' AS n ON (m.intitule = n.id) |
|
| 4180 | + FROM ' . prefixTable('misc').' AS m |
|
| 4181 | + INNER JOIN ' . prefixTable('nested_tree').' AS n ON (m.intitule = n.id) |
|
| 4182 | 4182 | WHERE type=%s AND intitule = %s', |
| 4183 | 4183 | 'complex', |
| 4184 | 4184 | $post_groupe |
@@ -4191,8 +4191,8 @@ discard block |
||
| 4191 | 4191 | // Prepare Item actual visibility (what Users/Roles can see it) |
| 4192 | 4192 | $rows = DB::query( |
| 4193 | 4193 | 'SELECT t.title |
| 4194 | - FROM ' . prefixTable('roles_values') . ' as v |
|
| 4195 | - INNER JOIN ' . prefixTable('roles_title') . ' as t ON (v.role_id = t.id) |
|
| 4194 | + FROM ' . prefixTable('roles_values').' as v |
|
| 4195 | + INNER JOIN ' . prefixTable('roles_title').' as t ON (v.role_id = t.id) |
|
| 4196 | 4196 | WHERE v.folder_id = %i |
| 4197 | 4197 | GROUP BY title', |
| 4198 | 4198 | $post_groupe |
@@ -4201,7 +4201,7 @@ discard block |
||
| 4201 | 4201 | if (empty($visibilite)) { |
| 4202 | 4202 | $visibilite = $record['title']; |
| 4203 | 4203 | } else { |
| 4204 | - $visibilite .= ' - ' . $record['title']; |
|
| 4204 | + $visibilite .= ' - '.$record['title']; |
|
| 4205 | 4205 | } |
| 4206 | 4206 | } |
| 4207 | 4207 | } else { |
@@ -4211,14 +4211,14 @@ discard block |
||
| 4211 | 4211 | // do new query to know if current folder is pf |
| 4212 | 4212 | $data_pf = DB::queryFirstRow( |
| 4213 | 4213 | 'SELECT personal_folder |
| 4214 | - FROM ' . prefixTable('nested_tree') . ' |
|
| 4214 | + FROM ' . prefixTable('nested_tree').' |
|
| 4215 | 4215 | WHERE id = %s', |
| 4216 | 4216 | $post_groupe |
| 4217 | 4217 | ); |
| 4218 | 4218 | |
| 4219 | 4219 | $folder_is_personal = $data_pf !== null ? (int) $data_pf['personal_folder'] : 0; |
| 4220 | 4220 | |
| 4221 | - $visibilite = $_SESSION['name'] . ' ' . $_SESSION['lastname'] . ' (' . $_SESSION['login'] . ')'; |
|
| 4221 | + $visibilite = $_SESSION['name'].' '.$_SESSION['lastname'].' ('.$_SESSION['login'].')'; |
|
| 4222 | 4222 | } |
| 4223 | 4223 | |
| 4224 | 4224 | recupDroitCreationSansComplexite($post_groupe); |
@@ -4228,8 +4228,8 @@ discard block |
||
| 4228 | 4228 | $listOptionsForRoles = array(); |
| 4229 | 4229 | $rows = DB::query( |
| 4230 | 4230 | 'SELECT r.role_id AS role_id, t.title AS title |
| 4231 | - FROM ' . prefixTable('roles_values') . ' AS r |
|
| 4232 | - INNER JOIN ' . prefixTable('roles_title') . ' AS t ON (r.role_id = t.id) |
|
| 4231 | + FROM ' . prefixTable('roles_values').' AS r |
|
| 4232 | + INNER JOIN ' . prefixTable('roles_title').' AS t ON (r.role_id = t.id) |
|
| 4233 | 4233 | WHERE r.folder_id = %i', |
| 4234 | 4234 | $post_groupe |
| 4235 | 4235 | ); |
@@ -4243,7 +4243,7 @@ discard block |
||
| 4243 | 4243 | ); |
| 4244 | 4244 | $rows2 = DB::query( |
| 4245 | 4245 | 'SELECT id, login, fonction_id, email, name, lastname |
| 4246 | - FROM ' . prefixTable('users') . ' |
|
| 4246 | + FROM ' . prefixTable('users').' |
|
| 4247 | 4247 | WHERE admin = 0' |
| 4248 | 4248 | ); |
| 4249 | 4249 | foreach ($rows2 as $record2) { |
@@ -4257,7 +4257,7 @@ discard block |
||
| 4257 | 4257 | array( |
| 4258 | 4258 | 'id' => $record2['id'], |
| 4259 | 4259 | 'login' => $record2['login'], |
| 4260 | - 'name' => $record2['name'] . ' ' . $record2['lastname'], |
|
| 4260 | + 'name' => $record2['name'].' '.$record2['lastname'], |
|
| 4261 | 4261 | 'email' => $record2['email'], |
| 4262 | 4262 | ) |
| 4263 | 4263 | ); |
@@ -4274,13 +4274,13 @@ discard block |
||
| 4274 | 4274 | //db::debugmode(true); |
| 4275 | 4275 | $access = DB::queryFirstRow( |
| 4276 | 4276 | 'SELECT type |
| 4277 | - FROM ' . prefixTable('roles_values') . ' |
|
| 4277 | + FROM ' . prefixTable('roles_values').' |
|
| 4278 | 4278 | WHERE role_id = %i AND folder_id = %i', |
| 4279 | 4279 | $role, |
| 4280 | 4280 | $post_groupe |
| 4281 | 4281 | ); |
| 4282 | 4282 | //db::debugmode(false); |
| 4283 | - if (DB::count()>0) { |
|
| 4283 | + if (DB::count() > 0) { |
|
| 4284 | 4284 | if ($access['type'] === 'R') { |
| 4285 | 4285 | array_push($arrTmp, 10); |
| 4286 | 4286 | } elseif ($access['type'] === 'W') { |
@@ -4350,7 +4350,7 @@ discard block |
||
| 4350 | 4350 | // Get some info before deleting |
| 4351 | 4351 | $data = DB::queryFirstRow( |
| 4352 | 4352 | 'SELECT name, id_item, file |
| 4353 | - FROM ' . prefixTable('files') . ' |
|
| 4353 | + FROM ' . prefixTable('files').' |
|
| 4354 | 4354 | WHERE id = %i', |
| 4355 | 4355 | $fileId |
| 4356 | 4356 | ); |
@@ -4358,7 +4358,7 @@ discard block |
||
| 4358 | 4358 | // Load item data |
| 4359 | 4359 | $data_item = DB::queryFirstRow( |
| 4360 | 4360 | 'SELECT id_tree |
| 4361 | - FROM ' . prefixTable('items') . ' |
|
| 4361 | + FROM ' . prefixTable('items').' |
|
| 4362 | 4362 | WHERE id = %i', |
| 4363 | 4363 | $data['id_item'] |
| 4364 | 4364 | ); |
@@ -4385,7 +4385,7 @@ discard block |
||
| 4385 | 4385 | $_SESSION['user_id'], |
| 4386 | 4386 | 'at_modification', |
| 4387 | 4387 | $_SESSION['login'], |
| 4388 | - 'at_del_file : ' . $data['name'] |
|
| 4388 | + 'at_del_file : '.$data['name'] |
|
| 4389 | 4389 | ); |
| 4390 | 4390 | |
| 4391 | 4391 | // DElete sharekeys |
@@ -4396,7 +4396,7 @@ discard block |
||
| 4396 | 4396 | ); |
| 4397 | 4397 | |
| 4398 | 4398 | // Delete file from server |
| 4399 | - fileDelete($SETTINGS['path_to_upload_folder'] . '/' . TP_FILE_PREFIX . base64_decode($data['file']), $SETTINGS); |
|
| 4399 | + fileDelete($SETTINGS['path_to_upload_folder'].'/'.TP_FILE_PREFIX.base64_decode($data['file']), $SETTINGS); |
|
| 4400 | 4400 | } |
| 4401 | 4401 | |
| 4402 | 4402 | echo (string) prepareExchangedData( |
@@ -4415,7 +4415,7 @@ discard block |
||
| 4415 | 4415 | case 'clear_html_tags': |
| 4416 | 4416 | // Get information for this item |
| 4417 | 4417 | $dataItem = DB::queryfirstrow( |
| 4418 | - 'SELECT description FROM ' . prefixTable('items') . ' WHERE id=%i', |
|
| 4418 | + 'SELECT description FROM '.prefixTable('items').' WHERE id=%i', |
|
| 4419 | 4419 | filter_input(INPUT_POST, 'id_item', FILTER_SANITIZE_NUMBER_INT) |
| 4420 | 4420 | ); |
| 4421 | 4421 | // Clean up the string |
@@ -4453,12 +4453,12 @@ discard block |
||
| 4453 | 4453 | // Update SESSION with this new favourite |
| 4454 | 4454 | $data = DB::queryfirstrow( |
| 4455 | 4455 | 'SELECT label,id_tree |
| 4456 | - FROM ' . prefixTable('items') . ' |
|
| 4456 | + FROM ' . prefixTable('items').' |
|
| 4457 | 4457 | WHERE id = ' . mysqli_real_escape_string($link, $post_item_id) |
| 4458 | 4458 | ); |
| 4459 | 4459 | $_SESSION['favourites_tab'][$post_item_id] = array( |
| 4460 | 4460 | 'label' => $data['label'], |
| 4461 | - 'url' => 'index.php?page=items&group=' . $data['id_tree'] . '&id=' . $post_item_id, |
|
| 4461 | + 'url' => 'index.php?page=items&group='.$data['id_tree'].'&id='.$post_item_id, |
|
| 4462 | 4462 | ); |
| 4463 | 4463 | } elseif ((int) filter_input(INPUT_POST, 'action', FILTER_SANITIZE_NUMBER_INT) === 1) { |
| 4464 | 4464 | // delete from session |
@@ -4527,8 +4527,8 @@ discard block |
||
| 4527 | 4527 | // get data about item |
| 4528 | 4528 | $dataSource = DB::queryfirstrow( |
| 4529 | 4529 | 'SELECT i.pw, f.personal_folder,i.id_tree, f.title,i.label |
| 4530 | - FROM ' . prefixTable('items') . ' as i |
|
| 4531 | - INNER JOIN ' . prefixTable('nested_tree') . ' as f ON (i.id_tree=f.id) |
|
| 4530 | + FROM ' . prefixTable('items').' as i |
|
| 4531 | + INNER JOIN ' . prefixTable('nested_tree').' as f ON (i.id_tree=f.id) |
|
| 4532 | 4532 | WHERE i.id=%i', |
| 4533 | 4533 | $post_item_id |
| 4534 | 4534 | ); |
@@ -4536,7 +4536,7 @@ discard block |
||
| 4536 | 4536 | // get data about new folder |
| 4537 | 4537 | $dataDestination = DB::queryfirstrow( |
| 4538 | 4538 | 'SELECT personal_folder, title |
| 4539 | - FROM ' . prefixTable('nested_tree') . ' |
|
| 4539 | + FROM ' . prefixTable('nested_tree').' |
|
| 4540 | 4540 | WHERE id = %i', |
| 4541 | 4541 | $post_folder_id |
| 4542 | 4542 | ); |
@@ -4588,7 +4588,7 @@ discard block |
||
| 4588 | 4588 | // Get fields for this Item |
| 4589 | 4589 | $rows = DB::query( |
| 4590 | 4590 | 'SELECT id |
| 4591 | - FROM ' . prefixTable('categories_items') . ' |
|
| 4591 | + FROM ' . prefixTable('categories_items').' |
|
| 4592 | 4592 | WHERE item_id = %i', |
| 4593 | 4593 | $post_item_id |
| 4594 | 4594 | ); |
@@ -4605,7 +4605,7 @@ discard block |
||
| 4605 | 4605 | // Get FILES for this Item |
| 4606 | 4606 | $rows = DB::query( |
| 4607 | 4607 | 'SELECT id |
| 4608 | - FROM ' . prefixTable('files') . ' |
|
| 4608 | + FROM ' . prefixTable('files').' |
|
| 4609 | 4609 | WHERE id_item = %i', |
| 4610 | 4610 | $post_item_id |
| 4611 | 4611 | ); |
@@ -4650,7 +4650,7 @@ discard block |
||
| 4650 | 4650 | // Get the ITEM object key for the user |
| 4651 | 4651 | $userKey = DB::queryFirstRow( |
| 4652 | 4652 | 'SELECT share_key |
| 4653 | - FROM ' . prefixTable('sharekeys_items') . ' |
|
| 4653 | + FROM ' . prefixTable('sharekeys_items').' |
|
| 4654 | 4654 | WHERE user_id = %i AND object_id = %i', |
| 4655 | 4655 | $_SESSION['user_id'], |
| 4656 | 4656 | $post_item_id |
@@ -4661,8 +4661,8 @@ discard block |
||
| 4661 | 4661 | // This is a public object |
| 4662 | 4662 | $users = DB::query( |
| 4663 | 4663 | 'SELECT id, public_key |
| 4664 | - FROM ' . prefixTable('users') . ' |
|
| 4665 | - WHERE id NOT IN ("' . OTV_USER_ID . '","' . SSH_USER_ID . '","' . API_USER_ID . '","' . $_SESSION['user_id'] . '") |
|
| 4664 | + FROM ' . prefixTable('users').' |
|
| 4665 | + WHERE id NOT IN ("' . OTV_USER_ID.'","'.SSH_USER_ID.'","'.API_USER_ID.'","'.$_SESSION['user_id'].'") |
|
| 4666 | 4666 | AND public_key != ""' |
| 4667 | 4667 | ); |
| 4668 | 4668 | foreach ($users as $user) { |
@@ -4682,14 +4682,14 @@ discard block |
||
| 4682 | 4682 | // Get fields for this Item |
| 4683 | 4683 | $rows = DB::query( |
| 4684 | 4684 | 'SELECT id |
| 4685 | - FROM ' . prefixTable('categories_items') . ' |
|
| 4685 | + FROM ' . prefixTable('categories_items').' |
|
| 4686 | 4686 | WHERE item_id = %i', |
| 4687 | 4687 | $post_item_id |
| 4688 | 4688 | ); |
| 4689 | 4689 | foreach ($rows as $field) { |
| 4690 | 4690 | $userKey = DB::queryFirstRow( |
| 4691 | 4691 | 'SELECT share_key |
| 4692 | - FROM ' . prefixTable('sharekeys_fields') . ' |
|
| 4692 | + FROM ' . prefixTable('sharekeys_fields').' |
|
| 4693 | 4693 | WHERE user_id = %i AND object_id = %i', |
| 4694 | 4694 | $_SESSION['user_id'], |
| 4695 | 4695 | $field['id'] |
@@ -4700,8 +4700,8 @@ discard block |
||
| 4700 | 4700 | // This is a public object |
| 4701 | 4701 | $users = DB::query( |
| 4702 | 4702 | 'SELECT id, public_key |
| 4703 | - FROM ' . prefixTable('users') . ' |
|
| 4704 | - WHERE id NOT IN ("' . OTV_USER_ID . '","' . SSH_USER_ID . '","' . API_USER_ID . '","' . $_SESSION['user_id'] . '") |
|
| 4703 | + FROM ' . prefixTable('users').' |
|
| 4704 | + WHERE id NOT IN ("' . OTV_USER_ID.'","'.SSH_USER_ID.'","'.API_USER_ID.'","'.$_SESSION['user_id'].'") |
|
| 4705 | 4705 | AND public_key != ""' |
| 4706 | 4706 | ); |
| 4707 | 4707 | foreach ($users as $user) { |
@@ -4722,14 +4722,14 @@ discard block |
||
| 4722 | 4722 | // Get FILES for this Item |
| 4723 | 4723 | $rows = DB::query( |
| 4724 | 4724 | 'SELECT id |
| 4725 | - FROM ' . prefixTable('files') . ' |
|
| 4725 | + FROM ' . prefixTable('files').' |
|
| 4726 | 4726 | WHERE id_item = %i', |
| 4727 | 4727 | $post_item_id |
| 4728 | 4728 | ); |
| 4729 | 4729 | foreach ($rows as $attachment) { |
| 4730 | 4730 | $userKey = DB::queryFirstRow( |
| 4731 | 4731 | 'SELECT share_key |
| 4732 | - FROM ' . prefixTable('sharekeys_files') . ' |
|
| 4732 | + FROM ' . prefixTable('sharekeys_files').' |
|
| 4733 | 4733 | WHERE user_id = %i AND object_id = %i', |
| 4734 | 4734 | $_SESSION['user_id'], |
| 4735 | 4735 | $attachment['id'] |
@@ -4740,8 +4740,8 @@ discard block |
||
| 4740 | 4740 | // This is a public object |
| 4741 | 4741 | $users = DB::query( |
| 4742 | 4742 | 'SELECT id, public_key |
| 4743 | - FROM ' . prefixTable('users') . ' |
|
| 4744 | - WHERE id NOT IN ("' . OTV_USER_ID . '","' . SSH_USER_ID . '","' . API_USER_ID . '","' . $_SESSION['user_id'] . '") |
|
| 4743 | + FROM ' . prefixTable('users').' |
|
| 4744 | + WHERE id NOT IN ("' . OTV_USER_ID.'","'.SSH_USER_ID.'","'.API_USER_ID.'","'.$_SESSION['user_id'].'") |
|
| 4745 | 4745 | AND public_key != ""' |
| 4746 | 4746 | ); |
| 4747 | 4747 | foreach ($users as $user) { |
@@ -4778,7 +4778,7 @@ discard block |
||
| 4778 | 4778 | $_SESSION['user_id'], |
| 4779 | 4779 | 'at_modification', |
| 4780 | 4780 | $_SESSION['login'], |
| 4781 | - 'at_moved : ' . $dataSource['title'] . ' -> ' . $dataDestination['title'] |
|
| 4781 | + 'at_moved : '.$dataSource['title'].' -> '.$dataDestination['title'] |
|
| 4782 | 4782 | ); |
| 4783 | 4783 | |
| 4784 | 4784 | $returnValues = array( |
@@ -4831,8 +4831,8 @@ discard block |
||
| 4831 | 4831 | // get data about item |
| 4832 | 4832 | $dataSource = DB::queryfirstrow( |
| 4833 | 4833 | 'SELECT i.pw, f.personal_folder,i.id_tree, f.title,i.label |
| 4834 | - FROM ' . prefixTable('items') . ' as i |
|
| 4835 | - INNER JOIN ' . prefixTable('nested_tree') . ' as f ON (i.id_tree=f.id) |
|
| 4834 | + FROM ' . prefixTable('items').' as i |
|
| 4835 | + INNER JOIN ' . prefixTable('nested_tree').' as f ON (i.id_tree=f.id) |
|
| 4836 | 4836 | WHERE i.id=%i', |
| 4837 | 4837 | $item_id |
| 4838 | 4838 | ); |
@@ -4854,7 +4854,7 @@ discard block |
||
| 4854 | 4854 | |
| 4855 | 4855 | // get data about new folder |
| 4856 | 4856 | $dataDestination = DB::queryfirstrow( |
| 4857 | - 'SELECT personal_folder, title FROM ' . prefixTable('nested_tree') . ' WHERE id = %i', |
|
| 4857 | + 'SELECT personal_folder, title FROM '.prefixTable('nested_tree').' WHERE id = %i', |
|
| 4858 | 4858 | $post_folder_id |
| 4859 | 4859 | ); |
| 4860 | 4860 | |
@@ -4895,7 +4895,7 @@ discard block |
||
| 4895 | 4895 | // Get fields for this Item |
| 4896 | 4896 | $rows = DB::query( |
| 4897 | 4897 | 'SELECT id |
| 4898 | - FROM ' . prefixTable('categories_items') . ' |
|
| 4898 | + FROM ' . prefixTable('categories_items').' |
|
| 4899 | 4899 | WHERE item_id = %i', |
| 4900 | 4900 | $item_id |
| 4901 | 4901 | ); |
@@ -4912,7 +4912,7 @@ discard block |
||
| 4912 | 4912 | // Get FILES for this Item |
| 4913 | 4913 | $rows = DB::query( |
| 4914 | 4914 | 'SELECT id |
| 4915 | - FROM ' . prefixTable('files') . ' |
|
| 4915 | + FROM ' . prefixTable('files').' |
|
| 4916 | 4916 | WHERE id_item = %i', |
| 4917 | 4917 | $item_id |
| 4918 | 4918 | ); |
@@ -4965,7 +4965,7 @@ discard block |
||
| 4965 | 4965 | // Get the ITEM object key for the user |
| 4966 | 4966 | $userKey = DB::queryFirstRow( |
| 4967 | 4967 | 'SELECT share_key |
| 4968 | - FROM ' . prefixTable('sharekeys_items') . ' |
|
| 4968 | + FROM ' . prefixTable('sharekeys_items').' |
|
| 4969 | 4969 | WHERE user_id = %i AND object_id = %i', |
| 4970 | 4970 | $_SESSION['user_id'], |
| 4971 | 4971 | $item_id |
@@ -4976,8 +4976,8 @@ discard block |
||
| 4976 | 4976 | // This is a public object |
| 4977 | 4977 | $users = DB::query( |
| 4978 | 4978 | 'SELECT id, public_key |
| 4979 | - FROM ' . prefixTable('users') . ' |
|
| 4980 | - WHERE id NOT IN ("' . OTV_USER_ID . '","' . SSH_USER_ID . '","' . API_USER_ID . '","' . $_SESSION['user_id'] . '") |
|
| 4979 | + FROM ' . prefixTable('users').' |
|
| 4980 | + WHERE id NOT IN ("' . OTV_USER_ID.'","'.SSH_USER_ID.'","'.API_USER_ID.'","'.$_SESSION['user_id'].'") |
|
| 4981 | 4981 | AND public_key != ""' |
| 4982 | 4982 | ); |
| 4983 | 4983 | foreach ($users as $user) { |
@@ -4997,14 +4997,14 @@ discard block |
||
| 4997 | 4997 | // Get fields for this Item |
| 4998 | 4998 | $rows = DB::query( |
| 4999 | 4999 | 'SELECT id |
| 5000 | - FROM ' . prefixTable('categories_items') . ' |
|
| 5000 | + FROM ' . prefixTable('categories_items').' |
|
| 5001 | 5001 | WHERE item_id = %i', |
| 5002 | 5002 | $item_id |
| 5003 | 5003 | ); |
| 5004 | 5004 | foreach ($rows as $field) { |
| 5005 | 5005 | $userKey = DB::queryFirstRow( |
| 5006 | 5006 | 'SELECT share_key |
| 5007 | - FROM ' . prefixTable('sharekeys_fields') . ' |
|
| 5007 | + FROM ' . prefixTable('sharekeys_fields').' |
|
| 5008 | 5008 | WHERE user_id = %i AND object_id = %i', |
| 5009 | 5009 | $_SESSION['user_id'], |
| 5010 | 5010 | $field['id'] |
@@ -5015,8 +5015,8 @@ discard block |
||
| 5015 | 5015 | // This is a public object |
| 5016 | 5016 | $users = DB::query( |
| 5017 | 5017 | 'SELECT id, public_key |
| 5018 | - FROM ' . prefixTable('users') . ' |
|
| 5019 | - WHERE id NOT IN ("' . OTV_USER_ID . '","' . SSH_USER_ID . '","' . API_USER_ID . '","' . $_SESSION['user_id'] . '") |
|
| 5018 | + FROM ' . prefixTable('users').' |
|
| 5019 | + WHERE id NOT IN ("' . OTV_USER_ID.'","'.SSH_USER_ID.'","'.API_USER_ID.'","'.$_SESSION['user_id'].'") |
|
| 5020 | 5020 | AND public_key != ""' |
| 5021 | 5021 | ); |
| 5022 | 5022 | foreach ($users as $user) { |
@@ -5037,14 +5037,14 @@ discard block |
||
| 5037 | 5037 | // Get FILES for this Item |
| 5038 | 5038 | $rows = DB::query( |
| 5039 | 5039 | 'SELECT id |
| 5040 | - FROM ' . prefixTable('files') . ' |
|
| 5040 | + FROM ' . prefixTable('files').' |
|
| 5041 | 5041 | WHERE id_item = %i', |
| 5042 | 5042 | $item_id |
| 5043 | 5043 | ); |
| 5044 | 5044 | foreach ($rows as $attachment) { |
| 5045 | 5045 | $userKey = DB::queryFirstRow( |
| 5046 | 5046 | 'SELECT share_key |
| 5047 | - FROM ' . prefixTable('sharekeys_files') . ' |
|
| 5047 | + FROM ' . prefixTable('sharekeys_files').' |
|
| 5048 | 5048 | WHERE user_id = %i AND object_id = %i', |
| 5049 | 5049 | $_SESSION['user_id'], |
| 5050 | 5050 | $attachment['id'] |
@@ -5055,8 +5055,8 @@ discard block |
||
| 5055 | 5055 | // This is a public object |
| 5056 | 5056 | $users = DB::query( |
| 5057 | 5057 | 'SELECT id, public_key |
| 5058 | - FROM ' . prefixTable('users') . ' |
|
| 5059 | - WHERE id NOT IN ("' . OTV_USER_ID . '","' . SSH_USER_ID . '","' . API_USER_ID . '","' . $_SESSION['user_id'] . '") |
|
| 5058 | + FROM ' . prefixTable('users').' |
|
| 5059 | + WHERE id NOT IN ("' . OTV_USER_ID.'","'.SSH_USER_ID.'","'.API_USER_ID.'","'.$_SESSION['user_id'].'") |
|
| 5060 | 5060 | AND public_key != ""' |
| 5061 | 5061 | ); |
| 5062 | 5062 | foreach ($users as $user) { |
@@ -5092,13 +5092,13 @@ discard block |
||
| 5092 | 5092 | $_SESSION['user_id'], |
| 5093 | 5093 | 'at_modification', |
| 5094 | 5094 | $_SESSION['login'], |
| 5095 | - 'at_moved : ' . $dataSource['title'] . ' -> ' . $dataDestination['title'] |
|
| 5095 | + 'at_moved : '.$dataSource['title'].' -> '.$dataDestination['title'] |
|
| 5096 | 5096 | ); |
| 5097 | 5097 | } |
| 5098 | 5098 | } |
| 5099 | 5099 | |
| 5100 | 5100 | // reload cache table |
| 5101 | - require_once $SETTINGS['cpassman_dir'] . '/sources/main.functions.php'; |
|
| 5101 | + require_once $SETTINGS['cpassman_dir'].'/sources/main.functions.php'; |
|
| 5102 | 5102 | updateCacheTable('reload', $SETTINGS, null); |
| 5103 | 5103 | |
| 5104 | 5104 | echo (string) prepareExchangedData( |
@@ -5162,7 +5162,7 @@ discard block |
||
| 5162 | 5162 | // get info |
| 5163 | 5163 | $dataSource = DB::queryfirstrow( |
| 5164 | 5164 | 'SELECT label, id_tree |
| 5165 | - FROM ' . prefixTable('items') . ' |
|
| 5165 | + FROM ' . prefixTable('items').' |
|
| 5166 | 5166 | WHERE id=%i', |
| 5167 | 5167 | $item_id |
| 5168 | 5168 | ); |
@@ -5262,8 +5262,8 @@ discard block |
||
| 5262 | 5262 | $content = explode(',', filter_input(INPUT_POST, 'content', FILTER_SANITIZE_STRING)); |
| 5263 | 5263 | } |
| 5264 | 5264 | // Variables |
| 5265 | - $dataAuthor = DB::queryfirstrow('SELECT email,login FROM ' . prefixTable('users') . ' WHERE id= ' . $content[1]); |
|
| 5266 | - $dataItem = DB::queryfirstrow('SELECT label, id_tree FROM ' . prefixTable('items') . ' WHERE id= ' . $content[0]); |
|
| 5265 | + $dataAuthor = DB::queryfirstrow('SELECT email,login FROM '.prefixTable('users').' WHERE id= '.$content[1]); |
|
| 5266 | + $dataItem = DB::queryfirstrow('SELECT label, id_tree FROM '.prefixTable('items').' WHERE id= '.$content[0]); |
|
| 5267 | 5267 | |
| 5268 | 5268 | // Get path |
| 5269 | 5269 | $path = geItemReadablePath( |
@@ -5277,7 +5277,7 @@ discard block |
||
| 5277 | 5277 | langHdl('email_request_access_subject'), |
| 5278 | 5278 | str_replace( |
| 5279 | 5279 | array('#tp_item_author#', '#tp_user#', '#tp_item#'), |
| 5280 | - array(' ' . addslashes($dataAuthor['login']), addslashes($_SESSION['login']), $path), |
|
| 5280 | + array(' '.addslashes($dataAuthor['login']), addslashes($_SESSION['login']), $path), |
|
| 5281 | 5281 | langHdl('email_request_access_mail') |
| 5282 | 5282 | ), |
| 5283 | 5283 | $dataAuthor['email'], |
@@ -5288,7 +5288,7 @@ discard block |
||
| 5288 | 5288 | } elseif ($post_cat === 'share_this_item') { |
| 5289 | 5289 | $dataItem = DB::queryfirstrow( |
| 5290 | 5290 | 'SELECT label,id_tree |
| 5291 | - FROM ' . prefixTable('items') . ' |
|
| 5291 | + FROM ' . prefixTable('items').' |
|
| 5292 | 5292 | WHERE id= %i', |
| 5293 | 5293 | $post_id |
| 5294 | 5294 | ); |
@@ -5312,7 +5312,7 @@ discard block |
||
| 5312 | 5312 | ), |
| 5313 | 5313 | array( |
| 5314 | 5314 | empty($SETTINGS['email_server_url']) === false ? |
| 5315 | - $SETTINGS['email_server_url'] . '/index.php?page=items&group=' . $dataItem['id_tree'] . '&id=' . $post_id : $SETTINGS['cpassman_url'] . '/index.php?page=items&group=' . $dataItem['id_tree'] . '&id=' . $post_id, |
|
| 5315 | + $SETTINGS['email_server_url'].'/index.php?page=items&group='.$dataItem['id_tree'].'&id='.$post_id : $SETTINGS['cpassman_url'].'/index.php?page=items&group='.$dataItem['id_tree'].'&id='.$post_id, |
|
| 5316 | 5316 | addslashes($_SESSION['login']), |
| 5317 | 5317 | addslashes($path), |
| 5318 | 5318 | ), |
@@ -5347,7 +5347,7 @@ discard block |
||
| 5347 | 5347 | if (filter_input(INPUT_POST, 'notify_type', FILTER_SANITIZE_STRING) === 'on_show') { |
| 5348 | 5348 | // Check if values already exist |
| 5349 | 5349 | $data = DB::queryfirstrow( |
| 5350 | - 'SELECT notification FROM ' . prefixTable('items') . ' WHERE id = %i', |
|
| 5350 | + 'SELECT notification FROM '.prefixTable('items').' WHERE id = %i', |
|
| 5351 | 5351 | $post_item_id |
| 5352 | 5352 | ); |
| 5353 | 5353 | $notifiedUsers = explode(';', $data['notification']); |
@@ -5358,8 +5358,8 @@ discard block |
||
| 5358 | 5358 | prefixTable('items'), |
| 5359 | 5359 | array( |
| 5360 | 5360 | 'notification' => empty($data['notification']) ? |
| 5361 | - filter_input(INPUT_POST, 'user_id', FILTER_SANITIZE_NUMBER_INT) . ';' |
|
| 5362 | - : $data['notification'] . filter_input(INPUT_POST, 'user_id', FILTER_SANITIZE_NUMBER_INT), |
|
| 5361 | + filter_input(INPUT_POST, 'user_id', FILTER_SANITIZE_NUMBER_INT).';' |
|
| 5362 | + : $data['notification'].filter_input(INPUT_POST, 'user_id', FILTER_SANITIZE_NUMBER_INT), |
|
| 5363 | 5363 | ), |
| 5364 | 5364 | 'id=%i', |
| 5365 | 5365 | $post_item_id |
@@ -5375,7 +5375,7 @@ discard block |
||
| 5375 | 5375 | array( |
| 5376 | 5376 | 'notification' => empty($data['notification']) ? |
| 5377 | 5377 | filter_input(INPUT_POST, 'user_id', FILTER_SANITIZE_NUMBER_INT) |
| 5378 | - : $data['notification'] . ';' . filter_input(INPUT_POST, 'user_id', FILTER_SANITIZE_NUMBER_INT), |
|
| 5378 | + : $data['notification'].';'.filter_input(INPUT_POST, 'user_id', FILTER_SANITIZE_NUMBER_INT), |
|
| 5379 | 5379 | ), |
| 5380 | 5380 | 'id=%i', |
| 5381 | 5381 | $post_item_id |
@@ -5400,8 +5400,8 @@ discard block |
||
| 5400 | 5400 | // Get all informations for this item |
| 5401 | 5401 | $dataItem = DB::queryfirstrow( |
| 5402 | 5402 | 'SELECT * |
| 5403 | - FROM ' . prefixTable('items') . ' as i |
|
| 5404 | - INNER JOIN ' . prefixTable('log_items') . ' as l ON (l.id_item = i.id) |
|
| 5403 | + FROM ' . prefixTable('items').' as i |
|
| 5404 | + INNER JOIN ' . prefixTable('log_items').' as l ON (l.id_item = i.id) |
|
| 5405 | 5405 | WHERE i.id=%i AND l.action = %s', |
| 5406 | 5406 | $dataReceived['item_id'], |
| 5407 | 5407 | 'at_creation' |
@@ -5432,14 +5432,14 @@ discard block |
||
| 5432 | 5432 | ); |
| 5433 | 5433 | // Prepare new line |
| 5434 | 5434 | $data = DB::queryfirstrow( |
| 5435 | - 'SELECT * FROM ' . prefixTable('log_items') . ' WHERE id_item = %i ORDER BY date DESC', |
|
| 5435 | + 'SELECT * FROM '.prefixTable('log_items').' WHERE id_item = %i ORDER BY date DESC', |
|
| 5436 | 5436 | $dataReceived['item_id'] |
| 5437 | 5437 | ); |
| 5438 | - $historic = date($SETTINGS['date_format'] . ' ' . $SETTINGS['time_format'], $data['date']) . ' - ' . $_SESSION['login'] . ' - ' . langHdl($data['action']) . ' - ' . $data['raison']; |
|
| 5438 | + $historic = date($SETTINGS['date_format'].' '.$SETTINGS['time_format'], $data['date']).' - '.$_SESSION['login'].' - '.langHdl($data['action']).' - '.$data['raison']; |
|
| 5439 | 5439 | // send back |
| 5440 | 5440 | $data = array( |
| 5441 | 5441 | 'error' => '', |
| 5442 | - 'new_line' => '<br>' . addslashes($historic), |
|
| 5442 | + 'new_line' => '<br>'.addslashes($historic), |
|
| 5443 | 5443 | ); |
| 5444 | 5444 | echo (string) prepareExchangedData($data, 'encode'); |
| 5445 | 5445 | } else { |
@@ -5473,7 +5473,7 @@ discard block |
||
| 5473 | 5473 | */ |
| 5474 | 5474 | case 'is_item_changed': |
| 5475 | 5475 | $data = DB::queryFirstRow( |
| 5476 | - 'SELECT date FROM ' . prefixTable('log_items') . ' WHERE action = %s AND id_item = %i ORDER BY date DESC', |
|
| 5476 | + 'SELECT date FROM '.prefixTable('log_items').' WHERE action = %s AND id_item = %i ORDER BY date DESC', |
|
| 5477 | 5477 | 'at_modification', |
| 5478 | 5478 | $post_item_id |
| 5479 | 5479 | ); |
@@ -5497,7 +5497,7 @@ discard block |
||
| 5497 | 5497 | } |
| 5498 | 5498 | |
| 5499 | 5499 | // delete all existing old otv codes |
| 5500 | - $rows = DB::query('SELECT id FROM ' . prefixTable('otv') . ' WHERE timestamp < ' . (time() - $SETTINGS['otv_expiration_period'] * 86400)); |
|
| 5500 | + $rows = DB::query('SELECT id FROM '.prefixTable('otv').' WHERE timestamp < '.(time() - $SETTINGS['otv_expiration_period'] * 86400)); |
|
| 5501 | 5501 | foreach ($rows as $record) { |
| 5502 | 5502 | DB::delete(prefixTable('otv'), 'id=%i', $record['id']); |
| 5503 | 5503 | } |
@@ -5519,8 +5519,8 @@ discard block |
||
| 5519 | 5519 | // Should we log a password change? |
| 5520 | 5520 | $itemQ = DB::queryFirstRow( |
| 5521 | 5521 | 'SELECT s.share_key, i.pw |
| 5522 | - FROM ' . prefixTable('items') . ' AS i |
|
| 5523 | - INNER JOIN ' . prefixTable('sharekeys_items') . ' AS s ON (i.id = s.object_id) |
|
| 5522 | + FROM ' . prefixTable('items').' AS i |
|
| 5523 | + INNER JOIN ' . prefixTable('sharekeys_items').' AS s ON (i.id = s.object_id) |
|
| 5524 | 5524 | WHERE s.user_id = %i AND s.object_id = %i', |
| 5525 | 5525 | $_SESSION['user_id'], |
| 5526 | 5526 | $post_id |
@@ -5570,7 +5570,7 @@ discard block |
||
| 5570 | 5570 | if (isset($SETTINGS['otv_expiration_period']) === false) { |
| 5571 | 5571 | $SETTINGS['otv_expiration_period'] = 7; |
| 5572 | 5572 | } |
| 5573 | - $url = $SETTINGS['cpassman_url'] . '/index.php?otv=true&' . http_build_query($otv_session); |
|
| 5573 | + $url = $SETTINGS['cpassman_url'].'/index.php?otv=true&'.http_build_query($otv_session); |
|
| 5574 | 5574 | //$exp_date = date($SETTINGS['date_format'] . ' ' . $SETTINGS['time_format'], time() + (intval($SETTINGS['otv_expiration_period']) * 86400)); |
| 5575 | 5575 | |
| 5576 | 5576 | echo json_encode( |
@@ -5608,8 +5608,8 @@ discard block |
||
| 5608 | 5608 | 'SELECT f.id AS id, f.file AS file, f.name AS name, f.status AS status, |
| 5609 | 5609 | f.extension AS extension, f.type AS type, |
| 5610 | 5610 | s.share_key AS share_key |
| 5611 | - FROM ' . prefixTable('files') . ' AS f |
|
| 5612 | - INNER JOIN ' . prefixTable('sharekeys_files') . ' AS s ON (f.id = s.object_id) |
|
| 5611 | + FROM ' . prefixTable('files').' AS f |
|
| 5612 | + INNER JOIN ' . prefixTable('sharekeys_files').' AS s ON (f.id = s.object_id) |
|
| 5613 | 5613 | WHERE s.user_id = %i AND s.object_id = %i', |
| 5614 | 5614 | $_SESSION['user_id'], |
| 5615 | 5615 | $post_id |
@@ -5630,7 +5630,7 @@ discard block |
||
| 5630 | 5630 | //$fileName = basename($file_info['name'], '.'.$file_info['extension']); |
| 5631 | 5631 | |
| 5632 | 5632 | // prepare image info |
| 5633 | - $post_title = basename($file_info['name'], '.' . $file_info['extension']); |
|
| 5633 | + $post_title = basename($file_info['name'], '.'.$file_info['extension']); |
|
| 5634 | 5634 | $post_title = isBase64($post_title) === true ? |
| 5635 | 5635 | base64_decode($post_title) : $post_title; |
| 5636 | 5636 | $image_code = $file_info['file']; |
@@ -5647,7 +5647,7 @@ discard block |
||
| 5647 | 5647 | echo (string) prepareExchangedData( |
| 5648 | 5648 | array( |
| 5649 | 5649 | 'error' => false, |
| 5650 | - 'filename' => $post_title . '.' . $file_info['extension'], |
|
| 5650 | + 'filename' => $post_title.'.'.$file_info['extension'], |
|
| 5651 | 5651 | 'file_type' => $file_info['type'], |
| 5652 | 5652 | 'file_content' => $fileContent, |
| 5653 | 5653 | ), |
@@ -5668,11 +5668,11 @@ discard block |
||
| 5668 | 5668 | |
| 5669 | 5669 | // get file info |
| 5670 | 5670 | $result = DB::queryfirstrow( |
| 5671 | - 'SELECT file FROM ' . prefixTable('files') . ' WHERE id=%i', |
|
| 5671 | + 'SELECT file FROM '.prefixTable('files').' WHERE id=%i', |
|
| 5672 | 5672 | intval(substr(filter_input(INPUT_POST, 'uri', FILTER_SANITIZE_STRING), 1)) |
| 5673 | 5673 | ); |
| 5674 | 5674 | |
| 5675 | - fileDelete($SETTINGS['path_to_upload_folder'] . '/' . $result['file'] . filter_input(INPUT_POST, 'file_suffix', FILTER_SANITIZE_STRING), $SETTINGS); |
|
| 5675 | + fileDelete($SETTINGS['path_to_upload_folder'].'/'.$result['file'].filter_input(INPUT_POST, 'file_suffix', FILTER_SANITIZE_STRING), $SETTINGS); |
|
| 5676 | 5676 | |
| 5677 | 5677 | break; |
| 5678 | 5678 | |
@@ -5695,16 +5695,16 @@ discard block |
||
| 5695 | 5695 | $idFolder = $dataReceived['idFolder']; |
| 5696 | 5696 | |
| 5697 | 5697 | // don't check if Personal Folder |
| 5698 | - $data = DB::queryFirstRow('SELECT title FROM ' . prefixTable('nested_tree') . ' WHERE id = %i', $idFolder); |
|
| 5698 | + $data = DB::queryFirstRow('SELECT title FROM '.prefixTable('nested_tree').' WHERE id = %i', $idFolder); |
|
| 5699 | 5699 | if ($data['title'] === $_SESSION['user_id']) { |
| 5700 | 5700 | // send data |
| 5701 | - echo '[{"duplicate" : "' . $duplicate . '" , error" : ""}]'; |
|
| 5701 | + echo '[{"duplicate" : "'.$duplicate.'" , error" : ""}]'; |
|
| 5702 | 5702 | } else { |
| 5703 | 5703 | if (filter_input(INPUT_POST, 'option', FILTER_SANITIZE_STRING) === 'same_folder') { |
| 5704 | 5704 | // case unique folder |
| 5705 | 5705 | DB::query( |
| 5706 | 5706 | 'SELECT label |
| 5707 | - FROM ' . prefixTable('items') . ' |
|
| 5707 | + FROM ' . prefixTable('items').' |
|
| 5708 | 5708 | WHERE id_tree = %i AND label = %s', |
| 5709 | 5709 | $idFolder, |
| 5710 | 5710 | $label |
@@ -5716,7 +5716,7 @@ discard block |
||
| 5716 | 5716 | $arrayPf = array(); |
| 5717 | 5717 | if (empty($row['id']) === false) { |
| 5718 | 5718 | $rows = DB::query( |
| 5719 | - 'SELECT id FROM ' . prefixTable('nested_tree') . ' WHERE personal_folder = %i', |
|
| 5719 | + 'SELECT id FROM '.prefixTable('nested_tree').' WHERE personal_folder = %i', |
|
| 5720 | 5720 | '1' |
| 5721 | 5721 | ); |
| 5722 | 5722 | foreach ($rows as $record) { |
@@ -5731,12 +5731,12 @@ discard block |
||
| 5731 | 5731 | $where->add('id_tree = %i', $idFolder); |
| 5732 | 5732 | $where->add('label = %s', $label); |
| 5733 | 5733 | if (empty($arrayPf) === false) { |
| 5734 | - $where->add('id_tree NOT IN (' . implode(',', $arrayPf) . ')'); |
|
| 5734 | + $where->add('id_tree NOT IN ('.implode(',', $arrayPf).')'); |
|
| 5735 | 5735 | } |
| 5736 | 5736 | |
| 5737 | 5737 | DB::query( |
| 5738 | 5738 | 'SELECT label |
| 5739 | - FROM ' . prefixTable('items') . ' |
|
| 5739 | + FROM ' . prefixTable('items').' |
|
| 5740 | 5740 | WHERE %l', |
| 5741 | 5741 | $where |
| 5742 | 5742 | ); |
@@ -5748,7 +5748,7 @@ discard block |
||
| 5748 | 5748 | } |
| 5749 | 5749 | |
| 5750 | 5750 | // send data |
| 5751 | - echo '[{"duplicate" : "' . $duplicate . '" , "error" : ""}]'; |
|
| 5751 | + echo '[{"duplicate" : "'.$duplicate.'" , "error" : ""}]'; |
|
| 5752 | 5752 | } |
| 5753 | 5753 | break; |
| 5754 | 5754 | |
@@ -5805,7 +5805,7 @@ discard block |
||
| 5805 | 5805 | } |
| 5806 | 5806 | |
| 5807 | 5807 | //Build tree |
| 5808 | - $tree = new SplClassLoader('Tree\NestedTree', $SETTINGS['cpassman_dir'] . '/includes/libraries'); |
|
| 5808 | + $tree = new SplClassLoader('Tree\NestedTree', $SETTINGS['cpassman_dir'].'/includes/libraries'); |
|
| 5809 | 5809 | $tree->register(); |
| 5810 | 5810 | $tree = new Tree\NestedTree\NestedTree(prefixTable('nested_tree'), 'id', 'parent_id', 'title'); |
| 5811 | 5811 | $tree->rebuild(); |
@@ -5856,7 +5856,7 @@ discard block |
||
| 5856 | 5856 | if (empty($arr_data['folders'][$inc]['path']) === true) { |
| 5857 | 5857 | $arr_data['folders'][$inc]['path'] = htmlspecialchars(stripslashes(htmlspecialchars_decode($elem->title, ENT_QUOTES)), ENT_QUOTES); |
| 5858 | 5858 | } else { |
| 5859 | - $arr_data['folders'][$inc]['path'] .= ' / ' . htmlspecialchars(stripslashes(htmlspecialchars_decode($elem->title, ENT_QUOTES)), ENT_QUOTES); |
|
| 5859 | + $arr_data['folders'][$inc]['path'] .= ' / '.htmlspecialchars(stripslashes(htmlspecialchars_decode($elem->title, ENT_QUOTES)), ENT_QUOTES); |
|
| 5860 | 5860 | } |
| 5861 | 5861 | } |
| 5862 | 5862 | |
@@ -5922,8 +5922,8 @@ discard block |
||
| 5922 | 5922 | $rows_tmp = DB::query( |
| 5923 | 5923 | 'SELECT c.id, c.title, c.level, c.type, c.masked, c.order, c.encrypted_data, c.role_visibility, c.is_mandatory, |
| 5924 | 5924 | f.id_category AS category_id |
| 5925 | - FROM ' . prefixTable('categories_folders') . ' AS f |
|
| 5926 | - INNER JOIN ' . prefixTable('categories') . ' AS c ON (f.id_category = c.parent_id) |
|
| 5925 | + FROM ' . prefixTable('categories_folders').' AS f |
|
| 5926 | + INNER JOIN ' . prefixTable('categories').' AS c ON (f.id_category = c.parent_id) |
|
| 5927 | 5927 | WHERE id_folder=%i', |
| 5928 | 5928 | $folder |
| 5929 | 5929 | ); |
@@ -5950,7 +5950,7 @@ discard block |
||
| 5950 | 5950 | $valTemp = ''; |
| 5951 | 5951 | $data = DB::queryFirstRow( |
| 5952 | 5952 | 'SELECT valeur |
| 5953 | - FROM ' . prefixTable('misc') . ' |
|
| 5953 | + FROM ' . prefixTable('misc').' |
|
| 5954 | 5954 | WHERE type = %s AND intitule=%i', |
| 5955 | 5955 | 'complex', |
| 5956 | 5956 | $folder |
@@ -5967,14 +5967,14 @@ discard block |
||
| 5967 | 5967 | $valTemp = ''; |
| 5968 | 5968 | $rows_tmp = DB::query( |
| 5969 | 5969 | 'SELECT t.title |
| 5970 | - FROM ' . prefixTable('roles_values') . ' as v |
|
| 5971 | - INNER JOIN ' . prefixTable('roles_title') . ' as t ON (v.role_id = t.id) |
|
| 5970 | + FROM ' . prefixTable('roles_values').' as v |
|
| 5971 | + INNER JOIN ' . prefixTable('roles_title').' as t ON (v.role_id = t.id) |
|
| 5972 | 5972 | WHERE v.folder_id = %i |
| 5973 | 5973 | GROUP BY title', |
| 5974 | 5974 | $folder |
| 5975 | 5975 | ); |
| 5976 | 5976 | foreach ($rows_tmp as $record) { |
| 5977 | - $valTemp .= (empty($valTemp) === true ? '' : ' - ') . $record['title']; |
|
| 5977 | + $valTemp .= (empty($valTemp) === true ? '' : ' - ').$record['title']; |
|
| 5978 | 5978 | } |
| 5979 | 5979 | $arr_data[$folder]['visibilityRoles'] = $valTemp; |
| 5980 | 5980 | } |
@@ -6002,7 +6002,7 @@ discard block |
||
| 6002 | 6002 | // get item info |
| 6003 | 6003 | $dataItem = DB::queryFirstRow( |
| 6004 | 6004 | 'SELECT * |
| 6005 | - FROM ' . prefixTable('items') . ' |
|
| 6005 | + FROM ' . prefixTable('items').' |
|
| 6006 | 6006 | WHERE id=%i', |
| 6007 | 6007 | $post_item_id |
| 6008 | 6008 | ); |
@@ -6012,8 +6012,8 @@ discard block |
||
| 6012 | 6012 | $rows = DB::query( |
| 6013 | 6013 | 'SELECT l.date as date, l.action as action, l.raison as raison, l.raison_iv AS raison_iv, |
| 6014 | 6014 | u.login as login, u.avatar_thumb as avatar_thumb, u.name as name, u.lastname as lastname |
| 6015 | - FROM ' . prefixTable('log_items') . ' as l |
|
| 6016 | - LEFT JOIN ' . prefixTable('users') . ' as u ON (l.id_user=u.id) |
|
| 6015 | + FROM ' . prefixTable('log_items').' as l |
|
| 6016 | + LEFT JOIN ' . prefixTable('users').' as u ON (l.id_user=u.id) |
|
| 6017 | 6017 | WHERE id_item=%i AND action <> %s |
| 6018 | 6018 | ORDER BY date DESC', |
| 6019 | 6019 | $post_item_id, |
@@ -6028,7 +6028,7 @@ discard block |
||
| 6028 | 6028 | |
| 6029 | 6029 | // imported via API |
| 6030 | 6030 | if (empty($record['login'])) { |
| 6031 | - $record['login'] = langHdl('imported_via_api') . ' [' . $record['raison'] . ']'; |
|
| 6031 | + $record['login'] = langHdl('imported_via_api').' ['.$record['raison'].']'; |
|
| 6032 | 6032 | } |
| 6033 | 6033 | |
| 6034 | 6034 | if ( |
@@ -6039,13 +6039,13 @@ discard block |
||
| 6039 | 6039 | ) { |
| 6040 | 6040 | // Prepare avatar |
| 6041 | 6041 | if (isset($record['avatar_thumb']) && empty($record['avatar_thumb']) === false) { |
| 6042 | - if (file_exists($SETTINGS['cpassman_dir'] . '/includes/avatars/' . $record['avatar_thumb'])) { |
|
| 6043 | - $avatar = $SETTINGS['cpassman_url'] . '/includes/avatars/' . $record['avatar_thumb']; |
|
| 6042 | + if (file_exists($SETTINGS['cpassman_dir'].'/includes/avatars/'.$record['avatar_thumb'])) { |
|
| 6043 | + $avatar = $SETTINGS['cpassman_url'].'/includes/avatars/'.$record['avatar_thumb']; |
|
| 6044 | 6044 | } else { |
| 6045 | - $avatar = $SETTINGS['cpassman_url'] . '/includes/images/photo.jpg'; |
|
| 6045 | + $avatar = $SETTINGS['cpassman_url'].'/includes/images/photo.jpg'; |
|
| 6046 | 6046 | } |
| 6047 | 6047 | } else { |
| 6048 | - $avatar = $SETTINGS['cpassman_url'] . '/includes/images/photo.jpg'; |
|
| 6048 | + $avatar = $SETTINGS['cpassman_url'].'/includes/images/photo.jpg'; |
|
| 6049 | 6049 | } |
| 6050 | 6050 | |
| 6051 | 6051 | // Prepare action |
@@ -6062,19 +6062,19 @@ discard block |
||
| 6062 | 6062 | $action = langHdl($reason[0]); |
| 6063 | 6063 | if ($reason[0] === 'at_moved') { |
| 6064 | 6064 | $tmp = explode(' -> ', $reason[1]); |
| 6065 | - $detail = langHdl('from') . ' <span class="font-weight-light">' . $tmp[0] . '</span> ' . langHdl('to') . ' <span class="font-weight-light">' . $tmp[1] . ' </span>'; |
|
| 6065 | + $detail = langHdl('from').' <span class="font-weight-light">'.$tmp[0].'</span> '.langHdl('to').' <span class="font-weight-light">'.$tmp[1].' </span>'; |
|
| 6066 | 6066 | } elseif ($reason[0] === 'at_field') { |
| 6067 | 6067 | $tmp = explode(' => ', $reason[1]); |
| 6068 | 6068 | if (count($tmp) > 1) { |
| 6069 | - $detail = '<b>' . trim($tmp[0]) . '</b> | ' . langHdl('previous_value') . |
|
| 6070 | - ': <span class="font-weight-light">' . trim($tmp[1]) . '</span>'; |
|
| 6069 | + $detail = '<b>'.trim($tmp[0]).'</b> | '.langHdl('previous_value'). |
|
| 6070 | + ': <span class="font-weight-light">'.trim($tmp[1]).'</span>'; |
|
| 6071 | 6071 | } else { |
| 6072 | 6072 | $detail = trim($reason[1]); |
| 6073 | 6073 | } |
| 6074 | 6074 | } elseif (in_array($reason[0], array('at_restriction', 'at_email', 'at_login', 'at_label', 'at_url', 'at_tag')) === true) { |
| 6075 | 6075 | $tmp = explode(' => ', $reason[1]); |
| 6076 | 6076 | $detail = empty(trim($tmp[0])) === true ? |
| 6077 | - langHdl('no_previous_value') : langHdl('previous_value') . ': <span class="font-weight-light">' . $tmp[0] . ' </span>'; |
|
| 6077 | + langHdl('no_previous_value') : langHdl('previous_value').': <span class="font-weight-light">'.$tmp[0].' </span>'; |
|
| 6078 | 6078 | } elseif ($reason[0] === 'at_automatic_del') { |
| 6079 | 6079 | $detail = langHdl($reason[1]); |
| 6080 | 6080 | } elseif ($reason[0] === 'at_anyoneconmodify') { |
@@ -6083,7 +6083,7 @@ discard block |
||
| 6083 | 6083 | $tmp = explode(':', $reason[1]); |
| 6084 | 6084 | $tmp = explode('.', $tmp[0]); |
| 6085 | 6085 | $detail = isBase64($tmp[0]) === true ? |
| 6086 | - base64_decode($tmp[0]) . '.' . $tmp[1] : $tmp[0]; |
|
| 6086 | + base64_decode($tmp[0]).'.'.$tmp[1] : $tmp[0]; |
|
| 6087 | 6087 | } elseif ($reason[0] === 'at_import') { |
| 6088 | 6088 | $detail = ''; |
| 6089 | 6089 | } elseif (in_array($reason[0], array('csv', 'pdf')) === true) { |
@@ -6102,8 +6102,8 @@ discard block |
||
| 6102 | 6102 | array( |
| 6103 | 6103 | 'avatar' => $avatar, |
| 6104 | 6104 | 'login' => $record['login'], |
| 6105 | - 'name' => $record['name'] . ' ' . $record['lastname'], |
|
| 6106 | - 'date' => date($SETTINGS['date_format'] . ' ' . $SETTINGS['time_format'], (int) $record['date']), |
|
| 6105 | + 'name' => $record['name'].' '.$record['lastname'], |
|
| 6106 | + 'date' => date($SETTINGS['date_format'].' '.$SETTINGS['time_format'], (int) $record['date']), |
|
| 6107 | 6107 | 'action' => $action, |
| 6108 | 6108 | 'detail' => $detail, |
| 6109 | 6109 | ) |
@@ -6184,18 +6184,18 @@ discard block |
||
| 6184 | 6184 | |
| 6185 | 6185 | // get some info to add to the notification email |
| 6186 | 6186 | $resp_user = DB::queryfirstrow( |
| 6187 | - 'SELECT login FROM ' . prefixTable('users') . ' WHERE id = %i', |
|
| 6187 | + 'SELECT login FROM '.prefixTable('users').' WHERE id = %i', |
|
| 6188 | 6188 | $_SESSION['user_id'] |
| 6189 | 6189 | ); |
| 6190 | 6190 | $resp_folder = DB::queryfirstrow( |
| 6191 | - 'SELECT title FROM ' . prefixTable('nested_tree') . ' WHERE id = %i', |
|
| 6191 | + 'SELECT title FROM '.prefixTable('nested_tree').' WHERE id = %i', |
|
| 6192 | 6192 | $folder |
| 6193 | 6193 | ); |
| 6194 | 6194 | |
| 6195 | 6195 | // notify Managers |
| 6196 | 6196 | $rows = DB::query( |
| 6197 | 6197 | 'SELECT email |
| 6198 | - FROM ' . prefixTable('users') . ' |
|
| 6198 | + FROM ' . prefixTable('users').' |
|
| 6199 | 6199 | WHERE `gestionnaire` = %i AND `email` IS NOT NULL', |
| 6200 | 6200 | 1 |
| 6201 | 6201 | ); |
@@ -6226,14 +6226,14 @@ discard block |
||
| 6226 | 6226 | // Get list of users |
| 6227 | 6227 | $usersList = array(); |
| 6228 | 6228 | $usersString = ''; |
| 6229 | - $rows = DB::query('SELECT id,login,email FROM ' . prefixTable('users') . ' ORDER BY login ASC'); |
|
| 6229 | + $rows = DB::query('SELECT id,login,email FROM '.prefixTable('users').' ORDER BY login ASC'); |
|
| 6230 | 6230 | foreach ($rows as $record) { |
| 6231 | 6231 | $usersList[$record['login']] = array( |
| 6232 | 6232 | 'id' => $record['id'], |
| 6233 | 6233 | 'login' => $record['login'], |
| 6234 | 6234 | 'email' => $record['email'], |
| 6235 | 6235 | ); |
| 6236 | - $usersString .= $record['id'] . '#' . $record['login'] . ';'; |
|
| 6236 | + $usersString .= $record['id'].'#'.$record['login'].';'; |
|
| 6237 | 6237 | } |
| 6238 | 6238 | |
| 6239 | 6239 | $data = array( |
@@ -6267,7 +6267,7 @@ discard block |
||
| 6267 | 6267 | // Send email |
| 6268 | 6268 | $dataItem = DB::queryfirstrow( |
| 6269 | 6269 | 'SELECT label, id_tree |
| 6270 | - FROM ' . prefixTable('items') . ' |
|
| 6270 | + FROM ' . prefixTable('items').' |
|
| 6271 | 6271 | WHERE id = %i', |
| 6272 | 6272 | $post_item_id |
| 6273 | 6273 | ); |
@@ -6361,7 +6361,7 @@ discard block |
||
| 6361 | 6361 | |
| 6362 | 6362 | DB::query( |
| 6363 | 6363 | 'SELECT * |
| 6364 | - FROM ' . prefixTable('notification') . ' |
|
| 6364 | + FROM ' . prefixTable('notification').' |
|
| 6365 | 6365 | WHERE item_id = %i AND user_id = %i', |
| 6366 | 6366 | $post_item_id, |
| 6367 | 6367 | $_SESSION['user_id'] |
@@ -6427,7 +6427,7 @@ discard block |
||
| 6427 | 6427 | // And related logs |
| 6428 | 6428 | $rows = DB::query( |
| 6429 | 6429 | 'SELECT id, file AS filename |
| 6430 | - FROM ' . prefixTable('files') . ' |
|
| 6430 | + FROM ' . prefixTable('files').' |
|
| 6431 | 6431 | WHERE id_item = %i AND confirmed = %i', |
| 6432 | 6432 | $post_item_id, |
| 6433 | 6433 | 0 |
@@ -6441,12 +6441,12 @@ discard block |
||
| 6441 | 6441 | ); |
| 6442 | 6442 | |
| 6443 | 6443 | // Delete file on server |
| 6444 | - unlink($SETTINGS['path_to_upload_folder'] . '/' . TP_FILE_PREFIX . base64_decode($file['filename'])); |
|
| 6444 | + unlink($SETTINGS['path_to_upload_folder'].'/'.TP_FILE_PREFIX.base64_decode($file['filename'])); |
|
| 6445 | 6445 | |
| 6446 | 6446 | // Delete related logs |
| 6447 | 6447 | $logFile = DB::query( |
| 6448 | 6448 | 'SELECT increment_id, raison |
| 6449 | - FROM ' . prefixTable('log_items') . ' |
|
| 6449 | + FROM ' . prefixTable('log_items').' |
|
| 6450 | 6450 | WHERE id_item = %i AND id_user = %i AND action = %s AND raison LIKE "at_add_file :%"', |
| 6451 | 6451 | $post_item_id, |
| 6452 | 6452 | $_SESSION['user_id'], |
@@ -6499,7 +6499,7 @@ discard block |
||
| 6499 | 6499 | // Confirm attachments |
| 6500 | 6500 | $rows = DB::query( |
| 6501 | 6501 | 'SELECT id, file AS filename |
| 6502 | - FROM ' . prefixTable('files') . ' |
|
| 6502 | + FROM ' . prefixTable('files').' |
|
| 6503 | 6503 | WHERE id_item = %i AND confirmed = %i', |
| 6504 | 6504 | $post_item_id, |
| 6505 | 6505 | 0 |
@@ -6536,15 +6536,15 @@ discard block |
||
| 6536 | 6536 | case 'autocomplete_tags': |
| 6537 | 6537 | // Get a list off all existing TAGS |
| 6538 | 6538 | $listOfTags = ''; |
| 6539 | - $rows = DB::query('SELECT tag FROM ' . prefixTable('tags') . ' WHERE tag LIKE %ss GROUP BY tag', $get['term']); |
|
| 6539 | + $rows = DB::query('SELECT tag FROM '.prefixTable('tags').' WHERE tag LIKE %ss GROUP BY tag', $get['term']); |
|
| 6540 | 6540 | foreach ($rows as $record) { |
| 6541 | 6541 | if (empty($listOfTags)) { |
| 6542 | - $listOfTags = '"' . $record['tag'] . '"'; |
|
| 6542 | + $listOfTags = '"'.$record['tag'].'"'; |
|
| 6543 | 6543 | } else { |
| 6544 | - $listOfTags .= ', "' . $record['tag'] . '"'; |
|
| 6544 | + $listOfTags .= ', "'.$record['tag'].'"'; |
|
| 6545 | 6545 | } |
| 6546 | 6546 | } |
| 6547 | - echo '[' . $listOfTags . ']'; |
|
| 6547 | + echo '['.$listOfTags.']'; |
|
| 6548 | 6548 | break; |
| 6549 | 6549 | } |
| 6550 | 6550 | } |
@@ -6560,7 +6560,7 @@ discard block |
||
| 6560 | 6560 | { |
| 6561 | 6561 | $data = DB::queryFirstRow( |
| 6562 | 6562 | 'SELECT bloquer_creation, bloquer_modification, personal_folder |
| 6563 | - FROM ' . prefixTable('nested_tree') . ' WHERE id = %i', |
|
| 6563 | + FROM ' . prefixTable('nested_tree').' WHERE id = %i', |
|
| 6564 | 6564 | $groupe |
| 6565 | 6565 | ); |
| 6566 | 6566 | // Check if it's in a personal folder. If yes, then force complexity overhead. |
@@ -50,22 +50,22 @@ discard block |
||
| 50 | 50 | // Load AntiXSS |
| 51 | 51 | include_once '../includes/libraries/voku/helper/AntiXSS.php'; |
| 52 | 52 | $antiXss = new voku\helper\AntiXSS(); |
| 53 | - if (! headers_sent()) { //If headers not sent yet... then do php redirect |
|
| 54 | - header('Location: ' . $antiXss->xss_clean($url)); |
|
| 53 | + if (!headers_sent()) { //If headers not sent yet... then do php redirect |
|
| 54 | + header('Location: '.$antiXss->xss_clean($url)); |
|
| 55 | 55 | exit; |
| 56 | 56 | } |
| 57 | 57 | |
| 58 | 58 | //If headers are sent... do java redirect... if java disabled, do html redirect. |
| 59 | 59 | echo '<script type="text/javascript">'; |
| 60 | - echo 'window.location.href="' . $antiXss->xss_clean($url) . '";'; |
|
| 60 | + echo 'window.location.href="'.$antiXss->xss_clean($url).'";'; |
|
| 61 | 61 | echo '</script>'; |
| 62 | 62 | echo '<noscript>'; |
| 63 | - echo '<meta http-equiv="refresh" content="0;url=' . $antiXss->xss_clean($url) . '" />'; |
|
| 63 | + echo '<meta http-equiv="refresh" content="0;url='.$antiXss->xss_clean($url).'" />'; |
|
| 64 | 64 | echo '</noscript>'; |
| 65 | 65 | } |
| 66 | 66 | |
| 67 | 67 | // Include files |
| 68 | -require_once $SETTINGS['cpassman_dir'] . '/includes/libraries/protect/SuperGlobal/SuperGlobal.php'; |
|
| 68 | +require_once $SETTINGS['cpassman_dir'].'/includes/libraries/protect/SuperGlobal/SuperGlobal.php'; |
|
| 69 | 69 | $superGlobal = new protect\SuperGlobal\SuperGlobal(); |
| 70 | 70 | // Prepare GET variables |
| 71 | 71 | $server = []; |
@@ -88,7 +88,7 @@ discard block |
||
| 88 | 88 | && isset($SETTINGS['enable_sts']) === true |
| 89 | 89 | && (int) $SETTINGS['enable_sts'] === 1 |
| 90 | 90 | ) { |
| 91 | - redirect('https://' . $server['http_host'] . $server['request_uri']); |
|
| 91 | + redirect('https://'.$server['http_host'].$server['request_uri']); |
|
| 92 | 92 | } |
| 93 | 93 | |
| 94 | 94 | // Load pwComplexity |
@@ -113,11 +113,11 @@ discard block |
||
| 113 | 113 | // LOAD CPASSMAN SETTINGS |
| 114 | 114 | if ( |
| 115 | 115 | isset($SETTINGS['cpassman_dir']) === true |
| 116 | - && is_dir($SETTINGS['cpassman_dir'] . '/install') === true |
|
| 116 | + && is_dir($SETTINGS['cpassman_dir'].'/install') === true |
|
| 117 | 117 | ) { |
| 118 | 118 | // Should we delete folder INSTALL? |
| 119 | 119 | $row = DB::queryFirstRow( |
| 120 | - 'SELECT valeur FROM ' . prefixTable('misc') . ' WHERE type=%s AND intitule=%s', |
|
| 120 | + 'SELECT valeur FROM '.prefixTable('misc').' WHERE type=%s AND intitule=%s', |
|
| 121 | 121 | 'install', |
| 122 | 122 | 'clear_install_folder' |
| 123 | 123 | ); |
@@ -135,11 +135,11 @@ discard block |
||
| 135 | 135 | if ($directories !== false) { |
| 136 | 136 | $files = array_diff($directories, ['.', '..']); |
| 137 | 137 | foreach ($files as $file) { |
| 138 | - if (is_dir($dir . '/' . $file)) { |
|
| 139 | - delTree($dir . '/' . $file); |
|
| 138 | + if (is_dir($dir.'/'.$file)) { |
|
| 139 | + delTree($dir.'/'.$file); |
|
| 140 | 140 | } else { |
| 141 | 141 | try { |
| 142 | - unlink($dir . '/' . $file); |
|
| 142 | + unlink($dir.'/'.$file); |
|
| 143 | 143 | } catch (Exception $e) { |
| 144 | 144 | // do nothing... php will ignore and continue |
| 145 | 145 | } |
@@ -152,13 +152,13 @@ discard block |
||
| 152 | 152 | } |
| 153 | 153 | } |
| 154 | 154 | |
| 155 | - if (is_dir($SETTINGS['cpassman_dir'] . '/install')) { |
|
| 155 | + if (is_dir($SETTINGS['cpassman_dir'].'/install')) { |
|
| 156 | 156 | // Set the permissions on the install directory and delete |
| 157 | 157 | // is server Windows or Linux? |
| 158 | 158 | if (strtoupper(substr(PHP_OS, 0, 3)) !== 'WIN') { |
| 159 | - recursiveChmod($SETTINGS['cpassman_dir'] . '/install', 0755, 0440); |
|
| 159 | + recursiveChmod($SETTINGS['cpassman_dir'].'/install', 0755, 0440); |
|
| 160 | 160 | } |
| 161 | - delTree($SETTINGS['cpassman_dir'] . '/install'); |
|
| 161 | + delTree($SETTINGS['cpassman_dir'].'/install'); |
|
| 162 | 162 | } |
| 163 | 163 | |
| 164 | 164 | // Delete temporary install table |
@@ -176,7 +176,7 @@ discard block |
||
| 176 | 176 | // Load Languages stuff |
| 177 | 177 | if (isset($languagesList) === false) { |
| 178 | 178 | $languagesList = []; |
| 179 | - $rows = DB::query('SELECT * FROM ' . prefixTable('languages') . ' GROUP BY name, label, code, flag, id ORDER BY name ASC'); |
|
| 179 | + $rows = DB::query('SELECT * FROM '.prefixTable('languages').' GROUP BY name, label, code, flag, id ORDER BY name ASC'); |
|
| 180 | 180 | foreach ($rows as $record) { |
| 181 | 181 | array_push($languagesList, $record['name']); |
| 182 | 182 | if (isset($_SESSION['user_language']) && $record['name'] === $_SESSION['user_language']) { |
@@ -234,7 +234,7 @@ discard block |
||
| 234 | 234 | // CHECK IF SESSION EXISTS AND IF SESSION IS VALID |
| 235 | 235 | if (empty($_SESSION['sessionDuration']) === false) { |
| 236 | 236 | $dataSession = DB::queryFirstRow( |
| 237 | - 'SELECT key_tempo FROM ' . prefixTable('users') . ' WHERE id=%i', |
|
| 237 | + 'SELECT key_tempo FROM '.prefixTable('users').' WHERE id=%i', |
|
| 238 | 238 | $_SESSION['user_id'] |
| 239 | 239 | ); |
| 240 | 240 | } else { |
@@ -298,7 +298,7 @@ discard block |
||
| 298 | 298 | && (isset($_SESSION['user_admin']) === true && $_SESSION['user_admin'] === 1) |
| 299 | 299 | ) { |
| 300 | 300 | $row = DB::queryFirstRow( |
| 301 | - 'SELECT valeur FROM ' . prefixTable('misc') . ' WHERE type=%s_type AND intitule=%s_intitule', |
|
| 301 | + 'SELECT valeur FROM '.prefixTable('misc').' WHERE type=%s_type AND intitule=%s_intitule', |
|
| 302 | 302 | [ |
| 303 | 303 | 'type' => 'admin', |
| 304 | 304 | 'intitule' => 'cpassman_version', |
@@ -358,7 +358,7 @@ discard block |
||
| 358 | 358 | |
| 359 | 359 | syslog( |
| 360 | 360 | LOG_WARNING, |
| 361 | - 'Unlog user: ' . date('Y/m/d H:i:s') . " {$server['remote_addr']} ({$server['http_user_agent']})" |
|
| 361 | + 'Unlog user: '.date('Y/m/d H:i:s')." {$server['remote_addr']} ({$server['http_user_agent']})" |
|
| 362 | 362 | ); |
| 363 | 363 | // erase session table |
| 364 | 364 | $_SESSION = []; |
@@ -409,7 +409,7 @@ discard block |
||
| 409 | 409 | if (isset($_SESSION['user_id']) === true && empty($_SESSION['user_id']) === false) { |
| 410 | 410 | // query on user |
| 411 | 411 | $data = DB::queryfirstrow( |
| 412 | - 'SELECT login, admin, gestionnaire, can_manage_all_users, groupes_visibles, groupes_interdits, fonction_id, last_connexion FROM ' . prefixTable('users') . ' WHERE id=%i', |
|
| 412 | + 'SELECT login, admin, gestionnaire, can_manage_all_users, groupes_visibles, groupes_interdits, fonction_id, last_connexion FROM '.prefixTable('users').' WHERE id=%i', |
|
| 413 | 413 | $_SESSION['user_id'] |
| 414 | 414 | ); |
| 415 | 415 | //Check if user has been deleted or unlogged |
@@ -490,7 +490,7 @@ discard block |
||
| 490 | 490 | $_SESSION['item_fields'] = []; |
| 491 | 491 | $rows = DB::query( |
| 492 | 492 | 'SELECT * |
| 493 | - FROM ' . prefixTable('categories') . ' |
|
| 493 | + FROM ' . prefixTable('categories').' |
|
| 494 | 494 | WHERE level=%i', |
| 495 | 495 | '0' |
| 496 | 496 | ); |
@@ -499,7 +499,7 @@ discard block |
||
| 499 | 499 | // get each field |
| 500 | 500 | $rows2 = DB::query( |
| 501 | 501 | 'SELECT * |
| 502 | - FROM ' . prefixTable('categories') . ' |
|
| 502 | + FROM ' . prefixTable('categories').' |
|
| 503 | 503 | WHERE parent_id=%i |
| 504 | 504 | ORDER BY `order` ASC', |
| 505 | 505 | $record['id'] |
@@ -576,7 +576,7 @@ discard block |
||
| 576 | 576 | if ( |
| 577 | 577 | isset($SETTINGS['roles_allowed_to_print']) === true |
| 578 | 578 | && isset($_SESSION['user_roles']) === true |
| 579 | - && (! isset($_SESSION['temporary']['user_can_printout']) || empty($_SESSION['temporary']['user_can_printout'])) |
|
| 579 | + && (!isset($_SESSION['temporary']['user_can_printout']) || empty($_SESSION['temporary']['user_can_printout'])) |
|
| 580 | 580 | ) { |
| 581 | 581 | foreach (explode(';', $SETTINGS['roles_allowed_to_print']) as $role) { |
| 582 | 582 | if (in_array($role, $_SESSION['user_roles']) === true) { |
@@ -586,5 +586,5 @@ discard block |
||
| 586 | 586 | } |
| 587 | 587 | |
| 588 | 588 | /* CHECK NUMBER OF USER ONLINE */ |
| 589 | -DB::query('SELECT * FROM ' . prefixTable('users') . ' WHERE timestamp>=%i', time() - 600); |
|
| 589 | +DB::query('SELECT * FROM '.prefixTable('users').' WHERE timestamp>=%i', time() - 600); |
|
| 590 | 590 | $_SESSION['nb_users_online'] = DB::count(); |
@@ -46,25 +46,25 @@ discard block |
||
| 46 | 46 | } |
| 47 | 47 | |
| 48 | 48 | /* do checks */ |
| 49 | -require_once $SETTINGS['cpassman_dir'] . '/includes/config/include.php'; |
|
| 50 | -require_once $SETTINGS['cpassman_dir'] . '/sources/checks.php'; |
|
| 49 | +require_once $SETTINGS['cpassman_dir'].'/includes/config/include.php'; |
|
| 50 | +require_once $SETTINGS['cpassman_dir'].'/sources/checks.php'; |
|
| 51 | 51 | if (!checkUser($_SESSION['user_id'], $_SESSION['key'], 'options', $SETTINGS)) { |
| 52 | 52 | $_SESSION['error']['code'] = ERR_NOT_ALLOWED; //not allowed page |
| 53 | - include $SETTINGS['cpassman_dir'] . '/error.php'; |
|
| 53 | + include $SETTINGS['cpassman_dir'].'/error.php'; |
|
| 54 | 54 | exit; |
| 55 | 55 | } |
| 56 | 56 | |
| 57 | -require_once $SETTINGS['cpassman_dir'] . '/includes/language/' . $_SESSION['user_language'] . '.php'; |
|
| 58 | -require_once $SETTINGS['cpassman_dir'] . '/includes/config/settings.php'; |
|
| 59 | -require_once $SETTINGS['cpassman_dir'] . '/includes/config/tp.config.php'; |
|
| 57 | +require_once $SETTINGS['cpassman_dir'].'/includes/language/'.$_SESSION['user_language'].'.php'; |
|
| 58 | +require_once $SETTINGS['cpassman_dir'].'/includes/config/settings.php'; |
|
| 59 | +require_once $SETTINGS['cpassman_dir'].'/includes/config/tp.config.php'; |
|
| 60 | 60 | |
| 61 | 61 | header('Content-type: text/html; charset=utf-8'); |
| 62 | 62 | header('Cache-Control: no-cache, no-store, must-revalidate'); |
| 63 | 63 | |
| 64 | -require_once $SETTINGS['cpassman_dir'] . '/sources/SplClassLoader.php'; |
|
| 64 | +require_once $SETTINGS['cpassman_dir'].'/sources/SplClassLoader.php'; |
|
| 65 | 65 | |
| 66 | 66 | // connect to the server |
| 67 | -require_once $SETTINGS['cpassman_dir'] . '/includes/libraries/Database/Meekrodb/db.class.php'; |
|
| 67 | +require_once $SETTINGS['cpassman_dir'].'/includes/libraries/Database/Meekrodb/db.class.php'; |
|
| 68 | 68 | if (defined('DB_PASSWD_CLEAR') === false) { |
| 69 | 69 | define('DB_PASSWD_CLEAR', defuseReturnDecrypted(DB_PASSWD, $SETTINGS)); |
| 70 | 70 | } |
@@ -117,7 +117,7 @@ discard block |
||
| 117 | 117 | array( |
| 118 | 118 | 'http' => array( |
| 119 | 119 | 'ignore_errors' => true, |
| 120 | - 'proxy' => $SETTINGS['proxy_ip'] . ':' . $SETTINGS['proxy_port'], |
|
| 120 | + 'proxy' => $SETTINGS['proxy_ip'].':'.$SETTINGS['proxy_port'], |
|
| 121 | 121 | ), |
| 122 | 122 | ) |
| 123 | 123 | ); |
@@ -136,16 +136,16 @@ discard block |
||
| 136 | 136 | $json_array = json_decode($json, true); |
| 137 | 137 | |
| 138 | 138 | // About version |
| 139 | - $text .= '<li><u>' . $LANG['your_version'] . '</u> : ' . TP_VERSION_FULL; |
|
| 139 | + $text .= '<li><u>'.$LANG['your_version'].'</u> : '.TP_VERSION_FULL; |
|
| 140 | 140 | if (floatval(TP_VERSION_FULL) < floatval($json_array['info']['version'])) { |
| 141 | - $text .= ' <b>' . $LANG['please_update'] . '</b>'; |
|
| 141 | + $text .= ' <b>'.$LANG['please_update'].'</b>'; |
|
| 142 | 142 | } |
| 143 | 143 | $text .= '</li>'; |
| 144 | 144 | |
| 145 | 145 | // Libraries |
| 146 | 146 | $text .= '<li><u>Libraries</u> :</li>'; |
| 147 | 147 | foreach ($json_array['libraries'] as $key => $val) { |
| 148 | - $text .= "<li> <span class='fa fa-caret-right'></span> " . $key . " (<a href='" . $val . "' target='_blank'>" . $val . '</a>)</li>'; |
|
| 148 | + $text .= "<li> <span class='fa fa-caret-right'></span> ".$key." (<a href='".$val."' target='_blank'>".$val.'</a>)</li>'; |
|
| 149 | 149 | } |
| 150 | 150 | } |
| 151 | 151 | } else { |
@@ -156,7 +156,7 @@ discard block |
||
| 156 | 156 | } |
| 157 | 157 | $text .= '</ul>'; |
| 158 | 158 | |
| 159 | - echo '[{"error":"' . $error . '" , "output":"' . str_replace(array("\n", "\t", "\r"), '', $text) . '"}]'; |
|
| 159 | + echo '[{"error":"'.$error.'" , "output":"'.str_replace(array("\n", "\t", "\r"), '', $text).'"}]'; |
|
| 160 | 160 | break; |
| 161 | 161 | |
| 162 | 162 | //########################################################## |
@@ -188,7 +188,7 @@ discard block |
||
| 188 | 188 | //get through all users |
| 189 | 189 | $rows = DB::query( |
| 190 | 190 | 'SELECT id, login, email |
| 191 | - FROM ' . prefixTable('users') . ' |
|
| 191 | + FROM ' . prefixTable('users').' |
|
| 192 | 192 | ORDER BY login ASC' |
| 193 | 193 | ); |
| 194 | 194 | foreach ($rows as $record) { |
@@ -205,7 +205,7 @@ discard block |
||
| 205 | 205 | //if folder doesn't exist then create it |
| 206 | 206 | $data = DB::queryfirstrow( |
| 207 | 207 | 'SELECT id |
| 208 | - FROM ' . prefixTable('nested_tree') . ' |
|
| 208 | + FROM ' . prefixTable('nested_tree').' |
|
| 209 | 209 | WHERE title = %s AND parent_id = %i', |
| 210 | 210 | $record['id'], |
| 211 | 211 | 0 |
@@ -267,8 +267,8 @@ discard block |
||
| 267 | 267 | echo prepareExchangedData( |
| 268 | 268 | array( |
| 269 | 269 | 'error' => false, |
| 270 | - 'message' => langHdl('last_execution') . ' ' . |
|
| 271 | - date($SETTINGS['date_format'] . ' ' . $SETTINGS['time_format'], (int) time()) . |
|
| 270 | + 'message' => langHdl('last_execution').' '. |
|
| 271 | + date($SETTINGS['date_format'].' '.$SETTINGS['time_format'], (int) time()). |
|
| 272 | 272 | '<i class="fas fa-check text-success ml-2"></i>', |
| 273 | 273 | ), |
| 274 | 274 | 'encode' |
@@ -302,7 +302,7 @@ discard block |
||
| 302 | 302 | } |
| 303 | 303 | |
| 304 | 304 | //Libraries call |
| 305 | - require_once $SETTINGS['cpassman_dir'] . '/sources/main.functions.php'; |
|
| 305 | + require_once $SETTINGS['cpassman_dir'].'/sources/main.functions.php'; |
|
| 306 | 306 | |
| 307 | 307 | //init |
| 308 | 308 | $foldersIds = array(); |
@@ -316,7 +316,7 @@ discard block |
||
| 316 | 316 | } |
| 317 | 317 | } |
| 318 | 318 | |
| 319 | - $items = DB::query('SELECT id,label FROM ' . prefixTable('items') . ' WHERE id_tree NOT IN %li', $foldersIds); |
|
| 319 | + $items = DB::query('SELECT id,label FROM '.prefixTable('items').' WHERE id_tree NOT IN %li', $foldersIds); |
|
| 320 | 320 | foreach ($items as $item) { |
| 321 | 321 | //Delete item |
| 322 | 322 | DB::DELETE(prefixTable('items'), 'id = %i', $item['id']); |
@@ -337,12 +337,12 @@ discard block |
||
| 337 | 337 | // delete orphan items |
| 338 | 338 | $rows = DB::query( |
| 339 | 339 | 'SELECT id |
| 340 | - FROM ' . prefixTable('items') . ' |
|
| 340 | + FROM ' . prefixTable('items').' |
|
| 341 | 341 | ORDER BY id ASC' |
| 342 | 342 | ); |
| 343 | 343 | foreach ($rows as $item) { |
| 344 | 344 | DB::query( |
| 345 | - 'SELECT * FROM ' . prefixTable('log_items') . ' WHERE id_item = %i AND action = %s', |
|
| 345 | + 'SELECT * FROM '.prefixTable('log_items').' WHERE id_item = %i AND action = %s', |
|
| 346 | 346 | $item['id'], |
| 347 | 347 | 'at_creation' |
| 348 | 348 | ); |
@@ -372,11 +372,11 @@ discard block |
||
| 372 | 372 | echo prepareExchangedData( |
| 373 | 373 | array( |
| 374 | 374 | 'error' => false, |
| 375 | - 'message' => langHdl('last_execution') . ' ' . |
|
| 376 | - date($SETTINGS['date_format'] . ' ' . $SETTINGS['time_format'], (int) time()) . |
|
| 375 | + 'message' => langHdl('last_execution').' '. |
|
| 376 | + date($SETTINGS['date_format'].' '.$SETTINGS['time_format'], (int) time()). |
|
| 377 | 377 | '<i class="fas fa-check text-success ml-2 mr-3"></i> |
| 378 | 378 | <i class="fas fa-chevron-right mr-2"></i>' . |
| 379 | - $nbItemsDeleted . ' ' . langHdl('deleted_items'), |
|
| 379 | + $nbItemsDeleted.' '.langHdl('deleted_items'), |
|
| 380 | 380 | ), |
| 381 | 381 | 'encode' |
| 382 | 382 | ); |
@@ -408,21 +408,21 @@ discard block |
||
| 408 | 408 | break; |
| 409 | 409 | } |
| 410 | 410 | |
| 411 | - require_once $SETTINGS['cpassman_dir'] . '/sources/main.functions.php'; |
|
| 411 | + require_once $SETTINGS['cpassman_dir'].'/sources/main.functions.php'; |
|
| 412 | 412 | $return = ''; |
| 413 | 413 | |
| 414 | 414 | //Get all tables |
| 415 | 415 | $tables = array(); |
| 416 | 416 | $result = DB::query('SHOW TABLES'); |
| 417 | 417 | foreach ($result as $row) { |
| 418 | - $tables[] = $row['Tables_in_' . $database]; |
|
| 418 | + $tables[] = $row['Tables_in_'.$database]; |
|
| 419 | 419 | } |
| 420 | 420 | |
| 421 | 421 | //cycle through |
| 422 | 422 | foreach ($tables as $table) { |
| 423 | 423 | if (defined('DB_PREFIX') || substr_count($table, DB_PREFIX) > 0) { |
| 424 | 424 | // Do query |
| 425 | - $result = DB::queryRaw('SELECT * FROM ' . $table); |
|
| 425 | + $result = DB::queryRaw('SELECT * FROM '.$table); |
|
| 426 | 426 | DB::queryRaw( |
| 427 | 427 | 'SELECT * |
| 428 | 428 | FROM INFORMATION_SCHEMA.COLUMNS |
@@ -434,19 +434,19 @@ discard block |
||
| 434 | 434 | $numFields = DB::count(); |
| 435 | 435 | |
| 436 | 436 | // prepare a drop table |
| 437 | - $return .= 'DROP TABLE ' . $table . ';'; |
|
| 438 | - $row2 = DB::queryfirstrow('SHOW CREATE TABLE ' . $table); |
|
| 439 | - $return .= "\n\n" . $row2['Create Table'] . ";\n\n"; |
|
| 437 | + $return .= 'DROP TABLE '.$table.';'; |
|
| 438 | + $row2 = DB::queryfirstrow('SHOW CREATE TABLE '.$table); |
|
| 439 | + $return .= "\n\n".$row2['Create Table'].";\n\n"; |
|
| 440 | 440 | |
| 441 | 441 | //prepare all fields and datas |
| 442 | 442 | for ($i = 0; $i < $numFields; ++$i) { |
| 443 | 443 | while ($row = $result->fetch_row()) { |
| 444 | - $return .= 'INSERT INTO ' . $table . ' VALUES('; |
|
| 444 | + $return .= 'INSERT INTO '.$table.' VALUES('; |
|
| 445 | 445 | for ($j = 0; $j < $numFields; ++$j) { |
| 446 | 446 | $row[$j] = addslashes($row[$j]); |
| 447 | 447 | $row[$j] = preg_replace("/\n/", '\\n', $row[$j]); |
| 448 | 448 | if (isset($row[$j])) { |
| 449 | - $return .= '"' . $row[$j] . '"'; |
|
| 449 | + $return .= '"'.$row[$j].'"'; |
|
| 450 | 450 | } else { |
| 451 | 451 | $return .= 'NULL'; |
| 452 | 452 | } |
@@ -466,8 +466,8 @@ discard block |
||
| 466 | 466 | $token = GenerateCryptKey(20, false, true, true, false, true, $SETTINGS); |
| 467 | 467 | |
| 468 | 468 | //save file |
| 469 | - $filename = time() . '-' . $token . '.sql'; |
|
| 470 | - $handle = fopen($SETTINGS['path_to_files_folder'] . '/' . $filename, 'w+'); |
|
| 469 | + $filename = time().'-'.$token.'.sql'; |
|
| 470 | + $handle = fopen($SETTINGS['path_to_files_folder'].'/'.$filename, 'w+'); |
|
| 471 | 471 | if ($handle !== false) { |
| 472 | 472 | //write file |
| 473 | 473 | fwrite($handle, $return); |
@@ -479,17 +479,17 @@ discard block |
||
| 479 | 479 | // Encrypt the file |
| 480 | 480 | prepareFileWithDefuse( |
| 481 | 481 | 'encrypt', |
| 482 | - $SETTINGS['path_to_files_folder'] . '/' . $filename, |
|
| 483 | - $SETTINGS['path_to_files_folder'] . '/defuse_temp_' . $filename, |
|
| 482 | + $SETTINGS['path_to_files_folder'].'/'.$filename, |
|
| 483 | + $SETTINGS['path_to_files_folder'].'/defuse_temp_'.$filename, |
|
| 484 | 484 | $SETTINGS, |
| 485 | 485 | $post_option |
| 486 | 486 | ); |
| 487 | 487 | |
| 488 | 488 | // Do clean |
| 489 | - unlink($SETTINGS['path_to_files_folder'] . '/' . $filename); |
|
| 489 | + unlink($SETTINGS['path_to_files_folder'].'/'.$filename); |
|
| 490 | 490 | rename( |
| 491 | - $SETTINGS['path_to_files_folder'] . '/defuse_temp_' . $filename, |
|
| 492 | - $SETTINGS['path_to_files_folder'] . '/' . $filename |
|
| 491 | + $SETTINGS['path_to_files_folder'].'/defuse_temp_'.$filename, |
|
| 492 | + $SETTINGS['path_to_files_folder'].'/'.$filename |
|
| 493 | 493 | ); |
| 494 | 494 | } |
| 495 | 495 | |
@@ -499,7 +499,7 @@ discard block |
||
| 499 | 499 | //update LOG |
| 500 | 500 | logEvents($SETTINGS, 'admin_action', 'dataBase backup', (string) $_SESSION['user_id'], $_SESSION['login']); |
| 501 | 501 | |
| 502 | - echo '[{"result":"db_backup" , "href":"sources/downloadFile.php?name=' . urlencode($filename) . '&sub=files&file=' . $filename . '&type=sql&key=' . $_SESSION['key'] . '&key_tmp=' . $_SESSION['key_tmp'] . '&pathIsFiles=1"}]'; |
|
| 502 | + echo '[{"result":"db_backup" , "href":"sources/downloadFile.php?name='.urlencode($filename).'&sub=files&file='.$filename.'&type=sql&key='.$_SESSION['key'].'&key_tmp='.$_SESSION['key_tmp'].'&pathIsFiles=1"}]'; |
|
| 503 | 503 | } |
| 504 | 504 | break; |
| 505 | 505 | |
@@ -528,7 +528,7 @@ discard block |
||
| 528 | 528 | ); |
| 529 | 529 | break; |
| 530 | 530 | } |
| 531 | - include_once $SETTINGS['cpassman_dir'] . '/sources/main.functions.php'; |
|
| 531 | + include_once $SETTINGS['cpassman_dir'].'/sources/main.functions.php'; |
|
| 532 | 532 | |
| 533 | 533 | $dataPost = explode('&', $post_option); |
| 534 | 534 | $file = htmlspecialchars($dataPost[0]); |
@@ -537,7 +537,7 @@ discard block |
||
| 537 | 537 | // Get filename from database |
| 538 | 538 | $data = DB::queryFirstRow( |
| 539 | 539 | 'SELECT valeur |
| 540 | - FROM ' . prefixTable('misc') . ' |
|
| 540 | + FROM ' . prefixTable('misc').' |
|
| 541 | 541 | WHERE increment_id = %i', |
| 542 | 542 | $file |
| 543 | 543 | ); |
@@ -556,22 +556,22 @@ discard block |
||
| 556 | 556 | // Decrypt the file |
| 557 | 557 | $ret = prepareFileWithDefuse( |
| 558 | 558 | 'decrypt', |
| 559 | - $SETTINGS['path_to_files_folder'] . '/' . $file, |
|
| 560 | - $SETTINGS['path_to_files_folder'] . '/defuse_temp_' . $file, |
|
| 559 | + $SETTINGS['path_to_files_folder'].'/'.$file, |
|
| 560 | + $SETTINGS['path_to_files_folder'].'/defuse_temp_'.$file, |
|
| 561 | 561 | $SETTINGS, |
| 562 | 562 | $key |
| 563 | 563 | ); |
| 564 | 564 | |
| 565 | 565 | if (empty($ret) === false) { |
| 566 | - echo '[{"result":"db_restore" , "message":"' . $ret . '"}]'; |
|
| 566 | + echo '[{"result":"db_restore" , "message":"'.$ret.'"}]'; |
|
| 567 | 567 | break; |
| 568 | 568 | } |
| 569 | 569 | |
| 570 | 570 | // Do clean |
| 571 | - fileDelete($SETTINGS['path_to_files_folder'] . '/' . $file, $SETTINGS); |
|
| 572 | - $file = $SETTINGS['path_to_files_folder'] . '/defuse_temp_' . $file; |
|
| 571 | + fileDelete($SETTINGS['path_to_files_folder'].'/'.$file, $SETTINGS); |
|
| 572 | + $file = $SETTINGS['path_to_files_folder'].'/defuse_temp_'.$file; |
|
| 573 | 573 | } else { |
| 574 | - $file = $SETTINGS['path_to_files_folder'] . '/' . $file; |
|
| 574 | + $file = $SETTINGS['path_to_files_folder'].'/'.$file; |
|
| 575 | 575 | } |
| 576 | 576 | |
| 577 | 577 | //read sql file |
@@ -588,7 +588,7 @@ discard block |
||
| 588 | 588 | fclose($handle); |
| 589 | 589 | |
| 590 | 590 | //delete file |
| 591 | - unlink($SETTINGS['path_to_files_folder'] . '/' . $file); |
|
| 591 | + unlink($SETTINGS['path_to_files_folder'].'/'.$file); |
|
| 592 | 592 | |
| 593 | 593 | //Show done |
| 594 | 594 | echo '[{"result":"db_restore" , "message":""}]'; |
@@ -626,8 +626,8 @@ discard block |
||
| 626 | 626 | foreach ($table as $i => $tablename) { |
| 627 | 627 | if (substr_count($tablename, DB_PREFIX) > 0) { |
| 628 | 628 | // launch optimization quieries |
| 629 | - DB::query('ANALYZE TABLE `' . $tablename . '`'); |
|
| 630 | - DB::query('OPTIMIZE TABLE `' . $tablename . '`'); |
|
| 629 | + DB::query('ANALYZE TABLE `'.$tablename.'`'); |
|
| 630 | + DB::query('OPTIMIZE TABLE `'.$tablename.'`'); |
|
| 631 | 631 | } |
| 632 | 632 | } |
| 633 | 633 | } |
@@ -635,12 +635,12 @@ discard block |
||
| 635 | 635 | //Clean up LOG_ITEMS table |
| 636 | 636 | $rows = DB::query( |
| 637 | 637 | 'SELECT id |
| 638 | - FROM ' . prefixTable('items') . ' |
|
| 638 | + FROM ' . prefixTable('items').' |
|
| 639 | 639 | ORDER BY id ASC' |
| 640 | 640 | ); |
| 641 | 641 | foreach ($rows as $item) { |
| 642 | 642 | DB::query( |
| 643 | - 'SELECT * FROM ' . prefixTable('log_items') . ' WHERE id_item = %i AND action = %s', |
|
| 643 | + 'SELECT * FROM '.prefixTable('log_items').' WHERE id_item = %i AND action = %s', |
|
| 644 | 644 | $item['id'], |
| 645 | 645 | 'at_creation' |
| 646 | 646 | ); |
@@ -648,7 +648,7 @@ discard block |
||
| 648 | 648 | if ($counter === 0) { |
| 649 | 649 | //Create new at_creation entry |
| 650 | 650 | $rowTmp = DB::queryFirstRow( |
| 651 | - 'SELECT date, id_user FROM ' . prefixTable('log_items') . ' WHERE id_item=%i ORDER BY date ASC', |
|
| 651 | + 'SELECT date, id_user FROM '.prefixTable('log_items').' WHERE id_item=%i ORDER BY date ASC', |
|
| 652 | 652 | $item['id'] |
| 653 | 653 | ); |
| 654 | 654 | DB::insert( |
@@ -678,8 +678,8 @@ discard block |
||
| 678 | 678 | echo prepareExchangedData( |
| 679 | 679 | array( |
| 680 | 680 | 'error' => false, |
| 681 | - 'message' => langHdl('last_execution') . ' ' . |
|
| 682 | - date($SETTINGS['date_format'] . ' ' . $SETTINGS['time_format'], (int) time()) . |
|
| 681 | + 'message' => langHdl('last_execution').' '. |
|
| 682 | + date($SETTINGS['date_format'].' '.$SETTINGS['time_format'], (int) time()). |
|
| 683 | 683 | '<i class="fas fa-check text-success ml-2"></i>', |
| 684 | 684 | ), |
| 685 | 685 | 'encode' |
@@ -712,14 +712,14 @@ discard block |
||
| 712 | 712 | break; |
| 713 | 713 | } |
| 714 | 714 | |
| 715 | - require_once $SETTINGS['cpassman_dir'] . '/sources/main.functions.php'; |
|
| 715 | + require_once $SETTINGS['cpassman_dir'].'/sources/main.functions.php'; |
|
| 716 | 716 | |
| 717 | 717 | //read folder |
| 718 | 718 | if (is_dir($SETTINGS['path_to_files_folder']) === false) { |
| 719 | 719 | echo prepareExchangedData( |
| 720 | 720 | array( |
| 721 | 721 | 'error' => true, |
| 722 | - 'message' => langHdl('file_folder_not_accessible') . ": " . $SETTINGS['path_to_files_folder'], |
|
| 722 | + 'message' => langHdl('file_folder_not_accessible').": ".$SETTINGS['path_to_files_folder'], |
|
| 723 | 723 | ), |
| 724 | 724 | 'encode' |
| 725 | 725 | ); |
@@ -731,8 +731,8 @@ discard block |
||
| 731 | 731 | //delete file FILES |
| 732 | 732 | while (false !== ($f = readdir($dir))) { |
| 733 | 733 | if ($f !== '.' && $f !== '..' && $f !== '.htaccess') { |
| 734 | - if (file_exists($dir . $f) && ((time() - filectime($dir . $f)) > 604800)) { |
|
| 735 | - fileDelete($dir . '/' . $f, $SETTINGS); |
|
| 734 | + if (file_exists($dir.$f) && ((time() - filectime($dir.$f)) > 604800)) { |
|
| 735 | + fileDelete($dir.'/'.$f, $SETTINGS); |
|
| 736 | 736 | } |
| 737 | 737 | } |
| 738 | 738 | } |
@@ -746,7 +746,7 @@ discard block |
||
| 746 | 746 | echo prepareExchangedData( |
| 747 | 747 | array( |
| 748 | 748 | 'error' => true, |
| 749 | - 'message' => langHdl('file_folder_not_accessible') . ": " . $SETTINGS['path_to_upload_folder'], |
|
| 749 | + 'message' => langHdl('file_folder_not_accessible').": ".$SETTINGS['path_to_upload_folder'], |
|
| 750 | 750 | ), |
| 751 | 751 | 'encode' |
| 752 | 752 | ); |
@@ -760,7 +760,7 @@ discard block |
||
| 760 | 760 | while (false !== ($f = readdir($dir))) { |
| 761 | 761 | if ($f !== '.' && $f !== '..') { |
| 762 | 762 | if (strpos($f, '_delete.') > 0) { |
| 763 | - fileDelete($SETTINGS['path_to_upload_folder'] . '/' . $f, $SETTINGS); |
|
| 763 | + fileDelete($SETTINGS['path_to_upload_folder'].'/'.$f, $SETTINGS); |
|
| 764 | 764 | } |
| 765 | 765 | } |
| 766 | 766 | } |
@@ -782,11 +782,11 @@ discard block |
||
| 782 | 782 | echo prepareExchangedData( |
| 783 | 783 | array( |
| 784 | 784 | 'error' => false, |
| 785 | - 'message' => langHdl('last_execution') . ' ' . |
|
| 786 | - date($SETTINGS['date_format'] . ' ' . $SETTINGS['time_format'], (int) time()) . |
|
| 785 | + 'message' => langHdl('last_execution').' '. |
|
| 786 | + date($SETTINGS['date_format'].' '.$SETTINGS['time_format'], (int) time()). |
|
| 787 | 787 | '<i class="fas fa-check text-success ml-2 mr-3"></i> |
| 788 | 788 | <i class="fas fa-chevron-right mr-2"></i>' . |
| 789 | - $nbItemsDeleted . ' ' . langHdl('deleted_items'), |
|
| 789 | + $nbItemsDeleted.' '.langHdl('deleted_items'), |
|
| 790 | 790 | ), |
| 791 | 791 | 'encode' |
| 792 | 792 | ); |
@@ -819,7 +819,7 @@ discard block |
||
| 819 | 819 | break; |
| 820 | 820 | } |
| 821 | 821 | |
| 822 | - require_once $SETTINGS['cpassman_dir'] . '/sources/main.functions.php'; |
|
| 822 | + require_once $SETTINGS['cpassman_dir'].'/sources/main.functions.php'; |
|
| 823 | 823 | updateCacheTable('reload', $SETTINGS, NULL); |
| 824 | 824 | |
| 825 | 825 | // Log |
@@ -835,8 +835,8 @@ discard block |
||
| 835 | 835 | echo prepareExchangedData( |
| 836 | 836 | [ |
| 837 | 837 | 'error' => false, |
| 838 | - 'message' => langHdl('last_execution') . ' ' . |
|
| 839 | - date($SETTINGS['date_format'] . ' ' . $SETTINGS['time_format'], (int) time()) . |
|
| 838 | + 'message' => langHdl('last_execution').' '. |
|
| 839 | + date($SETTINGS['date_format'].' '.$SETTINGS['time_format'], (int) time()). |
|
| 840 | 840 | '<i class="fas fa-check text-success mr-2"></i>', |
| 841 | 841 | ], |
| 842 | 842 | 'encode' |
@@ -871,7 +871,7 @@ discard block |
||
| 871 | 871 | } |
| 872 | 872 | |
| 873 | 873 | // Perform |
| 874 | - include_once $SETTINGS['cpassman_dir'] . '/sources/main.functions.php'; |
|
| 874 | + include_once $SETTINGS['cpassman_dir'].'/sources/main.functions.php'; |
|
| 875 | 875 | $ret = handleConfigFile('rebuild', $SETTINGS); |
| 876 | 876 | |
| 877 | 877 | // Log |
@@ -898,8 +898,8 @@ discard block |
||
| 898 | 898 | echo prepareExchangedData( |
| 899 | 899 | array( |
| 900 | 900 | 'error' => false, |
| 901 | - 'message' => langHdl('last_execution') . ' ' . |
|
| 902 | - date($SETTINGS['date_format'] . ' ' . $SETTINGS['time_format'], (int) time()) . |
|
| 901 | + 'message' => langHdl('last_execution').' '. |
|
| 902 | + date($SETTINGS['date_format'].' '.$SETTINGS['time_format'], (int) time()). |
|
| 903 | 903 | '<i class="fas fa-check text-success ml-2"></i>', |
| 904 | 904 | ), |
| 905 | 905 | 'encode' |
@@ -939,33 +939,33 @@ discard block |
||
| 939 | 939 | $filename = $post_option; |
| 940 | 940 | $tp_settings = []; |
| 941 | 941 | //get backups infos |
| 942 | - $rows = DB::query('SELECT * FROM ' . prefixTable('misc') . ' WHERE type = %s', 'admin'); |
|
| 942 | + $rows = DB::query('SELECT * FROM '.prefixTable('misc').' WHERE type = %s', 'admin'); |
|
| 943 | 943 | foreach ($rows as $record) { |
| 944 | 944 | $tp_settings[$record['intitule']] = $record['valeur']; |
| 945 | 945 | } |
| 946 | 946 | |
| 947 | 947 | // check if backup file is in DB. |
| 948 | 948 | // If YES then it is encrypted with DEFUSE |
| 949 | - $bck = DB::queryFirstRow('SELECT valeur FROM ' . prefixTable('misc') . ' WHERE type = %s AND intitule = %s', 'backup', 'filename'); |
|
| 949 | + $bck = DB::queryFirstRow('SELECT valeur FROM '.prefixTable('misc').' WHERE type = %s AND intitule = %s', 'backup', 'filename'); |
|
| 950 | 950 | |
| 951 | 951 | //read file |
| 952 | 952 | $return = ''; |
| 953 | - $Fnm = $tp_settings['bck_script_path'] . '/' . $filename . '.sql'; |
|
| 953 | + $Fnm = $tp_settings['bck_script_path'].'/'.$filename.'.sql'; |
|
| 954 | 954 | if (file_exists($Fnm)) { |
| 955 | 955 | if (!empty($bck) && $bck['valeur'] === $filename) { |
| 956 | 956 | $err = ''; |
| 957 | 957 | |
| 958 | 958 | // it means that file is DEFUSE encrypted |
| 959 | - include_once $SETTINGS['cpassman_dir'] . '/includes/libraries/Encryption/Encryption/Crypto.php'; |
|
| 960 | - include_once $SETTINGS['cpassman_dir'] . '/includes/libraries/Encryption/Encryption/DerivedKeys.php'; |
|
| 961 | - include_once $SETTINGS['cpassman_dir'] . '/includes/libraries/Encryption/Encryption/KeyOrPassword.php'; |
|
| 962 | - include_once $SETTINGS['cpassman_dir'] . '/includes/libraries/Encryption/Encryption/File.php'; |
|
| 963 | - include_once $SETTINGS['cpassman_dir'] . '/includes/libraries/Encryption/Encryption/Core.php'; |
|
| 959 | + include_once $SETTINGS['cpassman_dir'].'/includes/libraries/Encryption/Encryption/Crypto.php'; |
|
| 960 | + include_once $SETTINGS['cpassman_dir'].'/includes/libraries/Encryption/Encryption/DerivedKeys.php'; |
|
| 961 | + include_once $SETTINGS['cpassman_dir'].'/includes/libraries/Encryption/Encryption/KeyOrPassword.php'; |
|
| 962 | + include_once $SETTINGS['cpassman_dir'].'/includes/libraries/Encryption/Encryption/File.php'; |
|
| 963 | + include_once $SETTINGS['cpassman_dir'].'/includes/libraries/Encryption/Encryption/Core.php'; |
|
| 964 | 964 | |
| 965 | 965 | try { |
| 966 | 966 | \Defuse\Crypto\File::decryptFileWithPassword( |
| 967 | - $SETTINGS['bck_script_path'] . '/' . $post_option . '.sql', |
|
| 968 | - $SETTINGS['bck_script_path'] . '/' . str_replace('encrypted', 'clear', $filename) . '.sql', |
|
| 967 | + $SETTINGS['bck_script_path'].'/'.$post_option.'.sql', |
|
| 968 | + $SETTINGS['bck_script_path'].'/'.str_replace('encrypted', 'clear', $filename).'.sql', |
|
| 969 | 969 | base64_decode($SETTINGS['bck_script_key']) |
| 970 | 970 | ); |
| 971 | 971 | } catch (Defuse\Crypto\Exception\WrongKeyOrModifiedCiphertextException $ex) { |
@@ -973,7 +973,7 @@ discard block |
||
| 973 | 973 | } |
| 974 | 974 | |
| 975 | 975 | if (!empty($err)) { |
| 976 | - echo '[{ "result":"backup_decrypt_fails" , "msg":"' . $err . '"}]'; |
|
| 976 | + echo '[{ "result":"backup_decrypt_fails" , "msg":"'.$err.'"}]'; |
|
| 977 | 977 | break; |
| 978 | 978 | } |
| 979 | 979 | } else { |
@@ -995,19 +995,19 @@ discard block |
||
| 995 | 995 | ); |
| 996 | 996 | |
| 997 | 997 | //save the file |
| 998 | - $handle = fopen($tp_settings['bck_script_path'] . '/' . $filename . '.clear.sql', 'w+'); |
|
| 998 | + $handle = fopen($tp_settings['bck_script_path'].'/'.$filename.'.clear.sql', 'w+'); |
|
| 999 | 999 | if ($handle !== false) { |
| 1000 | 1000 | fwrite($handle, $return); |
| 1001 | 1001 | fclose($handle); |
| 1002 | 1002 | } |
| 1003 | 1003 | } |
| 1004 | 1004 | $result = 'backup_decrypt_success'; |
| 1005 | - $msg = $tp_settings['bck_script_path'] . '/' . $filename . '.clear.sql'; |
|
| 1005 | + $msg = $tp_settings['bck_script_path'].'/'.$filename.'.clear.sql'; |
|
| 1006 | 1006 | } else { |
| 1007 | 1007 | $result = 'backup_decrypt_fails'; |
| 1008 | - $msg = 'File not found: ' . $Fnm; |
|
| 1008 | + $msg = 'File not found: '.$Fnm; |
|
| 1009 | 1009 | } |
| 1010 | - echo '[{ "result":"' . $result . '" , "msg":"' . $msg . '"}]'; |
|
| 1010 | + echo '[{ "result":"'.$result.'" , "msg":"'.$msg.'"}]'; |
|
| 1011 | 1011 | break; |
| 1012 | 1012 | |
| 1013 | 1013 | /* |
@@ -1041,22 +1041,22 @@ discard block |
||
| 1041 | 1041 | require_once 'main.functions.php'; |
| 1042 | 1042 | |
| 1043 | 1043 | // store old sk |
| 1044 | - $_SESSION['reencrypt_old_salt'] = file_get_contents(SECUREPATH . '/teampass-seckey.txt'); |
|
| 1044 | + $_SESSION['reencrypt_old_salt'] = file_get_contents(SECUREPATH.'/teampass-seckey.txt'); |
|
| 1045 | 1045 | |
| 1046 | 1046 | // generate new saltkey |
| 1047 | - $old_sk_filename = SECUREPATH . '/teampass-seckey.txt.' . date('Y_m_d', mktime(0, 0, 0, (int) date('m'), (int) date('d'), (int) date('y'))) . '.' . time(); |
|
| 1047 | + $old_sk_filename = SECUREPATH.'/teampass-seckey.txt.'.date('Y_m_d', mktime(0, 0, 0, (int) date('m'), (int) date('d'), (int) date('y'))).'.'.time(); |
|
| 1048 | 1048 | copy( |
| 1049 | - SECUREPATH . '/teampass-seckey.txt', |
|
| 1049 | + SECUREPATH.'/teampass-seckey.txt', |
|
| 1050 | 1050 | $old_sk_filename |
| 1051 | 1051 | ); |
| 1052 | 1052 | $new_key = defuse_generate_key(); |
| 1053 | 1053 | file_put_contents( |
| 1054 | - SECUREPATH . '/teampass-seckey.txt', |
|
| 1054 | + SECUREPATH.'/teampass-seckey.txt', |
|
| 1055 | 1055 | $new_key |
| 1056 | 1056 | ); |
| 1057 | 1057 | |
| 1058 | 1058 | // store new sk |
| 1059 | - $_SESSION['reencrypt_new_salt'] = file_get_contents(SECUREPATH . '/teampass-seckey.txt'); |
|
| 1059 | + $_SESSION['reencrypt_new_salt'] = file_get_contents(SECUREPATH.'/teampass-seckey.txt'); |
|
| 1060 | 1060 | |
| 1061 | 1061 | //put tool in maintenance. |
| 1062 | 1062 | DB::update( |
@@ -1072,13 +1072,13 @@ discard block |
||
| 1072 | 1072 | logEvents($SETTINGS, 'system', 'change_salt_key', (string) $_SESSION['user_id'], $_SESSION['login']); |
| 1073 | 1073 | |
| 1074 | 1074 | // get number of items to change |
| 1075 | - DB::query('SELECT id FROM ' . prefixTable('items') . ' WHERE perso = %i', 0); |
|
| 1075 | + DB::query('SELECT id FROM '.prefixTable('items').' WHERE perso = %i', 0); |
|
| 1076 | 1076 | $nb_of_items = DB::count(); |
| 1077 | 1077 | |
| 1078 | 1078 | // create backup table |
| 1079 | - DB::query('DROP TABLE IF EXISTS ' . prefixTable('sk_reencrypt_backup')); |
|
| 1079 | + DB::query('DROP TABLE IF EXISTS '.prefixTable('sk_reencrypt_backup')); |
|
| 1080 | 1080 | DB::query( |
| 1081 | - 'CREATE TABLE `' . prefixTable('sk_reencrypt_backup') . '` ( |
|
| 1081 | + 'CREATE TABLE `'.prefixTable('sk_reencrypt_backup').'` ( |
|
| 1082 | 1082 | `id` int(12) NOT null AUTO_INCREMENT, |
| 1083 | 1083 | `current_table` varchar(100) NOT NULL, |
| 1084 | 1084 | `current_field` varchar(500) NOT NULL, |
@@ -1106,7 +1106,7 @@ discard block |
||
| 1106 | 1106 | ); |
| 1107 | 1107 | |
| 1108 | 1108 | // delete previous backup files |
| 1109 | - $files = glob($SETTINGS['path_to_upload_folder'] . '/*'); // get all file names |
|
| 1109 | + $files = glob($SETTINGS['path_to_upload_folder'].'/*'); // get all file names |
|
| 1110 | 1110 | foreach ($files as $file) { // iterate files |
| 1111 | 1111 | if (is_file($file)) { |
| 1112 | 1112 | $file_parts = pathinfo($file); |
@@ -1188,7 +1188,7 @@ discard block |
||
| 1188 | 1188 | echo prepareExchangedData( |
| 1189 | 1189 | array( |
| 1190 | 1190 | 'error' => true, |
| 1191 | - 'message' => 'Input `' . $objects[0] . '` is not allowed', |
|
| 1191 | + 'message' => 'Input `'.$objects[0].'` is not allowed', |
|
| 1192 | 1192 | 'nbOfItems' => '', |
| 1193 | 1193 | 'nextAction' => '', |
| 1194 | 1194 | ), |
@@ -1201,9 +1201,9 @@ discard block |
||
| 1201 | 1201 | //change all encrypted data in Items (passwords) |
| 1202 | 1202 | $rows = DB::query( |
| 1203 | 1203 | 'SELECT id, pw, pw_iv |
| 1204 | - FROM ' . prefixTable('items') . ' |
|
| 1204 | + FROM ' . prefixTable('items').' |
|
| 1205 | 1205 | WHERE perso = %s |
| 1206 | - LIMIT ' . $post_start . ', ' . $post_length, |
|
| 1206 | + LIMIT ' . $post_start.', '.$post_length, |
|
| 1207 | 1207 | '0' |
| 1208 | 1208 | ); |
| 1209 | 1209 | foreach ($rows as $record) { |
@@ -1215,7 +1215,7 @@ discard block |
||
| 1215 | 1215 | 'current_field' => 'pw', |
| 1216 | 1216 | 'value_id' => $record['id'], |
| 1217 | 1217 | 'value' => $record['pw'], |
| 1218 | - 'current_sql' => 'UPDATE ' . prefixTable('items') . " SET pw = '" . $record['pw'] . "' WHERE id = '" . $record['id'] . "';", |
|
| 1218 | + 'current_sql' => 'UPDATE '.prefixTable('items')." SET pw = '".$record['pw']."' WHERE id = '".$record['id']."';", |
|
| 1219 | 1219 | 'value2' => 'none', |
| 1220 | 1220 | 'result' => 'none', |
| 1221 | 1221 | ) |
@@ -1264,9 +1264,9 @@ discard block |
||
| 1264 | 1264 | //change all encrypted data in Logs (passwords) |
| 1265 | 1265 | $rows = DB::query( |
| 1266 | 1266 | 'SELECT raison, increment_id |
| 1267 | - FROM ' . prefixTable('log_items') . " |
|
| 1267 | + FROM ' . prefixTable('log_items')." |
|
| 1268 | 1268 | WHERE action = %s AND raison LIKE 'at_pw :%' |
| 1269 | - LIMIT " . $post_start . ', ' . $post_length, |
|
| 1269 | + LIMIT " . $post_start.', '.$post_length, |
|
| 1270 | 1270 | 'at_modification' |
| 1271 | 1271 | ); |
| 1272 | 1272 | foreach ($rows as $record) { |
@@ -1278,7 +1278,7 @@ discard block |
||
| 1278 | 1278 | 'current_field' => 'raison', |
| 1279 | 1279 | 'value_id' => $record['increment_id'], |
| 1280 | 1280 | 'value' => $record['raison'], |
| 1281 | - 'current_sql' => 'UPDATE ' . prefixTable('log_items') . " SET raison = '" . $record['raison'] . "' WHERE increment_id = '" . $record['increment_id'] . "';", |
|
| 1281 | + 'current_sql' => 'UPDATE '.prefixTable('log_items')." SET raison = '".$record['raison']."' WHERE increment_id = '".$record['increment_id']."';", |
|
| 1282 | 1282 | 'value2' => 'none', |
| 1283 | 1283 | 'result' => 'none', |
| 1284 | 1284 | ) |
@@ -1306,7 +1306,7 @@ discard block |
||
| 1306 | 1306 | DB::update( |
| 1307 | 1307 | prefixTable('log_items'), |
| 1308 | 1308 | array( |
| 1309 | - 'raison' => 'at_pw :' . $encrypt['string'], |
|
| 1309 | + 'raison' => 'at_pw :'.$encrypt['string'], |
|
| 1310 | 1310 | 'encryption_type' => 'defuse', |
| 1311 | 1311 | ), |
| 1312 | 1312 | 'increment_id = %i', |
@@ -1331,8 +1331,8 @@ discard block |
||
| 1331 | 1331 | //change all encrypted data in CATEGORIES (passwords) |
| 1332 | 1332 | $rows = DB::query( |
| 1333 | 1333 | 'SELECT id, data |
| 1334 | - FROM ' . prefixTable('categories_items') . ' |
|
| 1335 | - LIMIT ' . $post_start . ', ' . $post_length |
|
| 1334 | + FROM ' . prefixTable('categories_items').' |
|
| 1335 | + LIMIT ' . $post_start.', '.$post_length |
|
| 1336 | 1336 | ); |
| 1337 | 1337 | foreach ($rows as $record) { |
| 1338 | 1338 | // backup data |
@@ -1343,7 +1343,7 @@ discard block |
||
| 1343 | 1343 | 'current_field' => 'data', |
| 1344 | 1344 | 'value_id' => $record['id'], |
| 1345 | 1345 | 'value' => $record['data'], |
| 1346 | - 'current_sql' => 'UPDATE ' . prefixTable('categories_items') . " SET data = '" . $record['data'] . "' WHERE id = '" . $record['id'] . "';", |
|
| 1346 | + 'current_sql' => 'UPDATE '.prefixTable('categories_items')." SET data = '".$record['data']."' WHERE id = '".$record['id']."';", |
|
| 1347 | 1347 | 'value2' => 'none', |
| 1348 | 1348 | 'result' => 'none', |
| 1349 | 1349 | ) |
@@ -1391,9 +1391,9 @@ discard block |
||
| 1391 | 1391 | // Change all encrypted data in FILES (passwords) |
| 1392 | 1392 | $rows = DB::query( |
| 1393 | 1393 | 'SELECT id, file, status |
| 1394 | - FROM ' . prefixTable('files') . " |
|
| 1394 | + FROM ' . prefixTable('files')." |
|
| 1395 | 1395 | WHERE status = 'encrypted' |
| 1396 | - LIMIT " . $post_start . ', ' . $post_length |
|
| 1396 | + LIMIT " . $post_start.', '.$post_length |
|
| 1397 | 1397 | ); |
| 1398 | 1398 | foreach ($rows as $record) { |
| 1399 | 1399 | // backup data |
@@ -1411,20 +1411,20 @@ discard block |
||
| 1411 | 1411 | ); |
| 1412 | 1412 | $newID = DB::insertId(); |
| 1413 | 1413 | |
| 1414 | - if (file_exists($SETTINGS['path_to_upload_folder'] . '/' . $record['file'])) { |
|
| 1414 | + if (file_exists($SETTINGS['path_to_upload_folder'].'/'.$record['file'])) { |
|
| 1415 | 1415 | // make a copy of file |
| 1416 | 1416 | if (!copy( |
| 1417 | - $SETTINGS['path_to_upload_folder'] . '/' . $record['file'], |
|
| 1418 | - $SETTINGS['path_to_upload_folder'] . '/' . $record['file'] . '.copy' |
|
| 1417 | + $SETTINGS['path_to_upload_folder'].'/'.$record['file'], |
|
| 1418 | + $SETTINGS['path_to_upload_folder'].'/'.$record['file'].'.copy' |
|
| 1419 | 1419 | )) { |
| 1420 | 1420 | $error = 'Copy not possible'; |
| 1421 | 1421 | exit; |
| 1422 | 1422 | } else { |
| 1423 | 1423 | // prepare a bck of file (that will not be deleted) |
| 1424 | - $backup_filename = $record['file'] . '.bck-change-sk.' . time(); |
|
| 1424 | + $backup_filename = $record['file'].'.bck-change-sk.'.time(); |
|
| 1425 | 1425 | copy( |
| 1426 | - $SETTINGS['path_to_upload_folder'] . '/' . $record['file'], |
|
| 1427 | - $SETTINGS['path_to_upload_folder'] . '/' . $backup_filename |
|
| 1426 | + $SETTINGS['path_to_upload_folder'].'/'.$record['file'], |
|
| 1427 | + $SETTINGS['path_to_upload_folder'].'/'.$backup_filename |
|
| 1428 | 1428 | ); |
| 1429 | 1429 | } |
| 1430 | 1430 | |
@@ -1432,24 +1432,24 @@ discard block |
||
| 1432 | 1432 | // STEP1 - Do decryption |
| 1433 | 1433 | prepareFileWithDefuse( |
| 1434 | 1434 | 'decrypt', |
| 1435 | - $SETTINGS['path_to_upload_folder'] . '/' . $record['file'], |
|
| 1436 | - $SETTINGS['path_to_upload_folder'] . '/' . $record['file'] . '_encrypted', |
|
| 1435 | + $SETTINGS['path_to_upload_folder'].'/'.$record['file'], |
|
| 1436 | + $SETTINGS['path_to_upload_folder'].'/'.$record['file'].'_encrypted', |
|
| 1437 | 1437 | $SETTINGS |
| 1438 | 1438 | ); |
| 1439 | 1439 | |
| 1440 | 1440 | // Do cleanup of files |
| 1441 | - unlink($SETTINGS['path_to_upload_folder'] . '/' . $record['file']); |
|
| 1441 | + unlink($SETTINGS['path_to_upload_folder'].'/'.$record['file']); |
|
| 1442 | 1442 | |
| 1443 | 1443 | // STEP2 - Do encryption |
| 1444 | 1444 | prepareFileWithDefuse( |
| 1445 | 1445 | 'encryp', |
| 1446 | - $SETTINGS['path_to_upload_folder'] . '/' . $record['file'] . '_encrypted', |
|
| 1447 | - $SETTINGS['path_to_upload_folder'] . '/' . $record['file'], |
|
| 1446 | + $SETTINGS['path_to_upload_folder'].'/'.$record['file'].'_encrypted', |
|
| 1447 | + $SETTINGS['path_to_upload_folder'].'/'.$record['file'], |
|
| 1448 | 1448 | $SETTINGS |
| 1449 | 1449 | ); |
| 1450 | 1450 | |
| 1451 | 1451 | // Do cleanup of files |
| 1452 | - unlink($SETTINGS['path_to_upload_folder'] . '/' . $record['file'] . '_encrypted'); |
|
| 1452 | + unlink($SETTINGS['path_to_upload_folder'].'/'.$record['file'].'_encrypted'); |
|
| 1453 | 1453 | |
| 1454 | 1454 | // Update backup table |
| 1455 | 1455 | DB::update( |
@@ -1475,13 +1475,13 @@ discard block |
||
| 1475 | 1475 | // do some things for new object |
| 1476 | 1476 | if (isset($objects[0])) { |
| 1477 | 1477 | if ($objects[0] === 'logs') { |
| 1478 | - DB::query('SELECT increment_id FROM ' . prefixTable('log_items') . " WHERE action = %s AND raison LIKE 'at_pw :%'", 'at_modification'); |
|
| 1478 | + DB::query('SELECT increment_id FROM '.prefixTable('log_items')." WHERE action = %s AND raison LIKE 'at_pw :%'", 'at_modification'); |
|
| 1479 | 1479 | } elseif ($objects[0] === 'files') { |
| 1480 | - DB::query('SELECT id FROM ' . prefixTable('files')); |
|
| 1480 | + DB::query('SELECT id FROM '.prefixTable('files')); |
|
| 1481 | 1481 | } elseif ($objects[0] === 'categories') { |
| 1482 | - DB::query('SELECT id FROM ' . prefixTable('categories_items')); |
|
| 1482 | + DB::query('SELECT id FROM '.prefixTable('categories_items')); |
|
| 1483 | 1483 | } elseif ($objects[0] === 'custfields') { |
| 1484 | - DB::query('SELECT raison FROM ' . prefixTable('log_items') . " WHERE action = %s AND raison LIKE 'at_pw :%'", 'at_modification'); |
|
| 1484 | + DB::query('SELECT raison FROM '.prefixTable('log_items')." WHERE action = %s AND raison LIKE 'at_pw :%'", 'at_modification'); |
|
| 1485 | 1485 | } |
| 1486 | 1486 | $nb_of_items = DB::count(); |
| 1487 | 1487 | } else { |
@@ -1600,12 +1600,12 @@ discard block |
||
| 1600 | 1600 | ); |
| 1601 | 1601 | } elseif ($record['current_table'] === 'files') { |
| 1602 | 1602 | // restore backup file |
| 1603 | - if (file_exists($SETTINGS['path_to_upload_folder'] . '/' . $record['value'])) { |
|
| 1604 | - unlink($SETTINGS['path_to_upload_folder'] . '/' . $record['value']); |
|
| 1605 | - if (file_exists($SETTINGS['path_to_upload_folder'] . '/' . $record['value2'])) { |
|
| 1603 | + if (file_exists($SETTINGS['path_to_upload_folder'].'/'.$record['value'])) { |
|
| 1604 | + unlink($SETTINGS['path_to_upload_folder'].'/'.$record['value']); |
|
| 1605 | + if (file_exists($SETTINGS['path_to_upload_folder'].'/'.$record['value2'])) { |
|
| 1606 | 1606 | rename( |
| 1607 | - $SETTINGS['path_to_upload_folder'] . '/' . $record['value2'], |
|
| 1608 | - $SETTINGS['path_to_upload_folder'] . '/' . $record['value'] |
|
| 1607 | + $SETTINGS['path_to_upload_folder'].'/'.$record['value2'], |
|
| 1608 | + $SETTINGS['path_to_upload_folder'].'/'.$record['value'] |
|
| 1609 | 1609 | ); |
| 1610 | 1610 | } |
| 1611 | 1611 | } |
@@ -1616,15 +1616,15 @@ discard block |
||
| 1616 | 1616 | |
| 1617 | 1617 | // restore saltkey file |
| 1618 | 1618 | if (file_exists($previous_saltkey_filename)) { |
| 1619 | - unlink(SECUREPATH . '/teampass-seckey.txt'); |
|
| 1619 | + unlink(SECUREPATH.'/teampass-seckey.txt'); |
|
| 1620 | 1620 | rename( |
| 1621 | 1621 | $previous_saltkey_filename, |
| 1622 | - SECUREPATH . '/teampass-seckey.txt' |
|
| 1622 | + SECUREPATH.'/teampass-seckey.txt' |
|
| 1623 | 1623 | ); |
| 1624 | 1624 | } |
| 1625 | 1625 | |
| 1626 | 1626 | // drop table |
| 1627 | - DB::query('DROP TABLE IF EXISTS ' . prefixTable('sk_reencrypt_backup')); |
|
| 1627 | + DB::query('DROP TABLE IF EXISTS '.prefixTable('sk_reencrypt_backup')); |
|
| 1628 | 1628 | |
| 1629 | 1629 | // Send back |
| 1630 | 1630 | echo prepareExchangedData( |
@@ -1667,17 +1667,17 @@ discard block |
||
| 1667 | 1667 | // delete files |
| 1668 | 1668 | $rows = DB::query( |
| 1669 | 1669 | 'SELECT value, value2 |
| 1670 | - FROM ' . prefixTable('sk_reencrypt_backup') . " |
|
| 1670 | + FROM ' . prefixTable('sk_reencrypt_backup')." |
|
| 1671 | 1671 | WHERE current_table = 'files'" |
| 1672 | 1672 | ); |
| 1673 | 1673 | foreach ($rows as $record) { |
| 1674 | - if (file_exists($SETTINGS['path_to_upload_folder'] . '/' . $record['value2'])) { |
|
| 1675 | - unlink($SETTINGS['path_to_upload_folder'] . '/' . $record['value2']); |
|
| 1674 | + if (file_exists($SETTINGS['path_to_upload_folder'].'/'.$record['value2'])) { |
|
| 1675 | + unlink($SETTINGS['path_to_upload_folder'].'/'.$record['value2']); |
|
| 1676 | 1676 | } |
| 1677 | 1677 | } |
| 1678 | 1678 | |
| 1679 | 1679 | // drop table |
| 1680 | - DB::query('DROP TABLE IF EXISTS ' . prefixTable('sk_reencrypt_backup')); |
|
| 1680 | + DB::query('DROP TABLE IF EXISTS '.prefixTable('sk_reencrypt_backup')); |
|
| 1681 | 1681 | |
| 1682 | 1682 | echo '[{"status":"done"}]'; |
| 1683 | 1683 | break; |
@@ -1709,7 +1709,7 @@ discard block |
||
| 1709 | 1709 | ); |
| 1710 | 1710 | break; |
| 1711 | 1711 | } else { |
| 1712 | - require_once $SETTINGS['cpassman_dir'] . '/sources/main.functions.php'; |
|
| 1712 | + require_once $SETTINGS['cpassman_dir'].'/sources/main.functions.php'; |
|
| 1713 | 1713 | |
| 1714 | 1714 | //send email |
| 1715 | 1715 | sendEmail( |
@@ -1745,11 +1745,11 @@ discard block |
||
| 1745 | 1745 | break; |
| 1746 | 1746 | } |
| 1747 | 1747 | |
| 1748 | - include_once $SETTINGS['cpassman_dir'] . '/sources/main.functions.php'; |
|
| 1748 | + include_once $SETTINGS['cpassman_dir'].'/sources/main.functions.php'; |
|
| 1749 | 1749 | |
| 1750 | 1750 | $rows = DB::query( |
| 1751 | 1751 | 'SELECT * |
| 1752 | - FROM ' . prefixTable('emails') . ' |
|
| 1752 | + FROM ' . prefixTable('emails').' |
|
| 1753 | 1753 | WHERE status = %s OR status = %s', |
| 1754 | 1754 | 'not_sent', |
| 1755 | 1755 | '' |
@@ -1834,9 +1834,9 @@ discard block |
||
| 1834 | 1834 | break; |
| 1835 | 1835 | } |
| 1836 | 1836 | |
| 1837 | - include_once $SETTINGS['cpassman_dir'] . '/sources/main.functions.php'; |
|
| 1837 | + include_once $SETTINGS['cpassman_dir'].'/sources/main.functions.php'; |
|
| 1838 | 1838 | |
| 1839 | - $rows = DB::query('SELECT * FROM ' . prefixTable('emails') . ' WHERE status = %s OR status = %s', 'not_sent', ''); |
|
| 1839 | + $rows = DB::query('SELECT * FROM '.prefixTable('emails').' WHERE status = %s OR status = %s', 'not_sent', ''); |
|
| 1840 | 1840 | foreach ($rows as $record) { |
| 1841 | 1841 | //send email |
| 1842 | 1842 | $ret = json_decode( |
@@ -1904,7 +1904,7 @@ discard block |
||
| 1904 | 1904 | break; |
| 1905 | 1905 | } |
| 1906 | 1906 | |
| 1907 | - require_once $SETTINGS['cpassman_dir'] . '/sources/main.functions.php'; |
|
| 1907 | + require_once $SETTINGS['cpassman_dir'].'/sources/main.functions.php'; |
|
| 1908 | 1908 | |
| 1909 | 1909 | // init |
| 1910 | 1910 | $filesList = array(); |
@@ -1917,7 +1917,7 @@ discard block |
||
| 1917 | 1917 | FROM ' . prefixTable('files') |
| 1918 | 1918 | ); |
| 1919 | 1919 | foreach ($rows as $record) { |
| 1920 | - if (is_file($SETTINGS['path_to_upload_folder'] . '/' . $record['file'])) { |
|
| 1920 | + if (is_file($SETTINGS['path_to_upload_folder'].'/'.$record['file'])) { |
|
| 1921 | 1921 | $addFile = false; |
| 1922 | 1922 | if (($post_option === 'attachments-decrypt' && $record['status'] === 'encrypted') |
| 1923 | 1923 | || ($post_option === 'attachments-encrypt' && $record['status'] === 'clear') |
@@ -1982,8 +1982,8 @@ discard block |
||
| 1982 | 1982 | $post_list = filter_var_array($post_list, FILTER_SANITIZE_STRING); |
| 1983 | 1983 | $post_counter = filter_var($post_counter, FILTER_SANITIZE_NUMBER_INT); |
| 1984 | 1984 | |
| 1985 | - include $SETTINGS['cpassman_dir'] . '/includes/config/settings.php'; |
|
| 1986 | - include_once $SETTINGS['cpassman_dir'] . '/sources/main.functions.php'; |
|
| 1985 | + include $SETTINGS['cpassman_dir'].'/includes/config/settings.php'; |
|
| 1986 | + include_once $SETTINGS['cpassman_dir'].'/sources/main.functions.php'; |
|
| 1987 | 1987 | |
| 1988 | 1988 | $cpt = 0; |
| 1989 | 1989 | $continu = true; |
@@ -1991,15 +1991,15 @@ discard block |
||
| 1991 | 1991 | $message = ''; |
| 1992 | 1992 | |
| 1993 | 1993 | // load PhpEncryption library |
| 1994 | - include_once $SETTINGS['cpassman_dir'] . '/includes/libraries/Encryption/Encryption/Crypto.php'; |
|
| 1995 | - include_once $SETTINGS['cpassman_dir'] . '/includes/libraries/Encryption/Encryption/Encoding.php'; |
|
| 1996 | - include_once $SETTINGS['cpassman_dir'] . '/includes/libraries/Encryption/Encryption/DerivedKeys.php'; |
|
| 1997 | - include_once $SETTINGS['cpassman_dir'] . '/includes/libraries/Encryption/Encryption/Key.php'; |
|
| 1998 | - include_once $SETTINGS['cpassman_dir'] . '/includes/libraries/Encryption/Encryption/KeyOrPassword.php'; |
|
| 1999 | - include_once $SETTINGS['cpassman_dir'] . '/includes/libraries/Encryption/Encryption/File.php'; |
|
| 2000 | - include_once $SETTINGS['cpassman_dir'] . '/includes/libraries/Encryption/Encryption/RuntimeTests.php'; |
|
| 2001 | - include_once $SETTINGS['cpassman_dir'] . '/includes/libraries/Encryption/Encryption/KeyProtectedByPassword.php'; |
|
| 2002 | - include_once $SETTINGS['cpassman_dir'] . '/includes/libraries/Encryption/Encryption/Core.php'; |
|
| 1994 | + include_once $SETTINGS['cpassman_dir'].'/includes/libraries/Encryption/Encryption/Crypto.php'; |
|
| 1995 | + include_once $SETTINGS['cpassman_dir'].'/includes/libraries/Encryption/Encryption/Encoding.php'; |
|
| 1996 | + include_once $SETTINGS['cpassman_dir'].'/includes/libraries/Encryption/Encryption/DerivedKeys.php'; |
|
| 1997 | + include_once $SETTINGS['cpassman_dir'].'/includes/libraries/Encryption/Encryption/Key.php'; |
|
| 1998 | + include_once $SETTINGS['cpassman_dir'].'/includes/libraries/Encryption/Encryption/KeyOrPassword.php'; |
|
| 1999 | + include_once $SETTINGS['cpassman_dir'].'/includes/libraries/Encryption/Encryption/File.php'; |
|
| 2000 | + include_once $SETTINGS['cpassman_dir'].'/includes/libraries/Encryption/Encryption/RuntimeTests.php'; |
|
| 2001 | + include_once $SETTINGS['cpassman_dir'].'/includes/libraries/Encryption/Encryption/KeyProtectedByPassword.php'; |
|
| 2002 | + include_once $SETTINGS['cpassman_dir'].'/includes/libraries/Encryption/Encryption/Core.php'; |
|
| 2003 | 2003 | |
| 2004 | 2004 | // treat 10 files |
| 2005 | 2005 | foreach ($post_list as $file) { |
@@ -2007,35 +2007,35 @@ discard block |
||
| 2007 | 2007 | // Get file name |
| 2008 | 2008 | $file_info = DB::queryfirstrow( |
| 2009 | 2009 | 'SELECT file |
| 2010 | - FROM ' . prefixTable('files') . ' |
|
| 2010 | + FROM ' . prefixTable('files').' |
|
| 2011 | 2011 | WHERE id = %i', |
| 2012 | 2012 | $file |
| 2013 | 2013 | ); |
| 2014 | 2014 | |
| 2015 | 2015 | // skip file is Coherancey not respected |
| 2016 | - if (is_file($SETTINGS['path_to_upload_folder'] . '/' . $file_info['file'])) { |
|
| 2016 | + if (is_file($SETTINGS['path_to_upload_folder'].'/'.$file_info['file'])) { |
|
| 2017 | 2017 | // Case where we want to decrypt |
| 2018 | 2018 | if ($post_option === 'decrypt') { |
| 2019 | 2019 | prepareFileWithDefuse( |
| 2020 | 2020 | 'decrypt', |
| 2021 | - $SETTINGS['path_to_upload_folder'] . '/' . $file_info['file'], |
|
| 2022 | - $SETTINGS['path_to_upload_folder'] . '/defuse_temp_' . $file_info['file'], |
|
| 2021 | + $SETTINGS['path_to_upload_folder'].'/'.$file_info['file'], |
|
| 2022 | + $SETTINGS['path_to_upload_folder'].'/defuse_temp_'.$file_info['file'], |
|
| 2023 | 2023 | $SETTINGS |
| 2024 | 2024 | ); |
| 2025 | 2025 | // Case where we want to encrypt |
| 2026 | 2026 | } elseif ($post_option === 'encrypt') { |
| 2027 | 2027 | prepareFileWithDefuse( |
| 2028 | 2028 | 'encrypt', |
| 2029 | - $SETTINGS['path_to_upload_folder'] . '/' . $file_info['file'], |
|
| 2030 | - $SETTINGS['path_to_upload_folder'] . '/defuse_temp_' . $file_info['file'], |
|
| 2029 | + $SETTINGS['path_to_upload_folder'].'/'.$file_info['file'], |
|
| 2030 | + $SETTINGS['path_to_upload_folder'].'/defuse_temp_'.$file_info['file'], |
|
| 2031 | 2031 | $SETTINGS |
| 2032 | 2032 | ); |
| 2033 | 2033 | } |
| 2034 | 2034 | // Do file cleanup |
| 2035 | - fileDelete($SETTINGS['path_to_upload_folder'] . '/' . $file_info['file'], $SETTINGS); |
|
| 2035 | + fileDelete($SETTINGS['path_to_upload_folder'].'/'.$file_info['file'], $SETTINGS); |
|
| 2036 | 2036 | rename( |
| 2037 | - $SETTINGS['path_to_upload_folder'] . '/defuse_temp_' . $file_info['file'], |
|
| 2038 | - $SETTINGS['path_to_upload_folder'] . '/' . $file_info['file'] |
|
| 2037 | + $SETTINGS['path_to_upload_folder'].'/defuse_temp_'.$file_info['file'], |
|
| 2038 | + $SETTINGS['path_to_upload_folder'].'/'.$file_info['file'] |
|
| 2039 | 2039 | ); |
| 2040 | 2040 | |
| 2041 | 2041 | // store in DB |
@@ -2070,8 +2070,8 @@ discard block |
||
| 2070 | 2070 | $post_option === 'attachments-decrypt' ? 'clear' : 'encrypted' |
| 2071 | 2071 | ); |
| 2072 | 2072 | |
| 2073 | - $message = langHdl('last_execution') . ' ' . |
|
| 2074 | - date($SETTINGS['date_format'] . ' ' . $SETTINGS['time_format'], (int) time()) . |
|
| 2073 | + $message = langHdl('last_execution').' '. |
|
| 2074 | + date($SETTINGS['date_format'].' '.$SETTINGS['time_format'], (int) time()). |
|
| 2075 | 2075 | '<i class="fas fa-check text-success ml-2 mr-3"></i>'; |
| 2076 | 2076 | } |
| 2077 | 2077 | |
@@ -2157,7 +2157,7 @@ discard block |
||
| 2157 | 2157 | $post_id = filter_var($dataReceived['id'], FILTER_SANITIZE_STRING); |
| 2158 | 2158 | |
| 2159 | 2159 | DB::query( |
| 2160 | - 'DELETE FROM ' . prefixTable('api') . ' WHERE id = %i', |
|
| 2160 | + 'DELETE FROM '.prefixTable('api').' WHERE id = %i', |
|
| 2161 | 2161 | $post_id |
| 2162 | 2162 | ); |
| 2163 | 2163 | } |
@@ -2249,7 +2249,7 @@ discard block |
||
| 2249 | 2249 | // Delete existing key |
| 2250 | 2250 | } elseif (null !== $post_action && $post_action === 'delete') { |
| 2251 | 2251 | $post_id = filter_var($dataReceived['id'], FILTER_SANITIZE_STRING); |
| 2252 | - DB::query('DELETE FROM ' . prefixTable('api') . ' WHERE id=%i', $post_id); |
|
| 2252 | + DB::query('DELETE FROM '.prefixTable('api').' WHERE id=%i', $post_id); |
|
| 2253 | 2253 | } |
| 2254 | 2254 | |
| 2255 | 2255 | echo prepareExchangedData( |
@@ -2264,7 +2264,7 @@ discard block |
||
| 2264 | 2264 | |
| 2265 | 2265 | case 'save_api_status': |
| 2266 | 2266 | // Do query |
| 2267 | - DB::query('SELECT * FROM ' . prefixTable('misc') . ' WHERE type = %s AND intitule = %s', 'admin', 'api'); |
|
| 2267 | + DB::query('SELECT * FROM '.prefixTable('misc').' WHERE type = %s AND intitule = %s', 'admin', 'api'); |
|
| 2268 | 2268 | $counter = DB::count(); |
| 2269 | 2269 | if ($counter === 0) { |
| 2270 | 2270 | DB::insert( |
@@ -2290,7 +2290,7 @@ discard block |
||
| 2290 | 2290 | break; |
| 2291 | 2291 | |
| 2292 | 2292 | case 'save_duo_status': |
| 2293 | - DB::query('SELECT * FROM ' . prefixTable('misc') . ' WHERE type = %s AND intitule = %s', 'admin', 'duo'); |
|
| 2293 | + DB::query('SELECT * FROM '.prefixTable('misc').' WHERE type = %s AND intitule = %s', 'admin', 'duo'); |
|
| 2294 | 2294 | $counter = DB::count(); |
| 2295 | 2295 | if ($counter === 0) { |
| 2296 | 2296 | DB::insert( |
@@ -2333,7 +2333,7 @@ discard block |
||
| 2333 | 2333 | foreach ($dataReceived as $key => $value) { |
| 2334 | 2334 | DB::query( |
| 2335 | 2335 | 'SELECT * |
| 2336 | - FROM ' . prefixTable('misc') . ' |
|
| 2336 | + FROM ' . prefixTable('misc').' |
|
| 2337 | 2337 | WHERE type = %s AND intitule = %s', |
| 2338 | 2338 | 'admin', |
| 2339 | 2339 | $key |
@@ -2401,7 +2401,7 @@ discard block |
||
| 2401 | 2401 | } else { |
| 2402 | 2402 | $tmp = 1; |
| 2403 | 2403 | } |
| 2404 | - DB::query('SELECT * FROM ' . prefixTable('misc') . ' WHERE type = %s AND intitule = %s', 'admin', 'google_authentication'); |
|
| 2404 | + DB::query('SELECT * FROM '.prefixTable('misc').' WHERE type = %s AND intitule = %s', 'admin', 'google_authentication'); |
|
| 2405 | 2405 | $counter = DB::count(); |
| 2406 | 2406 | if ($counter === 0) { |
| 2407 | 2407 | DB::insert( |
@@ -2427,7 +2427,7 @@ discard block |
||
| 2427 | 2427 | |
| 2428 | 2428 | // ga_website_name |
| 2429 | 2429 | if (is_null($dataReceived['ga_website_name']) === false) { |
| 2430 | - DB::query('SELECT * FROM ' . prefixTable('misc') . ' WHERE type = %s AND intitule = %s', 'admin', 'ga_website_name'); |
|
| 2430 | + DB::query('SELECT * FROM '.prefixTable('misc').' WHERE type = %s AND intitule = %s', 'admin', 'ga_website_name'); |
|
| 2431 | 2431 | $counter = DB::count(); |
| 2432 | 2432 | if ($counter === 0) { |
| 2433 | 2433 | DB::insert( |
@@ -2458,7 +2458,7 @@ discard block |
||
| 2458 | 2458 | } |
| 2459 | 2459 | |
| 2460 | 2460 | // send data |
| 2461 | - echo '[{"result" : "' . addslashes($LANG['done']) . '" , "error" : ""}]'; |
|
| 2461 | + echo '[{"result" : "'.addslashes($LANG['done']).'" , "error" : ""}]'; |
|
| 2462 | 2462 | break; |
| 2463 | 2463 | |
| 2464 | 2464 | case 'save_agses_options': |
@@ -2481,7 +2481,7 @@ discard block |
||
| 2481 | 2481 | |
| 2482 | 2482 | // agses_hosted_url |
| 2483 | 2483 | if (!is_null($dataReceived['agses_hosted_url'])) { |
| 2484 | - DB::query('SELECT * FROM ' . prefixTable('misc') . ' WHERE type = %s AND intitule = %s', 'admin', 'agses_hosted_url'); |
|
| 2484 | + DB::query('SELECT * FROM '.prefixTable('misc').' WHERE type = %s AND intitule = %s', 'admin', 'agses_hosted_url'); |
|
| 2485 | 2485 | $counter = DB::count(); |
| 2486 | 2486 | if ($counter === 0) { |
| 2487 | 2487 | DB::insert( |
@@ -2510,7 +2510,7 @@ discard block |
||
| 2510 | 2510 | |
| 2511 | 2511 | // agses_hosted_id |
| 2512 | 2512 | if (!is_null($dataReceived['agses_hosted_id'])) { |
| 2513 | - DB::query('SELECT * FROM ' . prefixTable('misc') . ' WHERE type = %s AND intitule = %s', 'admin', 'agses_hosted_id'); |
|
| 2513 | + DB::query('SELECT * FROM '.prefixTable('misc').' WHERE type = %s AND intitule = %s', 'admin', 'agses_hosted_id'); |
|
| 2514 | 2514 | $counter = DB::count(); |
| 2515 | 2515 | if ($counter === 0) { |
| 2516 | 2516 | DB::insert( |
@@ -2539,7 +2539,7 @@ discard block |
||
| 2539 | 2539 | |
| 2540 | 2540 | // agses_hosted_apikey |
| 2541 | 2541 | if (!is_null($dataReceived['agses_hosted_apikey'])) { |
| 2542 | - DB::query('SELECT * FROM ' . prefixTable('misc') . ' WHERE type = %s AND intitule = %s', 'admin', 'agses_hosted_apikey'); |
|
| 2542 | + DB::query('SELECT * FROM '.prefixTable('misc').' WHERE type = %s AND intitule = %s', 'admin', 'agses_hosted_apikey'); |
|
| 2543 | 2543 | $counter = DB::count(); |
| 2544 | 2544 | if ($counter === 0) { |
| 2545 | 2545 | DB::insert( |
@@ -2567,7 +2567,7 @@ discard block |
||
| 2567 | 2567 | } |
| 2568 | 2568 | |
| 2569 | 2569 | // send data |
| 2570 | - echo '[{"result" : "' . addslashes($LANG['done']) . '" , "error" : ""}]'; |
|
| 2570 | + echo '[{"result" : "'.addslashes($LANG['done']).'" , "error" : ""}]'; |
|
| 2571 | 2571 | break; |
| 2572 | 2572 | |
| 2573 | 2573 | case 'save_option_change': |
@@ -2603,7 +2603,7 @@ discard block |
||
| 2603 | 2603 | |
| 2604 | 2604 | // Check if setting is already in DB. If NO then insert, if YES then update. |
| 2605 | 2605 | $data = DB::query( |
| 2606 | - 'SELECT * FROM ' . prefixTable('misc') . ' |
|
| 2606 | + 'SELECT * FROM '.prefixTable('misc').' |
|
| 2607 | 2607 | WHERE type = %s AND intitule = %s', |
| 2608 | 2608 | $type, |
| 2609 | 2609 | $dataReceived['field'] |
@@ -2625,7 +2625,7 @@ discard block |
||
| 2625 | 2625 | array( |
| 2626 | 2626 | 'valeur' => time(), |
| 2627 | 2627 | 'type' => $type, |
| 2628 | - 'intitule' => $dataReceived['field'] . '_time', |
|
| 2628 | + 'intitule' => $dataReceived['field'].'_time', |
|
| 2629 | 2629 | ) |
| 2630 | 2630 | ); |
| 2631 | 2631 | } |
@@ -2643,10 +2643,10 @@ discard block |
||
| 2643 | 2643 | if ($dataReceived['field'] === 'send_stats') { |
| 2644 | 2644 | // Check if previous time exists, if not them insert this value in DB |
| 2645 | 2645 | DB::query( |
| 2646 | - 'SELECT * FROM ' . prefixTable('misc') . ' |
|
| 2646 | + 'SELECT * FROM '.prefixTable('misc').' |
|
| 2647 | 2647 | WHERE type = %s AND intitule = %s', |
| 2648 | 2648 | $type, |
| 2649 | - $dataReceived['field'] . '_time' |
|
| 2649 | + $dataReceived['field'].'_time' |
|
| 2650 | 2650 | ); |
| 2651 | 2651 | $counter = DB::count(); |
| 2652 | 2652 | if ($counter === 0) { |
@@ -2655,7 +2655,7 @@ discard block |
||
| 2655 | 2655 | array( |
| 2656 | 2656 | 'valeur' => 0, |
| 2657 | 2657 | 'type' => $type, |
| 2658 | - 'intitule' => $dataReceived['field'] . '_time', |
|
| 2658 | + 'intitule' => $dataReceived['field'].'_time', |
|
| 2659 | 2659 | ) |
| 2660 | 2660 | ); |
| 2661 | 2661 | } else { |
@@ -2675,13 +2675,13 @@ discard block |
||
| 2675 | 2675 | // special Cases |
| 2676 | 2676 | if ($dataReceived['field'] === 'cpassman_url') { |
| 2677 | 2677 | // update also jsUrl for CSFP protection |
| 2678 | - $jsUrl = $dataReceived['value'] . '/includes/libraries/csrfp/js/csrfprotector.js'; |
|
| 2678 | + $jsUrl = $dataReceived['value'].'/includes/libraries/csrfp/js/csrfprotector.js'; |
|
| 2679 | 2679 | $csrfp_file = '../includes/libraries/csrfp/libs/csrfp.config.php'; |
| 2680 | 2680 | $data = file_get_contents($csrfp_file); |
| 2681 | 2681 | $posJsUrl = strpos($data, '"jsUrl" => "'); |
| 2682 | 2682 | $posEndLine = strpos($data, '",', $posJsUrl); |
| 2683 | 2683 | $line = substr($data, $posJsUrl, ($posEndLine - $posJsUrl + 2)); |
| 2684 | - $newdata = str_replace($line, '"jsUrl" => "' . filter_var($jsUrl, FILTER_SANITIZE_STRING) . '",', $data); |
|
| 2684 | + $newdata = str_replace($line, '"jsUrl" => "'.filter_var($jsUrl, FILTER_SANITIZE_STRING).'",', $data); |
|
| 2685 | 2685 | file_put_contents($csrfp_file, $newdata); |
| 2686 | 2686 | } elseif ($dataReceived['field'] === 'restricted_to_input' && $dataReceived['value'] === '0') { |
| 2687 | 2687 | DB::update( |
@@ -2705,7 +2705,7 @@ discard block |
||
| 2705 | 2705 | echo prepareExchangedData( |
| 2706 | 2706 | array( |
| 2707 | 2707 | 'error' => false, |
| 2708 | - 'misc' => $counter . ' ; ' . $SETTINGS[$dataReceived['field']], |
|
| 2708 | + 'misc' => $counter.' ; '.$SETTINGS[$dataReceived['field']], |
|
| 2709 | 2709 | ), |
| 2710 | 2710 | 'encode' |
| 2711 | 2711 | ); |
@@ -2747,7 +2747,7 @@ discard block |
||
| 2747 | 2747 | |
| 2748 | 2748 | // send statistics |
| 2749 | 2749 | if (null !== $post_status) { |
| 2750 | - DB::query('SELECT * FROM ' . prefixTable('misc') . ' WHERE type = %s AND intitule = %s', 'admin', 'send_stats'); |
|
| 2750 | + DB::query('SELECT * FROM '.prefixTable('misc').' WHERE type = %s AND intitule = %s', 'admin', 'send_stats'); |
|
| 2751 | 2751 | $counter = DB::count(); |
| 2752 | 2752 | if ($counter === 0) { |
| 2753 | 2753 | DB::insert( |
@@ -2779,7 +2779,7 @@ discard block |
||
| 2779 | 2779 | |
| 2780 | 2780 | // send statistics items |
| 2781 | 2781 | if (null !== $post_list) { |
| 2782 | - DB::query('SELECT * FROM ' . prefixTable('misc') . ' WHERE type = %s AND intitule = %s', 'admin', 'send_statistics_items'); |
|
| 2782 | + DB::query('SELECT * FROM '.prefixTable('misc').' WHERE type = %s AND intitule = %s', 'admin', 'send_statistics_items'); |
|
| 2783 | 2783 | $counter = DB::count(); |
| 2784 | 2784 | if ($counter === 0) { |
| 2785 | 2785 | DB::insert( |
@@ -2826,7 +2826,7 @@ discard block |
||
| 2826 | 2826 | break; |
| 2827 | 2827 | } |
| 2828 | 2828 | |
| 2829 | - if (DB::query("SHOW TABLES LIKE '" . prefixTable('sk_reencrypt_backup') . "'")) { |
|
| 2829 | + if (DB::query("SHOW TABLES LIKE '".prefixTable('sk_reencrypt_backup')."'")) { |
|
| 2830 | 2830 | if (DB::count() === 1) { |
| 2831 | 2831 | echo 1; |
| 2832 | 2832 | } else { |
@@ -2864,7 +2864,7 @@ discard block |
||
| 2864 | 2864 | |
| 2865 | 2865 | $rows = DB::query( |
| 2866 | 2866 | 'SELECT id, title |
| 2867 | - FROM ' . prefixTable('roles_title') . ' |
|
| 2867 | + FROM ' . prefixTable('roles_title').' |
|
| 2868 | 2868 | ORDER BY title ASC' |
| 2869 | 2869 | ); |
| 2870 | 2870 | foreach ($rows as $record) { |
@@ -37,12 +37,12 @@ discard block |
||
| 37 | 37 | } |
| 38 | 38 | |
| 39 | 39 | // Do checks |
| 40 | -require_once $SETTINGS['cpassman_dir'] . '/includes/config/include.php'; |
|
| 41 | -require_once $SETTINGS['cpassman_dir'] . '/sources/checks.php'; |
|
| 40 | +require_once $SETTINGS['cpassman_dir'].'/includes/config/include.php'; |
|
| 41 | +require_once $SETTINGS['cpassman_dir'].'/sources/checks.php'; |
|
| 42 | 42 | if (checkUser($_SESSION['user_id'], $_SESSION['key'], 'folders', $SETTINGS) === false) { |
| 43 | 43 | // Not allowed page |
| 44 | 44 | $_SESSION['error']['code'] = ERR_NOT_ALLOWED; |
| 45 | - include $SETTINGS['cpassman_dir'] . '/error.php'; |
|
| 45 | + include $SETTINGS['cpassman_dir'].'/error.php'; |
|
| 46 | 46 | exit(); |
| 47 | 47 | } |
| 48 | 48 | |
@@ -55,14 +55,14 @@ discard block |
||
| 55 | 55 | date_default_timezone_set('UTC'); |
| 56 | 56 | } |
| 57 | 57 | |
| 58 | -require_once $SETTINGS['cpassman_dir'] . '/includes/config/settings.php'; |
|
| 58 | +require_once $SETTINGS['cpassman_dir'].'/includes/config/settings.php'; |
|
| 59 | 59 | header('Content-type: text/html; charset=utf-8'); |
| 60 | -require_once $SETTINGS['cpassman_dir'] . '/includes/language/' . $_SESSION['user_language'] . '.php'; |
|
| 61 | -require_once $SETTINGS['cpassman_dir'] . '/sources/main.functions.php'; |
|
| 62 | -require_once $SETTINGS['cpassman_dir'] . '/sources/SplClassLoader.php'; |
|
| 60 | +require_once $SETTINGS['cpassman_dir'].'/includes/language/'.$_SESSION['user_language'].'.php'; |
|
| 61 | +require_once $SETTINGS['cpassman_dir'].'/sources/main.functions.php'; |
|
| 62 | +require_once $SETTINGS['cpassman_dir'].'/sources/SplClassLoader.php'; |
|
| 63 | 63 | |
| 64 | 64 | // Connect to mysql server |
| 65 | -require_once $SETTINGS['cpassman_dir'] . '/includes/libraries/Database/Meekrodb/db.class.php'; |
|
| 65 | +require_once $SETTINGS['cpassman_dir'].'/includes/libraries/Database/Meekrodb/db.class.php'; |
|
| 66 | 66 | if (defined('DB_PASSWD_CLEAR') === false) { |
| 67 | 67 | define('DB_PASSWD_CLEAR', defuseReturnDecrypted(DB_PASSWD, $SETTINGS)); |
| 68 | 68 | } |
@@ -132,14 +132,14 @@ discard block |
||
| 132 | 132 | && $t->personal_folder == 0 |
| 133 | 133 | ) { |
| 134 | 134 | // get $t->parent_id |
| 135 | - $data = DB::queryFirstRow('SELECT title FROM ' . prefixTable('nested_tree') . ' WHERE id = %i', $t->parent_id); |
|
| 135 | + $data = DB::queryFirstRow('SELECT title FROM '.prefixTable('nested_tree').' WHERE id = %i', $t->parent_id); |
|
| 136 | 136 | if ($t->nlevel == 1) { |
| 137 | 137 | $data['title'] = langHdl('root'); |
| 138 | 138 | } |
| 139 | 139 | |
| 140 | 140 | // get rights on this folder |
| 141 | 141 | $arrayRights = array(); |
| 142 | - $rows = DB::query('SELECT fonction_id FROM ' . prefixTable('rights') . ' WHERE authorized=%i AND tree_id = %i', 1, $t->id); |
|
| 142 | + $rows = DB::query('SELECT fonction_id FROM '.prefixTable('rights').' WHERE authorized=%i AND tree_id = %i', 1, $t->id); |
|
| 143 | 143 | foreach ($rows as $record) { |
| 144 | 144 | array_push($arrayRights, $record['fonction_id']); |
| 145 | 145 | } |
@@ -156,8 +156,8 @@ discard block |
||
| 156 | 156 | $node_data = DB::queryFirstRow( |
| 157 | 157 | 'SELECT m.valeur AS valeur, n.renewal_period AS renewal_period, |
| 158 | 158 | n.bloquer_creation AS bloquer_creation, n.bloquer_modification AS bloquer_modification |
| 159 | - FROM ' . prefixTable('misc') . ' AS m, |
|
| 160 | - ' . prefixTable('nested_tree') . ' AS n |
|
| 159 | + FROM ' . prefixTable('misc').' AS m, |
|
| 160 | + ' . prefixTable('nested_tree').' AS n |
|
| 161 | 161 | WHERE m.type=%s AND m.intitule = n.id AND m.intitule = %i', |
| 162 | 162 | 'complex', |
| 163 | 163 | $t->id |
@@ -190,7 +190,7 @@ discard block |
||
| 190 | 190 | //col7 |
| 191 | 191 | $data7 = DB::queryFirstRow( |
| 192 | 192 | 'SELECT bloquer_creation,bloquer_modification |
| 193 | - FROM ' . prefixTable('nested_tree') . ' |
|
| 193 | + FROM ' . prefixTable('nested_tree').' |
|
| 194 | 194 | WHERE id = %i', |
| 195 | 195 | intval($t->id) |
| 196 | 196 | ); |
@@ -325,7 +325,7 @@ discard block |
||
| 325 | 325 | // Get info about this folder |
| 326 | 326 | $dataFolder = DB::queryfirstrow( |
| 327 | 327 | 'SELECT * |
| 328 | - FROM ' . prefixTable('nested_tree') . ' |
|
| 328 | + FROM ' . prefixTable('nested_tree').' |
|
| 329 | 329 | WHERE id = %i', |
| 330 | 330 | $post_folder_id |
| 331 | 331 | ); |
@@ -361,7 +361,7 @@ discard block |
||
| 361 | 361 | //check if parent folder is personal |
| 362 | 362 | $dataParent = DB::queryfirstrow( |
| 363 | 363 | 'SELECT personal_folder, bloquer_creation, bloquer_modification |
| 364 | - FROM ' . prefixTable('nested_tree') . ' |
|
| 364 | + FROM ' . prefixTable('nested_tree').' |
|
| 365 | 365 | WHERE id = %i', |
| 366 | 366 | $post_parent_id |
| 367 | 367 | ); |
@@ -390,7 +390,7 @@ discard block |
||
| 390 | 390 | // get complexity level for this folder |
| 391 | 391 | $data = DB::queryfirstrow( |
| 392 | 392 | 'SELECT valeur |
| 393 | - FROM ' . prefixTable('misc') . ' |
|
| 393 | + FROM ' . prefixTable('misc').' |
|
| 394 | 394 | WHERE intitule = %i AND type = %s', |
| 395 | 395 | $post_parent_id, |
| 396 | 396 | 'complex' |
@@ -401,7 +401,7 @@ discard block |
||
| 401 | 401 | array( |
| 402 | 402 | 'error' => true, |
| 403 | 403 | 'message' => langHdl('error_folder_complexity_lower_than_top_folder') |
| 404 | - . ' [<b>' . TP_PW_COMPLEXITY[$data['valeur']][1] . '</b>]', |
|
| 404 | + . ' [<b>'.TP_PW_COMPLEXITY[$data['valeur']][1].'</b>]', |
|
| 405 | 405 | ), |
| 406 | 406 | 'encode' |
| 407 | 407 | ); |
@@ -554,7 +554,7 @@ discard block |
||
| 554 | 554 | ) { |
| 555 | 555 | DB::query( |
| 556 | 556 | 'SELECT * |
| 557 | - FROM ' . prefixTable('nested_tree') . ' |
|
| 557 | + FROM ' . prefixTable('nested_tree').' |
|
| 558 | 558 | WHERE title = %s', |
| 559 | 559 | $post_title |
| 560 | 560 | ); |
@@ -574,7 +574,7 @@ discard block |
||
| 574 | 574 | //check if parent folder is personal |
| 575 | 575 | $data = DB::queryfirstrow( |
| 576 | 576 | 'SELECT personal_folder, bloquer_creation, bloquer_modification |
| 577 | - FROM ' . prefixTable('nested_tree') . ' |
|
| 577 | + FROM ' . prefixTable('nested_tree').' |
|
| 578 | 578 | WHERE id = %i', |
| 579 | 579 | $post_parent_id |
| 580 | 580 | ); |
@@ -603,7 +603,7 @@ discard block |
||
| 603 | 603 | // get complexity level for this folder |
| 604 | 604 | $data = DB::queryfirstrow( |
| 605 | 605 | 'SELECT valeur |
| 606 | - FROM ' . prefixTable('misc') . ' |
|
| 606 | + FROM ' . prefixTable('misc').' |
|
| 607 | 607 | WHERE intitule = %i AND type = %s', |
| 608 | 608 | $post_parent_id, |
| 609 | 609 | 'complex' |
@@ -613,7 +613,7 @@ discard block |
||
| 613 | 613 | array( |
| 614 | 614 | 'error' => true, |
| 615 | 615 | 'message' => langHdl('error_folder_complexity_lower_than_top_folder') |
| 616 | - . ' [<b>' . TP_PW_COMPLEXITY[$data['valeur']][1] . '</b>]', |
|
| 616 | + . ' [<b>'.TP_PW_COMPLEXITY[$data['valeur']][1].'</b>]', |
|
| 617 | 617 | ), |
| 618 | 618 | 'encode' |
| 619 | 619 | ); |
@@ -687,7 +687,7 @@ discard block |
||
| 687 | 687 | && (int) $SETTINGS['subfolder_rights_as_parent'] === 1 |
| 688 | 688 | ) { |
| 689 | 689 | //If it is a subfolder, then give access to it for all roles that allows the parent folder |
| 690 | - $rows = DB::query('SELECT role_id, type FROM ' . prefixTable('roles_values') . ' WHERE folder_id = %i', $post_parent_id); |
|
| 690 | + $rows = DB::query('SELECT role_id, type FROM '.prefixTable('roles_values').' WHERE folder_id = %i', $post_parent_id); |
|
| 691 | 691 | foreach ($rows as $record) { |
| 692 | 692 | //add access to this subfolder |
| 693 | 693 | DB::insert( |
@@ -702,7 +702,7 @@ discard block |
||
| 702 | 702 | } |
| 703 | 703 | |
| 704 | 704 | // if parent folder has Custom Fields Categories then add to this child one too |
| 705 | - $rows = DB::query('SELECT id_category FROM ' . prefixTable('categories_folders') . ' WHERE id_folder = %i', $post_parent_id); |
|
| 705 | + $rows = DB::query('SELECT id_category FROM '.prefixTable('categories_folders').' WHERE id_folder = %i', $post_parent_id); |
|
| 706 | 706 | foreach ($rows as $record) { |
| 707 | 707 | //add CF Category to this subfolder |
| 708 | 708 | DB::insert( |
@@ -779,17 +779,17 @@ discard block |
||
| 779 | 779 | prefixTable('misc'), |
| 780 | 780 | array( |
| 781 | 781 | 'type' => 'folder_deleted', |
| 782 | - 'intitule' => 'f' . $folder->id, |
|
| 783 | - 'valeur' => $folder->id . ', ' . $folder->parent_id . ', ' . |
|
| 784 | - $folder->title . ', ' . $folder->nleft . ', ' . $folder->nright . ', ' . |
|
| 785 | - $folder->nlevel . ', 0, 0, 0, 0', |
|
| 782 | + 'intitule' => 'f'.$folder->id, |
|
| 783 | + 'valeur' => $folder->id.', '.$folder->parent_id.', '. |
|
| 784 | + $folder->title.', '.$folder->nleft.', '.$folder->nright.', '. |
|
| 785 | + $folder->nlevel.', 0, 0, 0, 0', |
|
| 786 | 786 | ) |
| 787 | 787 | ); |
| 788 | 788 | //array for delete folder |
| 789 | 789 | $folderForDel[] = $folder->id; |
| 790 | 790 | |
| 791 | 791 | //delete items & logs |
| 792 | - $items = DB::query('SELECT id FROM ' . prefixTable('items') . ' WHERE id_tree=%i', $folder->id); |
|
| 792 | + $items = DB::query('SELECT id FROM '.prefixTable('items').' WHERE id_tree=%i', $folder->id); |
|
| 793 | 793 | foreach ($items as $item) { |
| 794 | 794 | DB::update( |
| 795 | 795 | prefixTable('items'), |
@@ -846,7 +846,7 @@ discard block |
||
| 846 | 846 | $tree->rebuild(); |
| 847 | 847 | |
| 848 | 848 | // reload cache table |
| 849 | - include_once $SETTINGS['cpassman_dir'] . '/sources/main.functions.php'; |
|
| 849 | + include_once $SETTINGS['cpassman_dir'].'/sources/main.functions.php'; |
|
| 850 | 850 | updateCacheTable('reload', $SETTINGS, null); |
| 851 | 851 | |
| 852 | 852 | echo prepareExchangedData( |
@@ -932,7 +932,7 @@ discard block |
||
| 932 | 932 | // get complexity of current node |
| 933 | 933 | $nodeComplexity = DB::queryfirstrow( |
| 934 | 934 | 'SELECT valeur |
| 935 | - FROM ' . prefixTable('misc') . ' |
|
| 935 | + FROM ' . prefixTable('misc').' |
|
| 936 | 936 | WHERE intitule = %i AND type= %s', |
| 937 | 937 | $nodeInfo->id, |
| 938 | 938 | 'complex' |
@@ -1007,7 +1007,7 @@ discard block |
||
| 1007 | 1007 | // If it is a subfolder, then give access to it for all roles that allows the parent folder |
| 1008 | 1008 | $rows = DB::query( |
| 1009 | 1009 | 'SELECT role_id, type |
| 1010 | - FROM ' . prefixTable('roles_values') . ' |
|
| 1010 | + FROM ' . prefixTable('roles_values').' |
|
| 1011 | 1011 | WHERE folder_id = %i', |
| 1012 | 1012 | $parentId |
| 1013 | 1013 | ); |
@@ -1015,7 +1015,7 @@ discard block |
||
| 1015 | 1015 | // Add access to this subfolder after checking that it is not already set |
| 1016 | 1016 | DB::query( |
| 1017 | 1017 | 'SELECT * |
| 1018 | - FROM ' . prefixTable('roles_values') . ' |
|
| 1018 | + FROM ' . prefixTable('roles_values').' |
|
| 1019 | 1019 | WHERE folder_id = %i AND role_id = %i', |
| 1020 | 1020 | $newFolderId, |
| 1021 | 1021 | $record['role_id'] |
@@ -1035,7 +1035,7 @@ discard block |
||
| 1035 | 1035 | // if parent folder has Custom Fields Categories then add to this child one too |
| 1036 | 1036 | $rows = DB::query( |
| 1037 | 1037 | 'SELECT id_category |
| 1038 | - FROM ' . prefixTable('categories_folders') . ' |
|
| 1038 | + FROM ' . prefixTable('categories_folders').' |
|
| 1039 | 1039 | WHERE id_folder = %i', |
| 1040 | 1040 | $nodeInfo->id |
| 1041 | 1041 | ); |
@@ -1054,7 +1054,7 @@ discard block |
||
| 1054 | 1054 | |
| 1055 | 1055 | $rows = DB::query( |
| 1056 | 1056 | 'SELECT * |
| 1057 | - FROM ' . prefixTable('items') . ' |
|
| 1057 | + FROM ' . prefixTable('items').' |
|
| 1058 | 1058 | WHERE id_tree = %i', |
| 1059 | 1059 | $nodeInfo->id |
| 1060 | 1060 | ); |
@@ -1063,7 +1063,7 @@ discard block |
||
| 1063 | 1063 | // if it is then don't copy it |
| 1064 | 1064 | $item_deleted = DB::queryFirstRow( |
| 1065 | 1065 | 'SELECT * |
| 1066 | - FROM ' . prefixTable('log_items') . ' |
|
| 1066 | + FROM ' . prefixTable('log_items').' |
|
| 1067 | 1067 | WHERE id_item = %i AND action = %s |
| 1068 | 1068 | ORDER BY date DESC |
| 1069 | 1069 | LIMIT 0, 1', |
@@ -1074,7 +1074,7 @@ discard block |
||
| 1074 | 1074 | |
| 1075 | 1075 | $item_restored = DB::queryFirstRow( |
| 1076 | 1076 | 'SELECT * |
| 1077 | - FROM ' . prefixTable('log_items') . ' |
|
| 1077 | + FROM ' . prefixTable('log_items').' |
|
| 1078 | 1078 | WHERE id_item = %i AND action = %s |
| 1079 | 1079 | ORDER BY date DESC |
| 1080 | 1080 | LIMIT 0, 1', |
@@ -1089,7 +1089,7 @@ discard block |
||
| 1089 | 1089 | // Get the ITEM object key for the user |
| 1090 | 1090 | $userKey = DB::queryFirstRow( |
| 1091 | 1091 | 'SELECT share_key |
| 1092 | - FROM ' . prefixTable('sharekeys_items') . ' |
|
| 1092 | + FROM ' . prefixTable('sharekeys_items').' |
|
| 1093 | 1093 | WHERE user_id = %i AND object_id = %i', |
| 1094 | 1094 | $_SESSION['user_id'], |
| 1095 | 1095 | $record['id'] |
@@ -1163,7 +1163,7 @@ discard block |
||
| 1163 | 1163 | // Manage Custom Fields |
| 1164 | 1164 | $categories = DB::query( |
| 1165 | 1165 | 'SELECT * |
| 1166 | - FROM ' . prefixTable('categories_items') . ' |
|
| 1166 | + FROM ' . prefixTable('categories_items').' |
|
| 1167 | 1167 | WHERE item_id = %i', |
| 1168 | 1168 | $record['id'] |
| 1169 | 1169 | ); |
@@ -1211,15 +1211,15 @@ discard block |
||
| 1211 | 1211 | $files = DB::query( |
| 1212 | 1212 | 'SELECT f.id AS id, f.file AS file, f.name AS name, f.status AS status, f.extension AS extension, |
| 1213 | 1213 | f.size AS size, f.type AS type, s.share_key AS share_key |
| 1214 | - FROM ' . prefixTable('files') . ' AS f |
|
| 1215 | - INNER JOIN ' . prefixTable('sharekeys_files') . ' AS s ON (f.id = s.object_id) |
|
| 1214 | + FROM ' . prefixTable('files').' AS f |
|
| 1215 | + INNER JOIN ' . prefixTable('sharekeys_files').' AS s ON (f.id = s.object_id) |
|
| 1216 | 1216 | WHERE s.user_id = %i AND f.id_item = %i', |
| 1217 | 1217 | $_SESSION['user_id'], |
| 1218 | 1218 | $record['id'] |
| 1219 | 1219 | ); |
| 1220 | 1220 | foreach ($files as $file) { |
| 1221 | 1221 | // Check if file still exists |
| 1222 | - if (file_exists($SETTINGS['path_to_upload_folder'] . DIRECTORY_SEPARATOR . TP_FILE_PREFIX . base64_decode($file['file'])) === true) { |
|
| 1222 | + if (file_exists($SETTINGS['path_to_upload_folder'].DIRECTORY_SEPARATOR.TP_FILE_PREFIX.base64_decode($file['file'])) === true) { |
|
| 1223 | 1223 | // Step1 - decrypt the file |
| 1224 | 1224 | $fileContent = decryptFile( |
| 1225 | 1225 | $file['file'], |
@@ -1228,9 +1228,9 @@ discard block |
||
| 1228 | 1228 | ); |
| 1229 | 1229 | |
| 1230 | 1230 | // Step2 - create file |
| 1231 | - $newFileName = md5(time() . '_' . $file['id']) . '.' . $file['extension']; |
|
| 1231 | + $newFileName = md5(time().'_'.$file['id']).'.'.$file['extension']; |
|
| 1232 | 1232 | |
| 1233 | - $outstream = fopen($SETTINGS['path_to_upload_folder'] . DIRECTORY_SEPARATOR . $newFileName, 'ab'); |
|
| 1233 | + $outstream = fopen($SETTINGS['path_to_upload_folder'].DIRECTORY_SEPARATOR.$newFileName, 'ab'); |
|
| 1234 | 1234 | if ($outstream === false) { |
| 1235 | 1235 | echo prepareExchangedData( |
| 1236 | 1236 | array( |
@@ -1305,7 +1305,7 @@ discard block |
||
| 1305 | 1305 | $tree->rebuild(); |
| 1306 | 1306 | |
| 1307 | 1307 | // reload cache table |
| 1308 | - include_once $SETTINGS['cpassman_dir'] . '/sources/main.functions.php'; |
|
| 1308 | + include_once $SETTINGS['cpassman_dir'].'/sources/main.functions.php'; |
|
| 1309 | 1309 | updateCacheTable('reload', $SETTINGS, NULL); |
| 1310 | 1310 | |
| 1311 | 1311 | $data = array( |
@@ -1367,7 +1367,7 @@ discard block |
||
| 1367 | 1367 | // Get path |
| 1368 | 1368 | $text = ''; |
| 1369 | 1369 | foreach ($tree->getPath($folder->id, false) as $fld) { |
| 1370 | - $text .= empty($text) === true ? ' [<i>' . $fld->title : ' > ' . $fld->title; |
|
| 1370 | + $text .= empty($text) === true ? ' [<i>'.$fld->title : ' > '.$fld->title; |
|
| 1371 | 1371 | } |
| 1372 | 1372 | |
| 1373 | 1373 | // Save array |
@@ -1377,7 +1377,7 @@ discard block |
||
| 1377 | 1377 | 'id' => (int) $folder->id, |
| 1378 | 1378 | 'label' => $folder->title, |
| 1379 | 1379 | 'level' => $folder->nlevel, |
| 1380 | - 'path' => empty($text) === true ? '' : $text . '</i>]' |
|
| 1380 | + 'path' => empty($text) === true ? '' : $text.'</i>]' |
|
| 1381 | 1381 | ) |
| 1382 | 1382 | ); |
| 1383 | 1383 | } |
@@ -42,11 +42,11 @@ discard block |
||
| 42 | 42 | } |
| 43 | 43 | |
| 44 | 44 | // includes |
| 45 | -require_once $SETTINGS['cpassman_dir'] . '/includes/config/include.php'; |
|
| 46 | -require_once $SETTINGS['cpassman_dir'] . '/sources/SplClassLoader.php'; |
|
| 47 | -require_once $SETTINGS['cpassman_dir'] . '/sources/main.functions.php'; |
|
| 48 | -require_once $SETTINGS['cpassman_dir'] . '/includes/language/' . $_SESSION['user_language'] . '.php'; |
|
| 49 | -require_once $SETTINGS['cpassman_dir'] . '/includes/config/settings.php'; |
|
| 45 | +require_once $SETTINGS['cpassman_dir'].'/includes/config/include.php'; |
|
| 46 | +require_once $SETTINGS['cpassman_dir'].'/sources/SplClassLoader.php'; |
|
| 47 | +require_once $SETTINGS['cpassman_dir'].'/sources/main.functions.php'; |
|
| 48 | +require_once $SETTINGS['cpassman_dir'].'/includes/language/'.$_SESSION['user_language'].'.php'; |
|
| 49 | +require_once $SETTINGS['cpassman_dir'].'/includes/config/settings.php'; |
|
| 50 | 50 | |
| 51 | 51 | // header |
| 52 | 52 | header('Content-type: text/html; charset=utf-8'); |
@@ -60,7 +60,7 @@ discard block |
||
| 60 | 60 | } |
| 61 | 61 | |
| 62 | 62 | // Connect to mysql server |
| 63 | -require_once $SETTINGS['cpassman_dir'] . '/includes/libraries/Database/Meekrodb/db.class.php'; |
|
| 63 | +require_once $SETTINGS['cpassman_dir'].'/includes/libraries/Database/Meekrodb/db.class.php'; |
|
| 64 | 64 | if (defined('DB_PASSWD_CLEAR') === false) { |
| 65 | 65 | define('DB_PASSWD_CLEAR', defuseReturnDecrypted(DB_PASSWD, $SETTINGS)); |
| 66 | 66 | } |
@@ -72,7 +72,7 @@ discard block |
||
| 72 | 72 | DB::$encoding = DB_ENCODING; |
| 73 | 73 | |
| 74 | 74 | // Superglobal load |
| 75 | -require_once $SETTINGS['cpassman_dir'] . '/includes/libraries/protect/SuperGlobal/SuperGlobal.php'; |
|
| 75 | +require_once $SETTINGS['cpassman_dir'].'/includes/libraries/protect/SuperGlobal/SuperGlobal.php'; |
|
| 76 | 76 | $superGlobal = new protect\SuperGlobal\SuperGlobal(); |
| 77 | 77 | $get = []; |
| 78 | 78 | $get['user_tree_structure'] = $superGlobal->get('user_tree_structure', 'GET'); |
@@ -92,7 +92,7 @@ discard block |
||
| 92 | 92 | $session['personal_visible_groups'] = $superGlobal->get('personal_visible_groups', 'SESSION'); |
| 93 | 93 | |
| 94 | 94 | $lastFolderChange = DB::query( |
| 95 | - 'SELECT * FROM ' . prefixTable('misc') . ' |
|
| 95 | + 'SELECT * FROM '.prefixTable('misc').' |
|
| 96 | 96 | WHERE type = %s AND intitule = %s', |
| 97 | 97 | 'timestamp', |
| 98 | 98 | 'last_folder_change' |
@@ -103,7 +103,7 @@ discard block |
||
| 103 | 103 | || (isset($get['force_refresh']) === true && (int) $get['force_refresh'] === 1) |
| 104 | 104 | ) { |
| 105 | 105 | // Build tree |
| 106 | - $tree = new SplClassLoader('Tree\NestedTree', $SETTINGS['cpassman_dir'] . '/includes/libraries'); |
|
| 106 | + $tree = new SplClassLoader('Tree\NestedTree', $SETTINGS['cpassman_dir'].'/includes/libraries'); |
|
| 107 | 107 | $tree->register(); |
| 108 | 108 | $tree = new Tree\NestedTree\NestedTree(prefixTable('nested_tree'), 'id', 'parent_id', 'title'); |
| 109 | 109 | |
@@ -213,7 +213,7 @@ discard block |
||
| 213 | 213 | $SETTINGS |
| 214 | 214 | ) { |
| 215 | 215 | // Load library |
| 216 | - include_once $SETTINGS['cpassman_dir'] . '/includes/libraries/protect/SuperGlobal/SuperGlobal.php'; |
|
| 216 | + include_once $SETTINGS['cpassman_dir'].'/includes/libraries/protect/SuperGlobal/SuperGlobal.php'; |
|
| 217 | 217 | $superGlobal = new protect\SuperGlobal\SuperGlobal(); |
| 218 | 218 | |
| 219 | 219 | // Prepare superGlobal variables |
@@ -267,7 +267,7 @@ discard block |
||
| 267 | 267 | // get count of Items in this folder |
| 268 | 268 | DB::query( |
| 269 | 269 | 'SELECT * |
| 270 | - FROM ' . prefixTable('items') . ' |
|
| 270 | + FROM ' . prefixTable('items').' |
|
| 271 | 271 | WHERE inactif=%i AND id_tree = %i', |
| 272 | 272 | 0, |
| 273 | 273 | $node->id |
@@ -277,7 +277,7 @@ discard block |
||
| 277 | 277 | // get info about current folder |
| 278 | 278 | DB::query( |
| 279 | 279 | 'SELECT * |
| 280 | - FROM ' . prefixTable('nested_tree') . ' |
|
| 280 | + FROM ' . prefixTable('nested_tree').' |
|
| 281 | 281 | WHERE parent_id = %i', |
| 282 | 282 | $node->id |
| 283 | 283 | ); |
@@ -285,11 +285,10 @@ discard block |
||
| 285 | 285 | |
| 286 | 286 | // If personal Folder, convert id into user name |
| 287 | 287 | $node->title = $node->title === $session_user_id && (int) $node->nlevel === 1 ? |
| 288 | - $session_login : |
|
| 289 | - ($node->title === null ? '' : htmlspecialchars_decode($node->title, ENT_QUOTES)); |
|
| 288 | + $session_login : ($node->title === null ? '' : htmlspecialchars_decode($node->title, ENT_QUOTES)); |
|
| 290 | 289 | |
| 291 | 290 | // prepare json return for current node |
| 292 | - $parent = $node->parent_id === 0 ? '#' : 'li_' . $node->parent_id; |
|
| 291 | + $parent = $node->parent_id === 0 ? '#' : 'li_'.$node->parent_id; |
|
| 293 | 292 | |
| 294 | 293 | // special case for READ-ONLY folder |
| 295 | 294 | $title = $session_user_read_only === true && in_array($node->id, $session_personal_folders) === false ? langHdl('read_only_account') : $title; |
@@ -299,33 +298,30 @@ discard block |
||
| 299 | 298 | |
| 300 | 299 | if (in_array($node->id, $session_groupes_visibles)) { |
| 301 | 300 | if (in_array($node->id, $session_read_only_folders)) { |
| 302 | - $text = "<i class='far fa-eye fa-xs mr-1'></i>" . $text; |
|
| 301 | + $text = "<i class='far fa-eye fa-xs mr-1'></i>".$text; |
|
| 303 | 302 | $title = langHdl('read_only_account'); |
| 304 | 303 | $restricted = 1; |
| 305 | 304 | $folderClass = 'folder_not_droppable'; |
| 306 | 305 | } elseif ($session_user_read_only === true && !in_array($node->id, $session_personal_visible_groups)) { |
| 307 | - $text = "<i class='far fa-eye fa-xs mr-1'></i>" . $text; |
|
| 306 | + $text = "<i class='far fa-eye fa-xs mr-1'></i>".$text; |
|
| 308 | 307 | } |
| 309 | 308 | $text .= |
| 310 | - ' <span class=\'badge badge-danger ml-2 items_count\' id=\'itcount_' . $node->id . '\'>' . $itemsNb . '</span>' |
|
| 309 | + ' <span class=\'badge badge-danger ml-2 items_count\' id=\'itcount_'.$node->id.'\'>'.$itemsNb.'</span>' |
|
| 311 | 310 | .(isset($SETTINGS['tree_counters']) && $SETTINGS['tree_counters'] === 1 ? |
| 312 | - '/'.$nbChildrenItems .'/'.(count($nodeDescendants) - 1) : |
|
| 313 | - '') |
|
| 311 | + '/'.$nbChildrenItems.'/'.(count($nodeDescendants) - 1) : '') |
|
| 314 | 312 | .'</span>'; |
| 315 | 313 | } elseif (in_array($node->id, $listFoldersLimitedKeys)) { |
| 316 | 314 | $restricted = 1; |
| 317 | 315 | $text .= |
| 318 | 316 | $session_user_read_only === true ? |
| 319 | - "<i class='far fa-eye fa-xs mr-1'></i>" : |
|
| 320 | - '<span class="badge badge-danger ml-2 items_count" id="itcount_' . $node->id . '">' . count($session_list_folders_limited[$node->id]) . '</span>'; |
|
| 317 | + "<i class='far fa-eye fa-xs mr-1'></i>" : '<span class="badge badge-danger ml-2 items_count" id="itcount_'.$node->id.'">'.count($session_list_folders_limited[$node->id]).'</span>'; |
|
| 321 | 318 | } elseif (in_array($node->id, $listRestrictedFoldersForItemsKeys)) { |
| 322 | 319 | $restricted = 1; |
| 323 | 320 | if ($session_user_read_only === true) { |
| 324 | - $text = "<i class='far fa-eye fa-xs mr-1'></i>" . $text; |
|
| 321 | + $text = "<i class='far fa-eye fa-xs mr-1'></i>".$text; |
|
| 325 | 322 | } |
| 326 | 323 | $text .= $session_user_read_only === true ? |
| 327 | - "<i class='far fa-eye fa-xs mr-1'></i>" : |
|
| 328 | - '<span class="badge badge-danger ml-2 items_count" id="itcount_' . $node->id . '">' . count($session_list_restricted_folders_for_items[$node->id]) . '</span>'; |
|
| 324 | + "<i class='far fa-eye fa-xs mr-1'></i>" : '<span class="badge badge-danger ml-2 items_count" id="itcount_'.$node->id.'">'.count($session_list_restricted_folders_for_items[$node->id]).'</span>'; |
|
| 329 | 325 | } else { |
| 330 | 326 | $restricted = 1; |
| 331 | 327 | $folderClass = 'folder_not_droppable'; |
@@ -351,18 +347,18 @@ discard block |
||
| 351 | 347 | array_push( |
| 352 | 348 | $ret_json, |
| 353 | 349 | array( |
| 354 | - 'id' => 'li_' . $node->id, |
|
| 350 | + 'id' => 'li_'.$node->id, |
|
| 355 | 351 | 'parent' => $parent, |
| 356 | 352 | 'text' => $text, |
| 357 | 353 | 'children' => $childrenNb === 0 ? false : true, |
| 358 | 354 | 'li_attr' => array( |
| 359 | 355 | 'class' => 'jstreeopen', |
| 360 | - 'title' => 'ID [' . $node->id . '] ' . $title, |
|
| 356 | + 'title' => 'ID ['.$node->id.'] '.$title, |
|
| 361 | 357 | ), |
| 362 | 358 | 'a_attr' => array( |
| 363 | - 'id' => 'fld_' . $node->id, |
|
| 359 | + 'id' => 'fld_'.$node->id, |
|
| 364 | 360 | 'class' => $folderClass, |
| 365 | - 'onclick' => 'ListerItems(' . $node->id . ', ' . $restricted . ', 0, 1)', |
|
| 361 | + 'onclick' => 'ListerItems('.$node->id.', '.$restricted.', 0, 1)', |
|
| 366 | 362 | 'data-title' => $node->title, |
| 367 | 363 | ), |
| 368 | 364 | ) |
@@ -371,13 +367,13 @@ discard block |
||
| 371 | 367 | array_push( |
| 372 | 368 | $ret_json, |
| 373 | 369 | array( |
| 374 | - 'id' => 'li_' . $node->id, |
|
| 370 | + 'id' => 'li_'.$node->id, |
|
| 375 | 371 | 'parent' => $parent, |
| 376 | 372 | 'children' => $childrenNb === 0 ? false : true, |
| 377 | - 'text' => '<i class="fas fa-times fa-xs text-danger mr-1"></i>' . $text, |
|
| 373 | + 'text' => '<i class="fas fa-times fa-xs text-danger mr-1"></i>'.$text, |
|
| 378 | 374 | 'li_attr' => array( |
| 379 | 375 | 'class' => '', |
| 380 | - 'title' => 'ID [' . $node->id . '] ' . langHdl('no_access'), |
|
| 376 | + 'title' => 'ID ['.$node->id.'] '.langHdl('no_access'), |
|
| 381 | 377 | ), |
| 382 | 378 | ) |
| 383 | 379 | ); |
@@ -470,7 +466,7 @@ discard block |
||
| 470 | 466 | ) === true |
| 471 | 467 | ) { |
| 472 | 468 | DB::query( |
| 473 | - 'SELECT * FROM ' . prefixTable('items') . ' |
|
| 469 | + 'SELECT * FROM '.prefixTable('items').' |
|
| 474 | 470 | WHERE inactif=%i AND id_tree = %i', |
| 475 | 471 | 0, |
| 476 | 472 | $node |
@@ -557,7 +553,7 @@ discard block |
||
| 557 | 553 | { |
| 558 | 554 | // get info about current folder |
| 559 | 555 | DB::query( |
| 560 | - 'SELECT * FROM ' . prefixTable('items') . ' |
|
| 556 | + 'SELECT * FROM '.prefixTable('items').' |
|
| 561 | 557 | WHERE inactif=%i AND id_tree = %i', |
| 562 | 558 | 0, |
| 563 | 559 | $completTree[$nodeId]->id |
@@ -658,7 +654,7 @@ discard block |
||
| 658 | 654 | */ |
| 659 | 655 | |
| 660 | 656 | // prepare json return for current node |
| 661 | - $parent = $completTree[$nodeId]->parent_id === '0' ? '#' : 'li_' . $completTree[$nodeId]->parent_id; |
|
| 657 | + $parent = $completTree[$nodeId]->parent_id === '0' ? '#' : 'li_'.$completTree[$nodeId]->parent_id; |
|
| 662 | 658 | |
| 663 | 659 | // handle displaying |
| 664 | 660 | if ( |
@@ -678,17 +674,17 @@ discard block |
||
| 678 | 674 | array_push( |
| 679 | 675 | $ret_json, |
| 680 | 676 | array( |
| 681 | - 'id' => 'li_' . $completTree[$nodeId]->id, |
|
| 677 | + 'id' => 'li_'.$completTree[$nodeId]->id, |
|
| 682 | 678 | 'parent' => $last_visible_parent === -1 ? $parent : $last_visible_parent, |
| 683 | 679 | 'text' => $text.$completTree[$nodeId]->title.$nodeData['html'], |
| 684 | 680 | 'li_attr' => array( |
| 685 | 681 | 'class' => 'jstreeopen', |
| 686 | - 'title' => 'ID [' . $completTree[$nodeId]->id . '] ' . $nodeData['title'], |
|
| 682 | + 'title' => 'ID ['.$completTree[$nodeId]->id.'] '.$nodeData['title'], |
|
| 687 | 683 | ), |
| 688 | 684 | 'a_attr' => array( |
| 689 | - 'id' => 'fld_' . $completTree[$nodeId]->id, |
|
| 685 | + 'id' => 'fld_'.$completTree[$nodeId]->id, |
|
| 690 | 686 | 'class' => $nodeData['folderClass'], |
| 691 | - 'onclick' => 'ListerItems(' . $completTree[$nodeId]->id . ', ' . $nodeData['restricted'] . ', 0, 1)', |
|
| 687 | + 'onclick' => 'ListerItems('.$completTree[$nodeId]->id.', '.$nodeData['restricted'].', 0, 1)', |
|
| 692 | 688 | 'data-title' => $completTree[$nodeId]->title, |
| 693 | 689 | ), |
| 694 | 690 | ) |
@@ -697,12 +693,12 @@ discard block |
||
| 697 | 693 | array_push( |
| 698 | 694 | $ret_json, |
| 699 | 695 | array( |
| 700 | - 'id' => 'li_' . $completTree[$nodeId]->id, |
|
| 696 | + 'id' => 'li_'.$completTree[$nodeId]->id, |
|
| 701 | 697 | 'parent' => $last_visible_parent === -1 ? $parent : $last_visible_parent, |
| 702 | 698 | 'text' => '<i class="fas fa-times fa-xs text-danger mr-1"></i>'.$text.$completTree[$nodeId]->title.$nodeData['html'], |
| 703 | 699 | 'li_attr' => array( |
| 704 | 700 | 'class' => '', |
| 705 | - 'title' => 'ID [' . $completTree[$nodeId]->id . '] ' . langHdl('no_access'), |
|
| 701 | + 'title' => 'ID ['.$completTree[$nodeId]->id.'] '.langHdl('no_access'), |
|
| 706 | 702 | ), |
| 707 | 703 | ) |
| 708 | 704 | ); |
@@ -765,8 +761,8 @@ discard block |
||
| 765 | 761 | if (in_array($nodeId, $session_groupes_visibles) === true) { |
| 766 | 762 | if (in_array($nodeId, $session_read_only_folders) === true) { |
| 767 | 763 | return [ |
| 768 | - 'html' => '<i class="far fa-eye fa-xs mr-1"></i><span class="badge badge-pill badge-light ml-2 items_count" id="itcount_' . $nodeId . '">' . $itemsNb . |
|
| 769 | - ($tree_counters === 1 ? '/'.$nbChildrenItems .'/'.(count($nodeDescendants) - 1) : '') . '</span>', |
|
| 764 | + 'html' => '<i class="far fa-eye fa-xs mr-1"></i><span class="badge badge-pill badge-light ml-2 items_count" id="itcount_'.$nodeId.'">'.$itemsNb. |
|
| 765 | + ($tree_counters === 1 ? '/'.$nbChildrenItems.'/'.(count($nodeDescendants) - 1) : '').'</span>', |
|
| 770 | 766 | 'title' => langHdl('read_only_account'), |
| 771 | 767 | 'restricted' => 1, |
| 772 | 768 | 'folderClass' => 'folder_not_droppable', |
@@ -780,8 +776,8 @@ discard block |
||
| 780 | 776 | && in_array($nodeId, $session_personal_visible_groups) === false |
| 781 | 777 | ) { |
| 782 | 778 | return [ |
| 783 | - 'html' => '<i class="far fa-eye fa-xs mr-1"></i><span class="badge badge-pill badge-light ml-2 items_count" id="itcount_' . $nodeId . '">' . $itemsNb . |
|
| 784 | - ($tree_counters === 1 ? '/'.$nbChildrenItems .'/'.(count($nodeDescendants) - 1) : '') . '</span>', |
|
| 779 | + 'html' => '<i class="far fa-eye fa-xs mr-1"></i><span class="badge badge-pill badge-light ml-2 items_count" id="itcount_'.$nodeId.'">'.$itemsNb. |
|
| 780 | + ($tree_counters === 1 ? '/'.$nbChildrenItems.'/'.(count($nodeDescendants) - 1) : '').'</span>', |
|
| 785 | 781 | 'title' => $title, |
| 786 | 782 | 'restricted' => 0, |
| 787 | 783 | 'folderClass' => 'folder', |
@@ -791,8 +787,8 @@ discard block |
||
| 791 | 787 | } |
| 792 | 788 | |
| 793 | 789 | return [ |
| 794 | - 'html' => '<span class="badge badge-pill badge-light ml-2 items_count" id="itcount_' . $nodeId . '">' . $itemsNb . |
|
| 795 | - ($tree_counters === 1 ? '/'.$nbChildrenItems .'/'.(count($nodeDescendants) - 1) : '') . '</span>', |
|
| 790 | + 'html' => '<span class="badge badge-pill badge-light ml-2 items_count" id="itcount_'.$nodeId.'">'.$itemsNb. |
|
| 791 | + ($tree_counters === 1 ? '/'.$nbChildrenItems.'/'.(count($nodeDescendants) - 1) : '').'</span>', |
|
| 796 | 792 | 'title' => $title, |
| 797 | 793 | 'restricted' => 0, |
| 798 | 794 | 'folderClass' => 'folder', |
@@ -803,8 +799,8 @@ discard block |
||
| 803 | 799 | |
| 804 | 800 | if (in_array($nodeId, $listFoldersLimitedKeys) === true) { |
| 805 | 801 | return [ |
| 806 | - 'html' => ($session_user_read_only === true ? '<i class="far fa-eye fa-xs mr-1"></i>' : '') . |
|
| 807 | - '<span class="badge badge-pill badge-light ml-2 items_count" id="itcount_' . $nodeId . '">' . count($session_list_folders_limited[$nodeId]) . '</span>', |
|
| 802 | + 'html' => ($session_user_read_only === true ? '<i class="far fa-eye fa-xs mr-1"></i>' : ''). |
|
| 803 | + '<span class="badge badge-pill badge-light ml-2 items_count" id="itcount_'.$nodeId.'">'.count($session_list_folders_limited[$nodeId]).'</span>', |
|
| 808 | 804 | 'title' => $title, |
| 809 | 805 | 'restricted' => 1, |
| 810 | 806 | 'folderClass' => 'folder', |
@@ -815,8 +811,8 @@ discard block |
||
| 815 | 811 | |
| 816 | 812 | if (in_array($nodeId, $listRestrictedFoldersForItemsKeys) === true) { |
| 817 | 813 | return [ |
| 818 | - 'html' => $session_user_read_only === true ? '<i class="far fa-eye fa-xs mr-1"></i>' : '' . |
|
| 819 | - '<span class="badge badge-pill badge-light ml-2 items_count" id="itcount_' . $nodeId . '">' . count($session_list_restricted_folders_for_items[$nodeId]) . '</span>', |
|
| 814 | + 'html' => $session_user_read_only === true ? '<i class="far fa-eye fa-xs mr-1"></i>' : ''. |
|
| 815 | + '<span class="badge badge-pill badge-light ml-2 items_count" id="itcount_'.$nodeId.'">'.count($session_list_restricted_folders_for_items[$nodeId]).'</span>', |
|
| 820 | 816 | 'title' => $title, |
| 821 | 817 | 'restricted' => 1, |
| 822 | 818 | 'folderClass' => 'folder', |
@@ -47,8 +47,8 @@ discard block |
||
| 47 | 47 | } |
| 48 | 48 | |
| 49 | 49 | /* do checks */ |
| 50 | -require_once $SETTINGS['cpassman_dir'] . '/includes/config/include.php'; |
|
| 51 | -require_once $SETTINGS['cpassman_dir'] . '/sources/checks.php'; |
|
| 50 | +require_once $SETTINGS['cpassman_dir'].'/includes/config/include.php'; |
|
| 51 | +require_once $SETTINGS['cpassman_dir'].'/sources/checks.php'; |
|
| 52 | 52 | $isprofileupdate = filter_input(INPUT_POST, 'isprofileupdate', FILTER_SANITIZE_STRING); |
| 53 | 53 | if ( |
| 54 | 54 | checkUser($_SESSION['user_id'], $_SESSION['key'], 'profile', $SETTINGS) === false |
@@ -59,7 +59,7 @@ discard block |
||
| 59 | 59 | || $isprofileupdate === false |
| 60 | 60 | ) { |
| 61 | 61 | $_SESSION['error']['code'] = ERR_NOT_ALLOWED; //not allowed page |
| 62 | - include $SETTINGS['cpassman_dir'] . '/error.php'; |
|
| 62 | + include $SETTINGS['cpassman_dir'].'/error.php'; |
|
| 63 | 63 | exit(); |
| 64 | 64 | } else { |
| 65 | 65 | // Do special check to allow user to change attributes of his profile |
@@ -68,20 +68,20 @@ discard block |
||
| 68 | 68 | || checkUser($_SESSION['user_id'], $_SESSION['key'], 'profile', $SETTINGS) === false |
| 69 | 69 | ) { |
| 70 | 70 | $_SESSION['error']['code'] = ERR_NOT_ALLOWED; //not allowed page |
| 71 | - include $SETTINGS['cpassman_dir'] . '/error.php'; |
|
| 71 | + include $SETTINGS['cpassman_dir'].'/error.php'; |
|
| 72 | 72 | exit(); |
| 73 | 73 | } |
| 74 | 74 | } |
| 75 | 75 | } |
| 76 | 76 | |
| 77 | -require_once $SETTINGS['cpassman_dir'] . '/includes/config/settings.php'; |
|
| 77 | +require_once $SETTINGS['cpassman_dir'].'/includes/config/settings.php'; |
|
| 78 | 78 | header('Content-type: text/html; charset=utf-8'); |
| 79 | -require_once $SETTINGS['cpassman_dir'] . '/includes/language/' . $_SESSION['user_language'] . '.php'; |
|
| 80 | -require_once $SETTINGS['cpassman_dir'] . '/sources/main.functions.php'; |
|
| 81 | -require_once $SETTINGS['cpassman_dir'] . '/sources/SplClassLoader.php'; |
|
| 79 | +require_once $SETTINGS['cpassman_dir'].'/includes/language/'.$_SESSION['user_language'].'.php'; |
|
| 80 | +require_once $SETTINGS['cpassman_dir'].'/sources/main.functions.php'; |
|
| 81 | +require_once $SETTINGS['cpassman_dir'].'/sources/SplClassLoader.php'; |
|
| 82 | 82 | |
| 83 | 83 | // Connect to mysql server |
| 84 | -require_once $SETTINGS['cpassman_dir'] . '/includes/libraries/Database/Meekrodb/db.class.php'; |
|
| 84 | +require_once $SETTINGS['cpassman_dir'].'/includes/libraries/Database/Meekrodb/db.class.php'; |
|
| 85 | 85 | if (defined('DB_PASSWD_CLEAR') === false) { |
| 86 | 86 | define('DB_PASSWD_CLEAR', defuseReturnDecrypted(DB_PASSWD, $SETTINGS)); |
| 87 | 87 | } |
@@ -130,7 +130,7 @@ discard block |
||
| 130 | 130 | // Prepare variables |
| 131 | 131 | $login = filter_var($dataReceived['login'], FILTER_SANITIZE_STRING); |
| 132 | 132 | $email = filter_var($dataReceived['email'], FILTER_SANITIZE_EMAIL); |
| 133 | - $password = '';//filter_var($dataReceived['pw'], FILTER_SANITIZE_STRING); |
|
| 133 | + $password = ''; //filter_var($dataReceived['pw'], FILTER_SANITIZE_STRING); |
|
| 134 | 134 | $lastname = filter_var($dataReceived['lastname'], FILTER_SANITIZE_STRING); |
| 135 | 135 | $name = filter_var($dataReceived['name'], FILTER_SANITIZE_STRING); |
| 136 | 136 | $is_admin = filter_var($dataReceived['admin'], FILTER_SANITIZE_NUMBER_INT); |
@@ -159,7 +159,7 @@ discard block |
||
| 159 | 159 | // Check if user already exists |
| 160 | 160 | $data = DB::query( |
| 161 | 161 | 'SELECT id, fonction_id, groupes_interdits, groupes_visibles |
| 162 | - FROM ' . prefixTable('users') . ' |
|
| 162 | + FROM ' . prefixTable('users').' |
|
| 163 | 163 | WHERE login = %s', |
| 164 | 164 | $login |
| 165 | 165 | ); |
@@ -389,7 +389,7 @@ discard block |
||
| 389 | 389 | |
| 390 | 390 | // Get info about user to delete |
| 391 | 391 | $data_user = DB::queryfirstrow( |
| 392 | - 'SELECT admin, isAdministratedByRole FROM ' . prefixTable('users') . ' |
|
| 392 | + 'SELECT admin, isAdministratedByRole FROM '.prefixTable('users').' |
|
| 393 | 393 | WHERE id = %i', |
| 394 | 394 | $post_id |
| 395 | 395 | ); |
@@ -408,7 +408,7 @@ discard block |
||
| 408 | 408 | ); |
| 409 | 409 | // delete personal folder and subfolders |
| 410 | 410 | $data = DB::queryfirstrow( |
| 411 | - 'SELECT id FROM ' . prefixTable('nested_tree') . ' |
|
| 411 | + 'SELECT id FROM '.prefixTable('nested_tree').' |
|
| 412 | 412 | WHERE title = %s AND personal_folder = %i', |
| 413 | 413 | $post_id, |
| 414 | 414 | '1' |
@@ -421,7 +421,7 @@ discard block |
||
| 421 | 421 | DB::delete(prefixTable('nested_tree'), 'id = %i AND personal_folder = %i', $folder->id, '1'); |
| 422 | 422 | // delete items & logs |
| 423 | 423 | $items = DB::query( |
| 424 | - 'SELECT id FROM ' . prefixTable('items') . ' |
|
| 424 | + 'SELECT id FROM '.prefixTable('items').' |
|
| 425 | 425 | WHERE id_tree=%i AND perso = %i', |
| 426 | 426 | $folder->id, |
| 427 | 427 | '1' |
@@ -478,7 +478,7 @@ discard block |
||
| 478 | 478 | |
| 479 | 479 | // Get info about user to delete |
| 480 | 480 | $data_user = DB::queryfirstrow( |
| 481 | - 'SELECT admin, isAdministratedByRole FROM ' . prefixTable('users') . ' |
|
| 481 | + 'SELECT admin, isAdministratedByRole FROM '.prefixTable('users').' |
|
| 482 | 482 | WHERE id = %i', |
| 483 | 483 | $post_id |
| 484 | 484 | ); |
@@ -520,7 +520,7 @@ discard block |
||
| 520 | 520 | |
| 521 | 521 | // Get info about user to delete |
| 522 | 522 | $data_user = DB::queryfirstrow( |
| 523 | - 'SELECT admin, isAdministratedByRole FROM ' . prefixTable('users') . ' |
|
| 523 | + 'SELECT admin, isAdministratedByRole FROM '.prefixTable('users').' |
|
| 524 | 524 | WHERE id = %i', |
| 525 | 525 | $post_id |
| 526 | 526 | ); |
@@ -563,7 +563,7 @@ discard block |
||
| 563 | 563 | // Get info about user to delete |
| 564 | 564 | $data_user = DB::queryfirstrow( |
| 565 | 565 | 'SELECT admin, isAdministratedByRole, can_manage_all_users, gestionnaire |
| 566 | - FROM ' . prefixTable('users') . ' |
|
| 566 | + FROM ' . prefixTable('users').' |
|
| 567 | 567 | WHERE id = %i', |
| 568 | 568 | $post_id |
| 569 | 569 | ); |
@@ -607,7 +607,7 @@ discard block |
||
| 607 | 607 | |
| 608 | 608 | // Get info about user to delete |
| 609 | 609 | $data_user = DB::queryfirstrow( |
| 610 | - 'SELECT admin, isAdministratedByRole FROM ' . prefixTable('users') . ' |
|
| 610 | + 'SELECT admin, isAdministratedByRole FROM '.prefixTable('users').' |
|
| 611 | 611 | WHERE id = %i', |
| 612 | 612 | $post_id |
| 613 | 613 | ); |
@@ -650,7 +650,7 @@ discard block |
||
| 650 | 650 | // Get info about user to delete |
| 651 | 651 | $data_user = DB::queryfirstrow( |
| 652 | 652 | 'SELECT admin, isAdministratedByRole, gestionnaire |
| 653 | - FROM ' . prefixTable('users') . ' |
|
| 653 | + FROM ' . prefixTable('users').' |
|
| 654 | 654 | WHERE id = %i', |
| 655 | 655 | $post_id |
| 656 | 656 | ); |
@@ -693,7 +693,7 @@ discard block |
||
| 693 | 693 | // Get info about user to delete |
| 694 | 694 | $data_user = DB::queryfirstrow( |
| 695 | 695 | 'SELECT admin, isAdministratedByRole, gestionnaire |
| 696 | - FROM ' . prefixTable('users') . ' |
|
| 696 | + FROM ' . prefixTable('users').' |
|
| 697 | 697 | WHERE id = %i', |
| 698 | 698 | $post_id |
| 699 | 699 | ); |
@@ -733,7 +733,7 @@ discard block |
||
| 733 | 733 | // Get info about user to delete |
| 734 | 734 | $data_user = DB::queryfirstrow( |
| 735 | 735 | 'SELECT admin, isAdministratedByRole, gestionnaire |
| 736 | - FROM ' . prefixTable('users') . ' |
|
| 736 | + FROM ' . prefixTable('users').' |
|
| 737 | 737 | WHERE id = %i', |
| 738 | 738 | $post_id |
| 739 | 739 | ); |
@@ -772,7 +772,7 @@ discard block |
||
| 772 | 772 | $return = array(); |
| 773 | 773 | // Check if folder exists |
| 774 | 774 | $data = DB::query( |
| 775 | - 'SELECT * FROM ' . prefixTable('nested_tree') . ' |
|
| 775 | + 'SELECT * FROM '.prefixTable('nested_tree').' |
|
| 776 | 776 | WHERE title = %s AND parent_id = %i', |
| 777 | 777 | filter_input(INPUT_POST, 'domain', FILTER_SANITIZE_STRING), |
| 778 | 778 | '0' |
@@ -785,7 +785,7 @@ discard block |
||
| 785 | 785 | } |
| 786 | 786 | // Check if role exists |
| 787 | 787 | $data = DB::query( |
| 788 | - 'SELECT * FROM ' . prefixTable('roles_title') . ' |
|
| 788 | + 'SELECT * FROM '.prefixTable('roles_title').' |
|
| 789 | 789 | WHERE title = %s', |
| 790 | 790 | filter_input(INPUT_POST, 'domain', FILTER_SANITIZE_STRING) |
| 791 | 791 | ); |
@@ -805,7 +805,7 @@ discard block |
||
| 805 | 805 | case 'user_log_items': |
| 806 | 806 | $nb_pages = 1; |
| 807 | 807 | $logs = $sql_filter = ''; |
| 808 | - $pages = '<table style=\'border-top:1px solid #969696;\'><tr><td>' . langHdl('pages') . ' : </td>'; |
|
| 808 | + $pages = '<table style=\'border-top:1px solid #969696;\'><tr><td>'.langHdl('pages').' : </td>'; |
|
| 809 | 809 | |
| 810 | 810 | // Prepare POST variables |
| 811 | 811 | $post_nb_items_by_page = filter_input(INPUT_POST, 'nb_items_by_page', FILTER_SANITIZE_NUMBER_INT); |
@@ -817,14 +817,14 @@ discard block |
||
| 817 | 817 | && !empty(filter_input(INPUT_POST, 'filter', FILTER_SANITIZE_STRING)) |
| 818 | 818 | && filter_input(INPUT_POST, 'filter', FILTER_SANITIZE_STRING) !== 'all' |
| 819 | 819 | ) { |
| 820 | - $sql_filter = " AND l.action = '" . filter_input(INPUT_POST, 'filter', FILTER_SANITIZE_STRING) . "'"; |
|
| 820 | + $sql_filter = " AND l.action = '".filter_input(INPUT_POST, 'filter', FILTER_SANITIZE_STRING)."'"; |
|
| 821 | 821 | } |
| 822 | 822 | // get number of pages |
| 823 | 823 | DB::query( |
| 824 | 824 | 'SELECT * |
| 825 | - FROM ' . prefixTable('log_items') . ' as l |
|
| 826 | - INNER JOIN ' . prefixTable('items') . ' as i ON (l.id_item=i.id) |
|
| 827 | - INNER JOIN ' . prefixTable('users') . ' as u ON (l.id_user=u.id) |
|
| 825 | + FROM ' . prefixTable('log_items').' as l |
|
| 826 | + INNER JOIN ' . prefixTable('items').' as i ON (l.id_item=i.id) |
|
| 827 | + INNER JOIN ' . prefixTable('users').' as u ON (l.id_user=u.id) |
|
| 828 | 828 | WHERE l.id_user = %i ' . $sql_filter, |
| 829 | 829 | filter_input(INPUT_POST, 'id', FILTER_SANITIZE_NUMBER_INT) |
| 830 | 830 | ); |
@@ -842,19 +842,19 @@ discard block |
||
| 842 | 842 | // launch query |
| 843 | 843 | $rows = DB::query( |
| 844 | 844 | 'SELECT l.date as date, u.login as login, i.label as label, l.action as action |
| 845 | - FROM ' . prefixTable('log_items') . ' as l |
|
| 846 | - INNER JOIN ' . prefixTable('items') . ' as i ON (l.id_item=i.id) |
|
| 847 | - INNER JOIN ' . prefixTable('users') . ' as u ON (l.id_user=u.id) |
|
| 848 | - WHERE l.id_user = %i ' . $sql_filter . ' |
|
| 845 | + FROM ' . prefixTable('log_items').' as l |
|
| 846 | + INNER JOIN ' . prefixTable('items').' as i ON (l.id_item=i.id) |
|
| 847 | + INNER JOIN ' . prefixTable('users').' as u ON (l.id_user=u.id) |
|
| 848 | + WHERE l.id_user = %i ' . $sql_filter.' |
|
| 849 | 849 | ORDER BY date DESC |
| 850 | - LIMIT ' . intval($start) . ',' . intval($post_nb_items_by_page), |
|
| 850 | + LIMIT ' . intval($start).','.intval($post_nb_items_by_page), |
|
| 851 | 851 | filter_input(INPUT_POST, 'id', FILTER_SANITIZE_NUMBER_INT) |
| 852 | 852 | ); |
| 853 | 853 | } else { |
| 854 | 854 | // get number of pages |
| 855 | 855 | DB::query( |
| 856 | 856 | 'SELECT * |
| 857 | - FROM ' . prefixTable('log_system') . ' |
|
| 857 | + FROM ' . prefixTable('log_system').' |
|
| 858 | 858 | WHERE type = %s AND field_1=%i', |
| 859 | 859 | 'user_mngt', |
| 860 | 860 | filter_input(INPUT_POST, 'id', FILTER_SANITIZE_NUMBER_INT) |
@@ -873,7 +873,7 @@ discard block |
||
| 873 | 873 | // launch query |
| 874 | 874 | $rows = DB::query( |
| 875 | 875 | 'SELECT * |
| 876 | - FROM ' . prefixTable('log_system') . ' |
|
| 876 | + FROM ' . prefixTable('log_system').' |
|
| 877 | 877 | WHERE type = %s AND field_1 = %i |
| 878 | 878 | ORDER BY date DESC |
| 879 | 879 | LIMIT %i, %i', |
@@ -887,7 +887,7 @@ discard block |
||
| 887 | 887 | if (isset($counter) && $counter != 0) { |
| 888 | 888 | $nb_pages = ceil($counter / intval($post_nb_items_by_page)); |
| 889 | 889 | for ($i = 1; $i <= $nb_pages; ++$i) { |
| 890 | - $pages .= '<td onclick=\'displayLogs(' . $i . ',\"' . $post_scope . '\")\'><span style=\'cursor:pointer;' . (filter_input(INPUT_POST, 'page', FILTER_SANITIZE_NUMBER_INT) === $i ? 'font-weight:bold;font-size:18px;\'>' . $i : '\'>' . $i) . '</span></td>'; |
|
| 890 | + $pages .= '<td onclick=\'displayLogs('.$i.',\"'.$post_scope.'\")\'><span style=\'cursor:pointer;'.(filter_input(INPUT_POST, 'page', FILTER_SANITIZE_NUMBER_INT) === $i ? 'font-weight:bold;font-size:18px;\'>'.$i : '\'>'.$i).'</span></td>'; |
|
| 891 | 891 | } |
| 892 | 892 | } |
| 893 | 893 | $pages .= '</tr></table>'; |
@@ -896,7 +896,7 @@ discard block |
||
| 896 | 896 | if ($post_scope === 'user_mngt') { |
| 897 | 897 | $user = DB::queryfirstrow( |
| 898 | 898 | 'SELECT login |
| 899 | - from ' . prefixTable('users') . ' |
|
| 899 | + from ' . prefixTable('users').' |
|
| 900 | 900 | WHERE id=%i', |
| 901 | 901 | $record['qui'] |
| 902 | 902 | ); |
@@ -906,7 +906,7 @@ discard block |
||
| 906 | 906 | if ($tmp[0] == 'at_user_initial_pwd_changed') { |
| 907 | 907 | $label = langHdl('log_user_initial_pwd_changed'); |
| 908 | 908 | } elseif ($tmp[0] == 'at_user_email_changed') { |
| 909 | - $label = langHdl('log_user_email_changed') . $tmp[1]; |
|
| 909 | + $label = langHdl('log_user_email_changed').$tmp[1]; |
|
| 910 | 910 | } elseif ($tmp[0] == 'at_user_added') { |
| 911 | 911 | $label = langHdl('log_user_created'); |
| 912 | 912 | } elseif ($tmp[0] == 'at_user_locked') { |
@@ -917,14 +917,14 @@ discard block |
||
| 917 | 917 | $label = langHdl('log_user_pwd_changed'); |
| 918 | 918 | } |
| 919 | 919 | // prepare log |
| 920 | - $logs .= '<tr><td>' . date($SETTINGS['date_format'] . ' ' . $SETTINGS['time_format'], (int) $record['date']) . '</td><td align=\"center\">' . $label . '</td><td align=\"center\">' . $user['login'] . '</td><td align=\"center\"></td></tr>'; |
|
| 920 | + $logs .= '<tr><td>'.date($SETTINGS['date_format'].' '.$SETTINGS['time_format'], (int) $record['date']).'</td><td align=\"center\">'.$label.'</td><td align=\"center\">'.$user['login'].'</td><td align=\"center\"></td></tr>'; |
|
| 921 | 921 | } else { |
| 922 | - $logs .= '<tr><td>' . date($SETTINGS['date_format'] . ' ' . $SETTINGS['time_format'], (int) $record['date']) . '</td><td align=\"center\">' . str_replace('"', '\"', $record['label']) . '</td><td align=\"center\">' . $record['login'] . '</td><td align=\"center\">' . langHdl($record['action']) . '</td></tr>'; |
|
| 922 | + $logs .= '<tr><td>'.date($SETTINGS['date_format'].' '.$SETTINGS['time_format'], (int) $record['date']).'</td><td align=\"center\">'.str_replace('"', '\"', $record['label']).'</td><td align=\"center\">'.$record['login'].'</td><td align=\"center\">'.langHdl($record['action']).'</td></tr>'; |
|
| 923 | 923 | } |
| 924 | 924 | } |
| 925 | 925 | } |
| 926 | 926 | |
| 927 | - echo '[ { "table_logs": "' . ($logs) . '", "pages": "' . ($pages) . '", "error" : "no" } ]'; |
|
| 927 | + echo '[ { "table_logs": "'.($logs).'", "pages": "'.($pages).'", "error" : "no" } ]'; |
|
| 928 | 928 | break; |
| 929 | 929 | |
| 930 | 930 | /* |
@@ -949,7 +949,7 @@ discard block |
||
| 949 | 949 | } else { |
| 950 | 950 | // Get folder id for Admin |
| 951 | 951 | $admin_folder = DB::queryFirstRow( |
| 952 | - 'SELECT id FROM ' . prefixTable('nested_tree') . ' |
|
| 952 | + 'SELECT id FROM '.prefixTable('nested_tree').' |
|
| 953 | 953 | WHERE title = %i AND personal_folder = %i', |
| 954 | 954 | intval($_SESSION['user_id']), |
| 955 | 955 | '1' |
@@ -960,15 +960,15 @@ discard block |
||
| 960 | 960 | // Get each Items in PF |
| 961 | 961 | $rows = DB::query( |
| 962 | 962 | 'SELECT i.pw, i.label, l.id_user |
| 963 | - FROM ' . prefixTable('items') . ' as i |
|
| 964 | - LEFT JOIN ' . prefixTable('log_items') . ' as l ON (l.id_item=i.id) |
|
| 963 | + FROM ' . prefixTable('items').' as i |
|
| 964 | + LEFT JOIN ' . prefixTable('log_items').' as l ON (l.id_item=i.id) |
|
| 965 | 965 | WHERE l.action = %s AND i.perso=%i AND i.id_tree=%i', |
| 966 | 966 | 'at_creation', |
| 967 | 967 | '1', |
| 968 | 968 | intval($folder->id) |
| 969 | 969 | ); |
| 970 | 970 | foreach ($rows as $record) { |
| 971 | - echo $record['label'] . ' - '; |
|
| 971 | + echo $record['label'].' - '; |
|
| 972 | 972 | // Change user |
| 973 | 973 | DB::update( |
| 974 | 974 | prefixTable('log_items'), |
@@ -1003,7 +1003,7 @@ discard block |
||
| 1003 | 1003 | // Get info about user to delete |
| 1004 | 1004 | $data_user = DB::queryfirstrow( |
| 1005 | 1005 | 'SELECT admin, isAdministratedByRole, gestionnaire |
| 1006 | - FROM ' . prefixTable('users') . ' |
|
| 1006 | + FROM ' . prefixTable('users').' |
|
| 1007 | 1007 | WHERE id = %i', |
| 1008 | 1008 | $post_user_id |
| 1009 | 1009 | ); |
@@ -1040,7 +1040,7 @@ discard block |
||
| 1040 | 1040 | |
| 1041 | 1041 | // Do |
| 1042 | 1042 | $rows = DB::query( |
| 1043 | - 'SELECT id FROM ' . prefixTable('users') . ' |
|
| 1043 | + 'SELECT id FROM '.prefixTable('users').' |
|
| 1044 | 1044 | WHERE timestamp != %s AND admin != %i', |
| 1045 | 1045 | '', |
| 1046 | 1046 | '1' |
@@ -1049,7 +1049,7 @@ discard block |
||
| 1049 | 1049 | // Get info about user to delete |
| 1050 | 1050 | $data_user = DB::queryfirstrow( |
| 1051 | 1051 | 'SELECT admin, isAdministratedByRole, gestionnaire |
| 1052 | - FROM ' . prefixTable('users') . ' |
|
| 1052 | + FROM ' . prefixTable('users').' |
|
| 1053 | 1053 | WHERE id = %i', |
| 1054 | 1054 | $record['id'] |
| 1055 | 1055 | ); |
@@ -1103,7 +1103,7 @@ discard block |
||
| 1103 | 1103 | // Get info about user |
| 1104 | 1104 | $rowUser = DB::queryfirstrow( |
| 1105 | 1105 | 'SELECT * |
| 1106 | - FROM ' . prefixTable('users') . ' |
|
| 1106 | + FROM ' . prefixTable('users').' |
|
| 1107 | 1107 | WHERE id = %i', |
| 1108 | 1108 | $post_id |
| 1109 | 1109 | ); |
@@ -1121,7 +1121,7 @@ discard block |
||
| 1121 | 1121 | $arrFldAllowed = array(); |
| 1122 | 1122 | |
| 1123 | 1123 | //Build tree |
| 1124 | - $tree = new SplClassLoader('Tree\NestedTree', $SETTINGS['cpassman_dir'] . '/includes/libraries'); |
|
| 1124 | + $tree = new SplClassLoader('Tree\NestedTree', $SETTINGS['cpassman_dir'].'/includes/libraries'); |
|
| 1125 | 1125 | $tree->register(); |
| 1126 | 1126 | $tree = new Tree\NestedTree\NestedTree(prefixTable('nested_tree'), 'id', 'parent_id', 'title'); |
| 1127 | 1127 | |
@@ -1132,7 +1132,7 @@ discard block |
||
| 1132 | 1132 | // array of roles for actual user |
| 1133 | 1133 | $my_functions = explode(';', $_SESSION['fonction_id']); |
| 1134 | 1134 | |
| 1135 | - $rows = DB::query('SELECT id,title,creator_id FROM ' . prefixTable('roles_title')); |
|
| 1135 | + $rows = DB::query('SELECT id,title,creator_id FROM '.prefixTable('roles_title')); |
|
| 1136 | 1136 | foreach ($rows as $record) { |
| 1137 | 1137 | if ( |
| 1138 | 1138 | (int) $_SESSION['is_admin'] === 1 |
@@ -1168,7 +1168,7 @@ discard block |
||
| 1168 | 1168 | $rolesList = array(); |
| 1169 | 1169 | $managedBy = array(); |
| 1170 | 1170 | $selected = ''; |
| 1171 | - $rows = DB::query('SELECT id,title FROM ' . prefixTable('roles_title') . ' ORDER BY title ASC'); |
|
| 1171 | + $rows = DB::query('SELECT id,title FROM '.prefixTable('roles_title').' ORDER BY title ASC'); |
|
| 1172 | 1172 | foreach ($rows as $reccord) { |
| 1173 | 1173 | $rolesList[$reccord['id']] = array('id' => $reccord['id'], 'title' => $reccord['title']); |
| 1174 | 1174 | } |
@@ -1199,7 +1199,7 @@ discard block |
||
| 1199 | 1199 | array_push( |
| 1200 | 1200 | $managedBy, |
| 1201 | 1201 | array( |
| 1202 | - 'title' => langHdl('managers_of') . ' ' . $fonction['title'], |
|
| 1202 | + 'title' => langHdl('managers_of').' '.$fonction['title'], |
|
| 1203 | 1203 | 'id' => $fonction['id'], |
| 1204 | 1204 | 'selected' => $selected, |
| 1205 | 1205 | ) |
@@ -1281,9 +1281,9 @@ discard block |
||
| 1281 | 1281 | |
| 1282 | 1282 | // get USER STATUS |
| 1283 | 1283 | if ($rowUser['disabled'] == 1) { |
| 1284 | - $arrData['info'] = langHdl('user_info_locked') . '<br><input type="checkbox" value="unlock" name="1" class="chk"> <label for="1">' . langHdl('user_info_unlock_question') . '</label><br><input type="checkbox" value="delete" id="account_delete" class="chk mr-2" name="2" onclick="confirmDeletion()">label for="2">' . langHdl('user_info_delete_question') . '</label>'; |
|
| 1284 | + $arrData['info'] = langHdl('user_info_locked').'<br><input type="checkbox" value="unlock" name="1" class="chk"> <label for="1">'.langHdl('user_info_unlock_question').'</label><br><input type="checkbox" value="delete" id="account_delete" class="chk mr-2" name="2" onclick="confirmDeletion()">label for="2">'.langHdl('user_info_delete_question').'</label>'; |
|
| 1285 | 1285 | } else { |
| 1286 | - $arrData['info'] = langHdl('user_info_active') . '<br><input type="checkbox" value="lock" class="chk"> ' . langHdl('user_info_lock_question'); |
|
| 1286 | + $arrData['info'] = langHdl('user_info_active').'<br><input type="checkbox" value="lock" class="chk"> '.langHdl('user_info_lock_question'); |
|
| 1287 | 1287 | } |
| 1288 | 1288 | |
| 1289 | 1289 | $arrData['error'] = false; |
@@ -1375,7 +1375,7 @@ discard block |
||
| 1375 | 1375 | // count number of admins |
| 1376 | 1376 | $users = DB::query( |
| 1377 | 1377 | 'SELECT id |
| 1378 | - FROM ' . prefixTable('users') . ' |
|
| 1378 | + FROM ' . prefixTable('users').' |
|
| 1379 | 1379 | WHERE admin = 1 AND email != "" AND pw != ""' |
| 1380 | 1380 | ); |
| 1381 | 1381 | if (DB::count() === 1) { |
@@ -1461,7 +1461,7 @@ discard block |
||
| 1461 | 1461 | |
| 1462 | 1462 | // Get info about user to delete |
| 1463 | 1463 | $data_user = DB::queryfirstrow( |
| 1464 | - 'SELECT admin, isAdministratedByRole FROM ' . prefixTable('users') . ' |
|
| 1464 | + 'SELECT admin, isAdministratedByRole FROM '.prefixTable('users').' |
|
| 1465 | 1465 | WHERE id = %i', |
| 1466 | 1466 | $post_id |
| 1467 | 1467 | ); |
@@ -1482,7 +1482,7 @@ discard block |
||
| 1482 | 1482 | ); |
| 1483 | 1483 | // delete personal folder and subfolders |
| 1484 | 1484 | $data = DB::queryfirstrow( |
| 1485 | - 'SELECT id FROM ' . prefixTable('nested_tree') . ' |
|
| 1485 | + 'SELECT id FROM '.prefixTable('nested_tree').' |
|
| 1486 | 1486 | WHERE title = %s AND personal_folder = %i', |
| 1487 | 1487 | $post_id, |
| 1488 | 1488 | '1' |
@@ -1495,7 +1495,7 @@ discard block |
||
| 1495 | 1495 | DB::delete(prefixTable('nested_tree'), 'id = %i AND personal_folder = %i', $folder->id, '1'); |
| 1496 | 1496 | // delete items & logs |
| 1497 | 1497 | $items = DB::query( |
| 1498 | - 'SELECT id FROM ' . prefixTable('items') . ' |
|
| 1498 | + 'SELECT id FROM '.prefixTable('items').' |
|
| 1499 | 1499 | WHERE id_tree=%i AND perso = %i', |
| 1500 | 1500 | $folder->id, |
| 1501 | 1501 | '1' |
@@ -1516,7 +1516,7 @@ discard block |
||
| 1516 | 1516 | } else { |
| 1517 | 1517 | // Get old data about user |
| 1518 | 1518 | $oldData = DB::queryfirstrow( |
| 1519 | - 'SELECT * FROM ' . prefixTable('users') . ' |
|
| 1519 | + 'SELECT * FROM '.prefixTable('users').' |
|
| 1520 | 1520 | WHERE id = %i', |
| 1521 | 1521 | $post_id |
| 1522 | 1522 | ); |
@@ -1546,7 +1546,7 @@ discard block |
||
| 1546 | 1546 | |
| 1547 | 1547 | // update LOG |
| 1548 | 1548 | if ($oldData['email'] !== $post_email) { |
| 1549 | - logEvents($SETTINGS, 'user_mngt', 'at_user_email_changed:' . $oldData['email'], (string) $_SESSION['user_id'], $_SESSION['login'], $post_id); |
|
| 1549 | + logEvents($SETTINGS, 'user_mngt', 'at_user_email_changed:'.$oldData['email'], (string) $_SESSION['user_id'], $_SESSION['login'], $post_id); |
|
| 1550 | 1550 | } |
| 1551 | 1551 | } |
| 1552 | 1552 | echo prepareExchangedData( |
@@ -1601,7 +1601,7 @@ discard block |
||
| 1601 | 1601 | |
| 1602 | 1602 | // Get info about user to delete |
| 1603 | 1603 | $data_user = DB::queryfirstrow( |
| 1604 | - 'SELECT admin, isAdministratedByRole FROM ' . prefixTable('users') . ' |
|
| 1604 | + 'SELECT admin, isAdministratedByRole FROM '.prefixTable('users').' |
|
| 1605 | 1605 | WHERE id = %i', |
| 1606 | 1606 | $post_id |
| 1607 | 1607 | ); |
@@ -1651,7 +1651,7 @@ discard block |
||
| 1651 | 1651 | } |
| 1652 | 1652 | |
| 1653 | 1653 | DB::queryfirstrow( |
| 1654 | - 'SELECT * FROM ' . prefixTable('users') . ' |
|
| 1654 | + 'SELECT * FROM '.prefixTable('users').' |
|
| 1655 | 1655 | WHERE login = %s', |
| 1656 | 1656 | filter_input(INPUT_POST, 'login', FILTER_SANITIZE_STRING) |
| 1657 | 1657 | ); |
@@ -1700,14 +1700,14 @@ discard block |
||
| 1700 | 1700 | $arrData = array(); |
| 1701 | 1701 | |
| 1702 | 1702 | //Build tree |
| 1703 | - $tree = new SplClassLoader('Tree\NestedTree', $SETTINGS['cpassman_dir'] . '/includes/libraries'); |
|
| 1703 | + $tree = new SplClassLoader('Tree\NestedTree', $SETTINGS['cpassman_dir'].'/includes/libraries'); |
|
| 1704 | 1704 | $tree->register(); |
| 1705 | 1705 | $tree = new Tree\NestedTree\NestedTree(prefixTable('nested_tree'), 'id', 'parent_id', 'title'); |
| 1706 | 1706 | |
| 1707 | 1707 | // get User info |
| 1708 | 1708 | $rowUser = DB::queryFirstRow( |
| 1709 | 1709 | 'SELECT login, name, lastname, email, disabled, fonction_id, groupes_interdits, groupes_visibles, isAdministratedByRole, avatar_thumb |
| 1710 | - FROM ' . prefixTable('users') . ' |
|
| 1710 | + FROM ' . prefixTable('users').' |
|
| 1711 | 1711 | WHERE id = %i', |
| 1712 | 1712 | $post_id |
| 1713 | 1713 | ); |
@@ -1725,7 +1725,7 @@ discard block |
||
| 1725 | 1725 | // refine folders based upon roles |
| 1726 | 1726 | $rows = DB::query( |
| 1727 | 1727 | 'SELECT folder_id, type |
| 1728 | - FROM ' . prefixTable('roles_values') . ' |
|
| 1728 | + FROM ' . prefixTable('roles_values').' |
|
| 1729 | 1729 | WHERE role_id IN %ls |
| 1730 | 1730 | ORDER BY folder_id ASC', |
| 1731 | 1731 | $arrData['functions'] |
@@ -1754,7 +1754,7 @@ discard block |
||
| 1754 | 1754 | // get folder name |
| 1755 | 1755 | $row = DB::queryFirstRow( |
| 1756 | 1756 | 'SELECT title, nlevel, id |
| 1757 | - FROM ' . prefixTable('nested_tree') . ' |
|
| 1757 | + FROM ' . prefixTable('nested_tree').' |
|
| 1758 | 1758 | WHERE id = %i', |
| 1759 | 1759 | $fld['id'] |
| 1760 | 1760 | ); |
@@ -1767,34 +1767,34 @@ discard block |
||
| 1767 | 1767 | |
| 1768 | 1768 | // manage right icon |
| 1769 | 1769 | if ($fld['type'] == 'W') { |
| 1770 | - $label = '<i class="fas fa-indent infotip text-success mr-2" title="' . langHdl('write') . '"></i>' . |
|
| 1771 | - '<i class="fas fa-edit infotip text-success mr-2" title="' . langHdl('edit') . '"></i>' . |
|
| 1772 | - '<i class="fas fa-eraser infotip text-success" title="' . langHdl('delete') . '"></i>'; |
|
| 1770 | + $label = '<i class="fas fa-indent infotip text-success mr-2" title="'.langHdl('write').'"></i>'. |
|
| 1771 | + '<i class="fas fa-edit infotip text-success mr-2" title="'.langHdl('edit').'"></i>'. |
|
| 1772 | + '<i class="fas fa-eraser infotip text-success" title="'.langHdl('delete').'"></i>'; |
|
| 1773 | 1773 | } elseif ($fld['type'] == 'ND') { |
| 1774 | - $label = '<i class="fas fa-indent infotip text-warning mr-2" title="' . langHdl('write') . '"></i>' . |
|
| 1775 | - '<i class="fas fa-edit infotip text-success mr-2" title="' . langHdl('edit') . '"></i>' . |
|
| 1776 | - '<i class="fas fa-eraser infotip text-danger" title="' . langHdl('no_delete') . '"></i>'; |
|
| 1774 | + $label = '<i class="fas fa-indent infotip text-warning mr-2" title="'.langHdl('write').'"></i>'. |
|
| 1775 | + '<i class="fas fa-edit infotip text-success mr-2" title="'.langHdl('edit').'"></i>'. |
|
| 1776 | + '<i class="fas fa-eraser infotip text-danger" title="'.langHdl('no_delete').'"></i>'; |
|
| 1777 | 1777 | } elseif ($fld['type'] == 'NE') { |
| 1778 | - $label = '<i class="fas fa-indent infotip text-warning mr-2" title="' . langHdl('write') . '"></i>' . |
|
| 1779 | - '<i class="fas fa-edit infotip text-danger mr-2" title="' . langHdl('no_edit') . '"></i>' . |
|
| 1780 | - '<i class="fas fa-eraser infotip text-success" title="' . langHdl('delete') . '"></i>'; |
|
| 1778 | + $label = '<i class="fas fa-indent infotip text-warning mr-2" title="'.langHdl('write').'"></i>'. |
|
| 1779 | + '<i class="fas fa-edit infotip text-danger mr-2" title="'.langHdl('no_edit').'"></i>'. |
|
| 1780 | + '<i class="fas fa-eraser infotip text-success" title="'.langHdl('delete').'"></i>'; |
|
| 1781 | 1781 | } elseif ($fld['type'] == 'NDNE') { |
| 1782 | - $label = '<i class="fas fa-indent infotip text-warning mr-2" title="' . langHdl('write') . '"></i>' . |
|
| 1783 | - '<i class="fas fa-edit infotip text-danger mr-2" title="' . langHdl('no_edit') . '"></i>' . |
|
| 1784 | - '<i class="fas fa-eraser infotip text-danger" title="' . langHdl('no_delete') . '"></i>'; |
|
| 1782 | + $label = '<i class="fas fa-indent infotip text-warning mr-2" title="'.langHdl('write').'"></i>'. |
|
| 1783 | + '<i class="fas fa-edit infotip text-danger mr-2" title="'.langHdl('no_edit').'"></i>'. |
|
| 1784 | + '<i class="fas fa-eraser infotip text-danger" title="'.langHdl('no_delete').'"></i>'; |
|
| 1785 | 1785 | } else { |
| 1786 | - $label = '<i class="fas fa-eye infotip text-info mr-2" title="' . langHdl('read') . '"></i>'; |
|
| 1786 | + $label = '<i class="fas fa-eye infotip text-info mr-2" title="'.langHdl('read').'"></i>'; |
|
| 1787 | 1787 | } |
| 1788 | 1788 | |
| 1789 | - $html .= '<tr><td>' . $ident . $row['title'] . |
|
| 1790 | - ' <small>[' . $row['id'] . ']</small></td><td>' . $label . '</td></tr>'; |
|
| 1789 | + $html .= '<tr><td>'.$ident.$row['title']. |
|
| 1790 | + ' <small>['.$row['id'].']</small></td><td>'.$label.'</td></tr>'; |
|
| 1791 | 1791 | break; |
| 1792 | 1792 | } |
| 1793 | 1793 | } |
| 1794 | 1794 | } |
| 1795 | 1795 | |
| 1796 | - $html_full = '<table id="table-folders" class="table table-bordered table-striped dt-responsive nowrap" style="width:100%"><tbody>' . |
|
| 1797 | - $html . '</tbody></table>'; |
|
| 1796 | + $html_full = '<table id="table-folders" class="table table-bordered table-striped dt-responsive nowrap" style="width:100%"><tbody>'. |
|
| 1797 | + $html.'</tbody></table>'; |
|
| 1798 | 1798 | } else { |
| 1799 | 1799 | $html_full = ''; |
| 1800 | 1800 | } |
@@ -1840,7 +1840,7 @@ discard block |
||
| 1840 | 1840 | if ((int) $_SESSION['is_admin'] === 0 && (int) $_SESSION['user_can_manage_all_users'] === 0) { |
| 1841 | 1841 | $rows = DB::query( |
| 1842 | 1842 | 'SELECT * |
| 1843 | - FROM ' . prefixTable('users') . ' |
|
| 1843 | + FROM ' . prefixTable('users').' |
|
| 1844 | 1844 | WHERE admin = %i AND isAdministratedByRole IN %ls', |
| 1845 | 1845 | '0', |
| 1846 | 1846 | array_filter($_SESSION['user_roles']) |
@@ -1848,7 +1848,7 @@ discard block |
||
| 1848 | 1848 | } else { |
| 1849 | 1849 | $rows = DB::query( |
| 1850 | 1850 | 'SELECT * |
| 1851 | - FROM ' . prefixTable('users') . ' |
|
| 1851 | + FROM ' . prefixTable('users').' |
|
| 1852 | 1852 | WHERE admin = %i', |
| 1853 | 1853 | '0' |
| 1854 | 1854 | ); |
@@ -1860,7 +1860,7 @@ discard block |
||
| 1860 | 1860 | $groupIds = []; |
| 1861 | 1861 | foreach (explode(';', $record['fonction_id']) as $group) { |
| 1862 | 1862 | $tmp = DB::queryfirstrow( |
| 1863 | - 'SELECT id, title FROM ' . prefixTable('roles_title') . ' |
|
| 1863 | + 'SELECT id, title FROM '.prefixTable('roles_title').' |
|
| 1864 | 1864 | WHERE id = %i', |
| 1865 | 1865 | $group |
| 1866 | 1866 | ); |
@@ -1872,7 +1872,7 @@ discard block |
||
| 1872 | 1872 | |
| 1873 | 1873 | // Get managed_by |
| 1874 | 1874 | $managedBy = DB::queryfirstrow( |
| 1875 | - 'SELECT id, title FROM ' . prefixTable('roles_title') . ' |
|
| 1875 | + 'SELECT id, title FROM '.prefixTable('roles_title').' |
|
| 1876 | 1876 | WHERE id = %i', |
| 1877 | 1877 | $record['isAdministratedByRole'] |
| 1878 | 1878 | ); |
@@ -1882,7 +1882,7 @@ discard block |
||
| 1882 | 1882 | $foldersAllowedIds = []; |
| 1883 | 1883 | foreach (explode(';', $record['groupes_visibles']) as $role) { |
| 1884 | 1884 | $tmp = DB::queryfirstrow( |
| 1885 | - 'SELECT id, title FROM ' . prefixTable('nested_tree') . ' |
|
| 1885 | + 'SELECT id, title FROM '.prefixTable('nested_tree').' |
|
| 1886 | 1886 | WHERE id = %i', |
| 1887 | 1887 | $role |
| 1888 | 1888 | ); |
@@ -1895,7 +1895,7 @@ discard block |
||
| 1895 | 1895 | $foldersForbiddenIds = []; |
| 1896 | 1896 | foreach (explode(';', $record['groupes_interdits']) as $role) { |
| 1897 | 1897 | $tmp = DB::queryfirstrow( |
| 1898 | - 'SELECT id, title FROM ' . prefixTable('nested_tree') . ' |
|
| 1898 | + 'SELECT id, title FROM '.prefixTable('nested_tree').' |
|
| 1899 | 1899 | WHERE id = %i', |
| 1900 | 1900 | $role |
| 1901 | 1901 | ); |
@@ -1913,7 +1913,7 @@ discard block |
||
| 1913 | 1913 | 'login' => $record['login'], |
| 1914 | 1914 | 'groups' => implode(', ', $groups), |
| 1915 | 1915 | 'groupIds' => $groupIds, |
| 1916 | - 'managedBy' => $managedBy=== null ? langHdl('administrator') : $managedBy['title'], |
|
| 1916 | + 'managedBy' => $managedBy === null ? langHdl('administrator') : $managedBy['title'], |
|
| 1917 | 1917 | 'managedById' => $managedBy === null ? 0 : $managedBy['id'], |
| 1918 | 1918 | 'foldersAllowed' => implode(', ', $foldersAllowed), |
| 1919 | 1919 | 'foldersAllowedIds' => $foldersAllowedIds, |
@@ -1991,7 +1991,7 @@ discard block |
||
| 1991 | 1991 | |
| 1992 | 1992 | // Get info about user |
| 1993 | 1993 | $data_user = DB::queryfirstrow( |
| 1994 | - 'SELECT admin, isAdministratedByRole FROM ' . prefixTable('users') . ' |
|
| 1994 | + 'SELECT admin, isAdministratedByRole FROM '.prefixTable('users').' |
|
| 1995 | 1995 | WHERE id = %i', |
| 1996 | 1996 | $post_source_id |
| 1997 | 1997 | ); |
@@ -2151,14 +2151,14 @@ discard block |
||
| 2151 | 2151 | if (empty($post_context) === false && $post_context === 'add_one_role_to_user') { |
| 2152 | 2152 | $data_user = DB::queryfirstrow( |
| 2153 | 2153 | 'SELECT fonction_id |
| 2154 | - FROM ' . prefixTable('users') . ' |
|
| 2154 | + FROM ' . prefixTable('users').' |
|
| 2155 | 2155 | WHERE id = %i', |
| 2156 | 2156 | $post_user_id |
| 2157 | 2157 | ); |
| 2158 | 2158 | |
| 2159 | 2159 | if ($data_user) { |
| 2160 | 2160 | // Ensure array is unique |
| 2161 | - $post_new_value = str_replace(',', ';', $data_user['fonction_id']) . ';' . $post_new_value; |
|
| 2161 | + $post_new_value = str_replace(',', ';', $data_user['fonction_id']).';'.$post_new_value; |
|
| 2162 | 2162 | $post_new_value = implode(';', array_unique(explode(';', $post_new_value))); |
| 2163 | 2163 | } else { |
| 2164 | 2164 | // User not found |
@@ -2213,7 +2213,7 @@ discard block |
||
| 2213 | 2213 | if (filter_input(INPUT_POST, 'step', FILTER_SANITIZE_STRING) === 'refresh') { |
| 2214 | 2214 | $record = DB::queryFirstRow( |
| 2215 | 2215 | 'SELECT user_ip_lastdate |
| 2216 | - FROM ' . prefixTable('users') . ' |
|
| 2216 | + FROM ' . prefixTable('users').' |
|
| 2217 | 2217 | WHERE id = %i', |
| 2218 | 2218 | $_SESSION['user_id'] |
| 2219 | 2219 | ); |
@@ -2305,38 +2305,38 @@ discard block |
||
| 2305 | 2305 | ]; |
| 2306 | 2306 | |
| 2307 | 2307 | // Load expected libraries |
| 2308 | - require_once $SETTINGS['cpassman_dir'] . '/includes/libraries/Tightenco/Collect/Support/Traits/Macroable.php'; |
|
| 2309 | - require_once $SETTINGS['cpassman_dir'] . '/includes/libraries/Tightenco/Collect/Support/Arr.php'; |
|
| 2310 | - require_once $SETTINGS['cpassman_dir'] . '/includes/libraries/Symfony/contracts/Translation/TranslatorInterface.php'; |
|
| 2311 | - require_once $SETTINGS['cpassman_dir'] . '/includes/libraries/Carbon/CarbonTimeZone.php'; |
|
| 2312 | - require_once $SETTINGS['cpassman_dir'] . '/includes/libraries/Carbon/Traits/Units.php'; |
|
| 2313 | - require_once $SETTINGS['cpassman_dir'] . '/includes/libraries/Carbon/Traits/Week.php'; |
|
| 2314 | - require_once $SETTINGS['cpassman_dir'] . '/includes/libraries/Carbon/Traits/Timestamp.php'; |
|
| 2315 | - require_once $SETTINGS['cpassman_dir'] . '/includes/libraries/Carbon/Traits/Test.php'; |
|
| 2316 | - require_once $SETTINGS['cpassman_dir'] . '/includes/libraries/Carbon/Traits/ObjectInitialisation.php'; |
|
| 2317 | - require_once $SETTINGS['cpassman_dir'] . '/includes/libraries/Carbon/Traits/Serialization.php'; |
|
| 2318 | - require_once $SETTINGS['cpassman_dir'] . '/includes/libraries/Carbon/Traits/IntervalRounding.php'; |
|
| 2319 | - require_once $SETTINGS['cpassman_dir'] . '/includes/libraries/Carbon/Traits/Rounding.php'; |
|
| 2320 | - require_once $SETTINGS['cpassman_dir'] . '/includes/libraries/Carbon/Traits/Localization.php'; |
|
| 2321 | - require_once $SETTINGS['cpassman_dir'] . '/includes/libraries/Carbon/Traits/Options.php'; |
|
| 2322 | - require_once $SETTINGS['cpassman_dir'] . '/includes/libraries/Carbon/Traits/Cast.php'; |
|
| 2323 | - require_once $SETTINGS['cpassman_dir'] . '/includes/libraries/Carbon/Traits/Mutability.php'; |
|
| 2324 | - require_once $SETTINGS['cpassman_dir'] . '/includes/libraries/Carbon/Traits/Modifiers.php'; |
|
| 2325 | - require_once $SETTINGS['cpassman_dir'] . '/includes/libraries/Carbon/Traits/Mixin.php'; |
|
| 2326 | - require_once $SETTINGS['cpassman_dir'] . '/includes/libraries/Carbon/Traits/Macro.php'; |
|
| 2327 | - require_once $SETTINGS['cpassman_dir'] . '/includes/libraries/Carbon/Traits/Difference.php'; |
|
| 2328 | - require_once $SETTINGS['cpassman_dir'] . '/includes/libraries/Carbon/Traits/Creator.php'; |
|
| 2329 | - require_once $SETTINGS['cpassman_dir'] . '/includes/libraries/Carbon/Traits/Converter.php'; |
|
| 2330 | - require_once $SETTINGS['cpassman_dir'] . '/includes/libraries/Carbon/Traits/Comparison.php'; |
|
| 2331 | - require_once $SETTINGS['cpassman_dir'] . '/includes/libraries/Carbon/Traits/Boundaries.php'; |
|
| 2332 | - require_once $SETTINGS['cpassman_dir'] . '/includes/libraries/Carbon/Traits/Date.php'; |
|
| 2333 | - require_once $SETTINGS['cpassman_dir'] . '/includes/libraries/Carbon/CarbonInterface.php'; |
|
| 2334 | - require_once $SETTINGS['cpassman_dir'] . '/includes/libraries/Carbon/Carbon.php'; |
|
| 2335 | - require_once $SETTINGS['cpassman_dir'] . '/includes/libraries/LdapRecord/DetectsErrors.php'; |
|
| 2336 | - require_once $SETTINGS['cpassman_dir'] . '/includes/libraries/LdapRecord/Connection.php'; |
|
| 2337 | - require_once $SETTINGS['cpassman_dir'] . '/includes/libraries/LdapRecord/LdapInterface.php'; |
|
| 2338 | - require_once $SETTINGS['cpassman_dir'] . '/includes/libraries/LdapRecord/LdapBase.php'; |
|
| 2339 | - require_once $SETTINGS['cpassman_dir'] . '/includes/libraries/LdapRecord/Ldap.php'; |
|
| 2308 | + require_once $SETTINGS['cpassman_dir'].'/includes/libraries/Tightenco/Collect/Support/Traits/Macroable.php'; |
|
| 2309 | + require_once $SETTINGS['cpassman_dir'].'/includes/libraries/Tightenco/Collect/Support/Arr.php'; |
|
| 2310 | + require_once $SETTINGS['cpassman_dir'].'/includes/libraries/Symfony/contracts/Translation/TranslatorInterface.php'; |
|
| 2311 | + require_once $SETTINGS['cpassman_dir'].'/includes/libraries/Carbon/CarbonTimeZone.php'; |
|
| 2312 | + require_once $SETTINGS['cpassman_dir'].'/includes/libraries/Carbon/Traits/Units.php'; |
|
| 2313 | + require_once $SETTINGS['cpassman_dir'].'/includes/libraries/Carbon/Traits/Week.php'; |
|
| 2314 | + require_once $SETTINGS['cpassman_dir'].'/includes/libraries/Carbon/Traits/Timestamp.php'; |
|
| 2315 | + require_once $SETTINGS['cpassman_dir'].'/includes/libraries/Carbon/Traits/Test.php'; |
|
| 2316 | + require_once $SETTINGS['cpassman_dir'].'/includes/libraries/Carbon/Traits/ObjectInitialisation.php'; |
|
| 2317 | + require_once $SETTINGS['cpassman_dir'].'/includes/libraries/Carbon/Traits/Serialization.php'; |
|
| 2318 | + require_once $SETTINGS['cpassman_dir'].'/includes/libraries/Carbon/Traits/IntervalRounding.php'; |
|
| 2319 | + require_once $SETTINGS['cpassman_dir'].'/includes/libraries/Carbon/Traits/Rounding.php'; |
|
| 2320 | + require_once $SETTINGS['cpassman_dir'].'/includes/libraries/Carbon/Traits/Localization.php'; |
|
| 2321 | + require_once $SETTINGS['cpassman_dir'].'/includes/libraries/Carbon/Traits/Options.php'; |
|
| 2322 | + require_once $SETTINGS['cpassman_dir'].'/includes/libraries/Carbon/Traits/Cast.php'; |
|
| 2323 | + require_once $SETTINGS['cpassman_dir'].'/includes/libraries/Carbon/Traits/Mutability.php'; |
|
| 2324 | + require_once $SETTINGS['cpassman_dir'].'/includes/libraries/Carbon/Traits/Modifiers.php'; |
|
| 2325 | + require_once $SETTINGS['cpassman_dir'].'/includes/libraries/Carbon/Traits/Mixin.php'; |
|
| 2326 | + require_once $SETTINGS['cpassman_dir'].'/includes/libraries/Carbon/Traits/Macro.php'; |
|
| 2327 | + require_once $SETTINGS['cpassman_dir'].'/includes/libraries/Carbon/Traits/Difference.php'; |
|
| 2328 | + require_once $SETTINGS['cpassman_dir'].'/includes/libraries/Carbon/Traits/Creator.php'; |
|
| 2329 | + require_once $SETTINGS['cpassman_dir'].'/includes/libraries/Carbon/Traits/Converter.php'; |
|
| 2330 | + require_once $SETTINGS['cpassman_dir'].'/includes/libraries/Carbon/Traits/Comparison.php'; |
|
| 2331 | + require_once $SETTINGS['cpassman_dir'].'/includes/libraries/Carbon/Traits/Boundaries.php'; |
|
| 2332 | + require_once $SETTINGS['cpassman_dir'].'/includes/libraries/Carbon/Traits/Date.php'; |
|
| 2333 | + require_once $SETTINGS['cpassman_dir'].'/includes/libraries/Carbon/CarbonInterface.php'; |
|
| 2334 | + require_once $SETTINGS['cpassman_dir'].'/includes/libraries/Carbon/Carbon.php'; |
|
| 2335 | + require_once $SETTINGS['cpassman_dir'].'/includes/libraries/LdapRecord/DetectsErrors.php'; |
|
| 2336 | + require_once $SETTINGS['cpassman_dir'].'/includes/libraries/LdapRecord/Connection.php'; |
|
| 2337 | + require_once $SETTINGS['cpassman_dir'].'/includes/libraries/LdapRecord/LdapInterface.php'; |
|
| 2338 | + require_once $SETTINGS['cpassman_dir'].'/includes/libraries/LdapRecord/LdapBase.php'; |
|
| 2339 | + require_once $SETTINGS['cpassman_dir'].'/includes/libraries/LdapRecord/Ldap.php'; |
|
| 2340 | 2340 | |
| 2341 | 2341 | $ad = new SplClassLoader('LdapRecord', '../includes/libraries'); |
| 2342 | 2342 | $ad->register(); |
@@ -2352,7 +2352,7 @@ discard block |
||
| 2352 | 2352 | echo prepareExchangedData( |
| 2353 | 2353 | array( |
| 2354 | 2354 | 'error' => true, |
| 2355 | - 'message' => "Error : ".$error->getErrorCode()." - ".$error->getErrorMessage(). "<br>".$error->getDiagnosticMessage(), |
|
| 2355 | + 'message' => "Error : ".$error->getErrorCode()." - ".$error->getErrorMessage()."<br>".$error->getDiagnosticMessage(), |
|
| 2356 | 2356 | ), |
| 2357 | 2357 | 'encode' |
| 2358 | 2358 | ); |
@@ -2372,10 +2372,10 @@ discard block |
||
| 2372 | 2372 | ['objectclass', '=', 'inetorgperson'], |
| 2373 | 2373 | ])->get(); |
| 2374 | 2374 | |
| 2375 | - foreach($users as $i => $adUser) { |
|
| 2375 | + foreach ($users as $i => $adUser) { |
|
| 2376 | 2376 | |
| 2377 | 2377 | // Build the list of all groups in AD |
| 2378 | - foreach($adUser['memberof'] as $j => $adUserGroup) { |
|
| 2378 | + foreach ($adUser['memberof'] as $j => $adUserGroup) { |
|
| 2379 | 2379 | if (empty($adUserGroup) === false && $j !== "count") { |
| 2380 | 2380 | $adGroup = substr($adUserGroup, 3, strpos($adUserGroup, ',') - 3); |
| 2381 | 2381 | if (in_array($adGroup, $adRoles) === false && empty($adGroup) === false) { |
@@ -2390,7 +2390,7 @@ discard block |
||
| 2390 | 2390 | // Get his ID |
| 2391 | 2391 | DB::queryfirstrow( |
| 2392 | 2392 | 'SELECT id, fonction_id, auth_type |
| 2393 | - FROM ' . prefixTable('users') . ' |
|
| 2393 | + FROM ' . prefixTable('users').' |
|
| 2394 | 2394 | WHERE login = %s', |
| 2395 | 2395 | $userLogin |
| 2396 | 2396 | ); |
@@ -2425,7 +2425,7 @@ discard block |
||
| 2425 | 2425 | } |
| 2426 | 2426 | |
| 2427 | 2427 | // Get all groups in Teampass |
| 2428 | - $rows = DB::query('SELECT id,title FROM ' . prefixTable('roles_title')); |
|
| 2428 | + $rows = DB::query('SELECT id,title FROM '.prefixTable('roles_title')); |
|
| 2429 | 2429 | foreach ($rows as $record) { |
| 2430 | 2430 | array_push( |
| 2431 | 2431 | $teampassRoles, |
@@ -2491,7 +2491,7 @@ discard block |
||
| 2491 | 2491 | // Check if user already exists |
| 2492 | 2492 | $data = DB::query( |
| 2493 | 2493 | 'SELECT id, fonction_id, groupes_interdits, groupes_visibles |
| 2494 | - FROM ' . prefixTable('users') . ' |
|
| 2494 | + FROM ' . prefixTable('users').' |
|
| 2495 | 2495 | WHERE login = %s', |
| 2496 | 2496 | $post_login |
| 2497 | 2497 | ); |
@@ -2595,7 +2595,7 @@ discard block |
||
| 2595 | 2595 | ); |
| 2596 | 2596 | |
| 2597 | 2597 | // Rebuild tree |
| 2598 | - $tree = new SplClassLoader('Tree\NestedTree', $SETTINGS['cpassman_dir'] . '/includes/libraries'); |
|
| 2598 | + $tree = new SplClassLoader('Tree\NestedTree', $SETTINGS['cpassman_dir'].'/includes/libraries'); |
|
| 2599 | 2599 | $tree->register(); |
| 2600 | 2600 | $tree = new Tree\NestedTree\NestedTree(prefixTable('nested_tree'), 'id', 'parent_id', 'title'); |
| 2601 | 2601 | $tree->rebuild(); |
@@ -2663,7 +2663,7 @@ discard block |
||
| 2663 | 2663 | // Check if user already exists |
| 2664 | 2664 | DB::query( |
| 2665 | 2665 | 'SELECT id |
| 2666 | - FROM ' . prefixTable('users') . ' |
|
| 2666 | + FROM ' . prefixTable('users').' |
|
| 2667 | 2667 | WHERE id = %i', |
| 2668 | 2668 | $post_id |
| 2669 | 2669 | ); |
@@ -2739,7 +2739,7 @@ discard block |
||
| 2739 | 2739 | // Check if user already exists |
| 2740 | 2740 | $userInfo = DB::queryfirstrow( |
| 2741 | 2741 | 'SELECT id, private_key, public_key |
| 2742 | - FROM ' . prefixTable('users') . ' |
|
| 2742 | + FROM ' . prefixTable('users').' |
|
| 2743 | 2743 | WHERE id = %i', |
| 2744 | 2744 | $post_userid |
| 2745 | 2745 | ); |
@@ -2774,7 +2774,7 @@ discard block |
||
| 2774 | 2774 | if (count($_SESSION['personal_folders']) > 0) { |
| 2775 | 2775 | DB::query( |
| 2776 | 2776 | 'SELECT id |
| 2777 | - FROM ' . prefixTable('items') . ' |
|
| 2777 | + FROM ' . prefixTable('items').' |
|
| 2778 | 2778 | WHERE id_tree IN %ls', |
| 2779 | 2779 | $_SESSION['personal_folders'] |
| 2780 | 2780 | ); |
@@ -2852,7 +2852,7 @@ discard block |
||
| 2852 | 2852 | // Check if user already exists |
| 2853 | 2853 | DB::query( |
| 2854 | 2854 | 'SELECT id |
| 2855 | - FROM ' . prefixTable('users') . ' |
|
| 2855 | + FROM ' . prefixTable('users').' |
|
| 2856 | 2856 | WHERE id = %i', |
| 2857 | 2857 | $post_id |
| 2858 | 2858 | ); |
@@ -2946,7 +2946,7 @@ discard block |
||
| 2946 | 2946 | |
| 2947 | 2947 | // Get info about user |
| 2948 | 2948 | $data_user = DB::queryfirstrow( |
| 2949 | - 'SELECT admin, isAdministratedByRole FROM ' . prefixTable('users') . ' |
|
| 2949 | + 'SELECT admin, isAdministratedByRole FROM '.prefixTable('users').' |
|
| 2950 | 2950 | WHERE id = %i', |
| 2951 | 2951 | $value[1] |
| 2952 | 2952 | ); |
@@ -2979,7 +2979,7 @@ discard block |
||
| 2979 | 2979 | logEvents( |
| 2980 | 2980 | $SETTINGS, |
| 2981 | 2981 | 'user_mngt', |
| 2982 | - 'at_user_new_' . $value[0] . ':' . $value[1], |
|
| 2982 | + 'at_user_new_'.$value[0].':'.$value[1], |
|
| 2983 | 2983 | (string) $_SESSION['user_id'], |
| 2984 | 2984 | $_SESSION['login'], |
| 2985 | 2985 | filter_input(INPUT_POST, 'id', FILTER_SANITIZE_STRING) |
@@ -3011,7 +3011,7 @@ discard block |
||
| 3011 | 3011 | |
| 3012 | 3012 | // Get info about user |
| 3013 | 3013 | $data_user = DB::queryfirstrow( |
| 3014 | - 'SELECT admin, isAdministratedByRole FROM ' . prefixTable('users') . ' |
|
| 3014 | + 'SELECT admin, isAdministratedByRole FROM '.prefixTable('users').' |
|
| 3015 | 3015 | WHERE id = %i', |
| 3016 | 3016 | $value[1] |
| 3017 | 3017 | ); |
@@ -44,23 +44,23 @@ discard block |
||
| 44 | 44 | throw new Exception("Error file '/includes/config/tp.config.php' not exists", 1); |
| 45 | 45 | } |
| 46 | 46 | |
| 47 | -if (! isset($SETTINGS['cpassman_dir']) || empty($SETTINGS['cpassman_dir']) === true || $SETTINGS['cpassman_dir'] === '.') { |
|
| 47 | +if (!isset($SETTINGS['cpassman_dir']) || empty($SETTINGS['cpassman_dir']) === true || $SETTINGS['cpassman_dir'] === '.') { |
|
| 48 | 48 | $SETTINGS = []; |
| 49 | 49 | $SETTINGS['cpassman_dir'] = '..'; |
| 50 | 50 | } |
| 51 | 51 | |
| 52 | -require_once $SETTINGS['cpassman_dir'] . '/sources/main.functions.php'; |
|
| 53 | -require_once $SETTINGS['cpassman_dir'] . '/includes/config/include.php'; |
|
| 54 | -require_once $SETTINGS['cpassman_dir'] . '/includes/config/settings.php'; |
|
| 52 | +require_once $SETTINGS['cpassman_dir'].'/sources/main.functions.php'; |
|
| 53 | +require_once $SETTINGS['cpassman_dir'].'/includes/config/include.php'; |
|
| 54 | +require_once $SETTINGS['cpassman_dir'].'/includes/config/settings.php'; |
|
| 55 | 55 | |
| 56 | 56 | // If Debug then clean the files |
| 57 | 57 | if (DEBUGLDAP === true) { |
| 58 | - define('DEBUGLDAPFILE', $SETTINGS['path_to_files_folder'] . '/ldap.debug.txt'); |
|
| 58 | + define('DEBUGLDAPFILE', $SETTINGS['path_to_files_folder'].'/ldap.debug.txt'); |
|
| 59 | 59 | $fp = fopen(DEBUGLDAPFILE, 'w'); |
| 60 | 60 | fclose($fp); |
| 61 | 61 | } |
| 62 | 62 | if (DEBUGDUO === true) { |
| 63 | - define('DEBUGDUOFILE', $SETTINGS['path_to_files_folder'] . '/duo.debug.txt'); |
|
| 63 | + define('DEBUGDUOFILE', $SETTINGS['path_to_files_folder'].'/duo.debug.txt'); |
|
| 64 | 64 | $fp = fopen(DEBUGDUOFILE, 'w'); |
| 65 | 65 | fclose($fp); |
| 66 | 66 | } |
@@ -76,7 +76,7 @@ discard block |
||
| 76 | 76 | if (defined('DB_PASSWD_CLEAR') === false) { |
| 77 | 77 | define('DB_PASSWD_CLEAR', defuseReturnDecrypted(DB_PASSWD, $SETTINGS)); |
| 78 | 78 | } |
| 79 | -require_once $SETTINGS['cpassman_dir'] . '/includes/libraries/Database/Meekrodb/db.class.php'; |
|
| 79 | +require_once $SETTINGS['cpassman_dir'].'/includes/libraries/Database/Meekrodb/db.class.php'; |
|
| 80 | 80 | if (defined('DB_PASSWD_CLEAR') === false) { |
| 81 | 81 | define('DB_PASSWD_CLEAR', defuseReturnDecrypted(DB_PASSWD, $SETTINGS)); |
| 82 | 82 | } |
@@ -95,7 +95,7 @@ discard block |
||
| 95 | 95 | // Get DUO keys |
| 96 | 96 | $duoData = DB::query( |
| 97 | 97 | 'SELECT intitule, valeur |
| 98 | - FROM ' . prefixTable('misc') . ' |
|
| 98 | + FROM ' . prefixTable('misc').' |
|
| 99 | 99 | WHERE type = %s', |
| 100 | 100 | 'duoSecurity' |
| 101 | 101 | ); |
@@ -105,7 +105,7 @@ discard block |
||
| 105 | 105 | } |
| 106 | 106 | |
| 107 | 107 | // load library |
| 108 | - include_once $SETTINGS['cpassman_dir'] . '/includes/libraries/Authentication/DuoSecurity/Duo.php'; |
|
| 108 | + include_once $SETTINGS['cpassman_dir'].'/includes/libraries/Authentication/DuoSecurity/Duo.php'; |
|
| 109 | 109 | $sig_request = Duo::signRequest( |
| 110 | 110 | $_GLOBALS['IKEY'], |
| 111 | 111 | $_GLOBALS['SKEY'], |
@@ -116,16 +116,16 @@ discard block |
||
| 116 | 116 | debugIdentify( |
| 117 | 117 | DEBUGDUO, |
| 118 | 118 | DEBUGDUOFILE, |
| 119 | - "\n\n-----\n\n" . |
|
| 120 | - 'sig request : ' . $post_login . "\n" . |
|
| 121 | - 'resp : ' . $sig_request . "\n" |
|
| 119 | + "\n\n-----\n\n". |
|
| 120 | + 'sig request : '.$post_login."\n". |
|
| 121 | + 'resp : '.$sig_request."\n" |
|
| 122 | 122 | ); |
| 123 | 123 | } |
| 124 | 124 | |
| 125 | 125 | // load csrfprotector |
| 126 | - $csrfp_config = include_once $SETTINGS['cpassman_dir'] . '/includes/libraries/csrfp/libs/csrfp.config.php'; |
|
| 126 | + $csrfp_config = include_once $SETTINGS['cpassman_dir'].'/includes/libraries/csrfp/libs/csrfp.config.php'; |
|
| 127 | 127 | // return result |
| 128 | - echo '[{"sig_request" : "' . $sig_request . '" , "csrfp_token" : "' . $csrfp_config['CSRFP_TOKEN'] . '" , "csrfp_key" : "' . filter_var($_COOKIE[$csrfp_config['CSRFP_TOKEN']], FILTER_SANITIZE_STRING) . '"}]'; |
|
| 128 | + echo '[{"sig_request" : "'.$sig_request.'" , "csrfp_token" : "'.$csrfp_config['CSRFP_TOKEN'].'" , "csrfp_key" : "'.filter_var($_COOKIE[$csrfp_config['CSRFP_TOKEN']], FILTER_SANITIZE_STRING).'"}]'; |
|
| 129 | 129 | // --- |
| 130 | 130 | // --- |
| 131 | 131 | } elseif ($post_type === 'identify_duo_user_check') { |
@@ -135,7 +135,7 @@ discard block |
||
| 135 | 135 | //-------- |
| 136 | 136 | |
| 137 | 137 | // load library |
| 138 | - include_once $SETTINGS['cpassman_dir'] . '/includes/libraries/Authentication/DuoSecurity/Duo.php'; |
|
| 138 | + include_once $SETTINGS['cpassman_dir'].'/includes/libraries/Authentication/DuoSecurity/Duo.php'; |
|
| 139 | 139 | $authenticated_username = Duo::verifyResponse( |
| 140 | 140 | $SETTINGS['duo_ikey'], |
| 141 | 141 | $SETTINGS['duo_skey'], |
@@ -146,9 +146,9 @@ discard block |
||
| 146 | 146 | debugIdentify( |
| 147 | 147 | DEBUGDUO, |
| 148 | 148 | DEBUGDUOFILE, |
| 149 | - "\n\n-----\n\n" . |
|
| 150 | - 'sig response : ' . $post_sig_response . "\n" . |
|
| 151 | - 'resp : ' . $authenticated_username . "\n" |
|
| 149 | + "\n\n-----\n\n". |
|
| 150 | + 'sig response : '.$post_sig_response."\n". |
|
| 151 | + 'resp : '.$authenticated_username."\n" |
|
| 152 | 152 | ); |
| 153 | 153 | } |
| 154 | 154 | |
@@ -159,7 +159,7 @@ discard block |
||
| 159 | 159 | // is user in Teampass? |
| 160 | 160 | DB::queryfirstrow( |
| 161 | 161 | 'SELECT id |
| 162 | - FROM ' . prefixTable('users') . ' |
|
| 162 | + FROM ' . prefixTable('users').' |
|
| 163 | 163 | WHERE login = %s', |
| 164 | 164 | $post_login |
| 165 | 165 | ); |
@@ -169,9 +169,9 @@ discard block |
||
| 169 | 169 | } |
| 170 | 170 | } |
| 171 | 171 | |
| 172 | - echo '[{"authenticated_username" : "' . $authenticated_username . '"}]'; |
|
| 172 | + echo '[{"authenticated_username" : "'.$authenticated_username.'"}]'; |
|
| 173 | 173 | } else { |
| 174 | - echo '[{"authenticated_username" : "' . $authenticated_username . '"}]'; |
|
| 174 | + echo '[{"authenticated_username" : "'.$authenticated_username.'"}]'; |
|
| 175 | 175 | } |
| 176 | 176 | // --- |
| 177 | 177 | // --- |
@@ -197,7 +197,7 @@ discard block |
||
| 197 | 197 | } |
| 198 | 198 | |
| 199 | 199 | // Load superGlobals |
| 200 | - include_once $SETTINGS['cpassman_dir'] . '/includes/libraries/protect/SuperGlobal/SuperGlobal.php'; |
|
| 200 | + include_once $SETTINGS['cpassman_dir'].'/includes/libraries/protect/SuperGlobal/SuperGlobal.php'; |
|
| 201 | 201 | $superGlobal = new protect\SuperGlobal\SuperGlobal(); |
| 202 | 202 | // Prepare GET variables |
| 203 | 203 | $sessionPwdAttempts = $superGlobal->get('pwd_attempts', 'SESSION'); |
@@ -285,19 +285,19 @@ discard block |
||
| 285 | 285 | } else { |
| 286 | 286 | throw new Exception("Error file '/includes/config/tp.config.php' not exists", 1); |
| 287 | 287 | } |
| 288 | - include_once $SETTINGS['cpassman_dir'] . '/includes/config/settings.php'; |
|
| 289 | - include_once $SETTINGS['cpassman_dir'] . '/sources/main.functions.php'; |
|
| 290 | - include_once $SETTINGS['cpassman_dir'] . '/sources/SplClassLoader.php'; |
|
| 288 | + include_once $SETTINGS['cpassman_dir'].'/includes/config/settings.php'; |
|
| 289 | + include_once $SETTINGS['cpassman_dir'].'/sources/main.functions.php'; |
|
| 290 | + include_once $SETTINGS['cpassman_dir'].'/sources/SplClassLoader.php'; |
|
| 291 | 291 | |
| 292 | 292 | header('Content-type: text/html; charset=utf-8'); |
| 293 | 293 | error_reporting(E_ERROR); |
| 294 | 294 | |
| 295 | 295 | // Load AntiXSS |
| 296 | - include_once $SETTINGS['cpassman_dir'] . '/includes/libraries/voku/helper/AntiXSS.php'; |
|
| 296 | + include_once $SETTINGS['cpassman_dir'].'/includes/libraries/voku/helper/AntiXSS.php'; |
|
| 297 | 297 | $antiXss = new voku\helper\AntiXSS(); |
| 298 | 298 | |
| 299 | 299 | // Load superGlobals |
| 300 | - include_once $SETTINGS['cpassman_dir'] . '/includes/libraries/protect/SuperGlobal/SuperGlobal.php'; |
|
| 300 | + include_once $SETTINGS['cpassman_dir'].'/includes/libraries/protect/SuperGlobal/SuperGlobal.php'; |
|
| 301 | 301 | $superGlobal = new protect\SuperGlobal\SuperGlobal(); |
| 302 | 302 | |
| 303 | 303 | // Prepare GET variables |
@@ -311,7 +311,7 @@ discard block |
||
| 311 | 311 | $server['PHP_AUTH_PW'] = $superGlobal->get('PHP_AUTH_PW', 'SERVER'); |
| 312 | 312 | |
| 313 | 313 | // connect to the server |
| 314 | - include_once $SETTINGS['cpassman_dir'] . '/includes/libraries/Database/Meekrodb/db.class.php'; |
|
| 314 | + include_once $SETTINGS['cpassman_dir'].'/includes/libraries/Database/Meekrodb/db.class.php'; |
|
| 315 | 315 | DB::$host = DB_HOST; |
| 316 | 316 | DB::$user = DB_USER; |
| 317 | 317 | DB::$password = defined('DB_PASSWD_CLEAR') === false ? defuseReturnDecrypted(DB_PASSWD, $SETTINGS) : DB_PASSWD_CLEAR; |
@@ -319,7 +319,7 @@ discard block |
||
| 319 | 319 | DB::$port = DB_PORT; |
| 320 | 320 | DB::$encoding = DB_ENCODING; |
| 321 | 321 | // User's language loading |
| 322 | - include_once $SETTINGS['cpassman_dir'] . '/includes/language/' . $sessionUserLanguage . '.php'; |
|
| 322 | + include_once $SETTINGS['cpassman_dir'].'/includes/language/'.$sessionUserLanguage.'.php'; |
|
| 323 | 323 | |
| 324 | 324 | // decrypt and retreive data in JSON format |
| 325 | 325 | if (empty($sessionKey) === true) { |
@@ -447,7 +447,7 @@ discard block |
||
| 447 | 447 | //$arrAttempts = array(); |
| 448 | 448 | $rows = DB::query( |
| 449 | 449 | 'SELECT date |
| 450 | - FROM ' . prefixTable('log_system') . " |
|
| 450 | + FROM ' . prefixTable('log_system')." |
|
| 451 | 451 | WHERE field_1 = %s |
| 452 | 452 | AND type = 'failed_auth' |
| 453 | 453 | AND label = 'user_password_not_correct' |
@@ -463,7 +463,7 @@ discard block |
||
| 463 | 463 | foreach ($rows as $record) { |
| 464 | 464 | array_push( |
| 465 | 465 | $arrAttempts, |
| 466 | - date($SETTINGS['date_format'] . ' ' . $SETTINGS['time_format'], (int) $record['date']) |
|
| 466 | + date($SETTINGS['date_format'].' '.$SETTINGS['time_format'], (int) $record['date']) |
|
| 467 | 467 | ); |
| 468 | 468 | } |
| 469 | 469 | } |
@@ -499,7 +499,7 @@ discard block |
||
| 499 | 499 | $superGlobal->put('user_upgrade_needed', $userInfo['upgrade_needed'], 'SESSION'); |
| 500 | 500 | $superGlobal->put('user_force_relog', $userInfo['force-relog'], 'SESSION'); |
| 501 | 501 | // get personal settings |
| 502 | - if (! isset($userInfo['treeloadstrategy']) || empty($userInfo['treeloadstrategy'])) { |
|
| 502 | + if (!isset($userInfo['treeloadstrategy']) || empty($userInfo['treeloadstrategy'])) { |
|
| 503 | 503 | $userInfo['treeloadstrategy'] = 'full'; |
| 504 | 504 | } |
| 505 | 505 | $superGlobal->put('treeloadstrategy', $userInfo['treeloadstrategy'], 'SESSION', 'user'); |
@@ -601,7 +601,7 @@ discard block |
||
| 601 | 601 | foreach ($superGlobal->get('user_roles', 'SESSION') as $role) { |
| 602 | 602 | $resRoles = DB::queryFirstRow( |
| 603 | 603 | 'SELECT title, complexity |
| 604 | - FROM ' . prefixTable('roles_title') . ' |
|
| 604 | + FROM ' . prefixTable('roles_title').' |
|
| 605 | 605 | WHERE id=%i', |
| 606 | 606 | $role |
| 607 | 607 | ); |
@@ -622,7 +622,7 @@ discard block |
||
| 622 | 622 | |
| 623 | 623 | // build complete array of roles |
| 624 | 624 | $superGlobal->put('arr_roles_full', [], 'SESSION'); |
| 625 | - $rows = DB::query('SELECT id, title FROM ' . prefixTable('roles_title') . ' ORDER BY title ASC'); |
|
| 625 | + $rows = DB::query('SELECT id, title FROM '.prefixTable('roles_title').' ORDER BY title ASC'); |
|
| 626 | 626 | foreach ($rows as $record) { |
| 627 | 627 | $superGlobal->put( |
| 628 | 628 | $record['id'], |
@@ -713,10 +713,10 @@ discard block |
||
| 713 | 713 | $superGlobal->put('latest_items_tab', [], 'SESSION'); |
| 714 | 714 | $superGlobal->put('nb_roles', 0, 'SESSION'); |
| 715 | 715 | foreach ($superGlobal->get('latest_items', 'SESSION') as $item) { |
| 716 | - if (! empty($item)) { |
|
| 716 | + if (!empty($item)) { |
|
| 717 | 717 | $dataLastItems = DB::queryFirstRow( |
| 718 | 718 | 'SELECT id,label,id_tree |
| 719 | - FROM ' . prefixTable('items') . ' |
|
| 719 | + FROM ' . prefixTable('items').' |
|
| 720 | 720 | WHERE id=%i', |
| 721 | 721 | $item |
| 722 | 722 | ); |
@@ -725,7 +725,7 @@ discard block |
||
| 725 | 725 | [ |
| 726 | 726 | 'id' => $item, |
| 727 | 727 | 'label' => $dataLastItems['label'], |
| 728 | - 'url' => 'index.php?page=items&group=' . $dataLastItems['id_tree'] . '&id=' . $item, |
|
| 728 | + 'url' => 'index.php?page=items&group='.$dataLastItems['id_tree'].'&id='.$item, |
|
| 729 | 729 | ], |
| 730 | 730 | 'SESSION', |
| 731 | 731 | 'latest_items_tab' |
@@ -742,12 +742,12 @@ discard block |
||
| 742 | 742 | ) { |
| 743 | 743 | // get all Admin users |
| 744 | 744 | $receivers = ''; |
| 745 | - $rows = DB::query('SELECT email FROM ' . prefixTable('users') . " WHERE admin = %i and email != ''", 1); |
|
| 745 | + $rows = DB::query('SELECT email FROM '.prefixTable('users')." WHERE admin = %i and email != ''", 1); |
|
| 746 | 746 | foreach ($rows as $record) { |
| 747 | 747 | if (empty($receivers)) { |
| 748 | 748 | $receivers = $record['email']; |
| 749 | 749 | } else { |
| 750 | - $receivers = ',' . $record['email']; |
|
| 750 | + $receivers = ','.$record['email']; |
|
| 751 | 751 | } |
| 752 | 752 | } |
| 753 | 753 | // Add email to table |
@@ -763,7 +763,7 @@ discard block |
||
| 763 | 763 | '#tp_time#', |
| 764 | 764 | ], |
| 765 | 765 | [ |
| 766 | - ' ' . $superGlobal->get('login', 'SESSION') . ' (IP: ' . getClientIpServer() . ')', |
|
| 766 | + ' '.$superGlobal->get('login', 'SESSION').' (IP: '.getClientIpServer().')', |
|
| 767 | 767 | date($SETTINGS['date_format'], (int) $superGlobal->get('last_connection', 'SESSION')), |
| 768 | 768 | date($SETTINGS['time_format'], (int) $superGlobal->get('last_connection', 'SESSION')), |
| 769 | 769 | ], |
@@ -977,44 +977,44 @@ discard block |
||
| 977 | 977 | ], |
| 978 | 978 | ]; |
| 979 | 979 | // Load expected libraries |
| 980 | - require_once $SETTINGS['cpassman_dir'] . '/includes/libraries/Illuminate/Contracts/Auth/Authenticatable.php'; |
|
| 981 | - require_once $SETTINGS['cpassman_dir'] . '/includes/libraries/Tightenco/Collect/Support/Traits/EnumeratesValues.php'; |
|
| 982 | - require_once $SETTINGS['cpassman_dir'] . '/includes/libraries/Tightenco/Collect/Support/Traits/Macroable.php'; |
|
| 983 | - require_once $SETTINGS['cpassman_dir'] . '/includes/libraries/Tightenco/Collect/Support/helpers.php'; |
|
| 984 | - require_once $SETTINGS['cpassman_dir'] . '/includes/libraries/Tightenco/Collect/Support/Arr.php'; |
|
| 985 | - require_once $SETTINGS['cpassman_dir'] . '/includes/libraries/Tightenco/Collect/Contracts/Support/Jsonable.php'; |
|
| 986 | - require_once $SETTINGS['cpassman_dir'] . '/includes/libraries/Tightenco/Collect/Contracts/Support/Arrayable.php'; |
|
| 987 | - require_once $SETTINGS['cpassman_dir'] . '/includes/libraries/Tightenco/Collect/Support/Enumerable.php'; |
|
| 988 | - require_once $SETTINGS['cpassman_dir'] . '/includes/libraries/Tightenco/Collect/Support/Collection.php'; |
|
| 989 | - require_once $SETTINGS['cpassman_dir'] . '/includes/libraries/Carbon/CarbonTimeZone.php'; |
|
| 990 | - require_once $SETTINGS['cpassman_dir'] . '/includes/libraries/Carbon/Traits/Units.php'; |
|
| 991 | - require_once $SETTINGS['cpassman_dir'] . '/includes/libraries/Carbon/Traits/Week.php'; |
|
| 992 | - require_once $SETTINGS['cpassman_dir'] . '/includes/libraries/Carbon/Traits/Timestamp.php'; |
|
| 993 | - require_once $SETTINGS['cpassman_dir'] . '/includes/libraries/Carbon/Traits/Test.php'; |
|
| 994 | - require_once $SETTINGS['cpassman_dir'] . '/includes/libraries/Carbon/Traits/ObjectInitialisation.php'; |
|
| 995 | - require_once $SETTINGS['cpassman_dir'] . '/includes/libraries/Carbon/Traits/Serialization.php'; |
|
| 996 | - require_once $SETTINGS['cpassman_dir'] . '/includes/libraries/Carbon/Traits/IntervalRounding.php'; |
|
| 997 | - require_once $SETTINGS['cpassman_dir'] . '/includes/libraries/Carbon/Traits/Rounding.php'; |
|
| 998 | - require_once $SETTINGS['cpassman_dir'] . '/includes/libraries/Carbon/Traits/Localization.php'; |
|
| 999 | - require_once $SETTINGS['cpassman_dir'] . '/includes/libraries/Carbon/Traits/Options.php'; |
|
| 1000 | - require_once $SETTINGS['cpassman_dir'] . '/includes/libraries/Carbon/Traits/Cast.php'; |
|
| 1001 | - require_once $SETTINGS['cpassman_dir'] . '/includes/libraries/Carbon/Traits/Mutability.php'; |
|
| 1002 | - require_once $SETTINGS['cpassman_dir'] . '/includes/libraries/Carbon/Traits/Modifiers.php'; |
|
| 1003 | - require_once $SETTINGS['cpassman_dir'] . '/includes/libraries/Carbon/Traits/Mixin.php'; |
|
| 1004 | - require_once $SETTINGS['cpassman_dir'] . '/includes/libraries/Carbon/Traits/Macro.php'; |
|
| 1005 | - require_once $SETTINGS['cpassman_dir'] . '/includes/libraries/Carbon/Traits/Difference.php'; |
|
| 1006 | - require_once $SETTINGS['cpassman_dir'] . '/includes/libraries/Carbon/Traits/Creator.php'; |
|
| 1007 | - require_once $SETTINGS['cpassman_dir'] . '/includes/libraries/Carbon/Traits/Converter.php'; |
|
| 1008 | - require_once $SETTINGS['cpassman_dir'] . '/includes/libraries/Carbon/Traits/Comparison.php'; |
|
| 1009 | - require_once $SETTINGS['cpassman_dir'] . '/includes/libraries/Carbon/Traits/Boundaries.php'; |
|
| 1010 | - require_once $SETTINGS['cpassman_dir'] . '/includes/libraries/Carbon/Traits/Date.php'; |
|
| 1011 | - require_once $SETTINGS['cpassman_dir'] . '/includes/libraries/Carbon/CarbonInterface.php'; |
|
| 1012 | - require_once $SETTINGS['cpassman_dir'] . '/includes/libraries/Carbon/Carbon.php'; |
|
| 1013 | - require_once $SETTINGS['cpassman_dir'] . '/includes/libraries/LdapRecord/DetectsErrors.php'; |
|
| 1014 | - require_once $SETTINGS['cpassman_dir'] . '/includes/libraries/LdapRecord/Connection.php'; |
|
| 1015 | - require_once $SETTINGS['cpassman_dir'] . '/includes/libraries/LdapRecord/LdapInterface.php'; |
|
| 1016 | - require_once $SETTINGS['cpassman_dir'] . '/includes/libraries/LdapRecord/LdapBase.php'; |
|
| 1017 | - require_once $SETTINGS['cpassman_dir'] . '/includes/libraries/LdapRecord/Ldap.php'; |
|
| 980 | + require_once $SETTINGS['cpassman_dir'].'/includes/libraries/Illuminate/Contracts/Auth/Authenticatable.php'; |
|
| 981 | + require_once $SETTINGS['cpassman_dir'].'/includes/libraries/Tightenco/Collect/Support/Traits/EnumeratesValues.php'; |
|
| 982 | + require_once $SETTINGS['cpassman_dir'].'/includes/libraries/Tightenco/Collect/Support/Traits/Macroable.php'; |
|
| 983 | + require_once $SETTINGS['cpassman_dir'].'/includes/libraries/Tightenco/Collect/Support/helpers.php'; |
|
| 984 | + require_once $SETTINGS['cpassman_dir'].'/includes/libraries/Tightenco/Collect/Support/Arr.php'; |
|
| 985 | + require_once $SETTINGS['cpassman_dir'].'/includes/libraries/Tightenco/Collect/Contracts/Support/Jsonable.php'; |
|
| 986 | + require_once $SETTINGS['cpassman_dir'].'/includes/libraries/Tightenco/Collect/Contracts/Support/Arrayable.php'; |
|
| 987 | + require_once $SETTINGS['cpassman_dir'].'/includes/libraries/Tightenco/Collect/Support/Enumerable.php'; |
|
| 988 | + require_once $SETTINGS['cpassman_dir'].'/includes/libraries/Tightenco/Collect/Support/Collection.php'; |
|
| 989 | + require_once $SETTINGS['cpassman_dir'].'/includes/libraries/Carbon/CarbonTimeZone.php'; |
|
| 990 | + require_once $SETTINGS['cpassman_dir'].'/includes/libraries/Carbon/Traits/Units.php'; |
|
| 991 | + require_once $SETTINGS['cpassman_dir'].'/includes/libraries/Carbon/Traits/Week.php'; |
|
| 992 | + require_once $SETTINGS['cpassman_dir'].'/includes/libraries/Carbon/Traits/Timestamp.php'; |
|
| 993 | + require_once $SETTINGS['cpassman_dir'].'/includes/libraries/Carbon/Traits/Test.php'; |
|
| 994 | + require_once $SETTINGS['cpassman_dir'].'/includes/libraries/Carbon/Traits/ObjectInitialisation.php'; |
|
| 995 | + require_once $SETTINGS['cpassman_dir'].'/includes/libraries/Carbon/Traits/Serialization.php'; |
|
| 996 | + require_once $SETTINGS['cpassman_dir'].'/includes/libraries/Carbon/Traits/IntervalRounding.php'; |
|
| 997 | + require_once $SETTINGS['cpassman_dir'].'/includes/libraries/Carbon/Traits/Rounding.php'; |
|
| 998 | + require_once $SETTINGS['cpassman_dir'].'/includes/libraries/Carbon/Traits/Localization.php'; |
|
| 999 | + require_once $SETTINGS['cpassman_dir'].'/includes/libraries/Carbon/Traits/Options.php'; |
|
| 1000 | + require_once $SETTINGS['cpassman_dir'].'/includes/libraries/Carbon/Traits/Cast.php'; |
|
| 1001 | + require_once $SETTINGS['cpassman_dir'].'/includes/libraries/Carbon/Traits/Mutability.php'; |
|
| 1002 | + require_once $SETTINGS['cpassman_dir'].'/includes/libraries/Carbon/Traits/Modifiers.php'; |
|
| 1003 | + require_once $SETTINGS['cpassman_dir'].'/includes/libraries/Carbon/Traits/Mixin.php'; |
|
| 1004 | + require_once $SETTINGS['cpassman_dir'].'/includes/libraries/Carbon/Traits/Macro.php'; |
|
| 1005 | + require_once $SETTINGS['cpassman_dir'].'/includes/libraries/Carbon/Traits/Difference.php'; |
|
| 1006 | + require_once $SETTINGS['cpassman_dir'].'/includes/libraries/Carbon/Traits/Creator.php'; |
|
| 1007 | + require_once $SETTINGS['cpassman_dir'].'/includes/libraries/Carbon/Traits/Converter.php'; |
|
| 1008 | + require_once $SETTINGS['cpassman_dir'].'/includes/libraries/Carbon/Traits/Comparison.php'; |
|
| 1009 | + require_once $SETTINGS['cpassman_dir'].'/includes/libraries/Carbon/Traits/Boundaries.php'; |
|
| 1010 | + require_once $SETTINGS['cpassman_dir'].'/includes/libraries/Carbon/Traits/Date.php'; |
|
| 1011 | + require_once $SETTINGS['cpassman_dir'].'/includes/libraries/Carbon/CarbonInterface.php'; |
|
| 1012 | + require_once $SETTINGS['cpassman_dir'].'/includes/libraries/Carbon/Carbon.php'; |
|
| 1013 | + require_once $SETTINGS['cpassman_dir'].'/includes/libraries/LdapRecord/DetectsErrors.php'; |
|
| 1014 | + require_once $SETTINGS['cpassman_dir'].'/includes/libraries/LdapRecord/Connection.php'; |
|
| 1015 | + require_once $SETTINGS['cpassman_dir'].'/includes/libraries/LdapRecord/LdapInterface.php'; |
|
| 1016 | + require_once $SETTINGS['cpassman_dir'].'/includes/libraries/LdapRecord/LdapBase.php'; |
|
| 1017 | + require_once $SETTINGS['cpassman_dir'].'/includes/libraries/LdapRecord/Ldap.php'; |
|
| 1018 | 1018 | $ad = new SplClassLoader('LdapRecord', '../includes/libraries'); |
| 1019 | 1019 | $ad->register(); |
| 1020 | 1020 | $connection = new Connection($config); |
@@ -1026,7 +1026,7 @@ discard block |
||
| 1026 | 1026 | $error = $e->getDetailedError(); |
| 1027 | 1027 | return [ |
| 1028 | 1028 | 'error' => true, |
| 1029 | - 'message' => langHdl('error').' : '.$error->getErrorCode().' - '.$error->getErrorMessage(). '<br>'.$error->getDiagnosticMessage().' '.$config['username'], |
|
| 1029 | + 'message' => langHdl('error').' : '.$error->getErrorCode().' - '.$error->getErrorMessage().'<br>'.$error->getDiagnosticMessage().' '.$config['username'], |
|
| 1030 | 1030 | |
| 1031 | 1031 | ]; |
| 1032 | 1032 | } |
@@ -1054,7 +1054,7 @@ discard block |
||
| 1054 | 1054 | } |
| 1055 | 1055 | |
| 1056 | 1056 | // load passwordLib library |
| 1057 | - $pwdlib = new SplClassLoader('PasswordLib', $SETTINGS['cpassman_dir'] . '/includes/libraries'); |
|
| 1057 | + $pwdlib = new SplClassLoader('PasswordLib', $SETTINGS['cpassman_dir'].'/includes/libraries'); |
|
| 1058 | 1058 | $pwdlib->register(); |
| 1059 | 1059 | $pwdlib = new PasswordLib\PasswordLib(); |
| 1060 | 1060 | $hashedPassword = $pwdlib->createPasswordHash($passwordClear); |
@@ -1119,7 +1119,7 @@ discard block |
||
| 1119 | 1119 | function yubicoMFACheck($dataReceived, string $userInfo, array $SETTINGS): array |
| 1120 | 1120 | { |
| 1121 | 1121 | // Load superGlobals |
| 1122 | - include_once $SETTINGS['cpassman_dir'] . '/includes/libraries/protect/SuperGlobal/SuperGlobal.php'; |
|
| 1122 | + include_once $SETTINGS['cpassman_dir'].'/includes/libraries/protect/SuperGlobal/SuperGlobal.php'; |
|
| 1123 | 1123 | $superGlobal = new protect\SuperGlobal\SuperGlobal(); |
| 1124 | 1124 | $sessionAdmin = $superGlobal->get('user_admin', 'SESSION'); |
| 1125 | 1125 | $sessionUrl = $superGlobal->get('initial_url', 'SESSION'); |
@@ -1158,7 +1158,7 @@ discard block |
||
| 1158 | 1158 | } |
| 1159 | 1159 | |
| 1160 | 1160 | // Now check yubico validity |
| 1161 | - include_once $SETTINGS['cpassman_dir'] . '/includes/libraries/Authentication/Yubico/Yubico.php'; |
|
| 1161 | + include_once $SETTINGS['cpassman_dir'].'/includes/libraries/Authentication/Yubico/Yubico.php'; |
|
| 1162 | 1162 | $yubi = new Auth_Yubico($yubico_user_id, $yubico_user_key); |
| 1163 | 1163 | $auth = $yubi->verify($yubico_key); |
| 1164 | 1164 | //, null, null, null, 60 |
@@ -1210,7 +1210,7 @@ discard block |
||
| 1210 | 1210 | 'gestionnaire' => '0', |
| 1211 | 1211 | 'can_manage_all_users' => '0', |
| 1212 | 1212 | 'personal_folder' => $SETTINGS['enable_pf_feature'] === '1' ? '1' : '0', |
| 1213 | - 'fonction_id' => (empty($retLDAP['user_info_from_ad'][0]['commonGroupsLdapVsTeampass']) === false ? $retLDAP['user_info_from_ad'][0]['commonGroupsLdapVsTeampass'] . ';' : '') . (isset($SETTINGS['ldap_new_user_role']) === true ? $SETTINGS['ldap_new_user_role'] : '0'), |
|
| 1213 | + 'fonction_id' => (empty($retLDAP['user_info_from_ad'][0]['commonGroupsLdapVsTeampass']) === false ? $retLDAP['user_info_from_ad'][0]['commonGroupsLdapVsTeampass'].';' : '').(isset($SETTINGS['ldap_new_user_role']) === true ? $SETTINGS['ldap_new_user_role'] : '0'), |
|
| 1214 | 1214 | 'groupes_interdits' => '', |
| 1215 | 1215 | 'groupes_visibles' => '', |
| 1216 | 1216 | 'last_pw_change' => (int) time(), |
@@ -1235,7 +1235,7 @@ discard block |
||
| 1235 | 1235 | ] |
| 1236 | 1236 | ); |
| 1237 | 1237 | // Rebuild tree |
| 1238 | - $tree = new SplClassLoader('Tree\NestedTree', $SETTINGS['cpassman_dir'] . '/includes/libraries'); |
|
| 1238 | + $tree = new SplClassLoader('Tree\NestedTree', $SETTINGS['cpassman_dir'].'/includes/libraries'); |
|
| 1239 | 1239 | $tree->register(); |
| 1240 | 1240 | $tree = new Tree\NestedTree\NestedTree(prefixTable('nested_tree'), 'id', 'parent_id', 'title'); |
| 1241 | 1241 | $tree->rebuild(); |
@@ -1266,13 +1266,13 @@ discard block |
||
| 1266 | 1266 | && empty($dataReceived['GACode']) === false |
| 1267 | 1267 | ) { |
| 1268 | 1268 | // Load superGlobals |
| 1269 | - include_once $SETTINGS['cpassman_dir'] . '/includes/libraries/protect/SuperGlobal/SuperGlobal.php'; |
|
| 1269 | + include_once $SETTINGS['cpassman_dir'].'/includes/libraries/protect/SuperGlobal/SuperGlobal.php'; |
|
| 1270 | 1270 | $superGlobal = new protect\SuperGlobal\SuperGlobal(); |
| 1271 | 1271 | $sessionAdmin = $superGlobal->get('user_admin', 'SESSION'); |
| 1272 | 1272 | $sessionUrl = $superGlobal->get('initial_url', 'SESSION'); |
| 1273 | 1273 | $sessionPwdAttempts = $superGlobal->get('pwd_attempts', 'SESSION'); |
| 1274 | 1274 | // load library |
| 1275 | - include_once $SETTINGS['cpassman_dir'] . '/includes/libraries/Authentication/TwoFactorAuth/TwoFactorAuth.php'; |
|
| 1275 | + include_once $SETTINGS['cpassman_dir'].'/includes/libraries/Authentication/TwoFactorAuth/TwoFactorAuth.php'; |
|
| 1276 | 1276 | // create new instance |
| 1277 | 1277 | $tfa = new Authentication\TwoFactorAuth\TwoFactorAuth($SETTINGS['ga_website_name']); |
| 1278 | 1278 | // Init |
@@ -1294,7 +1294,7 @@ discard block |
||
| 1294 | 1294 | $mfaMessage = langHdl('ga_flash_qr_and_login'); |
| 1295 | 1295 | // generate new QR |
| 1296 | 1296 | $new_2fa_qr = $tfa->getQRCodeImageAsDataUri( |
| 1297 | - 'Teampass - ' . $username, |
|
| 1297 | + 'Teampass - '.$username, |
|
| 1298 | 1298 | $userInfo['ga'] |
| 1299 | 1299 | ); |
| 1300 | 1300 | // clear temporary code from DB |
@@ -1307,7 +1307,7 @@ discard block |
||
| 1307 | 1307 | $userInfo['id'] |
| 1308 | 1308 | ); |
| 1309 | 1309 | $firstTime = [ |
| 1310 | - 'value' => '<img src="' . $new_2fa_qr . '">', |
|
| 1310 | + 'value' => '<img src="'.$new_2fa_qr.'">', |
|
| 1311 | 1311 | 'user_admin' => isset($sessionAdmin) ? (int) $sessionAdmin : '', |
| 1312 | 1312 | 'initial_url' => isset($sessionUrl) === true ? $sessionUrl : '', |
| 1313 | 1313 | 'pwd_attempts' => (int) $sessionPwdAttempts, |
@@ -1359,8 +1359,8 @@ discard block |
||
| 1359 | 1359 | // Set to false |
| 1360 | 1360 | $userPasswordVerified = false; |
| 1361 | 1361 | // load passwordLib library |
| 1362 | - include_once $SETTINGS['cpassman_dir'] . '/sources/SplClassLoader.php'; |
|
| 1363 | - $pwdlib = new SplClassLoader('PasswordLib', $SETTINGS['cpassman_dir'] . '/includes/libraries'); |
|
| 1362 | + include_once $SETTINGS['cpassman_dir'].'/sources/SplClassLoader.php'; |
|
| 1363 | + $pwdlib = new SplClassLoader('PasswordLib', $SETTINGS['cpassman_dir'].'/includes/libraries'); |
|
| 1364 | 1364 | $pwdlib->register(); |
| 1365 | 1365 | $pwdlib = new PasswordLib\PasswordLib(); |
| 1366 | 1366 | // Check if old encryption used |
@@ -1491,7 +1491,7 @@ discard block |
||
| 1491 | 1491 | // Brute force management |
| 1492 | 1492 | if ($sessionPwdAttempts > 3) { |
| 1493 | 1493 | // Load superGlobals |
| 1494 | - include_once $SETTINGS['cpassman_dir'] . '/includes/libraries/protect/SuperGlobal/SuperGlobal.php'; |
|
| 1494 | + include_once $SETTINGS['cpassman_dir'].'/includes/libraries/protect/SuperGlobal/SuperGlobal.php'; |
|
| 1495 | 1495 | $superGlobal = new protect\SuperGlobal\SuperGlobal(); |
| 1496 | 1496 | $superGlobal->put('next_possible_pwd_attempts', time() + 10, 'SESSION'); |
| 1497 | 1497 | $superGlobal->put('pwd_attempts', 0, 'SESSION'); |
@@ -1533,7 +1533,7 @@ discard block |
||
| 1533 | 1533 | // Check if user exists |
| 1534 | 1534 | $userInfo = DB::queryFirstRow( |
| 1535 | 1535 | 'SELECT * |
| 1536 | - FROM ' . prefixTable('users') . ' WHERE login=%s', |
|
| 1536 | + FROM ' . prefixTable('users').' WHERE login=%s', |
|
| 1537 | 1537 | $username |
| 1538 | 1538 | ); |
| 1539 | 1539 | |
@@ -43,11 +43,11 @@ discard block |
||
| 43 | 43 | } |
| 44 | 44 | |
| 45 | 45 | /* do checks */ |
| 46 | -require_once $SETTINGS['cpassman_dir'] . '/sources/checks.php'; |
|
| 46 | +require_once $SETTINGS['cpassman_dir'].'/sources/checks.php'; |
|
| 47 | 47 | if (checkUser($_SESSION['user_id'], $_SESSION['key'], 'folders', $SETTINGS) === false) { |
| 48 | 48 | $_SESSION['error']['code'] = ERR_NOT_ALLOWED; |
| 49 | 49 | //not allowed page |
| 50 | - include $SETTINGS['cpassman_dir'] . '/error.php'; |
|
| 50 | + include $SETTINGS['cpassman_dir'].'/error.php'; |
|
| 51 | 51 | exit; |
| 52 | 52 | } |
| 53 | 53 | ?> |
@@ -275,8 +275,8 @@ discard block |
||
| 275 | 275 | if (store.get('teampassApplication').formUserAction === "add_new_user") { |
| 276 | 276 | var data = { |
| 277 | 277 | 'receipt': $('#form-email').val(), |
| 278 | - 'subject': 'TEAMPASS - <?php echo langHdl('temporary_encryption_code');?>', |
|
| 279 | - 'body': '<?php echo langHdl('email_body_new_user');?>', |
|
| 278 | + 'subject': 'TEAMPASS - <?php echo langHdl('temporary_encryption_code'); ?>', |
|
| 279 | + 'body': '<?php echo langHdl('email_body_new_user'); ?>', |
|
| 280 | 280 | 'pre_replace' : { |
| 281 | 281 | '#code#' : store.get('teampassUser').admin_new_user_temporary_encryption_code, |
| 282 | 282 | '#login#' : store.get('teampassUser').admin_new_user_login, |
@@ -286,8 +286,8 @@ discard block |
||
| 286 | 286 | } else { |
| 287 | 287 | var data = { |
| 288 | 288 | 'receipt': $('#form-email').val(), |
| 289 | - 'subject': 'TEAMPASS - <?php echo langHdl('temporary_encryption_code');?>', |
|
| 290 | - 'body': '<?php echo langHdl('email_body_temporary_encryption_code');?>', |
|
| 289 | + 'subject': 'TEAMPASS - <?php echo langHdl('temporary_encryption_code'); ?>', |
|
| 290 | + 'body': '<?php echo langHdl('email_body_temporary_encryption_code'); ?>', |
|
| 291 | 291 | 'pre_replace' : { |
| 292 | 292 | '#enc_code#' : store.get('teampassUser').admin_new_user_temporary_encryption_code, |
| 293 | 293 | } |
@@ -463,13 +463,13 @@ discard block |
||
| 463 | 463 | } |
| 464 | 464 | // Inform user |
| 465 | 465 | $("#warningModalBody").html('<b><?php echo langHdl('encryption_keys'); ?> - ' + |
| 466 | - stepText + '</b> [' + start + ' - ' + (parseInt(start) + <?php echo NUMBER_ITEMS_IN_BATCH;?>) + ']<span id="warningModalBody_extra">' + $nbItemsToConvert + '</span> ' + |
|
| 466 | + stepText + '</b> [' + start + ' - ' + (parseInt(start) + <?php echo NUMBER_ITEMS_IN_BATCH; ?>) + ']<span id="warningModalBody_extra">' + $nbItemsToConvert + '</span> ' + |
|
| 467 | 467 | '... <?php echo langHdl('please_wait'); ?><i class="fas fa-spinner fa-pulse ml-3 text-primary"></i>'); |
| 468 | 468 | |
| 469 | 469 | var data = { |
| 470 | 470 | action: step, |
| 471 | 471 | start: start, |
| 472 | - length: <?php echo NUMBER_ITEMS_IN_BATCH;?>, |
|
| 472 | + length: <?php echo NUMBER_ITEMS_IN_BATCH; ?>, |
|
| 473 | 473 | user_id: userId, |
| 474 | 474 | } |
| 475 | 475 | //console.info("Envoi des données :") |
@@ -1236,7 +1236,7 @@ discard block |
||
| 1236 | 1236 | } else { |
| 1237 | 1237 | // Show icon or not |
| 1238 | 1238 | if ($('#user-disabled').prop('checked') === true) { |
| 1239 | - $('#user-login-'+userID).before('<i class="fas fa-user-slash infotip text-danger mr-2" title="<?php echo langHdl('account_is_locked');?>" id="user-disable-'+userID+'"></i>'); |
|
| 1239 | + $('#user-login-'+userID).before('<i class="fas fa-user-slash infotip text-danger mr-2" title="<?php echo langHdl('account_is_locked'); ?>" id="user-disable-'+userID+'"></i>'); |
|
| 1240 | 1240 | } else { |
| 1241 | 1241 | $('#user-disable-'+userID).remove(); |
| 1242 | 1242 | } |
@@ -2081,12 +2081,12 @@ discard block |
||
| 2081 | 2081 | if (step !== 'finished') { |
| 2082 | 2082 | // Inform user |
| 2083 | 2083 | $("#warningModal-progress").html('<b><?php echo langHdl('encryption_keys'); ?> - ' + |
| 2084 | - stepText + '</b> [' + start + ' - ' + (parseInt(start) + <?php echo NUMBER_ITEMS_IN_BATCH;?>) + ']'); |
|
| 2084 | + stepText + '</b> [' + start + ' - ' + (parseInt(start) + <?php echo NUMBER_ITEMS_IN_BATCH; ?>) + ']'); |
|
| 2085 | 2085 | |
| 2086 | 2086 | var data = { |
| 2087 | 2087 | 'action': step, |
| 2088 | 2088 | 'start': start, |
| 2089 | - 'length': <?php echo NUMBER_ITEMS_IN_BATCH;?>, |
|
| 2089 | + 'length': <?php echo NUMBER_ITEMS_IN_BATCH; ?>, |
|
| 2090 | 2090 | userId: userId, |
| 2091 | 2091 | } |
| 2092 | 2092 | // Do query |
@@ -43,15 +43,15 @@ discard block |
||
| 43 | 43 | } |
| 44 | 44 | |
| 45 | 45 | /* do checks */ |
| 46 | -require_once $SETTINGS['cpassman_dir'] . '/sources/checks.php'; |
|
| 46 | +require_once $SETTINGS['cpassman_dir'].'/sources/checks.php'; |
|
| 47 | 47 | if (checkUser($_SESSION['user_id'], $_SESSION['key'], 'emails', $SETTINGS) === false) { |
| 48 | 48 | $_SESSION['error']['code'] = ERR_NOT_ALLOWED; |
| 49 | - include $SETTINGS['cpassman_dir'] . '/error.php'; |
|
| 49 | + include $SETTINGS['cpassman_dir'].'/error.php'; |
|
| 50 | 50 | exit; |
| 51 | 51 | } |
| 52 | 52 | |
| 53 | 53 | // Load template |
| 54 | -require_once $SETTINGS['cpassman_dir'] . '/sources/main.functions.php'; |
|
| 54 | +require_once $SETTINGS['cpassman_dir'].'/sources/main.functions.php'; |
|
| 55 | 55 | |
| 56 | 56 | ?> |
| 57 | 57 | <!-- Content Header (Page header) --> |
@@ -199,7 +199,7 @@ discard block |
||
| 199 | 199 | <div class="card-body"> |
| 200 | 200 | <div id="unsent-emails"> |
| 201 | 201 | <?php |
| 202 | - DB::query('SELECT * FROM ' . prefixTable('emails') . ' WHERE status = %s OR status = %s', 'not_sent', ''); |
|
| 202 | + DB::query('SELECT * FROM '.prefixTable('emails').' WHERE status = %s OR status = %s', 'not_sent', ''); |
|
| 203 | 203 | echo str_replace('#nb_emails#', (string) DB::count(), langHdl('email_send_backlog')); |
| 204 | 204 | ?> |
| 205 | 205 | </div> |