@@ -105,7 +105,7 @@ discard block |
||
| 105 | 105 | $var_dk = ''; // Derived key |
| 106 | 106 | |
| 107 | 107 | for ($block = 1; $block <= $var_kb; ++$block) { // Create key |
| 108 | - $var_ib = $var_h = hash_hmac($var_a, $var_s . pack('N', $block), $var_p, true); // Initial hash for this block |
|
| 108 | + $var_ib = $var_h = hash_hmac($var_a, $var_s.pack('N', $block), $var_p, true); // Initial hash for this block |
|
| 109 | 109 | for ($var_i = 1; $var_i < $var_c; ++$var_i) { // Perform block iterations |
| 110 | 110 | $var_ib ^= ($var_h = hash_hmac($var_a, $var_h, $var_p, true)); // XOR each iterate |
| 111 | 111 | } |
@@ -339,25 +339,25 @@ discard block |
||
| 339 | 339 | */ |
| 340 | 340 | function cryption($message, $ascii_key, $type, $SETTINGS) |
| 341 | 341 | { |
| 342 | - $ascii_key = (empty($ascii_key) === true) ? file_get_contents(SECUREPATH . '/teampass-seckey.txt') : $ascii_key; |
|
| 342 | + $ascii_key = (empty($ascii_key) === true) ? file_get_contents(SECUREPATH.'/teampass-seckey.txt') : $ascii_key; |
|
| 343 | 343 | $err = false; |
| 344 | 344 | |
| 345 | 345 | // load PhpEncryption library |
| 346 | 346 | if (isset($SETTINGS['cpassman_dir']) === false || empty($SETTINGS['cpassman_dir']) === true) { |
| 347 | 347 | $path = '../includes/libraries/Encryption/Encryption/'; |
| 348 | 348 | } else { |
| 349 | - $path = $SETTINGS['cpassman_dir'] . '/includes/libraries/Encryption/Encryption/'; |
|
| 349 | + $path = $SETTINGS['cpassman_dir'].'/includes/libraries/Encryption/Encryption/'; |
|
| 350 | 350 | } |
| 351 | 351 | |
| 352 | - include_once $path . 'Crypto.php'; |
|
| 353 | - include_once $path . 'Encoding.php'; |
|
| 354 | - include_once $path . 'DerivedKeys.php'; |
|
| 355 | - include_once $path . 'Key.php'; |
|
| 356 | - include_once $path . 'KeyOrPassword.php'; |
|
| 357 | - include_once $path . 'File.php'; |
|
| 358 | - include_once $path . 'RuntimeTests.php'; |
|
| 359 | - include_once $path . 'KeyProtectedByPassword.php'; |
|
| 360 | - include_once $path . 'Core.php'; |
|
| 352 | + include_once $path.'Crypto.php'; |
|
| 353 | + include_once $path.'Encoding.php'; |
|
| 354 | + include_once $path.'DerivedKeys.php'; |
|
| 355 | + include_once $path.'Key.php'; |
|
| 356 | + include_once $path.'KeyOrPassword.php'; |
|
| 357 | + include_once $path.'File.php'; |
|
| 358 | + include_once $path.'RuntimeTests.php'; |
|
| 359 | + include_once $path.'KeyProtectedByPassword.php'; |
|
| 360 | + include_once $path.'Core.php'; |
|
| 361 | 361 | |
| 362 | 362 | // convert KEY |
| 363 | 363 | $key = \Defuse\Crypto\Key::loadFromAsciiSafeString($ascii_key); |
@@ -403,15 +403,15 @@ discard block |
||
| 403 | 403 | $path = '../includes/libraries/Encryption/Encryption/'; |
| 404 | 404 | } |
| 405 | 405 | |
| 406 | - include_once $path . 'Crypto.php'; |
|
| 407 | - include_once $path . 'Encoding.php'; |
|
| 408 | - include_once $path . 'DerivedKeys.php'; |
|
| 409 | - include_once $path . 'Key.php'; |
|
| 410 | - include_once $path . 'KeyOrPassword.php'; |
|
| 411 | - include_once $path . 'File.php'; |
|
| 412 | - include_once $path . 'RuntimeTests.php'; |
|
| 413 | - include_once $path . 'KeyProtectedByPassword.php'; |
|
| 414 | - include_once $path . 'Core.php'; |
|
| 406 | + include_once $path.'Crypto.php'; |
|
| 407 | + include_once $path.'Encoding.php'; |
|
| 408 | + include_once $path.'DerivedKeys.php'; |
|
| 409 | + include_once $path.'Key.php'; |
|
| 410 | + include_once $path.'KeyOrPassword.php'; |
|
| 411 | + include_once $path.'File.php'; |
|
| 412 | + include_once $path.'RuntimeTests.php'; |
|
| 413 | + include_once $path.'KeyProtectedByPassword.php'; |
|
| 414 | + include_once $path.'Core.php'; |
|
| 415 | 415 | |
| 416 | 416 | $key = \Defuse\Crypto\Key::createNewRandomKey(); |
| 417 | 417 | $key = $key->saveToAsciiSafeString(); |
@@ -437,15 +437,15 @@ discard block |
||
| 437 | 437 | $path = '../includes/libraries/Encryption/Encryption/'; |
| 438 | 438 | } |
| 439 | 439 | |
| 440 | - include_once $path . 'Crypto.php'; |
|
| 441 | - include_once $path . 'Encoding.php'; |
|
| 442 | - include_once $path . 'DerivedKeys.php'; |
|
| 443 | - include_once $path . 'Key.php'; |
|
| 444 | - include_once $path . 'KeyOrPassword.php'; |
|
| 445 | - include_once $path . 'File.php'; |
|
| 446 | - include_once $path . 'RuntimeTests.php'; |
|
| 447 | - include_once $path . 'KeyProtectedByPassword.php'; |
|
| 448 | - include_once $path . 'Core.php'; |
|
| 440 | + include_once $path.'Crypto.php'; |
|
| 441 | + include_once $path.'Encoding.php'; |
|
| 442 | + include_once $path.'DerivedKeys.php'; |
|
| 443 | + include_once $path.'Key.php'; |
|
| 444 | + include_once $path.'KeyOrPassword.php'; |
|
| 445 | + include_once $path.'File.php'; |
|
| 446 | + include_once $path.'RuntimeTests.php'; |
|
| 447 | + include_once $path.'KeyProtectedByPassword.php'; |
|
| 448 | + include_once $path.'Core.php'; |
|
| 449 | 449 | |
| 450 | 450 | $protected_key = \Defuse\Crypto\KeyProtectedByPassword::createRandomPasswordProtectedKey($psk); |
| 451 | 451 | $protected_key_encoded = $protected_key->saveToAsciiSafeString(); |
@@ -472,15 +472,15 @@ discard block |
||
| 472 | 472 | $path = '../includes/libraries/Encryption/Encryption/'; |
| 473 | 473 | } |
| 474 | 474 | |
| 475 | - include_once $path . 'Crypto.php'; |
|
| 476 | - include_once $path . 'Encoding.php'; |
|
| 477 | - include_once $path . 'DerivedKeys.php'; |
|
| 478 | - include_once $path . 'Key.php'; |
|
| 479 | - include_once $path . 'KeyOrPassword.php'; |
|
| 480 | - include_once $path . 'File.php'; |
|
| 481 | - include_once $path . 'RuntimeTests.php'; |
|
| 482 | - include_once $path . 'KeyProtectedByPassword.php'; |
|
| 483 | - include_once $path . 'Core.php'; |
|
| 475 | + include_once $path.'Crypto.php'; |
|
| 476 | + include_once $path.'Encoding.php'; |
|
| 477 | + include_once $path.'DerivedKeys.php'; |
|
| 478 | + include_once $path.'Key.php'; |
|
| 479 | + include_once $path.'KeyOrPassword.php'; |
|
| 480 | + include_once $path.'File.php'; |
|
| 481 | + include_once $path.'RuntimeTests.php'; |
|
| 482 | + include_once $path.'KeyProtectedByPassword.php'; |
|
| 483 | + include_once $path.'Core.php'; |
|
| 484 | 484 | |
| 485 | 485 | try { |
| 486 | 486 | $protected_key = \Defuse\Crypto\KeyProtectedByPassword::loadFromAsciiSafeString($protected_key_encoded); |
@@ -567,8 +567,8 @@ discard block |
||
| 567 | 567 | */ |
| 568 | 568 | function db_error_handler($params) |
| 569 | 569 | { |
| 570 | - echo 'Error: ' . $params['error'] . "<br>\n"; |
|
| 571 | - echo 'Query: ' . $params['query'] . "<br>\n"; |
|
| 570 | + echo 'Error: '.$params['error']."<br>\n"; |
|
| 571 | + echo 'Query: '.$params['query']."<br>\n"; |
|
| 572 | 572 | throw new Exception('Error - Query', 1); |
| 573 | 573 | } |
| 574 | 574 | |
@@ -590,14 +590,14 @@ discard block |
||
| 590 | 590 | $SETTINGS |
| 591 | 591 | ) { |
| 592 | 592 | //load ClassLoader |
| 593 | - include_once $SETTINGS['cpassman_dir'] . '/sources/SplClassLoader.php'; |
|
| 593 | + include_once $SETTINGS['cpassman_dir'].'/sources/SplClassLoader.php'; |
|
| 594 | 594 | |
| 595 | 595 | // Load superglobal |
| 596 | - include_once $SETTINGS['cpassman_dir'] . '/includes/libraries/protect/SuperGlobal/SuperGlobal.php'; |
|
| 596 | + include_once $SETTINGS['cpassman_dir'].'/includes/libraries/protect/SuperGlobal/SuperGlobal.php'; |
|
| 597 | 597 | $superGlobal = new protect\SuperGlobal\SuperGlobal(); |
| 598 | 598 | |
| 599 | 599 | //Connect to DB |
| 600 | - include_once $SETTINGS['cpassman_dir'] . '/includes/libraries/Database/Meekrodb/db.class.php'; |
|
| 600 | + include_once $SETTINGS['cpassman_dir'].'/includes/libraries/Database/Meekrodb/db.class.php'; |
|
| 601 | 601 | if (defined('DB_PASSWD_CLEAR') === false) { |
| 602 | 602 | define('DB_PASSWD_CLEAR', defuseReturnDecrypted(DB_PASSWD, $SETTINGS)); |
| 603 | 603 | } |
@@ -609,7 +609,7 @@ discard block |
||
| 609 | 609 | DB::$encoding = DB_ENCODING; |
| 610 | 610 | |
| 611 | 611 | //Build tree |
| 612 | - $tree = new SplClassLoader('Tree\NestedTree', $SETTINGS['cpassman_dir'] . '/includes/libraries'); |
|
| 612 | + $tree = new SplClassLoader('Tree\NestedTree', $SETTINGS['cpassman_dir'].'/includes/libraries'); |
|
| 613 | 613 | $tree->register(); |
| 614 | 614 | $tree = new Tree\NestedTree\NestedTree(prefixTable('nested_tree'), 'id', 'parent_id', 'title'); |
| 615 | 615 | |
@@ -651,7 +651,7 @@ discard block |
||
| 651 | 651 | function identAdmin($idFonctions, $SETTINGS, $tree) |
| 652 | 652 | { |
| 653 | 653 | // Load superglobal |
| 654 | - include_once $SETTINGS['cpassman_dir'] . '/includes/libraries/protect/SuperGlobal/SuperGlobal.php'; |
|
| 654 | + include_once $SETTINGS['cpassman_dir'].'/includes/libraries/protect/SuperGlobal/SuperGlobal.php'; |
|
| 655 | 655 | $superGlobal = new protect\SuperGlobal\SuperGlobal(); |
| 656 | 656 | |
| 657 | 657 | // Init |
@@ -673,7 +673,7 @@ discard block |
||
| 673 | 673 | $globalsPersonalVisibleFolders = $superGlobal->get('personal_visible_groups', 'SESSION'); |
| 674 | 674 | |
| 675 | 675 | // Get list of Folders |
| 676 | - $rows = DB::query('SELECT id FROM ' . prefixTable('nested_tree') . ' WHERE personal_folder = %i', 0); |
|
| 676 | + $rows = DB::query('SELECT id FROM '.prefixTable('nested_tree').' WHERE personal_folder = %i', 0); |
|
| 677 | 677 | foreach ($rows as $record) { |
| 678 | 678 | array_push($groupesVisibles, $record['id']); |
| 679 | 679 | } |
@@ -692,7 +692,7 @@ discard block |
||
| 692 | 692 | } |
| 693 | 693 | // Get ID of personal folder |
| 694 | 694 | $persfld = DB::queryfirstrow( |
| 695 | - 'SELECT id FROM ' . prefixTable('nested_tree') . ' WHERE title = %s', |
|
| 695 | + 'SELECT id FROM '.prefixTable('nested_tree').' WHERE title = %s', |
|
| 696 | 696 | $globalsUserId |
| 697 | 697 | ); |
| 698 | 698 | if (empty($persfld['id']) === false) { |
@@ -713,7 +713,7 @@ discard block |
||
| 713 | 713 | // get complete list of ROLES |
| 714 | 714 | $tmp = explode(';', $idFonctions); |
| 715 | 715 | $rows = DB::query( |
| 716 | - 'SELECT * FROM ' . prefixTable('roles_title') . ' |
|
| 716 | + 'SELECT * FROM '.prefixTable('roles_title').' |
|
| 717 | 717 | ORDER BY title ASC' |
| 718 | 718 | ); |
| 719 | 719 | foreach ($rows as $record) { |
@@ -725,9 +725,9 @@ discard block |
||
| 725 | 725 | $superGlobal->put('is_admin', 1, 'SESSION'); |
| 726 | 726 | |
| 727 | 727 | // Check if admin has created Folders and Roles |
| 728 | - DB::query('SELECT * FROM ' . prefixTable('nested_tree') . ''); |
|
| 728 | + DB::query('SELECT * FROM '.prefixTable('nested_tree').''); |
|
| 729 | 729 | $superGlobal->put('nb_folders', DB::count(), 'SESSION'); |
| 730 | - DB::query('SELECT * FROM ' . prefixTable('roles_title')); |
|
| 730 | + DB::query('SELECT * FROM '.prefixTable('roles_title')); |
|
| 731 | 731 | $superGlobal->put('nb_roles', DB::count(), 'SESSION'); |
| 732 | 732 | } |
| 733 | 733 | |
@@ -771,7 +771,7 @@ discard block |
||
| 771 | 771 | $tree |
| 772 | 772 | ) { |
| 773 | 773 | // Load superglobal |
| 774 | - include_once $SETTINGS['cpassman_dir'] . '/includes/libraries/protect/SuperGlobal/SuperGlobal.php'; |
|
| 774 | + include_once $SETTINGS['cpassman_dir'].'/includes/libraries/protect/SuperGlobal/SuperGlobal.php'; |
|
| 775 | 775 | $superGlobal = new protect\SuperGlobal\SuperGlobal(); |
| 776 | 776 | |
| 777 | 777 | // Init |
@@ -804,7 +804,7 @@ discard block |
||
| 804 | 804 | // Get list of folders depending on Roles |
| 805 | 805 | $rows = DB::query( |
| 806 | 806 | 'SELECT * |
| 807 | - FROM ' . prefixTable('roles_values') . ' |
|
| 807 | + FROM ' . prefixTable('roles_values').' |
|
| 808 | 808 | WHERE role_id IN %li AND type IN %ls', |
| 809 | 809 | $userRoles, |
| 810 | 810 | array('W', 'ND', 'NE', 'NDNE', 'R') |
@@ -829,9 +829,9 @@ discard block |
||
| 829 | 829 | // Does this user is allowed to see other items |
| 830 | 830 | $inc = 0; |
| 831 | 831 | $rows = DB::query( |
| 832 | - 'SELECT id, id_tree FROM ' . prefixTable('items') . ' |
|
| 832 | + 'SELECT id, id_tree FROM '.prefixTable('items').' |
|
| 833 | 833 | WHERE restricted_to LIKE %ss AND inactif = %s', |
| 834 | - $globalsUserId . ';', |
|
| 834 | + $globalsUserId.';', |
|
| 835 | 835 | '0' |
| 836 | 836 | ); |
| 837 | 837 | foreach ($rows as $record) { |
@@ -845,8 +845,8 @@ discard block |
||
| 845 | 845 | // Check for the users roles if some specific rights exist on items |
| 846 | 846 | $rows = DB::query( |
| 847 | 847 | 'SELECT i.id_tree, r.item_id |
| 848 | - FROM ' . prefixTable('items') . ' as i |
|
| 849 | - INNER JOIN ' . prefixTable('restriction_to_roles') . ' as r ON (r.item_id=i.id) |
|
| 848 | + FROM ' . prefixTable('items').' as i |
|
| 849 | + INNER JOIN ' . prefixTable('restriction_to_roles').' as r ON (r.item_id=i.id) |
|
| 850 | 850 | WHERE r.role_id IN %li |
| 851 | 851 | ORDER BY i.id_tree ASC', |
| 852 | 852 | $userRoles |
@@ -867,7 +867,7 @@ discard block |
||
| 867 | 867 | ) { |
| 868 | 868 | $persoFld = DB::queryfirstrow( |
| 869 | 869 | 'SELECT id |
| 870 | - FROM ' . prefixTable('nested_tree') . ' |
|
| 870 | + FROM ' . prefixTable('nested_tree').' |
|
| 871 | 871 | WHERE title = %s AND personal_folder = %i', |
| 872 | 872 | $globalsUserId, |
| 873 | 873 | 1 |
@@ -901,7 +901,7 @@ discard block |
||
| 901 | 901 | } |
| 902 | 902 | $persoFlds = DB::query( |
| 903 | 903 | 'SELECT id |
| 904 | - FROM ' . prefixTable('nested_tree') . ' |
|
| 904 | + FROM ' . prefixTable('nested_tree').' |
|
| 905 | 905 | WHERE %l', |
| 906 | 906 | $where |
| 907 | 907 | ); |
@@ -944,17 +944,17 @@ discard block |
||
| 944 | 944 | ); |
| 945 | 945 | |
| 946 | 946 | // Folders and Roles numbers |
| 947 | - DB::queryfirstrow('SELECT id FROM ' . prefixTable('nested_tree') . ''); |
|
| 947 | + DB::queryfirstrow('SELECT id FROM '.prefixTable('nested_tree').''); |
|
| 948 | 948 | $superGlobal->put('nb_folders', DB::count(), 'SESSION'); |
| 949 | - DB::queryfirstrow('SELECT id FROM ' . prefixTable('roles_title')); |
|
| 949 | + DB::queryfirstrow('SELECT id FROM '.prefixTable('roles_title')); |
|
| 950 | 950 | $superGlobal->put('nb_roles', DB::count(), 'SESSION'); |
| 951 | 951 | |
| 952 | 952 | // check if change proposals on User's items |
| 953 | 953 | if (isset($SETTINGS['enable_suggestion']) === true && (int) $SETTINGS['enable_suggestion'] === 1) { |
| 954 | 954 | DB::query( |
| 955 | 955 | 'SELECT * |
| 956 | - FROM ' . prefixTable('items_change') . ' AS c |
|
| 957 | - LEFT JOIN ' . prefixTable('log_items') . ' AS i ON (c.item_id = i.id_item) |
|
| 956 | + FROM ' . prefixTable('items_change').' AS c |
|
| 957 | + LEFT JOIN ' . prefixTable('log_items').' AS i ON (c.item_id = i.id_item) |
|
| 958 | 958 | WHERE i.action = %s AND i.id_user = %i', |
| 959 | 959 | 'at_creation', |
| 960 | 960 | $globalsUserId |
@@ -998,10 +998,10 @@ discard block |
||
| 998 | 998 | */ |
| 999 | 999 | function cacheTableRefresh($SETTINGS) |
| 1000 | 1000 | { |
| 1001 | - include_once $SETTINGS['cpassman_dir'] . '/sources/SplClassLoader.php'; |
|
| 1001 | + include_once $SETTINGS['cpassman_dir'].'/sources/SplClassLoader.php'; |
|
| 1002 | 1002 | |
| 1003 | 1003 | //Connect to DB |
| 1004 | - include_once $SETTINGS['cpassman_dir'] . '/includes/libraries/Database/Meekrodb/db.class.php'; |
|
| 1004 | + include_once $SETTINGS['cpassman_dir'].'/includes/libraries/Database/Meekrodb/db.class.php'; |
|
| 1005 | 1005 | if (defined('DB_PASSWD_CLEAR') === false) { |
| 1006 | 1006 | define('DB_PASSWD_CLEAR', defuseReturnDecrypted(DB_PASSWD, $SETTINGS)); |
| 1007 | 1007 | } |
@@ -1018,13 +1018,13 @@ discard block |
||
| 1018 | 1018 | $tree = new Tree\NestedTree\NestedTree(prefixTable('nested_tree'), 'id', 'parent_id', 'title'); |
| 1019 | 1019 | |
| 1020 | 1020 | // truncate table |
| 1021 | - DB::query('TRUNCATE TABLE ' . prefixTable('cache')); |
|
| 1021 | + DB::query('TRUNCATE TABLE '.prefixTable('cache')); |
|
| 1022 | 1022 | |
| 1023 | 1023 | // reload date |
| 1024 | 1024 | $rows = DB::query( |
| 1025 | 1025 | 'SELECT * |
| 1026 | - FROM ' . prefixTable('items') . ' as i |
|
| 1027 | - INNER JOIN ' . prefixTable('log_items') . ' as l ON (l.id_item = i.id) |
|
| 1026 | + FROM ' . prefixTable('items').' as i |
|
| 1027 | + INNER JOIN ' . prefixTable('log_items').' as l ON (l.id_item = i.id) |
|
| 1028 | 1028 | AND l.action = %s |
| 1029 | 1029 | AND i.inactif = %i', |
| 1030 | 1030 | 'at_creation', |
@@ -1036,18 +1036,18 @@ discard block |
||
| 1036 | 1036 | $tags = ''; |
| 1037 | 1037 | $itemTags = DB::query( |
| 1038 | 1038 | 'SELECT tag |
| 1039 | - FROM ' . prefixTable('tags') . ' |
|
| 1039 | + FROM ' . prefixTable('tags').' |
|
| 1040 | 1040 | WHERE item_id = %i AND tag != ""', |
| 1041 | 1041 | $record['id'] |
| 1042 | 1042 | ); |
| 1043 | 1043 | foreach ($itemTags as $itemTag) { |
| 1044 | - $tags .= $itemTag['tag'] . ' '; |
|
| 1044 | + $tags .= $itemTag['tag'].' '; |
|
| 1045 | 1045 | } |
| 1046 | 1046 | |
| 1047 | 1047 | // Get renewal period |
| 1048 | 1048 | $resNT = DB::queryfirstrow( |
| 1049 | 1049 | 'SELECT renewal_period |
| 1050 | - FROM ' . prefixTable('nested_tree') . ' |
|
| 1050 | + FROM ' . prefixTable('nested_tree').' |
|
| 1051 | 1051 | WHERE id = %i', |
| 1052 | 1052 | $record['id_tree'] |
| 1053 | 1053 | ); |
@@ -1061,7 +1061,7 @@ discard block |
||
| 1061 | 1061 | // Is this a User id? |
| 1062 | 1062 | $user = DB::queryfirstrow( |
| 1063 | 1063 | 'SELECT id, login |
| 1064 | - FROM ' . prefixTable('users') . ' |
|
| 1064 | + FROM ' . prefixTable('users').' |
|
| 1065 | 1065 | WHERE id = %i', |
| 1066 | 1066 | $elem->title |
| 1067 | 1067 | ); |
@@ -1103,14 +1103,14 @@ discard block |
||
| 1103 | 1103 | */ |
| 1104 | 1104 | function cacheTableUpdate($SETTINGS, $ident = null) |
| 1105 | 1105 | { |
| 1106 | - include_once $SETTINGS['cpassman_dir'] . '/sources/SplClassLoader.php'; |
|
| 1106 | + include_once $SETTINGS['cpassman_dir'].'/sources/SplClassLoader.php'; |
|
| 1107 | 1107 | |
| 1108 | 1108 | // Load superglobal |
| 1109 | - include_once $SETTINGS['cpassman_dir'] . '/includes/libraries/protect/SuperGlobal/SuperGlobal.php'; |
|
| 1109 | + include_once $SETTINGS['cpassman_dir'].'/includes/libraries/protect/SuperGlobal/SuperGlobal.php'; |
|
| 1110 | 1110 | $superGlobal = new protect\SuperGlobal\SuperGlobal(); |
| 1111 | 1111 | |
| 1112 | 1112 | //Connect to DB |
| 1113 | - include_once $SETTINGS['cpassman_dir'] . '/includes/libraries/Database/Meekrodb/db.class.php'; |
|
| 1113 | + include_once $SETTINGS['cpassman_dir'].'/includes/libraries/Database/Meekrodb/db.class.php'; |
|
| 1114 | 1114 | if (defined('DB_PASSWD_CLEAR') === false) { |
| 1115 | 1115 | define('DB_PASSWD_CLEAR', defuseReturnDecrypted(DB_PASSWD, $SETTINGS)); |
| 1116 | 1116 | } |
@@ -1129,7 +1129,7 @@ discard block |
||
| 1129 | 1129 | // get new value from db |
| 1130 | 1130 | $data = DB::queryfirstrow( |
| 1131 | 1131 | 'SELECT label, description, id_tree, perso, restricted_to, login, url |
| 1132 | - FROM ' . prefixTable('items') . ' |
|
| 1132 | + FROM ' . prefixTable('items').' |
|
| 1133 | 1133 | WHERE id=%i', |
| 1134 | 1134 | $ident |
| 1135 | 1135 | ); |
@@ -1137,12 +1137,12 @@ discard block |
||
| 1137 | 1137 | $tags = ''; |
| 1138 | 1138 | $itemTags = DB::query( |
| 1139 | 1139 | 'SELECT tag |
| 1140 | - FROM ' . prefixTable('tags') . ' |
|
| 1140 | + FROM ' . prefixTable('tags').' |
|
| 1141 | 1141 | WHERE item_id = %i AND tag != ""', |
| 1142 | 1142 | $ident |
| 1143 | 1143 | ); |
| 1144 | 1144 | foreach ($itemTags as $itemTag) { |
| 1145 | - $tags .= $itemTag['tag'] . ' '; |
|
| 1145 | + $tags .= $itemTag['tag'].' '; |
|
| 1146 | 1146 | } |
| 1147 | 1147 | // form id_tree to full foldername |
| 1148 | 1148 | $folder = array(); |
@@ -1153,7 +1153,7 @@ discard block |
||
| 1153 | 1153 | // Is this a User id? |
| 1154 | 1154 | $user = DB::queryfirstrow( |
| 1155 | 1155 | 'SELECT id, login |
| 1156 | - FROM ' . prefixTable('users') . ' |
|
| 1156 | + FROM ' . prefixTable('users').' |
|
| 1157 | 1157 | WHERE id = %i', |
| 1158 | 1158 | $elem->title |
| 1159 | 1159 | ); |
@@ -1192,17 +1192,17 @@ discard block |
||
| 1192 | 1192 | */ |
| 1193 | 1193 | function cacheTableAdd($SETTINGS, $ident = null) |
| 1194 | 1194 | { |
| 1195 | - include_once $SETTINGS['cpassman_dir'] . '/sources/SplClassLoader.php'; |
|
| 1195 | + include_once $SETTINGS['cpassman_dir'].'/sources/SplClassLoader.php'; |
|
| 1196 | 1196 | |
| 1197 | 1197 | // Load superglobal |
| 1198 | - include_once $SETTINGS['cpassman_dir'] . '/includes/libraries/protect/SuperGlobal/SuperGlobal.php'; |
|
| 1198 | + include_once $SETTINGS['cpassman_dir'].'/includes/libraries/protect/SuperGlobal/SuperGlobal.php'; |
|
| 1199 | 1199 | $superGlobal = new protect\SuperGlobal\SuperGlobal(); |
| 1200 | 1200 | |
| 1201 | 1201 | // Get superglobals |
| 1202 | 1202 | $globalsUserId = $superGlobal->get('user_id', 'SESSION'); |
| 1203 | 1203 | |
| 1204 | 1204 | //Connect to DB |
| 1205 | - include_once $SETTINGS['cpassman_dir'] . '/includes/libraries/Database/Meekrodb/db.class.php'; |
|
| 1205 | + include_once $SETTINGS['cpassman_dir'].'/includes/libraries/Database/Meekrodb/db.class.php'; |
|
| 1206 | 1206 | if (defined('DB_PASSWD_CLEAR') === false) { |
| 1207 | 1207 | define('DB_PASSWD_CLEAR', defuseReturnDecrypted(DB_PASSWD, $SETTINGS)); |
| 1208 | 1208 | } |
@@ -1221,8 +1221,8 @@ discard block |
||
| 1221 | 1221 | // get new value from db |
| 1222 | 1222 | $data = DB::queryFirstRow( |
| 1223 | 1223 | 'SELECT i.label, i.description, i.id_tree as id_tree, i.perso, i.restricted_to, i.id, i.login, i.url, l.date |
| 1224 | - FROM ' . prefixTable('items') . ' as i |
|
| 1225 | - INNER JOIN ' . prefixTable('log_items') . ' as l ON (l.id_item = i.id) |
|
| 1224 | + FROM ' . prefixTable('items').' as i |
|
| 1225 | + INNER JOIN ' . prefixTable('log_items').' as l ON (l.id_item = i.id) |
|
| 1226 | 1226 | WHERE i.id = %i |
| 1227 | 1227 | AND l.action = %s', |
| 1228 | 1228 | $ident, |
@@ -1232,12 +1232,12 @@ discard block |
||
| 1232 | 1232 | $tags = ''; |
| 1233 | 1233 | $itemTags = DB::query( |
| 1234 | 1234 | 'SELECT tag |
| 1235 | - FROM ' . prefixTable('tags') . ' |
|
| 1235 | + FROM ' . prefixTable('tags').' |
|
| 1236 | 1236 | WHERE item_id = %i AND tag != ""', |
| 1237 | 1237 | $ident |
| 1238 | 1238 | ); |
| 1239 | 1239 | foreach ($itemTags as $itemTag) { |
| 1240 | - $tags .= $itemTag['tag'] . ' '; |
|
| 1240 | + $tags .= $itemTag['tag'].' '; |
|
| 1241 | 1241 | } |
| 1242 | 1242 | // form id_tree to full foldername |
| 1243 | 1243 | $folder = array(); |
@@ -1248,7 +1248,7 @@ discard block |
||
| 1248 | 1248 | // Is this a User id? |
| 1249 | 1249 | $user = DB::queryfirstrow( |
| 1250 | 1250 | 'SELECT id, login |
| 1251 | - FROM ' . prefixTable('users') . ' |
|
| 1251 | + FROM ' . prefixTable('users').' |
|
| 1252 | 1252 | WHERE id = %i', |
| 1253 | 1253 | $elem->title |
| 1254 | 1254 | ); |
@@ -1289,48 +1289,48 @@ discard block |
||
| 1289 | 1289 | function getStatisticsData($SETTINGS) |
| 1290 | 1290 | { |
| 1291 | 1291 | DB::query( |
| 1292 | - 'SELECT id FROM ' . prefixTable('nested_tree') . ' WHERE personal_folder = %i', |
|
| 1292 | + 'SELECT id FROM '.prefixTable('nested_tree').' WHERE personal_folder = %i', |
|
| 1293 | 1293 | 0 |
| 1294 | 1294 | ); |
| 1295 | 1295 | $counter_folders = DB::count(); |
| 1296 | 1296 | |
| 1297 | 1297 | DB::query( |
| 1298 | - 'SELECT id FROM ' . prefixTable('nested_tree') . ' WHERE personal_folder = %i', |
|
| 1298 | + 'SELECT id FROM '.prefixTable('nested_tree').' WHERE personal_folder = %i', |
|
| 1299 | 1299 | 1 |
| 1300 | 1300 | ); |
| 1301 | 1301 | $counter_folders_perso = DB::count(); |
| 1302 | 1302 | |
| 1303 | 1303 | DB::query( |
| 1304 | - 'SELECT id FROM ' . prefixTable('items') . ' WHERE perso = %i', |
|
| 1304 | + 'SELECT id FROM '.prefixTable('items').' WHERE perso = %i', |
|
| 1305 | 1305 | 0 |
| 1306 | 1306 | ); |
| 1307 | 1307 | $counter_items = DB::count(); |
| 1308 | 1308 | |
| 1309 | 1309 | DB::query( |
| 1310 | - 'SELECT id FROM ' . prefixTable('items') . ' WHERE perso = %i', |
|
| 1310 | + 'SELECT id FROM '.prefixTable('items').' WHERE perso = %i', |
|
| 1311 | 1311 | 1 |
| 1312 | 1312 | ); |
| 1313 | 1313 | $counter_items_perso = DB::count(); |
| 1314 | 1314 | |
| 1315 | 1315 | DB::query( |
| 1316 | - 'SELECT id FROM ' . prefixTable('users') . '' |
|
| 1316 | + 'SELECT id FROM '.prefixTable('users').'' |
|
| 1317 | 1317 | ); |
| 1318 | 1318 | $counter_users = DB::count(); |
| 1319 | 1319 | |
| 1320 | 1320 | DB::query( |
| 1321 | - 'SELECT id FROM ' . prefixTable('users') . ' WHERE admin = %i', |
|
| 1321 | + 'SELECT id FROM '.prefixTable('users').' WHERE admin = %i', |
|
| 1322 | 1322 | 1 |
| 1323 | 1323 | ); |
| 1324 | 1324 | $admins = DB::count(); |
| 1325 | 1325 | |
| 1326 | 1326 | DB::query( |
| 1327 | - 'SELECT id FROM ' . prefixTable('users') . ' WHERE gestionnaire = %i', |
|
| 1327 | + 'SELECT id FROM '.prefixTable('users').' WHERE gestionnaire = %i', |
|
| 1328 | 1328 | 1 |
| 1329 | 1329 | ); |
| 1330 | 1330 | $managers = DB::count(); |
| 1331 | 1331 | |
| 1332 | 1332 | DB::query( |
| 1333 | - 'SELECT id FROM ' . prefixTable('users') . ' WHERE read_only = %i', |
|
| 1333 | + 'SELECT id FROM '.prefixTable('users').' WHERE read_only = %i', |
|
| 1334 | 1334 | 1 |
| 1335 | 1335 | ); |
| 1336 | 1336 | $readOnly = DB::count(); |
@@ -1338,11 +1338,11 @@ discard block |
||
| 1338 | 1338 | // list the languages |
| 1339 | 1339 | $usedLang = []; |
| 1340 | 1340 | $tp_languages = DB::query( |
| 1341 | - 'SELECT name FROM ' . prefixTable('languages') |
|
| 1341 | + 'SELECT name FROM '.prefixTable('languages') |
|
| 1342 | 1342 | ); |
| 1343 | 1343 | foreach ($tp_languages as $tp_language) { |
| 1344 | 1344 | DB::query( |
| 1345 | - 'SELECT * FROM ' . prefixTable('users') . ' WHERE user_language = %s', |
|
| 1345 | + 'SELECT * FROM '.prefixTable('users').' WHERE user_language = %s', |
|
| 1346 | 1346 | $tp_language['name'] |
| 1347 | 1347 | ); |
| 1348 | 1348 | $usedLang[$tp_language['name']] = round((DB::count() * 100 / $counter_users), 0); |
@@ -1351,7 +1351,7 @@ discard block |
||
| 1351 | 1351 | // get list of ips |
| 1352 | 1352 | $usedIp = []; |
| 1353 | 1353 | $tp_ips = DB::query( |
| 1354 | - 'SELECT user_ip FROM ' . prefixTable('users') |
|
| 1354 | + 'SELECT user_ip FROM '.prefixTable('users') |
|
| 1355 | 1355 | ); |
| 1356 | 1356 | foreach ($tp_ips as $ip) { |
| 1357 | 1357 | if (array_key_exists($ip['user_ip'], $usedIp)) { |
@@ -1413,23 +1413,23 @@ discard block |
||
| 1413 | 1413 | ) { |
| 1414 | 1414 | // CAse where email not defined |
| 1415 | 1415 | if ($email === 'none') { |
| 1416 | - return '"error":"" , "message":"' . langHdl('forgot_my_pw_email_sent') . '"'; |
|
| 1416 | + return '"error":"" , "message":"'.langHdl('forgot_my_pw_email_sent').'"'; |
|
| 1417 | 1417 | } |
| 1418 | 1418 | |
| 1419 | 1419 | // Load settings |
| 1420 | - include_once $SETTINGS['cpassman_dir'] . '/includes/config/settings.php'; |
|
| 1420 | + include_once $SETTINGS['cpassman_dir'].'/includes/config/settings.php'; |
|
| 1421 | 1421 | |
| 1422 | 1422 | // Load superglobal |
| 1423 | - include_once $SETTINGS['cpassman_dir'] . '/includes/libraries/protect/SuperGlobal/SuperGlobal.php'; |
|
| 1423 | + include_once $SETTINGS['cpassman_dir'].'/includes/libraries/protect/SuperGlobal/SuperGlobal.php'; |
|
| 1424 | 1424 | $superGlobal = new protect\SuperGlobal\SuperGlobal(); |
| 1425 | 1425 | |
| 1426 | 1426 | // Get user language |
| 1427 | 1427 | $session_user_language = $superGlobal->get('user_language', 'SESSION'); |
| 1428 | 1428 | $user_language = isset($session_user_language) ? $session_user_language : 'english'; |
| 1429 | - include_once $SETTINGS['cpassman_dir'] . '/includes/language/' . $user_language . '.php'; |
|
| 1429 | + include_once $SETTINGS['cpassman_dir'].'/includes/language/'.$user_language.'.php'; |
|
| 1430 | 1430 | |
| 1431 | 1431 | // Load library |
| 1432 | - include_once $SETTINGS['cpassman_dir'] . '/sources/SplClassLoader.php'; |
|
| 1432 | + include_once $SETTINGS['cpassman_dir'].'/sources/SplClassLoader.php'; |
|
| 1433 | 1433 | |
| 1434 | 1434 | // load PHPMailer |
| 1435 | 1435 | $mail = new SplClassLoader('Email\PHPMailer', '../includes/libraries'); |
@@ -1437,7 +1437,7 @@ discard block |
||
| 1437 | 1437 | $mail = new Email\PHPMailer\PHPMailer(true); |
| 1438 | 1438 | try { |
| 1439 | 1439 | // send to user |
| 1440 | - $mail->setLanguage('en', $SETTINGS['cpassman_dir'] . '/includes/libraries/Email/PHPMailer/language/'); |
|
| 1440 | + $mail->setLanguage('en', $SETTINGS['cpassman_dir'].'/includes/libraries/Email/PHPMailer/language/'); |
|
| 1441 | 1441 | $mail->SMTPDebug = 0; //value 1 can be used to debug - 4 for debuging connections |
| 1442 | 1442 | $mail->Port = $SETTINGS['email_port']; //COULD BE USED |
| 1443 | 1443 | $mail->CharSet = 'utf-8'; |
@@ -1533,7 +1533,7 @@ discard block |
||
| 1533 | 1533 | <table width="600" cellpadding="0" cellspacing="0" border="0" class="container" bgcolor="#ffffff" style="border-spacing: 0; border-bottom: 1px solid #e0e0e0; box-shadow: 0 0 3px #ddd; color: #434343; font-family: Helvetica, Verdana, sans-serif;"> |
| 1534 | 1534 | <tr><td class="container-padding" bgcolor="#ffffff" style="border-collapse: collapse; border-left: 1px solid #e0e0e0; background-color: #ffffff; padding-left: 30px; padding-right: 30px;"> |
| 1535 | 1535 | <br><div style="float:right;">' . |
| 1536 | - $textMail . |
|
| 1536 | + $textMail. |
|
| 1537 | 1537 | '<br><br></td></tr></table> |
| 1538 | 1538 | </td></tr></table> |
| 1539 | 1539 | <br></body></html>'; |
@@ -1546,7 +1546,7 @@ discard block |
||
| 1546 | 1546 | */ |
| 1547 | 1547 | function generateKey() |
| 1548 | 1548 | { |
| 1549 | - return substr(md5(rand() . rand()), 0, 15); |
|
| 1549 | + return substr(md5(rand().rand()), 0, 15); |
|
| 1550 | 1550 | } |
| 1551 | 1551 | |
| 1552 | 1552 | /** |
@@ -1616,7 +1616,7 @@ discard block |
||
| 1616 | 1616 | { |
| 1617 | 1617 | array_walk_recursive( |
| 1618 | 1618 | $array, |
| 1619 | - function (&$item) { |
|
| 1619 | + function(&$item) { |
|
| 1620 | 1620 | if (mb_detect_encoding($item, 'utf-8', true) === false) { |
| 1621 | 1621 | $item = utf8_encode($item); |
| 1622 | 1622 | } |
@@ -1648,7 +1648,7 @@ discard block |
||
| 1648 | 1648 | } |
| 1649 | 1649 | |
| 1650 | 1650 | // Load superglobal |
| 1651 | - include_once $SETTINGS['cpassman_dir'] . '/includes/libraries/protect/SuperGlobal/SuperGlobal.php'; |
|
| 1651 | + include_once $SETTINGS['cpassman_dir'].'/includes/libraries/protect/SuperGlobal/SuperGlobal.php'; |
|
| 1652 | 1652 | $superGlobal = new protect\SuperGlobal\SuperGlobal(); |
| 1653 | 1653 | |
| 1654 | 1654 | // Get superglobals |
@@ -1660,9 +1660,9 @@ discard block |
||
| 1660 | 1660 | } |
| 1661 | 1661 | |
| 1662 | 1662 | //load ClassLoader |
| 1663 | - include_once $SETTINGS['cpassman_dir'] . '/sources/SplClassLoader.php'; |
|
| 1663 | + include_once $SETTINGS['cpassman_dir'].'/sources/SplClassLoader.php'; |
|
| 1664 | 1664 | //Load AES |
| 1665 | - $aes = new SplClassLoader('Encryption\Crypt', $SETTINGS['cpassman_dir'] . '/includes/libraries'); |
|
| 1665 | + $aes = new SplClassLoader('Encryption\Crypt', $SETTINGS['cpassman_dir'].'/includes/libraries'); |
|
| 1666 | 1666 | $aes->register(); |
| 1667 | 1667 | |
| 1668 | 1668 | if ($type === 'encode' && is_array($data) === true) { |
@@ -1717,7 +1717,7 @@ discard block |
||
| 1717 | 1717 | function makeThumbnail($src, $dest, $desired_width) |
| 1718 | 1718 | { |
| 1719 | 1719 | /* read the source image */ |
| 1720 | - if(is_file($src) === true && mime_content_type($src) === 'image/png'){ |
|
| 1720 | + if (is_file($src) === true && mime_content_type($src) === 'image/png') { |
|
| 1721 | 1721 | $source_image = imagecreatefrompng($src); |
| 1722 | 1722 | } else { |
| 1723 | 1723 | return "Error: Not a valid PNG file! It's type is ".mime_content_type($src); |
@@ -1749,7 +1749,7 @@ discard block |
||
| 1749 | 1749 | */ |
| 1750 | 1750 | function prefixTable($table) |
| 1751 | 1751 | { |
| 1752 | - $safeTable = htmlspecialchars(DB_PREFIX . $table); |
|
| 1752 | + $safeTable = htmlspecialchars(DB_PREFIX.$table); |
|
| 1753 | 1753 | if (!empty($safeTable)) { |
| 1754 | 1754 | // sanitize string |
| 1755 | 1755 | return $safeTable; |
@@ -1781,14 +1781,14 @@ discard block |
||
| 1781 | 1781 | $lowercase = false, |
| 1782 | 1782 | $SETTINGS |
| 1783 | 1783 | ) { |
| 1784 | - include_once $SETTINGS['cpassman_dir'] . '/sources/SplClassLoader.php'; |
|
| 1785 | - $generator = new SplClassLoader('PasswordGenerator\Generator', $SETTINGS['cpassman_dir'] . '/includes/libraries'); |
|
| 1784 | + include_once $SETTINGS['cpassman_dir'].'/sources/SplClassLoader.php'; |
|
| 1785 | + $generator = new SplClassLoader('PasswordGenerator\Generator', $SETTINGS['cpassman_dir'].'/includes/libraries'); |
|
| 1786 | 1786 | $generator->register(); |
| 1787 | 1787 | $generator = new PasswordGenerator\Generator\ComputerPasswordGenerator(); |
| 1788 | 1788 | |
| 1789 | 1789 | // Is PHP7 being used? |
| 1790 | 1790 | if (version_compare(PHP_VERSION, '7.0.0', '>=')) { |
| 1791 | - $php7generator = new SplClassLoader('PasswordGenerator\RandomGenerator', $SETTINGS['cpassman_dir'] . '/includes/libraries'); |
|
| 1791 | + $php7generator = new SplClassLoader('PasswordGenerator\RandomGenerator', $SETTINGS['cpassman_dir'].'/includes/libraries'); |
|
| 1792 | 1792 | $php7generator->register(); |
| 1793 | 1793 | $generator->setRandomGenerator(new PasswordGenerator\RandomGenerator\Php7RandomGenerator()); |
| 1794 | 1794 | } |
@@ -1819,7 +1819,7 @@ discard block |
||
| 1819 | 1819 | function send_syslog($message, $host, $port, $component = 'teampass') |
| 1820 | 1820 | { |
| 1821 | 1821 | $sock = socket_create(AF_INET, SOCK_DGRAM, SOL_UDP); |
| 1822 | - $syslog_message = '<123>' . date('M d H:i:s ') . $component . ': ' . $message; |
|
| 1822 | + $syslog_message = '<123>'.date('M d H:i:s ').$component.': '.$message; |
|
| 1823 | 1823 | socket_sendto($sock, $syslog_message, strlen($syslog_message), 0, $host, $port); |
| 1824 | 1824 | socket_close($sock); |
| 1825 | 1825 | } |
@@ -1843,7 +1843,7 @@ discard block |
||
| 1843 | 1843 | } |
| 1844 | 1844 | |
| 1845 | 1845 | // include librairies & connect to DB |
| 1846 | - include_once $SETTINGS['cpassman_dir'] . '/includes/libraries/Database/Meekrodb/db.class.php'; |
|
| 1846 | + include_once $SETTINGS['cpassman_dir'].'/includes/libraries/Database/Meekrodb/db.class.php'; |
|
| 1847 | 1847 | if (defined('DB_PASSWD_CLEAR') === false) { |
| 1848 | 1848 | define('DB_PASSWD_CLEAR', defuseReturnDecrypted(DB_PASSWD, $SETTINGS)); |
| 1849 | 1849 | } |
@@ -1869,14 +1869,14 @@ discard block |
||
| 1869 | 1869 | if (isset($SETTINGS['syslog_enable']) === true && (int) $SETTINGS['syslog_enable'] === 1) { |
| 1870 | 1870 | if ($type === 'user_mngt') { |
| 1871 | 1871 | send_syslog( |
| 1872 | - 'action=' . str_replace('at_', '', $label) . ' attribute=user user=' . $who . ' userid="' . $login . '" change="' . $field_1 . '" ', |
|
| 1872 | + 'action='.str_replace('at_', '', $label).' attribute=user user='.$who.' userid="'.$login.'" change="'.$field_1.'" ', |
|
| 1873 | 1873 | $SETTINGS['syslog_host'], |
| 1874 | 1874 | $SETTINGS['syslog_port'], |
| 1875 | 1875 | 'teampass' |
| 1876 | 1876 | ); |
| 1877 | 1877 | } else { |
| 1878 | 1878 | send_syslog( |
| 1879 | - 'action=' . $type . ' attribute=' . $label . ' user=' . $who . ' userid="' . $login . '" ', |
|
| 1879 | + 'action='.$type.' attribute='.$label.' user='.$who.' userid="'.$login.'" ', |
|
| 1880 | 1880 | $SETTINGS['syslog_host'], |
| 1881 | 1881 | $SETTINGS['syslog_port'], |
| 1882 | 1882 | 'teampass' |
@@ -1908,7 +1908,7 @@ discard block |
||
| 1908 | 1908 | $encryption_type = null |
| 1909 | 1909 | ) { |
| 1910 | 1910 | // include librairies & connect to DB |
| 1911 | - include_once $SETTINGS['cpassman_dir'] . '/includes/libraries/Database/Meekrodb/db.class.php'; |
|
| 1911 | + include_once $SETTINGS['cpassman_dir'].'/includes/libraries/Database/Meekrodb/db.class.php'; |
|
| 1912 | 1912 | if (defined('DB_PASSWD_CLEAR') === false) { |
| 1913 | 1913 | define('DB_PASSWD_CLEAR', defuseReturnDecrypted(DB_PASSWD, $SETTINGS)); |
| 1914 | 1914 | } |
@@ -1954,7 +1954,7 @@ discard block |
||
| 1954 | 1954 | if (empty($item_label) === true) { |
| 1955 | 1955 | $dataItem = DB::queryfirstrow( |
| 1956 | 1956 | 'SELECT id, id_tree, label |
| 1957 | - FROM ' . prefixTable('items') . ' |
|
| 1957 | + FROM ' . prefixTable('items').' |
|
| 1958 | 1958 | WHERE id = %i', |
| 1959 | 1959 | $item_id |
| 1960 | 1960 | ); |
@@ -1963,7 +1963,7 @@ discard block |
||
| 1963 | 1963 | } |
| 1964 | 1964 | |
| 1965 | 1965 | send_syslog( |
| 1966 | - 'action=' . str_replace('at_', '', $action) . ' attribute=' . str_replace('at_', '', $attribute[0]) . ' itemno=' . $item_id . ' user=' . addslashes($login) . ' itemname="' . addslashes($item_label) . '"', |
|
| 1966 | + 'action='.str_replace('at_', '', $action).' attribute='.str_replace('at_', '', $attribute[0]).' itemno='.$item_id.' user='.addslashes($login).' itemname="'.addslashes($item_label).'"', |
|
| 1967 | 1967 | $SETTINGS['syslog_host'], |
| 1968 | 1968 | $SETTINGS['syslog_port'], |
| 1969 | 1969 | 'teampass' |
@@ -1989,7 +1989,7 @@ discard block |
||
| 1989 | 1989 | && $action === 'at_shown' |
| 1990 | 1990 | ) { |
| 1991 | 1991 | // Load superglobal |
| 1992 | - include_once $SETTINGS['cpassman_dir'] . '/includes/libraries/protect/SuperGlobal/SuperGlobal.php'; |
|
| 1992 | + include_once $SETTINGS['cpassman_dir'].'/includes/libraries/protect/SuperGlobal/SuperGlobal.php'; |
|
| 1993 | 1993 | $superGlobal = new protect\SuperGlobal\SuperGlobal(); |
| 1994 | 1994 | |
| 1995 | 1995 | // Get superglobals |
@@ -2000,7 +2000,7 @@ discard block |
||
| 2000 | 2000 | // Get info about item |
| 2001 | 2001 | $dataItem = DB::queryfirstrow( |
| 2002 | 2002 | 'SELECT id, id_tree, label |
| 2003 | - FROM ' . prefixTable('items') . ' |
|
| 2003 | + FROM ' . prefixTable('items').' |
|
| 2004 | 2004 | WHERE id = %i', |
| 2005 | 2005 | $item_id |
| 2006 | 2006 | ); |
@@ -2015,9 +2015,9 @@ discard block |
||
| 2015 | 2015 | 'body' => str_replace( |
| 2016 | 2016 | array('#tp_user#', '#tp_item#', '#tp_link#'), |
| 2017 | 2017 | array( |
| 2018 | - addslashes($globalsName . ' ' . $globalsLastname), |
|
| 2018 | + addslashes($globalsName.' '.$globalsLastname), |
|
| 2019 | 2019 | addslashes($item_label), |
| 2020 | - $SETTINGS['cpassman_url'] . '/index.php?page=items&group=' . $dataItem['id_tree'] . '&id=' . $item_id, |
|
| 2020 | + $SETTINGS['cpassman_url'].'/index.php?page=items&group='.$dataItem['id_tree'].'&id='.$item_id, |
|
| 2021 | 2021 | ), |
| 2022 | 2022 | langHdl('email_on_open_notification_mail') |
| 2023 | 2023 | ), |
@@ -2039,7 +2039,7 @@ discard block |
||
| 2039 | 2039 | function notifyChangesToSubscribers($item_id, $label, $changes, $SETTINGS) |
| 2040 | 2040 | { |
| 2041 | 2041 | // Load superglobal |
| 2042 | - include_once $SETTINGS['cpassman_dir'] . '/includes/libraries/protect/SuperGlobal/SuperGlobal.php'; |
|
| 2042 | + include_once $SETTINGS['cpassman_dir'].'/includes/libraries/protect/SuperGlobal/SuperGlobal.php'; |
|
| 2043 | 2043 | $superGlobal = new protect\SuperGlobal\SuperGlobal(); |
| 2044 | 2044 | |
| 2045 | 2045 | // Get superglobals |
@@ -2051,8 +2051,8 @@ discard block |
||
| 2051 | 2051 | $notification = DB::queryOneColumn( |
| 2052 | 2052 | 'email', |
| 2053 | 2053 | 'SELECT * |
| 2054 | - FROM ' . prefixTable('notification') . ' AS n |
|
| 2055 | - INNER JOIN ' . prefixTable('users') . ' AS u ON (n.user_id = u.id) |
|
| 2054 | + FROM ' . prefixTable('notification').' AS n |
|
| 2055 | + INNER JOIN ' . prefixTable('users').' AS u ON (n.user_id = u.id) |
|
| 2056 | 2056 | WHERE n.item_id = %i AND n.user_id != %i', |
| 2057 | 2057 | $item_id, |
| 2058 | 2058 | $globalsUserId |
@@ -2065,7 +2065,7 @@ discard block |
||
| 2065 | 2065 | // Get list of changes |
| 2066 | 2066 | $htmlChanges = '<ul>'; |
| 2067 | 2067 | foreach ($changes as $change) { |
| 2068 | - $htmlChanges .= '<li>' . $change . '</li>'; |
|
| 2068 | + $htmlChanges .= '<li>'.$change.'</li>'; |
|
| 2069 | 2069 | } |
| 2070 | 2070 | $htmlChanges .= '</ul>'; |
| 2071 | 2071 | |
@@ -2099,7 +2099,7 @@ discard block |
||
| 2099 | 2099 | function geItemReadablePath($id_tree, $label, $SETTINGS) |
| 2100 | 2100 | { |
| 2101 | 2101 | // Class loader |
| 2102 | - include_once $SETTINGS['cpassman_dir'] . '/sources/SplClassLoader.php'; |
|
| 2102 | + include_once $SETTINGS['cpassman_dir'].'/sources/SplClassLoader.php'; |
|
| 2103 | 2103 | |
| 2104 | 2104 | //Load Tree |
| 2105 | 2105 | $tree = new SplClassLoader('Tree\NestedTree', '../includes/libraries'); |
@@ -2110,15 +2110,15 @@ discard block |
||
| 2110 | 2110 | $path = ''; |
| 2111 | 2111 | foreach ($arbo as $elem) { |
| 2112 | 2112 | if (empty($path) === true) { |
| 2113 | - $path = htmlspecialchars(stripslashes(htmlspecialchars_decode($elem->title, ENT_QUOTES)), ENT_QUOTES) . ' '; |
|
| 2113 | + $path = htmlspecialchars(stripslashes(htmlspecialchars_decode($elem->title, ENT_QUOTES)), ENT_QUOTES).' '; |
|
| 2114 | 2114 | } else { |
| 2115 | - $path .= '→ ' . htmlspecialchars(stripslashes(htmlspecialchars_decode($elem->title, ENT_QUOTES)), ENT_QUOTES); |
|
| 2115 | + $path .= '→ '.htmlspecialchars(stripslashes(htmlspecialchars_decode($elem->title, ENT_QUOTES)), ENT_QUOTES); |
|
| 2116 | 2116 | } |
| 2117 | 2117 | } |
| 2118 | 2118 | |
| 2119 | 2119 | // Build text to show user |
| 2120 | 2120 | if (empty($label) === false) { |
| 2121 | - return empty($path) === true ? addslashes($label) : addslashes($label) . ' (' . $path . ')'; |
|
| 2121 | + return empty($path) === true ? addslashes($label) : addslashes($label).' ('.$path.')'; |
|
| 2122 | 2122 | } else { |
| 2123 | 2123 | return empty($path) === true ? '' : $path; |
| 2124 | 2124 | } |
@@ -2177,10 +2177,10 @@ discard block |
||
| 2177 | 2177 | */ |
| 2178 | 2178 | function handleConfigFile($action, $SETTINGS, $field = null, $value = null) |
| 2179 | 2179 | { |
| 2180 | - $tp_config_file = $SETTINGS['cpassman_dir'] . '/includes/config/tp.config.php'; |
|
| 2180 | + $tp_config_file = $SETTINGS['cpassman_dir'].'/includes/config/tp.config.php'; |
|
| 2181 | 2181 | |
| 2182 | 2182 | // include librairies & connect to DB |
| 2183 | - include_once $SETTINGS['cpassman_dir'] . '/includes/libraries/Database/Meekrodb/db.class.php'; |
|
| 2183 | + include_once $SETTINGS['cpassman_dir'].'/includes/libraries/Database/Meekrodb/db.class.php'; |
|
| 2184 | 2184 | if (defined('DB_PASSWD_CLEAR') === false) { |
| 2185 | 2185 | define('DB_PASSWD_CLEAR', defuseReturnDecrypted(DB_PASSWD, $SETTINGS)); |
| 2186 | 2186 | } |
@@ -2194,8 +2194,8 @@ discard block |
||
| 2194 | 2194 | if (file_exists($tp_config_file) === false || $action === 'rebuild') { |
| 2195 | 2195 | // perform a copy |
| 2196 | 2196 | if (file_exists($tp_config_file)) { |
| 2197 | - if (!copy($tp_config_file, $tp_config_file . '.' . date('Y_m_d_His', time()))) { |
|
| 2198 | - return "ERROR: Could not copy file '" . $tp_config_file . "'"; |
|
| 2197 | + if (!copy($tp_config_file, $tp_config_file.'.'.date('Y_m_d_His', time()))) { |
|
| 2198 | + return "ERROR: Could not copy file '".$tp_config_file."'"; |
|
| 2199 | 2199 | } |
| 2200 | 2200 | } |
| 2201 | 2201 | |
@@ -2206,11 +2206,11 @@ discard block |
||
| 2206 | 2206 | $data[1] = "global \$SETTINGS;\n"; |
| 2207 | 2207 | $data[2] = "\$SETTINGS = array (\n"; |
| 2208 | 2208 | $rows = DB::query( |
| 2209 | - 'SELECT * FROM ' . prefixTable('misc') . ' WHERE type=%s', |
|
| 2209 | + 'SELECT * FROM '.prefixTable('misc').' WHERE type=%s', |
|
| 2210 | 2210 | 'admin' |
| 2211 | 2211 | ); |
| 2212 | 2212 | foreach ($rows as $record) { |
| 2213 | - array_push($data, " '" . $record['intitule'] . "' => '" . $record['valeur'] . "',\n"); |
|
| 2213 | + array_push($data, " '".$record['intitule']."' => '".$record['valeur']."',\n"); |
|
| 2214 | 2214 | } |
| 2215 | 2215 | array_push($data, ");\n"); |
| 2216 | 2216 | $data = array_unique($data); |
@@ -2224,15 +2224,15 @@ discard block |
||
| 2224 | 2224 | break; |
| 2225 | 2225 | } |
| 2226 | 2226 | |
| 2227 | - if (stristr($line, "'" . $field . "' => '")) { |
|
| 2228 | - $data[$inc] = " '" . $field . "' => '" . filter_var($value, FILTER_SANITIZE_STRING) . "',\n"; |
|
| 2227 | + if (stristr($line, "'".$field."' => '")) { |
|
| 2228 | + $data[$inc] = " '".$field."' => '".filter_var($value, FILTER_SANITIZE_STRING)."',\n"; |
|
| 2229 | 2229 | $bFound = true; |
| 2230 | 2230 | break; |
| 2231 | 2231 | } |
| 2232 | 2232 | ++$inc; |
| 2233 | 2233 | } |
| 2234 | 2234 | if ($bFound === false) { |
| 2235 | - $data[($inc)] = " '" . $field . "' => '" . filter_var($value, FILTER_SANITIZE_STRING) . "',\n);\n"; |
|
| 2235 | + $data[($inc)] = " '".$field."' => '".filter_var($value, FILTER_SANITIZE_STRING)."',\n);\n"; |
|
| 2236 | 2236 | } |
| 2237 | 2237 | } |
| 2238 | 2238 | |
@@ -2270,7 +2270,7 @@ discard block |
||
| 2270 | 2270 | $settings = array(); |
| 2271 | 2271 | |
| 2272 | 2272 | $rows = DB::query( |
| 2273 | - 'SELECT * FROM ' . prefixTable('misc') . ' WHERE type=%s_type OR type=%s_type2', |
|
| 2273 | + 'SELECT * FROM '.prefixTable('misc').' WHERE type=%s_type OR type=%s_type2', |
|
| 2274 | 2274 | array( |
| 2275 | 2275 | 'type' => 'admin', |
| 2276 | 2276 | 'type2' => 'settings', |
@@ -2297,7 +2297,7 @@ discard block |
||
| 2297 | 2297 | $source_cf = array(); |
| 2298 | 2298 | $rows = DB::QUERY( |
| 2299 | 2299 | 'SELECT id_category |
| 2300 | - FROM ' . prefixTable('categories_folders') . ' |
|
| 2300 | + FROM ' . prefixTable('categories_folders').' |
|
| 2301 | 2301 | WHERE id_folder = %i', |
| 2302 | 2302 | $source_id |
| 2303 | 2303 | ); |
@@ -2308,7 +2308,7 @@ discard block |
||
| 2308 | 2308 | $target_cf = array(); |
| 2309 | 2309 | $rows = DB::QUERY( |
| 2310 | 2310 | 'SELECT id_category |
| 2311 | - FROM ' . prefixTable('categories_folders') . ' |
|
| 2311 | + FROM ' . prefixTable('categories_folders').' |
|
| 2312 | 2312 | WHERE id_folder = %i', |
| 2313 | 2313 | $target_id |
| 2314 | 2314 | ); |
@@ -2343,9 +2343,9 @@ discard block |
||
| 2343 | 2343 | $password = null |
| 2344 | 2344 | ) { |
| 2345 | 2345 | // Load AntiXSS |
| 2346 | - include_once $SETTINGS['cpassman_dir'] . '/includes/libraries/voku/helper/AntiXSS.php'; |
|
| 2347 | - include_once $SETTINGS['cpassman_dir'] . '/includes/libraries/voku/helper/ASCII.php'; |
|
| 2348 | - include_once $SETTINGS['cpassman_dir'] . '/includes/libraries/voku/helper/UTF8.php'; |
|
| 2346 | + include_once $SETTINGS['cpassman_dir'].'/includes/libraries/voku/helper/AntiXSS.php'; |
|
| 2347 | + include_once $SETTINGS['cpassman_dir'].'/includes/libraries/voku/helper/ASCII.php'; |
|
| 2348 | + include_once $SETTINGS['cpassman_dir'].'/includes/libraries/voku/helper/UTF8.php'; |
|
| 2349 | 2349 | $antiXss = new voku\helper\AntiXSS(); |
| 2350 | 2350 | |
| 2351 | 2351 | // Protect against bad inputs |
@@ -2359,7 +2359,7 @@ discard block |
||
| 2359 | 2359 | |
| 2360 | 2360 | if (empty($password) === true || is_null($password) === true) { |
| 2361 | 2361 | // get KEY to define password |
| 2362 | - $ascii_key = file_get_contents(SECUREPATH . '/teampass-seckey.txt'); |
|
| 2362 | + $ascii_key = file_get_contents(SECUREPATH.'/teampass-seckey.txt'); |
|
| 2363 | 2363 | $password = \Defuse\Crypto\Key::loadFromAsciiSafeString($ascii_key); |
| 2364 | 2364 | } |
| 2365 | 2365 | |
@@ -2405,15 +2405,15 @@ discard block |
||
| 2405 | 2405 | ) { |
| 2406 | 2406 | // load PhpEncryption library |
| 2407 | 2407 | $path_to_encryption = '/includes/libraries/Encryption/Encryption/'; |
| 2408 | - include_once $SETTINGS['cpassman_dir'] . $path_to_encryption . 'Crypto.php'; |
|
| 2409 | - include_once $SETTINGS['cpassman_dir'] . $path_to_encryption . 'Encoding.php'; |
|
| 2410 | - include_once $SETTINGS['cpassman_dir'] . $path_to_encryption . 'DerivedKeys.php'; |
|
| 2411 | - include_once $SETTINGS['cpassman_dir'] . $path_to_encryption . 'Key.php'; |
|
| 2412 | - include_once $SETTINGS['cpassman_dir'] . $path_to_encryption . 'KeyOrPassword.php'; |
|
| 2413 | - include_once $SETTINGS['cpassman_dir'] . $path_to_encryption . 'File.php'; |
|
| 2414 | - include_once $SETTINGS['cpassman_dir'] . $path_to_encryption . 'RuntimeTests.php'; |
|
| 2415 | - include_once $SETTINGS['cpassman_dir'] . $path_to_encryption . 'KeyProtectedByPassword.php'; |
|
| 2416 | - include_once $SETTINGS['cpassman_dir'] . $path_to_encryption . 'Core.php'; |
|
| 2408 | + include_once $SETTINGS['cpassman_dir'].$path_to_encryption.'Crypto.php'; |
|
| 2409 | + include_once $SETTINGS['cpassman_dir'].$path_to_encryption.'Encoding.php'; |
|
| 2410 | + include_once $SETTINGS['cpassman_dir'].$path_to_encryption.'DerivedKeys.php'; |
|
| 2411 | + include_once $SETTINGS['cpassman_dir'].$path_to_encryption.'Key.php'; |
|
| 2412 | + include_once $SETTINGS['cpassman_dir'].$path_to_encryption.'KeyOrPassword.php'; |
|
| 2413 | + include_once $SETTINGS['cpassman_dir'].$path_to_encryption.'File.php'; |
|
| 2414 | + include_once $SETTINGS['cpassman_dir'].$path_to_encryption.'RuntimeTests.php'; |
|
| 2415 | + include_once $SETTINGS['cpassman_dir'].$path_to_encryption.'KeyProtectedByPassword.php'; |
|
| 2416 | + include_once $SETTINGS['cpassman_dir'].$path_to_encryption.'Core.php'; |
|
| 2417 | 2417 | |
| 2418 | 2418 | try { |
| 2419 | 2419 | \Defuse\Crypto\File::encryptFileWithPassword( |
@@ -2451,15 +2451,15 @@ discard block |
||
| 2451 | 2451 | ) { |
| 2452 | 2452 | // load PhpEncryption library |
| 2453 | 2453 | $path_to_encryption = '/includes/libraries/Encryption/Encryption/'; |
| 2454 | - include_once $SETTINGS['cpassman_dir'] . $path_to_encryption . 'Crypto.php'; |
|
| 2455 | - include_once $SETTINGS['cpassman_dir'] . $path_to_encryption . 'Encoding.php'; |
|
| 2456 | - include_once $SETTINGS['cpassman_dir'] . $path_to_encryption . 'DerivedKeys.php'; |
|
| 2457 | - include_once $SETTINGS['cpassman_dir'] . $path_to_encryption . 'Key.php'; |
|
| 2458 | - include_once $SETTINGS['cpassman_dir'] . $path_to_encryption . 'KeyOrPassword.php'; |
|
| 2459 | - include_once $SETTINGS['cpassman_dir'] . $path_to_encryption . 'File.php'; |
|
| 2460 | - include_once $SETTINGS['cpassman_dir'] . $path_to_encryption . 'RuntimeTests.php'; |
|
| 2461 | - include_once $SETTINGS['cpassman_dir'] . $path_to_encryption . 'KeyProtectedByPassword.php'; |
|
| 2462 | - include_once $SETTINGS['cpassman_dir'] . $path_to_encryption . 'Core.php'; |
|
| 2454 | + include_once $SETTINGS['cpassman_dir'].$path_to_encryption.'Crypto.php'; |
|
| 2455 | + include_once $SETTINGS['cpassman_dir'].$path_to_encryption.'Encoding.php'; |
|
| 2456 | + include_once $SETTINGS['cpassman_dir'].$path_to_encryption.'DerivedKeys.php'; |
|
| 2457 | + include_once $SETTINGS['cpassman_dir'].$path_to_encryption.'Key.php'; |
|
| 2458 | + include_once $SETTINGS['cpassman_dir'].$path_to_encryption.'KeyOrPassword.php'; |
|
| 2459 | + include_once $SETTINGS['cpassman_dir'].$path_to_encryption.'File.php'; |
|
| 2460 | + include_once $SETTINGS['cpassman_dir'].$path_to_encryption.'RuntimeTests.php'; |
|
| 2461 | + include_once $SETTINGS['cpassman_dir'].$path_to_encryption.'KeyProtectedByPassword.php'; |
|
| 2462 | + include_once $SETTINGS['cpassman_dir'].$path_to_encryption.'Core.php'; |
|
| 2463 | 2463 | |
| 2464 | 2464 | try { |
| 2465 | 2465 | \Defuse\Crypto\File::decryptFileWithPassword( |
@@ -2503,9 +2503,9 @@ discard block |
||
| 2503 | 2503 | function fileDelete($file, $SETTINGS) |
| 2504 | 2504 | { |
| 2505 | 2505 | // Load AntiXSS |
| 2506 | - include_once $SETTINGS['cpassman_dir'] . '/includes/libraries/voku/helper/ASCII.php'; |
|
| 2507 | - include_once $SETTINGS['cpassman_dir'] . '/includes/libraries/voku/helper/UTF8.php'; |
|
| 2508 | - include_once $SETTINGS['cpassman_dir'] . '/includes/libraries/voku/helper/AntiXSS.php'; |
|
| 2506 | + include_once $SETTINGS['cpassman_dir'].'/includes/libraries/voku/helper/ASCII.php'; |
|
| 2507 | + include_once $SETTINGS['cpassman_dir'].'/includes/libraries/voku/helper/UTF8.php'; |
|
| 2508 | + include_once $SETTINGS['cpassman_dir'].'/includes/libraries/voku/helper/AntiXSS.php'; |
|
| 2509 | 2509 | $antiXss = new voku\helper\AntiXSS(); |
| 2510 | 2510 | |
| 2511 | 2511 | $file = $antiXss->xss_clean($file); |
@@ -2548,7 +2548,7 @@ discard block |
||
| 2548 | 2548 | continue; |
| 2549 | 2549 | } |
| 2550 | 2550 | |
| 2551 | - $fullPath = $dir . '/' . $file; |
|
| 2551 | + $fullPath = $dir.'/'.$file; |
|
| 2552 | 2552 | |
| 2553 | 2553 | if (is_dir($fullPath)) { |
| 2554 | 2554 | if ($res = @chmod($fullPath, $dirPermissions)) { |
@@ -2578,7 +2578,7 @@ discard block |
||
| 2578 | 2578 | */ |
| 2579 | 2579 | function accessToItemIsGranted($item_id, $SETTINGS) |
| 2580 | 2580 | { |
| 2581 | - include_once $SETTINGS['cpassman_dir'] . '/includes/libraries/protect/SuperGlobal/SuperGlobal.php'; |
|
| 2581 | + include_once $SETTINGS['cpassman_dir'].'/includes/libraries/protect/SuperGlobal/SuperGlobal.php'; |
|
| 2582 | 2582 | $superGlobal = new protect\SuperGlobal\SuperGlobal(); |
| 2583 | 2583 | |
| 2584 | 2584 | // Prepare superGlobal variables |
@@ -2588,7 +2588,7 @@ discard block |
||
| 2588 | 2588 | // Load item data |
| 2589 | 2589 | $data = DB::queryFirstRow( |
| 2590 | 2590 | 'SELECT id_tree |
| 2591 | - FROM ' . prefixTable('items') . ' |
|
| 2591 | + FROM ' . prefixTable('items').' |
|
| 2592 | 2592 | WHERE id = %i', |
| 2593 | 2593 | $item_id |
| 2594 | 2594 | ); |
@@ -2707,9 +2707,9 @@ discard block |
||
| 2707 | 2707 | |
| 2708 | 2708 | foreach (explode(',', $SETTINGS['ldap_domain_controler']) as $domainControler) { |
| 2709 | 2709 | if ($SETTINGS['ldap_ssl'] == 1) { |
| 2710 | - $ldapURIs .= 'ldaps://' . $domainControler . ':' . $SETTINGS['ldap_port'] . ' '; |
|
| 2710 | + $ldapURIs .= 'ldaps://'.$domainControler.':'.$SETTINGS['ldap_port'].' '; |
|
| 2711 | 2711 | } else { |
| 2712 | - $ldapURIs .= 'ldap://' . $domainControler . ':' . $SETTINGS['ldap_port'] . ' '; |
|
| 2712 | + $ldapURIs .= 'ldap://'.$domainControler.':'.$SETTINGS['ldap_port'].' '; |
|
| 2713 | 2713 | } |
| 2714 | 2714 | } |
| 2715 | 2715 | $ldapconn = ldap_connect($ldapURIs); |
@@ -2734,7 +2734,7 @@ discard block |
||
| 2734 | 2734 | if ((empty($SETTINGS['ldap_bind_dn']) === true && empty($SETTINGS['ldap_bind_passwd']) === true) |
| 2735 | 2735 | || $ldapbind === true |
| 2736 | 2736 | ) { |
| 2737 | - $filter = '(&(' . $SETTINGS['ldap_user_attribute'] . '=' . $username . ')(objectClass=' . $SETTINGS['ldap_object_class'] . '))'; |
|
| 2737 | + $filter = '(&('.$SETTINGS['ldap_user_attribute'].'='.$username.')(objectClass='.$SETTINGS['ldap_object_class'].'))'; |
|
| 2738 | 2738 | $result = ldap_search( |
| 2739 | 2739 | $ldapconn, |
| 2740 | 2740 | $SETTINGS['ldap_search_base'], |
@@ -2759,7 +2759,7 @@ discard block |
||
| 2759 | 2759 | && empty($SETTINGS['ldap_usergroup']) === false |
| 2760 | 2760 | ) { |
| 2761 | 2761 | // New way to check User's group membership |
| 2762 | - $filter_group = 'memberUid=' . $username; |
|
| 2762 | + $filter_group = 'memberUid='.$username; |
|
| 2763 | 2763 | $result_group = ldap_search( |
| 2764 | 2764 | $ldapconn, |
| 2765 | 2765 | $SETTINGS['ldap_search_base'], |
@@ -2830,18 +2830,18 @@ discard block |
||
| 2830 | 2830 | |
| 2831 | 2831 | //Multiple Domain Names |
| 2832 | 2832 | if (strpos(html_entity_decode($username), '\\') === true) { |
| 2833 | - $ldap_suffix = '@' . substr(html_entity_decode($username), 0, strpos(html_entity_decode($username), '\\')); |
|
| 2833 | + $ldap_suffix = '@'.substr(html_entity_decode($username), 0, strpos(html_entity_decode($username), '\\')); |
|
| 2834 | 2834 | $username = substr(html_entity_decode($username), strpos(html_entity_decode($username), '\\') + 1); |
| 2835 | 2835 | } |
| 2836 | 2836 | //load ClassLoader |
| 2837 | - include_once $SETTINGS['cpassman_dir'] . '/sources/SplClassLoader.php'; |
|
| 2837 | + include_once $SETTINGS['cpassman_dir'].'/sources/SplClassLoader.php'; |
|
| 2838 | 2838 | |
| 2839 | 2839 | $adldap = new SplClassLoader('adLDAP', '../includes/libraries/LDAP'); |
| 2840 | 2840 | $adldap->register(); |
| 2841 | 2841 | |
| 2842 | 2842 | // Posix style LDAP handles user searches a bit differently |
| 2843 | 2843 | if ($SETTINGS['ldap_type'] === 'posix') { |
| 2844 | - $ldap_suffix = ',' . $SETTINGS['ldap_suffix'] . ',' . $SETTINGS['ldap_domain_dn']; |
|
| 2844 | + $ldap_suffix = ','.$SETTINGS['ldap_suffix'].','.$SETTINGS['ldap_domain_dn']; |
|
| 2845 | 2845 | } else { |
| 2846 | 2846 | // case where $SETTINGS['ldap_type'] equals 'windows' |
| 2847 | 2847 | //Multiple Domain Names |
@@ -2865,7 +2865,7 @@ discard block |
||
| 2865 | 2865 | |
| 2866 | 2866 | // OpenLDAP expects an attribute=value pair |
| 2867 | 2867 | if ($SETTINGS['ldap_type'] === 'posix') { |
| 2868 | - $auth_username = $SETTINGS['ldap_user_attribute'] . '=' . $username; |
|
| 2868 | + $auth_username = $SETTINGS['ldap_user_attribute'].'='.$username; |
|
| 2869 | 2869 | } else { |
| 2870 | 2870 | $auth_username = $username; |
| 2871 | 2871 | } |
@@ -2913,8 +2913,8 @@ discard block |
||
| 2913 | 2913 | function performDBQuery($SETTINGS, $fields, $table) |
| 2914 | 2914 | { |
| 2915 | 2915 | // include librairies & connect to DB |
| 2916 | - include_once $SETTINGS['cpassman_dir'] . '/includes/config/settings.php'; |
|
| 2917 | - include_once $SETTINGS['cpassman_dir'] . '/includes/libraries/Database/Meekrodb/db.class.php'; |
|
| 2916 | + include_once $SETTINGS['cpassman_dir'].'/includes/config/settings.php'; |
|
| 2917 | + include_once $SETTINGS['cpassman_dir'].'/includes/libraries/Database/Meekrodb/db.class.php'; |
|
| 2918 | 2918 | if (defined('DB_PASSWD_CLEAR') === false) { |
| 2919 | 2919 | define('DB_PASSWD_CLEAR', defuseReturnDecrypted(DB_PASSWD, $SETTINGS)); |
| 2920 | 2920 | } |
@@ -2927,7 +2927,7 @@ discard block |
||
| 2927 | 2927 | |
| 2928 | 2928 | // Insert log in DB |
| 2929 | 2929 | return DB::query( |
| 2930 | - 'SELECT ' . $fields . ' |
|
| 2930 | + 'SELECT '.$fields.' |
|
| 2931 | 2931 | FROM ' . prefixTable($table) |
| 2932 | 2932 | ); |
| 2933 | 2933 | } |
@@ -2942,15 +2942,15 @@ discard block |
||
| 2942 | 2942 | function formatSizeUnits($bytes) |
| 2943 | 2943 | { |
| 2944 | 2944 | if ($bytes >= 1073741824) { |
| 2945 | - $bytes = number_format($bytes / 1073741824, 2) . ' GB'; |
|
| 2945 | + $bytes = number_format($bytes / 1073741824, 2).' GB'; |
|
| 2946 | 2946 | } elseif ($bytes >= 1048576) { |
| 2947 | - $bytes = number_format($bytes / 1048576, 2) . ' MB'; |
|
| 2947 | + $bytes = number_format($bytes / 1048576, 2).' MB'; |
|
| 2948 | 2948 | } elseif ($bytes >= 1024) { |
| 2949 | - $bytes = number_format($bytes / 1024, 2) . ' KB'; |
|
| 2949 | + $bytes = number_format($bytes / 1024, 2).' KB'; |
|
| 2950 | 2950 | } elseif ($bytes > 1) { |
| 2951 | - $bytes = $bytes . ' bytes'; |
|
| 2951 | + $bytes = $bytes.' bytes'; |
|
| 2952 | 2952 | } elseif ($bytes == 1) { |
| 2953 | - $bytes = $bytes . ' byte'; |
|
| 2953 | + $bytes = $bytes.' byte'; |
|
| 2954 | 2954 | } else { |
| 2955 | 2955 | $bytes = '0 bytes'; |
| 2956 | 2956 | } |
@@ -3165,16 +3165,16 @@ discard block |
||
| 3165 | 3165 | |
| 3166 | 3166 | // Encrypt the file content |
| 3167 | 3167 | $plaintext = file_get_contents( |
| 3168 | - filter_var($fileInPath . '/' . $fileInName, FILTER_SANITIZE_URL) |
|
| 3168 | + filter_var($fileInPath.'/'.$fileInName, FILTER_SANITIZE_URL) |
|
| 3169 | 3169 | ); |
| 3170 | 3170 | |
| 3171 | 3171 | $ciphertext = $cipher->encrypt($plaintext); |
| 3172 | 3172 | |
| 3173 | 3173 | // Save new file |
| 3174 | 3174 | $hash = md5($plaintext); |
| 3175 | - $fileOut = $fileInPath . '/' . TP_FILE_PREFIX . $hash; |
|
| 3175 | + $fileOut = $fileInPath.'/'.TP_FILE_PREFIX.$hash; |
|
| 3176 | 3176 | file_put_contents($fileOut, $ciphertext); |
| 3177 | - unlink($fileInPath . '/' . $fileInName); |
|
| 3177 | + unlink($fileInPath.'/'.$fileInName); |
|
| 3178 | 3178 | |
| 3179 | 3179 | return array( |
| 3180 | 3180 | 'fileHash' => base64_encode($hash), |
@@ -3217,7 +3217,7 @@ discard block |
||
| 3217 | 3217 | $cipher->disablePadding(); |
| 3218 | 3218 | |
| 3219 | 3219 | // Get file content |
| 3220 | - $ciphertext = file_get_contents($filePath . '/' . TP_FILE_PREFIX . $fileName); |
|
| 3220 | + $ciphertext = file_get_contents($filePath.'/'.TP_FILE_PREFIX.$fileName); |
|
| 3221 | 3221 | |
| 3222 | 3222 | // Decrypt file content and return |
| 3223 | 3223 | return base64_encode($cipher->decrypt($ciphertext)); |
@@ -3273,8 +3273,8 @@ discard block |
||
| 3273 | 3273 | $SETTINGS |
| 3274 | 3274 | ) { |
| 3275 | 3275 | // include librairies & connect to DB |
| 3276 | - include_once $SETTINGS['cpassman_dir'] . '/includes/config/settings.php'; |
|
| 3277 | - include_once $SETTINGS['cpassman_dir'] . '/includes/libraries/Database/Meekrodb/db.class.php'; |
|
| 3276 | + include_once $SETTINGS['cpassman_dir'].'/includes/config/settings.php'; |
|
| 3277 | + include_once $SETTINGS['cpassman_dir'].'/includes/libraries/Database/Meekrodb/db.class.php'; |
|
| 3278 | 3278 | if (defined('DB_PASSWD_CLEAR') === false) { |
| 3279 | 3279 | define('DB_PASSWD_CLEAR', defuseReturnDecrypted(DB_PASSWD, $SETTINGS)); |
| 3280 | 3280 | } |
@@ -3293,7 +3293,7 @@ discard block |
||
| 3293 | 3293 | ); |
| 3294 | 3294 | |
| 3295 | 3295 | // Superglobals |
| 3296 | - include_once $SETTINGS['cpassman_dir'] . '/includes/libraries/protect/SuperGlobal/SuperGlobal.php'; |
|
| 3296 | + include_once $SETTINGS['cpassman_dir'].'/includes/libraries/protect/SuperGlobal/SuperGlobal.php'; |
|
| 3297 | 3297 | $superGlobal = new protect\SuperGlobal\SuperGlobal(); |
| 3298 | 3298 | |
| 3299 | 3299 | // Prepare superGlobal variables |
@@ -3320,8 +3320,8 @@ discard block |
||
| 3320 | 3320 | // Create sharekey for each user |
| 3321 | 3321 | $users = DB::query( |
| 3322 | 3322 | 'SELECT id, public_key |
| 3323 | - FROM ' . prefixTable('users') . ' |
|
| 3324 | - WHERE id NOT IN ("' . OTV_USER_ID . '","' . SSH_USER_ID . '","' . API_USER_ID . '") |
|
| 3323 | + FROM ' . prefixTable('users').' |
|
| 3324 | + WHERE id NOT IN ("' . OTV_USER_ID.'","'.SSH_USER_ID.'","'.API_USER_ID.'") |
|
| 3325 | 3325 | AND public_key != ""' |
| 3326 | 3326 | ); |
| 3327 | 3327 | foreach ($users as $user) { |
@@ -3405,9 +3405,9 @@ discard block |
||
| 3405 | 3405 | $ldapURIs = ''; |
| 3406 | 3406 | foreach (explode(',', $SETTINGS['ldap_domain_controler']) as $domainControler) { |
| 3407 | 3407 | if ($SETTINGS['ldap_ssl'] == 1) { |
| 3408 | - $ldapURIs .= 'ldaps://' . $domainControler . ':' . $SETTINGS['ldap_port'] . ' '; |
|
| 3408 | + $ldapURIs .= 'ldaps://'.$domainControler.':'.$SETTINGS['ldap_port'].' '; |
|
| 3409 | 3409 | } else { |
| 3410 | - $ldapURIs .= 'ldap://' . $domainControler . ':' . $SETTINGS['ldap_port'] . ' '; |
|
| 3410 | + $ldapURIs .= 'ldap://'.$domainControler.':'.$SETTINGS['ldap_port'].' '; |
|
| 3411 | 3411 | } |
| 3412 | 3412 | } |
| 3413 | 3413 | // Connect |
@@ -3451,7 +3451,7 @@ discard block |
||
| 3451 | 3451 | if ($ldapconn) { |
| 3452 | 3452 | if ($SETTINGS['ldap_type'] === 'posix-search') { |
| 3453 | 3453 | // LDAP with posix search |
| 3454 | - $filter = '(&(' . $SETTINGS['ldap_user_attribute'] . '=' . $login . ')(objectClass=' . $SETTINGS['ldap_object_class'] . '))'; |
|
| 3454 | + $filter = '(&('.$SETTINGS['ldap_user_attribute'].'='.$login.')(objectClass='.$SETTINGS['ldap_object_class'].'))'; |
|
| 3455 | 3455 | $result = ldap_search( |
| 3456 | 3456 | $ldapconn, |
| 3457 | 3457 | $SETTINGS['ldap_search_base'], |
@@ -3470,13 +3470,13 @@ discard block |
||
| 3470 | 3470 | } |
| 3471 | 3471 | } |
| 3472 | 3472 | } else { |
| 3473 | - $adldap = new SplClassLoader('adLDAP', $SETTINGS['cpassman_dir'] . '/includes/libraries/LDAP'); |
|
| 3473 | + $adldap = new SplClassLoader('adLDAP', $SETTINGS['cpassman_dir'].'/includes/libraries/LDAP'); |
|
| 3474 | 3474 | $adldap->register(); |
| 3475 | 3475 | $ldap_suffix = ''; |
| 3476 | 3476 | |
| 3477 | 3477 | // Posix style LDAP handles user searches a bit differently |
| 3478 | 3478 | if ($SETTINGS['ldap_type'] === 'posix') { |
| 3479 | - $ldap_suffix = ',' . $SETTINGS['ldap_suffix'] . ',' . $SETTINGS['ldap_domain_dn']; |
|
| 3479 | + $ldap_suffix = ','.$SETTINGS['ldap_suffix'].','.$SETTINGS['ldap_domain_dn']; |
|
| 3480 | 3480 | } elseif ($SETTINGS['ldap_type'] === 'windows') { |
| 3481 | 3481 | //Multiple Domain Names |
| 3482 | 3482 | $ldap_suffix = $SETTINGS['ldap_suffix']; |
@@ -3499,7 +3499,7 @@ discard block |
||
| 3499 | 3499 | |
| 3500 | 3500 | // OpenLDAP expects an attribute=value pair |
| 3501 | 3501 | if ($SETTINGS['ldap_type'] === 'posix') { |
| 3502 | - $login = $SETTINGS['ldap_user_attribute'] . '=' . $login; |
|
| 3502 | + $login = $SETTINGS['ldap_user_attribute'].'='.$login; |
|
| 3503 | 3503 | } |
| 3504 | 3504 | |
| 3505 | 3505 | // Authenticate the user |
@@ -3523,8 +3523,8 @@ discard block |
||
| 3523 | 3523 | function deleteUserObjetsKeys($userId, $SETTINGS) |
| 3524 | 3524 | { |
| 3525 | 3525 | // include librairies & connect to DB |
| 3526 | - include_once $SETTINGS['cpassman_dir'] . '/includes/config/settings.php'; |
|
| 3527 | - include_once $SETTINGS['cpassman_dir'] . '/includes/libraries/Database/Meekrodb/db.class.php'; |
|
| 3526 | + include_once $SETTINGS['cpassman_dir'].'/includes/config/settings.php'; |
|
| 3527 | + include_once $SETTINGS['cpassman_dir'].'/includes/libraries/Database/Meekrodb/db.class.php'; |
|
| 3528 | 3528 | if (defined('DB_PASSWD_CLEAR') === false) { |
| 3529 | 3529 | define('DB_PASSWD_CLEAR', defuseReturnDecrypted(DB_PASSWD, $SETTINGS)); |
| 3530 | 3530 | } |
@@ -44,8 +44,8 @@ discard block |
||
| 44 | 44 | } |
| 45 | 45 | |
| 46 | 46 | /* do checks */ |
| 47 | -require_once $SETTINGS['cpassman_dir'] . '/includes/config/include.php'; |
|
| 48 | -require_once $SETTINGS['cpassman_dir'] . '/sources/checks.php'; |
|
| 47 | +require_once $SETTINGS['cpassman_dir'].'/includes/config/include.php'; |
|
| 48 | +require_once $SETTINGS['cpassman_dir'].'/sources/checks.php'; |
|
| 49 | 49 | $isprofileupdate = filter_input(INPUT_POST, 'isprofileupdate', FILTER_SANITIZE_STRING); |
| 50 | 50 | if ( |
| 51 | 51 | checkUser($_SESSION['user_id'], $_SESSION['key'], 'profile', $SETTINGS) === false |
@@ -56,7 +56,7 @@ discard block |
||
| 56 | 56 | || $isprofileupdate === false |
| 57 | 57 | ) { |
| 58 | 58 | $_SESSION['error']['code'] = ERR_NOT_ALLOWED; //not allowed page |
| 59 | - include $SETTINGS['cpassman_dir'] . '/error.php'; |
|
| 59 | + include $SETTINGS['cpassman_dir'].'/error.php'; |
|
| 60 | 60 | exit(); |
| 61 | 61 | } else { |
| 62 | 62 | // Do special check to allow user to change attributes of his profile |
@@ -65,20 +65,20 @@ discard block |
||
| 65 | 65 | || checkUser($_SESSION['user_id'], $_SESSION['key'], 'profile', $SETTINGS) === false |
| 66 | 66 | ) { |
| 67 | 67 | $_SESSION['error']['code'] = ERR_NOT_ALLOWED; //not allowed page |
| 68 | - include $SETTINGS['cpassman_dir'] . '/error.php'; |
|
| 68 | + include $SETTINGS['cpassman_dir'].'/error.php'; |
|
| 69 | 69 | exit(); |
| 70 | 70 | } |
| 71 | 71 | } |
| 72 | 72 | } |
| 73 | 73 | |
| 74 | -require_once $SETTINGS['cpassman_dir'] . '/includes/config/settings.php'; |
|
| 74 | +require_once $SETTINGS['cpassman_dir'].'/includes/config/settings.php'; |
|
| 75 | 75 | header('Content-type: text/html; charset=utf-8'); |
| 76 | -require_once $SETTINGS['cpassman_dir'] . '/includes/language/' . $_SESSION['user_language'] . '.php'; |
|
| 77 | -require_once $SETTINGS['cpassman_dir'] . '/sources/main.functions.php'; |
|
| 78 | -require_once $SETTINGS['cpassman_dir'] . '/sources/SplClassLoader.php'; |
|
| 76 | +require_once $SETTINGS['cpassman_dir'].'/includes/language/'.$_SESSION['user_language'].'.php'; |
|
| 77 | +require_once $SETTINGS['cpassman_dir'].'/sources/main.functions.php'; |
|
| 78 | +require_once $SETTINGS['cpassman_dir'].'/sources/SplClassLoader.php'; |
|
| 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 | } |
@@ -164,7 +164,7 @@ discard block |
||
| 164 | 164 | // Check if user already exists |
| 165 | 165 | $data = DB::query( |
| 166 | 166 | 'SELECT id, fonction_id, groupes_interdits, groupes_visibles |
| 167 | - FROM ' . prefixTable('users') . ' |
|
| 167 | + FROM ' . prefixTable('users').' |
|
| 168 | 168 | WHERE login = %s', |
| 169 | 169 | $login |
| 170 | 170 | ); |
@@ -308,7 +308,7 @@ discard block |
||
| 308 | 308 | // Send email to new user |
| 309 | 309 | sendEmail( |
| 310 | 310 | langHdl('email_subject_new_user'), |
| 311 | - str_replace(array('#tp_login#', '#tp_pw#', '#tp_link#'), array(' ' . addslashes($login), addslashes($password), $SETTINGS['email_server_url']), langHdl('email_new_user_mail')), |
|
| 311 | + str_replace(array('#tp_login#', '#tp_pw#', '#tp_link#'), array(' '.addslashes($login), addslashes($password), $SETTINGS['email_server_url']), langHdl('email_new_user_mail')), |
|
| 312 | 312 | $dataReceived['email'], |
| 313 | 313 | $SETTINGS |
| 314 | 314 | ); |
@@ -373,7 +373,7 @@ discard block |
||
| 373 | 373 | |
| 374 | 374 | // Get info about user to delete |
| 375 | 375 | $data_user = DB::queryfirstrow( |
| 376 | - 'SELECT admin, isAdministratedByRole FROM ' . prefixTable('users') . ' |
|
| 376 | + 'SELECT admin, isAdministratedByRole FROM '.prefixTable('users').' |
|
| 377 | 377 | WHERE id = %i', |
| 378 | 378 | $post_id |
| 379 | 379 | ); |
@@ -392,7 +392,7 @@ discard block |
||
| 392 | 392 | ); |
| 393 | 393 | // delete personal folder and subfolders |
| 394 | 394 | $data = DB::queryfirstrow( |
| 395 | - 'SELECT id FROM ' . prefixTable('nested_tree') . ' |
|
| 395 | + 'SELECT id FROM '.prefixTable('nested_tree').' |
|
| 396 | 396 | WHERE title = %s AND personal_folder = %i', |
| 397 | 397 | $post_id, |
| 398 | 398 | '1' |
@@ -405,7 +405,7 @@ discard block |
||
| 405 | 405 | DB::delete(prefixTable('nested_tree'), 'id = %i AND personal_folder = %i', $folder->id, '1'); |
| 406 | 406 | // delete items & logs |
| 407 | 407 | $items = DB::query( |
| 408 | - 'SELECT id FROM ' . prefixTable('items') . ' |
|
| 408 | + 'SELECT id FROM '.prefixTable('items').' |
|
| 409 | 409 | WHERE id_tree=%i AND perso = %i', |
| 410 | 410 | $folder->id, |
| 411 | 411 | '1' |
@@ -462,7 +462,7 @@ discard block |
||
| 462 | 462 | |
| 463 | 463 | // Get info about user to delete |
| 464 | 464 | $data_user = DB::queryfirstrow( |
| 465 | - 'SELECT admin, isAdministratedByRole FROM ' . prefixTable('users') . ' |
|
| 465 | + 'SELECT admin, isAdministratedByRole FROM '.prefixTable('users').' |
|
| 466 | 466 | WHERE id = %i', |
| 467 | 467 | $post_id |
| 468 | 468 | ); |
@@ -504,7 +504,7 @@ discard block |
||
| 504 | 504 | |
| 505 | 505 | // Get info about user to delete |
| 506 | 506 | $data_user = DB::queryfirstrow( |
| 507 | - 'SELECT admin, isAdministratedByRole FROM ' . prefixTable('users') . ' |
|
| 507 | + 'SELECT admin, isAdministratedByRole FROM '.prefixTable('users').' |
|
| 508 | 508 | WHERE id = %i', |
| 509 | 509 | $post_id |
| 510 | 510 | ); |
@@ -547,7 +547,7 @@ discard block |
||
| 547 | 547 | // Get info about user to delete |
| 548 | 548 | $data_user = DB::queryfirstrow( |
| 549 | 549 | 'SELECT admin, isAdministratedByRole, can_manage_all_users, gestionnaire |
| 550 | - FROM ' . prefixTable('users') . ' |
|
| 550 | + FROM ' . prefixTable('users').' |
|
| 551 | 551 | WHERE id = %i', |
| 552 | 552 | $post_id |
| 553 | 553 | ); |
@@ -591,7 +591,7 @@ discard block |
||
| 591 | 591 | |
| 592 | 592 | // Get info about user to delete |
| 593 | 593 | $data_user = DB::queryfirstrow( |
| 594 | - 'SELECT admin, isAdministratedByRole FROM ' . prefixTable('users') . ' |
|
| 594 | + 'SELECT admin, isAdministratedByRole FROM '.prefixTable('users').' |
|
| 595 | 595 | WHERE id = %i', |
| 596 | 596 | $post_id |
| 597 | 597 | ); |
@@ -634,7 +634,7 @@ discard block |
||
| 634 | 634 | // Get info about user to delete |
| 635 | 635 | $data_user = DB::queryfirstrow( |
| 636 | 636 | 'SELECT admin, isAdministratedByRole, gestionnaire |
| 637 | - FROM ' . prefixTable('users') . ' |
|
| 637 | + FROM ' . prefixTable('users').' |
|
| 638 | 638 | WHERE id = %i', |
| 639 | 639 | $post_id |
| 640 | 640 | ); |
@@ -677,7 +677,7 @@ discard block |
||
| 677 | 677 | // Get info about user to delete |
| 678 | 678 | $data_user = DB::queryfirstrow( |
| 679 | 679 | 'SELECT admin, isAdministratedByRole, gestionnaire |
| 680 | - FROM ' . prefixTable('users') . ' |
|
| 680 | + FROM ' . prefixTable('users').' |
|
| 681 | 681 | WHERE id = %i', |
| 682 | 682 | $post_id |
| 683 | 683 | ); |
@@ -717,7 +717,7 @@ discard block |
||
| 717 | 717 | // Get info about user to delete |
| 718 | 718 | $data_user = DB::queryfirstrow( |
| 719 | 719 | 'SELECT admin, isAdministratedByRole, gestionnaire |
| 720 | - FROM ' . prefixTable('users') . ' |
|
| 720 | + FROM ' . prefixTable('users').' |
|
| 721 | 721 | WHERE id = %i', |
| 722 | 722 | $post_id |
| 723 | 723 | ); |
@@ -756,7 +756,7 @@ discard block |
||
| 756 | 756 | $return = array(); |
| 757 | 757 | // Check if folder exists |
| 758 | 758 | $data = DB::query( |
| 759 | - 'SELECT * FROM ' . prefixTable('nested_tree') . ' |
|
| 759 | + 'SELECT * FROM '.prefixTable('nested_tree').' |
|
| 760 | 760 | WHERE title = %s AND parent_id = %i', |
| 761 | 761 | filter_input(INPUT_POST, 'domain', FILTER_SANITIZE_STRING), |
| 762 | 762 | '0' |
@@ -769,7 +769,7 @@ discard block |
||
| 769 | 769 | } |
| 770 | 770 | // Check if role exists |
| 771 | 771 | $data = DB::query( |
| 772 | - 'SELECT * FROM ' . prefixTable('roles_title') . ' |
|
| 772 | + 'SELECT * FROM '.prefixTable('roles_title').' |
|
| 773 | 773 | WHERE title = %s', |
| 774 | 774 | filter_input(INPUT_POST, 'domain', FILTER_SANITIZE_STRING) |
| 775 | 775 | ); |
@@ -789,7 +789,7 @@ discard block |
||
| 789 | 789 | case 'user_log_items': |
| 790 | 790 | $nb_pages = 1; |
| 791 | 791 | $logs = $sql_filter = ''; |
| 792 | - $pages = '<table style=\'border-top:1px solid #969696;\'><tr><td>' . langHdl('pages') . ' : </td>'; |
|
| 792 | + $pages = '<table style=\'border-top:1px solid #969696;\'><tr><td>'.langHdl('pages').' : </td>'; |
|
| 793 | 793 | |
| 794 | 794 | // Prepare POST variables |
| 795 | 795 | $post_nb_items_by_page = filter_input(INPUT_POST, 'nb_items_by_page', FILTER_SANITIZE_NUMBER_INT); |
@@ -801,14 +801,14 @@ discard block |
||
| 801 | 801 | && !empty(filter_input(INPUT_POST, 'filter', FILTER_SANITIZE_STRING)) |
| 802 | 802 | && filter_input(INPUT_POST, 'filter', FILTER_SANITIZE_STRING) !== 'all' |
| 803 | 803 | ) { |
| 804 | - $sql_filter = " AND l.action = '" . filter_input(INPUT_POST, 'filter', FILTER_SANITIZE_STRING) . "'"; |
|
| 804 | + $sql_filter = " AND l.action = '".filter_input(INPUT_POST, 'filter', FILTER_SANITIZE_STRING)."'"; |
|
| 805 | 805 | } |
| 806 | 806 | // get number of pages |
| 807 | 807 | DB::query( |
| 808 | 808 | 'SELECT * |
| 809 | - FROM ' . prefixTable('log_items') . ' as l |
|
| 810 | - INNER JOIN ' . prefixTable('items') . ' as i ON (l.id_item=i.id) |
|
| 811 | - INNER JOIN ' . prefixTable('users') . ' as u ON (l.id_user=u.id) |
|
| 809 | + FROM ' . prefixTable('log_items').' as l |
|
| 810 | + INNER JOIN ' . prefixTable('items').' as i ON (l.id_item=i.id) |
|
| 811 | + INNER JOIN ' . prefixTable('users').' as u ON (l.id_user=u.id) |
|
| 812 | 812 | WHERE l.id_user = %i ' . $sql_filter, |
| 813 | 813 | filter_input(INPUT_POST, 'id', FILTER_SANITIZE_NUMBER_INT) |
| 814 | 814 | ); |
@@ -826,19 +826,19 @@ discard block |
||
| 826 | 826 | // launch query |
| 827 | 827 | $rows = DB::query( |
| 828 | 828 | 'SELECT l.date as date, u.login as login, i.label as label, l.action as action |
| 829 | - FROM ' . prefixTable('log_items') . ' as l |
|
| 830 | - INNER JOIN ' . prefixTable('items') . ' as i ON (l.id_item=i.id) |
|
| 831 | - INNER JOIN ' . prefixTable('users') . ' as u ON (l.id_user=u.id) |
|
| 832 | - WHERE l.id_user = %i ' . $sql_filter . ' |
|
| 829 | + FROM ' . prefixTable('log_items').' as l |
|
| 830 | + INNER JOIN ' . prefixTable('items').' as i ON (l.id_item=i.id) |
|
| 831 | + INNER JOIN ' . prefixTable('users').' as u ON (l.id_user=u.id) |
|
| 832 | + WHERE l.id_user = %i ' . $sql_filter.' |
|
| 833 | 833 | ORDER BY date DESC |
| 834 | - LIMIT ' . intval($start) . ',' . intval($post_nb_items_by_page), |
|
| 834 | + LIMIT ' . intval($start).','.intval($post_nb_items_by_page), |
|
| 835 | 835 | filter_input(INPUT_POST, 'id', FILTER_SANITIZE_NUMBER_INT) |
| 836 | 836 | ); |
| 837 | 837 | } else { |
| 838 | 838 | // get number of pages |
| 839 | 839 | DB::query( |
| 840 | 840 | 'SELECT * |
| 841 | - FROM ' . prefixTable('log_system') . ' |
|
| 841 | + FROM ' . prefixTable('log_system').' |
|
| 842 | 842 | WHERE type = %s AND field_1=%i', |
| 843 | 843 | 'user_mngt', |
| 844 | 844 | filter_input(INPUT_POST, 'id', FILTER_SANITIZE_NUMBER_INT) |
@@ -857,7 +857,7 @@ discard block |
||
| 857 | 857 | // launch query |
| 858 | 858 | $rows = DB::query( |
| 859 | 859 | 'SELECT * |
| 860 | - FROM ' . prefixTable('log_system') . ' |
|
| 860 | + FROM ' . prefixTable('log_system').' |
|
| 861 | 861 | WHERE type = %s AND field_1 = %i |
| 862 | 862 | ORDER BY date DESC |
| 863 | 863 | LIMIT %i, %i', |
@@ -871,7 +871,7 @@ discard block |
||
| 871 | 871 | if (isset($counter) && $counter != 0) { |
| 872 | 872 | $nb_pages = ceil($counter / intval($post_nb_items_by_page)); |
| 873 | 873 | for ($i = 1; $i <= $nb_pages; ++$i) { |
| 874 | - $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>'; |
|
| 874 | + $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>'; |
|
| 875 | 875 | } |
| 876 | 876 | } |
| 877 | 877 | $pages .= '</tr></table>'; |
@@ -880,13 +880,13 @@ discard block |
||
| 880 | 880 | if ($post_scope === 'user_mngt') { |
| 881 | 881 | $user = DB::queryfirstrow( |
| 882 | 882 | 'SELECT login |
| 883 | - from ' . prefixTable('users') . ' |
|
| 883 | + from ' . prefixTable('users').' |
|
| 884 | 884 | WHERE id=%i', |
| 885 | 885 | $record['qui'] |
| 886 | 886 | ); |
| 887 | 887 | $user_1 = DB::queryfirstrow( |
| 888 | 888 | 'SELECT login |
| 889 | - from ' . prefixTable('users') . ' |
|
| 889 | + from ' . prefixTable('users').' |
|
| 890 | 890 | WHERE id=%i', |
| 891 | 891 | filter_input(INPUT_POST, 'id', FILTER_SANITIZE_NUMBER_INT) |
| 892 | 892 | ); |
@@ -896,7 +896,7 @@ discard block |
||
| 896 | 896 | if ($tmp[0] == 'at_user_initial_pwd_changed') { |
| 897 | 897 | $label = langHdl('log_user_initial_pwd_changed'); |
| 898 | 898 | } elseif ($tmp[0] == 'at_user_email_changed') { |
| 899 | - $label = langHdl('log_user_email_changed') . $tmp[1]; |
|
| 899 | + $label = langHdl('log_user_email_changed').$tmp[1]; |
|
| 900 | 900 | } elseif ($tmp[0] == 'at_user_added') { |
| 901 | 901 | $label = langHdl('log_user_created'); |
| 902 | 902 | } elseif ($tmp[0] == 'at_user_locked') { |
@@ -907,14 +907,14 @@ discard block |
||
| 907 | 907 | $label = langHdl('log_user_pwd_changed'); |
| 908 | 908 | } |
| 909 | 909 | // prepare log |
| 910 | - $logs .= '<tr><td>' . date($SETTINGS['date_format'] . ' ' . $SETTINGS['time_format'], $record['date']) . '</td><td align=\"center\">' . $label . '</td><td align=\"center\">' . $user['login'] . '</td><td align=\"center\"></td></tr>'; |
|
| 910 | + $logs .= '<tr><td>'.date($SETTINGS['date_format'].' '.$SETTINGS['time_format'], $record['date']).'</td><td align=\"center\">'.$label.'</td><td align=\"center\">'.$user['login'].'</td><td align=\"center\"></td></tr>'; |
|
| 911 | 911 | } else { |
| 912 | - $logs .= '<tr><td>' . date($SETTINGS['date_format'] . ' ' . $SETTINGS['time_format'], $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>'; |
|
| 912 | + $logs .= '<tr><td>'.date($SETTINGS['date_format'].' '.$SETTINGS['time_format'], $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>'; |
|
| 913 | 913 | } |
| 914 | 914 | } |
| 915 | 915 | } |
| 916 | 916 | |
| 917 | - echo '[ { "table_logs": "' . ($logs) . '", "pages": "' . ($pages) . '", "error" : "no" } ]'; |
|
| 917 | + echo '[ { "table_logs": "'.($logs).'", "pages": "'.($pages).'", "error" : "no" } ]'; |
|
| 918 | 918 | break; |
| 919 | 919 | |
| 920 | 920 | /* |
@@ -939,14 +939,14 @@ discard block |
||
| 939 | 939 | } else { |
| 940 | 940 | // Get folder id for Admin |
| 941 | 941 | $admin_folder = DB::queryFirstRow( |
| 942 | - 'SELECT id FROM ' . prefixTable('nested_tree') . ' |
|
| 942 | + 'SELECT id FROM '.prefixTable('nested_tree').' |
|
| 943 | 943 | WHERE title = %i AND personal_folder = %i', |
| 944 | 944 | intval($_SESSION['user_id']), |
| 945 | 945 | '1' |
| 946 | 946 | ); |
| 947 | 947 | // Get folder id for User |
| 948 | 948 | $user_folder = DB::queryFirstRow( |
| 949 | - 'SELECT id FROM ' . prefixTable('nested_tree') . ' |
|
| 949 | + 'SELECT id FROM '.prefixTable('nested_tree').' |
|
| 950 | 950 | WHERE title=%i AND personal_folder = %i', |
| 951 | 951 | intval($user_id), |
| 952 | 952 | '1' |
@@ -956,15 +956,15 @@ discard block |
||
| 956 | 956 | // Get each Items in PF |
| 957 | 957 | $rows = DB::query( |
| 958 | 958 | 'SELECT i.pw, i.label, l.id_user |
| 959 | - FROM ' . prefixTable('items') . ' as i |
|
| 960 | - LEFT JOIN ' . prefixTable('log_items') . ' as l ON (l.id_item=i.id) |
|
| 959 | + FROM ' . prefixTable('items').' as i |
|
| 960 | + LEFT JOIN ' . prefixTable('log_items').' as l ON (l.id_item=i.id) |
|
| 961 | 961 | WHERE l.action = %s AND i.perso=%i AND i.id_tree=%i', |
| 962 | 962 | 'at_creation', |
| 963 | 963 | '1', |
| 964 | 964 | intval($folder->id) |
| 965 | 965 | ); |
| 966 | 966 | foreach ($rows as $record) { |
| 967 | - echo $record['label'] . ' - '; |
|
| 967 | + echo $record['label'].' - '; |
|
| 968 | 968 | // Change user |
| 969 | 969 | DB::update( |
| 970 | 970 | prefixTable('log_items'), |
@@ -999,7 +999,7 @@ discard block |
||
| 999 | 999 | // Get info about user to delete |
| 1000 | 1000 | $data_user = DB::queryfirstrow( |
| 1001 | 1001 | 'SELECT admin, isAdministratedByRole, gestionnaire |
| 1002 | - FROM ' . prefixTable('users') . ' |
|
| 1002 | + FROM ' . prefixTable('users').' |
|
| 1003 | 1003 | WHERE id = %i', |
| 1004 | 1004 | $post_user_id |
| 1005 | 1005 | ); |
@@ -1036,7 +1036,7 @@ discard block |
||
| 1036 | 1036 | |
| 1037 | 1037 | // Do |
| 1038 | 1038 | $rows = DB::query( |
| 1039 | - 'SELECT id FROM ' . prefixTable('users') . ' |
|
| 1039 | + 'SELECT id FROM '.prefixTable('users').' |
|
| 1040 | 1040 | WHERE timestamp != %s AND admin != %i', |
| 1041 | 1041 | '', |
| 1042 | 1042 | '1' |
@@ -1045,7 +1045,7 @@ discard block |
||
| 1045 | 1045 | // Get info about user to delete |
| 1046 | 1046 | $data_user = DB::queryfirstrow( |
| 1047 | 1047 | 'SELECT admin, isAdministratedByRole, gestionnaire |
| 1048 | - FROM ' . prefixTable('users') . ' |
|
| 1048 | + FROM ' . prefixTable('users').' |
|
| 1049 | 1049 | WHERE id = %i', |
| 1050 | 1050 | $record['id'] |
| 1051 | 1051 | ); |
@@ -1099,7 +1099,7 @@ discard block |
||
| 1099 | 1099 | // Get info about user |
| 1100 | 1100 | $rowUser = DB::queryfirstrow( |
| 1101 | 1101 | 'SELECT * |
| 1102 | - FROM ' . prefixTable('users') . ' |
|
| 1102 | + FROM ' . prefixTable('users').' |
|
| 1103 | 1103 | WHERE id = %i', |
| 1104 | 1104 | $post_id |
| 1105 | 1105 | ); |
@@ -1117,7 +1117,7 @@ discard block |
||
| 1117 | 1117 | $arrFldAllowed = array(); |
| 1118 | 1118 | |
| 1119 | 1119 | //Build tree |
| 1120 | - $tree = new SplClassLoader('Tree\NestedTree', $SETTINGS['cpassman_dir'] . '/includes/libraries'); |
|
| 1120 | + $tree = new SplClassLoader('Tree\NestedTree', $SETTINGS['cpassman_dir'].'/includes/libraries'); |
|
| 1121 | 1121 | $tree->register(); |
| 1122 | 1122 | $tree = new Tree\NestedTree\NestedTree(prefixTable('nested_tree'), 'id', 'parent_id', 'title'); |
| 1123 | 1123 | |
@@ -1128,7 +1128,7 @@ discard block |
||
| 1128 | 1128 | // array of roles for actual user |
| 1129 | 1129 | $my_functions = explode(';', $_SESSION['fonction_id']); |
| 1130 | 1130 | |
| 1131 | - $rows = DB::query('SELECT id,title,creator_id FROM ' . prefixTable('roles_title')); |
|
| 1131 | + $rows = DB::query('SELECT id,title,creator_id FROM '.prefixTable('roles_title')); |
|
| 1132 | 1132 | foreach ($rows as $record) { |
| 1133 | 1133 | if ( |
| 1134 | 1134 | (int) $_SESSION['is_admin'] === 1 |
@@ -1164,7 +1164,7 @@ discard block |
||
| 1164 | 1164 | $rolesList = array(); |
| 1165 | 1165 | $managedBy = array(); |
| 1166 | 1166 | $selected = ''; |
| 1167 | - $rows = DB::query('SELECT id,title FROM ' . prefixTable('roles_title') . ' ORDER BY title ASC'); |
|
| 1167 | + $rows = DB::query('SELECT id,title FROM '.prefixTable('roles_title').' ORDER BY title ASC'); |
|
| 1168 | 1168 | foreach ($rows as $reccord) { |
| 1169 | 1169 | $rolesList[$reccord['id']] = array('id' => $reccord['id'], 'title' => $reccord['title']); |
| 1170 | 1170 | } |
@@ -1195,7 +1195,7 @@ discard block |
||
| 1195 | 1195 | array_push( |
| 1196 | 1196 | $managedBy, |
| 1197 | 1197 | array( |
| 1198 | - 'title' => langHdl('managers_of') . ' ' . $fonction['title'], |
|
| 1198 | + 'title' => langHdl('managers_of').' '.$fonction['title'], |
|
| 1199 | 1199 | 'id' => $fonction['id'], |
| 1200 | 1200 | 'selected' => $selected, |
| 1201 | 1201 | ) |
@@ -1277,9 +1277,9 @@ discard block |
||
| 1277 | 1277 | |
| 1278 | 1278 | // get USER STATUS |
| 1279 | 1279 | if ($rowUser['disabled'] == 1) { |
| 1280 | - $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>'; |
|
| 1280 | + $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>'; |
|
| 1281 | 1281 | } else { |
| 1282 | - $arrData['info'] = langHdl('user_info_active') . '<br><input type="checkbox" value="lock" class="chk"> ' . langHdl('user_info_lock_question'); |
|
| 1282 | + $arrData['info'] = langHdl('user_info_active').'<br><input type="checkbox" value="lock" class="chk"> '.langHdl('user_info_lock_question'); |
|
| 1283 | 1283 | } |
| 1284 | 1284 | |
| 1285 | 1285 | $arrData['error'] = false; |
@@ -1414,19 +1414,19 @@ discard block |
||
| 1414 | 1414 | |
| 1415 | 1415 | // Empty user |
| 1416 | 1416 | if (empty($post_login) === true) { |
| 1417 | - echo '[ { "error" : "' . langHdl('error_empty_data') . '" } ]'; |
|
| 1417 | + echo '[ { "error" : "'.langHdl('error_empty_data').'" } ]'; |
|
| 1418 | 1418 | break; |
| 1419 | 1419 | } |
| 1420 | 1420 | |
| 1421 | 1421 | // User has email? |
| 1422 | 1422 | if (empty($post_email) === true) { |
| 1423 | - echo '[ { "error" : "' . langHdl('error_no_email') . '" } ]'; |
|
| 1423 | + echo '[ { "error" : "'.langHdl('error_no_email').'" } ]'; |
|
| 1424 | 1424 | break; |
| 1425 | 1425 | } |
| 1426 | 1426 | |
| 1427 | 1427 | // Get info about user to delete |
| 1428 | 1428 | $data_user = DB::queryfirstrow( |
| 1429 | - 'SELECT admin, isAdministratedByRole FROM ' . prefixTable('users') . ' |
|
| 1429 | + 'SELECT admin, isAdministratedByRole FROM '.prefixTable('users').' |
|
| 1430 | 1430 | WHERE id = %i', |
| 1431 | 1431 | $post_id |
| 1432 | 1432 | ); |
@@ -1447,7 +1447,7 @@ discard block |
||
| 1447 | 1447 | ); |
| 1448 | 1448 | // delete personal folder and subfolders |
| 1449 | 1449 | $data = DB::queryfirstrow( |
| 1450 | - 'SELECT id FROM ' . prefixTable('nested_tree') . ' |
|
| 1450 | + 'SELECT id FROM '.prefixTable('nested_tree').' |
|
| 1451 | 1451 | WHERE title = %s AND personal_folder = %i', |
| 1452 | 1452 | $post_id, |
| 1453 | 1453 | '1' |
@@ -1460,7 +1460,7 @@ discard block |
||
| 1460 | 1460 | DB::delete(prefixTable('nested_tree'), 'id = %i AND personal_folder = %i', $folder->id, '1'); |
| 1461 | 1461 | // delete items & logs |
| 1462 | 1462 | $items = DB::query( |
| 1463 | - 'SELECT id FROM ' . prefixTable('items') . ' |
|
| 1463 | + 'SELECT id FROM '.prefixTable('items').' |
|
| 1464 | 1464 | WHERE id_tree=%i AND perso = %i', |
| 1465 | 1465 | $folder->id, |
| 1466 | 1466 | '1' |
@@ -1481,7 +1481,7 @@ discard block |
||
| 1481 | 1481 | } else { |
| 1482 | 1482 | // Get old data about user |
| 1483 | 1483 | $oldData = DB::queryfirstrow( |
| 1484 | - 'SELECT * FROM ' . prefixTable('users') . ' |
|
| 1484 | + 'SELECT * FROM '.prefixTable('users').' |
|
| 1485 | 1485 | WHERE id = %i', |
| 1486 | 1486 | $post_id |
| 1487 | 1487 | ); |
@@ -1510,7 +1510,7 @@ discard block |
||
| 1510 | 1510 | |
| 1511 | 1511 | // update LOG |
| 1512 | 1512 | if ($oldData['email'] !== $post_email) { |
| 1513 | - logEvents($SETTINGS, 'user_mngt', 'at_user_email_changed:' . $oldData['email'], intval($_SESSION['user_id']), $_SESSION['login'], $post_id); |
|
| 1513 | + logEvents($SETTINGS, 'user_mngt', 'at_user_email_changed:'.$oldData['email'], intval($_SESSION['user_id']), $_SESSION['login'], $post_id); |
|
| 1514 | 1514 | } |
| 1515 | 1515 | |
| 1516 | 1516 | if ((int) $oldData['disabled'] !== (int) $post_user_disabled) { |
@@ -1569,7 +1569,7 @@ discard block |
||
| 1569 | 1569 | |
| 1570 | 1570 | // Get info about user to delete |
| 1571 | 1571 | $data_user = DB::queryfirstrow( |
| 1572 | - 'SELECT admin, isAdministratedByRole FROM ' . prefixTable('users') . ' |
|
| 1572 | + 'SELECT admin, isAdministratedByRole FROM '.prefixTable('users').' |
|
| 1573 | 1573 | WHERE id = %i', |
| 1574 | 1574 | $post_id |
| 1575 | 1575 | ); |
@@ -1619,7 +1619,7 @@ discard block |
||
| 1619 | 1619 | } |
| 1620 | 1620 | |
| 1621 | 1621 | DB::queryfirstrow( |
| 1622 | - 'SELECT * FROM ' . prefixTable('users') . ' |
|
| 1622 | + 'SELECT * FROM '.prefixTable('users').' |
|
| 1623 | 1623 | WHERE login = %s', |
| 1624 | 1624 | filter_input(INPUT_POST, 'login', FILTER_SANITIZE_STRING) |
| 1625 | 1625 | ); |
@@ -1668,14 +1668,14 @@ discard block |
||
| 1668 | 1668 | $arrData = array(); |
| 1669 | 1669 | |
| 1670 | 1670 | //Build tree |
| 1671 | - $tree = new SplClassLoader('Tree\NestedTree', $SETTINGS['cpassman_dir'] . '/includes/libraries'); |
|
| 1671 | + $tree = new SplClassLoader('Tree\NestedTree', $SETTINGS['cpassman_dir'].'/includes/libraries'); |
|
| 1672 | 1672 | $tree->register(); |
| 1673 | 1673 | $tree = new Tree\NestedTree\NestedTree(prefixTable('nested_tree'), 'id', 'parent_id', 'title'); |
| 1674 | 1674 | |
| 1675 | 1675 | // get User info |
| 1676 | 1676 | $rowUser = DB::queryFirstRow( |
| 1677 | 1677 | 'SELECT login, name, lastname, email, disabled, fonction_id, groupes_interdits, groupes_visibles, isAdministratedByRole, avatar_thumb |
| 1678 | - FROM ' . prefixTable('users') . ' |
|
| 1678 | + FROM ' . prefixTable('users').' |
|
| 1679 | 1679 | WHERE id = %i', |
| 1680 | 1680 | $post_id |
| 1681 | 1681 | ); |
@@ -1694,7 +1694,7 @@ discard block |
||
| 1694 | 1694 | // refine folders based upon roles |
| 1695 | 1695 | $rows = DB::query( |
| 1696 | 1696 | 'SELECT folder_id, type |
| 1697 | - FROM ' . prefixTable('roles_values') . ' |
|
| 1697 | + FROM ' . prefixTable('roles_values').' |
|
| 1698 | 1698 | WHERE role_id IN %ls |
| 1699 | 1699 | ORDER BY folder_id ASC', |
| 1700 | 1700 | $arrData['functions'] |
@@ -1723,7 +1723,7 @@ discard block |
||
| 1723 | 1723 | // get folder name |
| 1724 | 1724 | $row = DB::queryFirstRow( |
| 1725 | 1725 | 'SELECT title, nlevel, id |
| 1726 | - FROM ' . prefixTable('nested_tree') . ' |
|
| 1726 | + FROM ' . prefixTable('nested_tree').' |
|
| 1727 | 1727 | WHERE id = %i', |
| 1728 | 1728 | $fld['id'] |
| 1729 | 1729 | ); |
@@ -1736,37 +1736,37 @@ discard block |
||
| 1736 | 1736 | |
| 1737 | 1737 | // manage right icon |
| 1738 | 1738 | if ($fld['type'] == 'W') { |
| 1739 | - $label = '<i class="fas fa-indent infotip text-success mr-2" title="' . langHdl('write') . '"></i>' . |
|
| 1740 | - '<i class="fas fa-edit infotip text-success mr-2" title="' . langHdl('edit') . '"></i>' . |
|
| 1741 | - '<i class="fas fa-eraser infotip text-success" title="' . langHdl('delete') . '"></i>'; |
|
| 1739 | + $label = '<i class="fas fa-indent infotip text-success mr-2" title="'.langHdl('write').'"></i>'. |
|
| 1740 | + '<i class="fas fa-edit infotip text-success mr-2" title="'.langHdl('edit').'"></i>'. |
|
| 1741 | + '<i class="fas fa-eraser infotip text-success" title="'.langHdl('delete').'"></i>'; |
|
| 1742 | 1742 | } elseif ($fld['type'] == 'ND') { |
| 1743 | - $label = '<i class="fas fa-indent infotip text-warning mr-2" title="' . langHdl('write') . '"></i>' . |
|
| 1744 | - '<i class="fas fa-edit infotip text-success mr-2" title="' . langHdl('edit') . '"></i>' . |
|
| 1745 | - '<i class="fas fa-eraser infotip text-danger" title="' . langHdl('no_delete') . '"></i>'; |
|
| 1743 | + $label = '<i class="fas fa-indent infotip text-warning mr-2" title="'.langHdl('write').'"></i>'. |
|
| 1744 | + '<i class="fas fa-edit infotip text-success mr-2" title="'.langHdl('edit').'"></i>'. |
|
| 1745 | + '<i class="fas fa-eraser infotip text-danger" title="'.langHdl('no_delete').'"></i>'; |
|
| 1746 | 1746 | } elseif ($fld['type'] == 'NE') { |
| 1747 | - $label = '<i class="fas fa-indent infotip text-warning mr-2" title="' . langHdl('write') . '"></i>' . |
|
| 1748 | - '<i class="fas fa-edit infotip text-danger mr-2" title="' . langHdl('no_edit') . '"></i>' . |
|
| 1749 | - '<i class="fas fa-eraser infotip text-success" title="' . langHdl('delete') . '"></i>'; |
|
| 1747 | + $label = '<i class="fas fa-indent infotip text-warning mr-2" title="'.langHdl('write').'"></i>'. |
|
| 1748 | + '<i class="fas fa-edit infotip text-danger mr-2" title="'.langHdl('no_edit').'"></i>'. |
|
| 1749 | + '<i class="fas fa-eraser infotip text-success" title="'.langHdl('delete').'"></i>'; |
|
| 1750 | 1750 | } elseif ($fld['type'] == 'NDNE') { |
| 1751 | - $label = '<i class="fas fa-indent infotip text-warning mr-2" title="' . langHdl('write') . '"></i>' . |
|
| 1752 | - '<i class="fas fa-edit infotip text-danger mr-2" title="' . langHdl('no_edit') . '"></i>' . |
|
| 1753 | - '<i class="fas fa-eraser infotip text-danger" title="' . langHdl('no_delete') . '"></i>'; |
|
| 1751 | + $label = '<i class="fas fa-indent infotip text-warning mr-2" title="'.langHdl('write').'"></i>'. |
|
| 1752 | + '<i class="fas fa-edit infotip text-danger mr-2" title="'.langHdl('no_edit').'"></i>'. |
|
| 1753 | + '<i class="fas fa-eraser infotip text-danger" title="'.langHdl('no_delete').'"></i>'; |
|
| 1754 | 1754 | } else { |
| 1755 | 1755 | $color = '#FEBC11'; |
| 1756 | 1756 | $allowed = 'R'; |
| 1757 | 1757 | $title = langHdl('read'); |
| 1758 | - $label = '<i class="fas fa-eye infotip text-info mr-2" title="' . langHdl('read') . '"></i>'; |
|
| 1758 | + $label = '<i class="fas fa-eye infotip text-info mr-2" title="'.langHdl('read').'"></i>'; |
|
| 1759 | 1759 | } |
| 1760 | 1760 | |
| 1761 | - $html .= '<tr><td>' . $ident . $row['title'] . |
|
| 1762 | - ' <small>[' . $row['id'] . ']</small></td><td>' . $label . '</td></tr>'; |
|
| 1761 | + $html .= '<tr><td>'.$ident.$row['title']. |
|
| 1762 | + ' <small>['.$row['id'].']</small></td><td>'.$label.'</td></tr>'; |
|
| 1763 | 1763 | break; |
| 1764 | 1764 | } |
| 1765 | 1765 | } |
| 1766 | 1766 | } |
| 1767 | 1767 | |
| 1768 | - $html_full = '<table id="table-folders" class="table table-bordered table-striped dt-responsive nowrap" style="width:100%"><tbody>' . |
|
| 1769 | - $html . '</tbody></table>'; |
|
| 1768 | + $html_full = '<table id="table-folders" class="table table-bordered table-striped dt-responsive nowrap" style="width:100%"><tbody>'. |
|
| 1769 | + $html.'</tbody></table>'; |
|
| 1770 | 1770 | } else { |
| 1771 | 1771 | $html_full = ''; |
| 1772 | 1772 | } |
@@ -1812,7 +1812,7 @@ discard block |
||
| 1812 | 1812 | if (!$_SESSION['is_admin'] && !$_SESSION['user_can_manage_all_users']) { |
| 1813 | 1813 | $rows = DB::query( |
| 1814 | 1814 | 'SELECT * |
| 1815 | - FROM ' . prefixTable('users') . ' |
|
| 1815 | + FROM ' . prefixTable('users').' |
|
| 1816 | 1816 | WHERE admin = %i AND isAdministratedByRole IN %ls', |
| 1817 | 1817 | '0', |
| 1818 | 1818 | array_filter($_SESSION['user_roles']) |
@@ -1820,7 +1820,7 @@ discard block |
||
| 1820 | 1820 | } else { |
| 1821 | 1821 | $rows = DB::query( |
| 1822 | 1822 | 'SELECT * |
| 1823 | - FROM ' . prefixTable('users') . ' |
|
| 1823 | + FROM ' . prefixTable('users').' |
|
| 1824 | 1824 | WHERE admin = %i', |
| 1825 | 1825 | '0' |
| 1826 | 1826 | ); |
@@ -1832,7 +1832,7 @@ discard block |
||
| 1832 | 1832 | $groupIds = []; |
| 1833 | 1833 | foreach (explode(';', $record['fonction_id']) as $group) { |
| 1834 | 1834 | $tmp = DB::queryfirstrow( |
| 1835 | - 'SELECT id, title FROM ' . prefixTable('roles_title') . ' |
|
| 1835 | + 'SELECT id, title FROM '.prefixTable('roles_title').' |
|
| 1836 | 1836 | WHERE id = %i', |
| 1837 | 1837 | $group |
| 1838 | 1838 | ); |
@@ -1842,7 +1842,7 @@ discard block |
||
| 1842 | 1842 | |
| 1843 | 1843 | // Get managed_by |
| 1844 | 1844 | $managedBy = DB::queryfirstrow( |
| 1845 | - 'SELECT id, title FROM ' . prefixTable('roles_title') . ' |
|
| 1845 | + 'SELECT id, title FROM '.prefixTable('roles_title').' |
|
| 1846 | 1846 | WHERE id = %i', |
| 1847 | 1847 | $record['isAdministratedByRole'] |
| 1848 | 1848 | ); |
@@ -1852,7 +1852,7 @@ discard block |
||
| 1852 | 1852 | $foldersAllowedIds = []; |
| 1853 | 1853 | foreach (explode(';', $record['groupes_visibles']) as $role) { |
| 1854 | 1854 | $tmp = DB::queryfirstrow( |
| 1855 | - 'SELECT id, title FROM ' . prefixTable('nested_tree') . ' |
|
| 1855 | + 'SELECT id, title FROM '.prefixTable('nested_tree').' |
|
| 1856 | 1856 | WHERE id = %i', |
| 1857 | 1857 | $role |
| 1858 | 1858 | ); |
@@ -1865,7 +1865,7 @@ discard block |
||
| 1865 | 1865 | $foldersForbiddenIds = []; |
| 1866 | 1866 | foreach (explode(';', $record['groupes_interdits']) as $role) { |
| 1867 | 1867 | $tmp = DB::queryfirstrow( |
| 1868 | - 'SELECT id, title FROM ' . prefixTable('nested_tree') . ' |
|
| 1868 | + 'SELECT id, title FROM '.prefixTable('nested_tree').' |
|
| 1869 | 1869 | WHERE id = %i', |
| 1870 | 1870 | $role |
| 1871 | 1871 | ); |
@@ -1961,7 +1961,7 @@ discard block |
||
| 1961 | 1961 | |
| 1962 | 1962 | // Get info about user |
| 1963 | 1963 | $data_user = DB::queryfirstrow( |
| 1964 | - 'SELECT admin, isAdministratedByRole FROM ' . prefixTable('users') . ' |
|
| 1964 | + 'SELECT admin, isAdministratedByRole FROM '.prefixTable('users').' |
|
| 1965 | 1965 | WHERE id = %i', |
| 1966 | 1966 | $post_source_id |
| 1967 | 1967 | ); |
@@ -2121,14 +2121,14 @@ discard block |
||
| 2121 | 2121 | if (empty($post_context) === false && $post_context = 'add_one_role_to_user') { |
| 2122 | 2122 | $data_user = DB::queryfirstrow( |
| 2123 | 2123 | 'SELECT fonction_id |
| 2124 | - FROM ' . prefixTable('users') . ' |
|
| 2124 | + FROM ' . prefixTable('users').' |
|
| 2125 | 2125 | WHERE id = %i', |
| 2126 | 2126 | $post_user_id |
| 2127 | 2127 | ); |
| 2128 | 2128 | |
| 2129 | 2129 | if ($data_user) { |
| 2130 | 2130 | // Ensure array is unique |
| 2131 | - $post_new_value = str_replace(',', ';', $data_user['fonction_id']) . ';' . $post_new_value; |
|
| 2131 | + $post_new_value = str_replace(',', ';', $data_user['fonction_id']).';'.$post_new_value; |
|
| 2132 | 2132 | $post_new_value = implode(';', array_unique(explode(';', $post_new_value))); |
| 2133 | 2133 | } else { |
| 2134 | 2134 | // User not found |
@@ -2183,7 +2183,7 @@ discard block |
||
| 2183 | 2183 | if (filter_input(INPUT_POST, 'step', FILTER_SANITIZE_STRING) === 'refresh') { |
| 2184 | 2184 | $record = DB::queryFirstRow( |
| 2185 | 2185 | 'SELECT user_ip_lastdate |
| 2186 | - FROM ' . prefixTable('users') . ' |
|
| 2186 | + FROM ' . prefixTable('users').' |
|
| 2187 | 2187 | WHERE id = %i', |
| 2188 | 2188 | $_SESSION['user_id'] |
| 2189 | 2189 | ); |
@@ -2261,7 +2261,7 @@ discard block |
||
| 2261 | 2261 | $debug_ldap = $ldap_suffix = ''; |
| 2262 | 2262 | |
| 2263 | 2263 | // Get list of existing Roles in Teampass |
| 2264 | - $rows = DB::query('SELECT id,title FROM ' . prefixTable('roles_title')); |
|
| 2264 | + $rows = DB::query('SELECT id,title FROM '.prefixTable('roles_title')); |
|
| 2265 | 2265 | foreach ($rows as $record) { |
| 2266 | 2266 | array_push( |
| 2267 | 2267 | $teampassRoles, |
@@ -2274,35 +2274,35 @@ discard block |
||
| 2274 | 2274 | |
| 2275 | 2275 | //Multiple Domain Names |
| 2276 | 2276 | if (strpos(html_entity_decode($dataReceived['username']), '\\') === true) { |
| 2277 | - $ldap_suffix = '@' . substr(html_entity_decode($dataReceived['username']), 0, strpos(html_entity_decode($dataReceived['username']), '\\')); |
|
| 2277 | + $ldap_suffix = '@'.substr(html_entity_decode($dataReceived['username']), 0, strpos(html_entity_decode($dataReceived['username']), '\\')); |
|
| 2278 | 2278 | $dataReceived['username'] = substr(html_entity_decode($dataReceived['username']), strpos(html_entity_decode($dataReceived['username']), '\\') + 1); |
| 2279 | 2279 | } |
| 2280 | 2280 | if ($SETTINGS['ldap_type'] === 'posix-search') { |
| 2281 | 2281 | $ldapURIs = ''; |
| 2282 | 2282 | foreach (explode(',', $SETTINGS['ldap_domain_controler']) as $domainControler) { |
| 2283 | 2283 | if ((int) $SETTINGS['ldap_ssl'] === 1) { |
| 2284 | - $ldapURIs .= 'ldaps://' . $domainControler . ':' . $SETTINGS['ldap_port'] . ' '; |
|
| 2284 | + $ldapURIs .= 'ldaps://'.$domainControler.':'.$SETTINGS['ldap_port'].' '; |
|
| 2285 | 2285 | } else { |
| 2286 | - $ldapURIs .= 'ldap://' . $domainControler . ':' . $SETTINGS['ldap_port'] . ' '; |
|
| 2286 | + $ldapURIs .= 'ldap://'.$domainControler.':'.$SETTINGS['ldap_port'].' '; |
|
| 2287 | 2287 | } |
| 2288 | 2288 | } |
| 2289 | 2289 | |
| 2290 | - $debug_ldap .= 'LDAP URIs : ' . $ldapURIs . '<br/>'; |
|
| 2290 | + $debug_ldap .= 'LDAP URIs : '.$ldapURIs.'<br/>'; |
|
| 2291 | 2291 | $ldapconn = ldap_connect($ldapURIs); |
| 2292 | 2292 | |
| 2293 | 2293 | if ($SETTINGS['ldap_ssl']) { |
| 2294 | 2294 | ldap_start_tls($ldapconn); |
| 2295 | 2295 | } |
| 2296 | 2296 | |
| 2297 | - $debug_ldap .= 'LDAP connection : ' . ($ldapconn ? 'Connected' : 'Failed') . '<br/>'; |
|
| 2297 | + $debug_ldap .= 'LDAP connection : '.($ldapconn ? 'Connected' : 'Failed').'<br/>'; |
|
| 2298 | 2298 | |
| 2299 | 2299 | if ($ldapconn) { |
| 2300 | - $debug_ldap .= 'DN : ' . $SETTINGS['ldap_bind_dn'] . ' -- ' . $SETTINGS['ldap_bind_passwd'] . '<br/>'; |
|
| 2300 | + $debug_ldap .= 'DN : '.$SETTINGS['ldap_bind_dn'].' -- '.$SETTINGS['ldap_bind_passwd'].'<br/>'; |
|
| 2301 | 2301 | ldap_set_option($ldapconn, LDAP_OPT_PROTOCOL_VERSION, 3); |
| 2302 | 2302 | ldap_set_option($ldapconn, LDAP_OPT_REFERRALS, 0); |
| 2303 | 2303 | $ldapbind = ldap_bind($ldapconn, $SETTINGS['ldap_bind_dn'], $SETTINGS['ldap_bind_passwd']); |
| 2304 | 2304 | |
| 2305 | - $debug_ldap .= 'LDAP bind : ' . ($ldapbind ? 'Bound' : 'Failed') . '<br/>'; |
|
| 2305 | + $debug_ldap .= 'LDAP bind : '.($ldapbind ? 'Bound' : 'Failed').'<br/>'; |
|
| 2306 | 2306 | |
| 2307 | 2307 | if ($ldapbind) { |
| 2308 | 2308 | //$filter = '(&(' . $SETTINGS['ldap_user_attribute'] . '=' . $dataReceived['username'] . ')(objectClass=' . $SETTINGS['ldap_object_class'] . '))'; |
@@ -2340,7 +2340,7 @@ discard block |
||
| 2340 | 2340 | // Get his ID |
| 2341 | 2341 | $user = DB::queryfirstrow( |
| 2342 | 2342 | 'SELECT id, fonction_id, auth_type |
| 2343 | - FROM ' . prefixTable('users') . ' |
|
| 2343 | + FROM ' . prefixTable('users').' |
|
| 2344 | 2344 | WHERE login = %s', |
| 2345 | 2345 | $userLogin |
| 2346 | 2346 | ); |
@@ -2355,7 +2355,7 @@ discard block |
||
| 2355 | 2355 | foreach (explode(';', $user['fonction_id']) as $group) { |
| 2356 | 2356 | $entry = DB::queryfirstrow( |
| 2357 | 2357 | 'SELECT title |
| 2358 | - FROM ' . prefixTable('roles_title') . ' |
|
| 2358 | + FROM ' . prefixTable('roles_title').' |
|
| 2359 | 2359 | WHERE id = %i', |
| 2360 | 2360 | $group |
| 2361 | 2361 | ); |
@@ -2431,20 +2431,20 @@ discard block |
||
| 2431 | 2431 | $debug_ldap .= 'Error - Could not connect to server!'; |
| 2432 | 2432 | } |
| 2433 | 2433 | } else { |
| 2434 | - $debug_ldap .= 'Get all ldap params: <br/>' . |
|
| 2435 | - ' - base_dn : ' . $SETTINGS['ldap_domain_dn'] . '<br/>' . |
|
| 2436 | - ' - account_suffix : ' . $SETTINGS['ldap_suffix'] . '<br/>' . |
|
| 2437 | - ' - domain_controllers : ' . $SETTINGS['ldap_domain_controler'] . '<br/>' . |
|
| 2438 | - ' - ad_port : ' . $SETTINGS['ldap_port'] . '<br/>' . |
|
| 2439 | - ' - use_ssl : ' . $SETTINGS['ldap_ssl'] . '<br/>' . |
|
| 2440 | - ' - use_tls : ' . $SETTINGS['ldap_tls'] . '<br/>*********<br/>'; |
|
| 2434 | + $debug_ldap .= 'Get all ldap params: <br/>'. |
|
| 2435 | + ' - base_dn : '.$SETTINGS['ldap_domain_dn'].'<br/>'. |
|
| 2436 | + ' - account_suffix : '.$SETTINGS['ldap_suffix'].'<br/>'. |
|
| 2437 | + ' - domain_controllers : '.$SETTINGS['ldap_domain_controler'].'<br/>'. |
|
| 2438 | + ' - ad_port : '.$SETTINGS['ldap_port'].'<br/>'. |
|
| 2439 | + ' - use_ssl : '.$SETTINGS['ldap_ssl'].'<br/>'. |
|
| 2440 | + ' - use_tls : '.$SETTINGS['ldap_tls'].'<br/>*********<br/>'; |
|
| 2441 | 2441 | |
| 2442 | 2442 | $adldap = new SplClassLoader('adLDAP', '../includes/libraries/LDAP'); |
| 2443 | 2443 | $adldap->register(); |
| 2444 | 2444 | |
| 2445 | 2445 | // Posix style LDAP handles user searches a bit differently |
| 2446 | 2446 | if ($SETTINGS['ldap_type'] === 'posix') { |
| 2447 | - $ldap_suffix = ',' . $SETTINGS['ldap_suffix'] . ',' . $SETTINGS['ldap_domain_dn']; |
|
| 2447 | + $ldap_suffix = ','.$SETTINGS['ldap_suffix'].','.$SETTINGS['ldap_domain_dn']; |
|
| 2448 | 2448 | } elseif ($SETTINGS['ldap_type'] === 'windows' && $ldap_suffix === '') { //Multiple Domain Names |
| 2449 | 2449 | $ldap_suffix = $SETTINGS['ldap_suffix']; |
| 2450 | 2450 | } |
@@ -2459,11 +2459,11 @@ discard block |
||
| 2459 | 2459 | ) |
| 2460 | 2460 | ); |
| 2461 | 2461 | |
| 2462 | - $debug_ldap .= 'Create new adldap object : ' . $adldap->getLastError() . '<br/><br/>'; |
|
| 2462 | + $debug_ldap .= 'Create new adldap object : '.$adldap->getLastError().'<br/><br/>'; |
|
| 2463 | 2463 | |
| 2464 | 2464 | // openLDAP expects an attribute=value pair |
| 2465 | 2465 | if ($SETTINGS['ldap_type'] === 'posix') { |
| 2466 | - $auth_username = $SETTINGS['ldap_user_attribute'] . '=' . $dataReceived['username']; |
|
| 2466 | + $auth_username = $SETTINGS['ldap_user_attribute'].'='.$dataReceived['username']; |
|
| 2467 | 2467 | } else { |
| 2468 | 2468 | $auth_username = $dataReceived['username']; |
| 2469 | 2469 | } |
@@ -2475,8 +2475,8 @@ discard block |
||
| 2475 | 2475 | $ldapConnection = 'Not possible to get connected with this user'; |
| 2476 | 2476 | } |
| 2477 | 2477 | |
| 2478 | - $debug_ldap .= 'After authenticate : ' . $adldap->getLastError() . '<br/><br/>' . |
|
| 2479 | - 'ldap status : ' . $ldapConnection; //Debug |
|
| 2478 | + $debug_ldap .= 'After authenticate : '.$adldap->getLastError().'<br/><br/>'. |
|
| 2479 | + 'ldap status : '.$ldapConnection; //Debug |
|
| 2480 | 2480 | } |
| 2481 | 2481 | |
| 2482 | 2482 | echo prepareExchangedData( |
@@ -2533,7 +2533,7 @@ discard block |
||
| 2533 | 2533 | // Check if user already exists |
| 2534 | 2534 | $data = DB::query( |
| 2535 | 2535 | 'SELECT id, fonction_id, groupes_interdits, groupes_visibles |
| 2536 | - FROM ' . prefixTable('users') . ' |
|
| 2536 | + FROM ' . prefixTable('users').' |
|
| 2537 | 2537 | WHERE login = %s', |
| 2538 | 2538 | $post_login |
| 2539 | 2539 | ); |
@@ -2632,7 +2632,7 @@ discard block |
||
| 2632 | 2632 | ); |
| 2633 | 2633 | |
| 2634 | 2634 | // Rebuild tree |
| 2635 | - $tree = new SplClassLoader('Tree\NestedTree', $SETTINGS['cpassman_dir'] . '/includes/libraries'); |
|
| 2635 | + $tree = new SplClassLoader('Tree\NestedTree', $SETTINGS['cpassman_dir'].'/includes/libraries'); |
|
| 2636 | 2636 | $tree->register(); |
| 2637 | 2637 | $tree = new Tree\NestedTree\NestedTree(prefixTable('nested_tree'), 'id', 'parent_id', 'title'); |
| 2638 | 2638 | $tree->rebuild(); |
@@ -2686,7 +2686,7 @@ discard block |
||
| 2686 | 2686 | // Check if user already exists |
| 2687 | 2687 | $data = DB::query( |
| 2688 | 2688 | 'SELECT id |
| 2689 | - FROM ' . prefixTable('users') . ' |
|
| 2689 | + FROM ' . prefixTable('users').' |
|
| 2690 | 2690 | WHERE id = %i', |
| 2691 | 2691 | $post_id |
| 2692 | 2692 | ); |
@@ -2762,7 +2762,7 @@ discard block |
||
| 2762 | 2762 | // Check if user already exists |
| 2763 | 2763 | $userInfo = DB::queryfirstrow( |
| 2764 | 2764 | 'SELECT id, private_key, public_key |
| 2765 | - FROM ' . prefixTable('users') . ' |
|
| 2765 | + FROM ' . prefixTable('users').' |
|
| 2766 | 2766 | WHERE id = %i', |
| 2767 | 2767 | $post_userid |
| 2768 | 2768 | ); |
@@ -2797,7 +2797,7 @@ discard block |
||
| 2797 | 2797 | if (count($_SESSION['personal_folders']) > 0) { |
| 2798 | 2798 | DB::query( |
| 2799 | 2799 | 'SELECT id |
| 2800 | - FROM ' . prefixTable('items') . ' |
|
| 2800 | + FROM ' . prefixTable('items').' |
|
| 2801 | 2801 | WHERE id_tree IN %ls', |
| 2802 | 2802 | $_SESSION['personal_folders'] |
| 2803 | 2803 | ); |
@@ -2845,7 +2845,7 @@ discard block |
||
| 2845 | 2845 | |
| 2846 | 2846 | // Get info about user |
| 2847 | 2847 | $data_user = DB::queryfirstrow( |
| 2848 | - 'SELECT admin, isAdministratedByRole FROM ' . prefixTable('users') . ' |
|
| 2848 | + 'SELECT admin, isAdministratedByRole FROM '.prefixTable('users').' |
|
| 2849 | 2849 | WHERE id = %i', |
| 2850 | 2850 | $value[1] |
| 2851 | 2851 | ); |
@@ -2878,7 +2878,7 @@ discard block |
||
| 2878 | 2878 | logEvents( |
| 2879 | 2879 | $SETTINGS, |
| 2880 | 2880 | 'user_mngt', |
| 2881 | - 'at_user_new_' . $value[0] . ':' . $value[1], |
|
| 2881 | + 'at_user_new_'.$value[0].':'.$value[1], |
|
| 2882 | 2882 | $_SESSION['user_id'], |
| 2883 | 2883 | $_SESSION['login'], |
| 2884 | 2884 | filter_input(INPUT_POST, 'id', FILTER_SANITIZE_STRING) |
@@ -2910,7 +2910,7 @@ discard block |
||
| 2910 | 2910 | |
| 2911 | 2911 | // Get info about user |
| 2912 | 2912 | $data_user = DB::queryfirstrow( |
| 2913 | - 'SELECT admin, isAdministratedByRole FROM ' . prefixTable('users') . ' |
|
| 2913 | + 'SELECT admin, isAdministratedByRole FROM '.prefixTable('users').' |
|
| 2914 | 2914 | WHERE id = %i', |
| 2915 | 2915 | $value[1] |
| 2916 | 2916 | ); |