@@ -43,11 +43,11 @@ |
||
| 43 | 43 | } |
| 44 | 44 | |
| 45 | 45 | /* do checks */ |
| 46 | -require_once $SETTINGS['cpassman_dir'] . '/sources/checks.php'; |
|
| 46 | +require_once $SETTINGS['cpassman_dir'].'/sources/checks.php'; |
|
| 47 | 47 | if (checkUser($_SESSION['user_id'], $_SESSION['key'], 'profile', $SETTINGS) === false) { |
| 48 | 48 | $_SESSION['error']['code'] = ERR_NOT_ALLOWED; |
| 49 | 49 | //not allowed page |
| 50 | - include $SETTINGS['cpassman_dir'] . '/error.php'; |
|
| 50 | + include $SETTINGS['cpassman_dir'].'/error.php'; |
|
| 51 | 51 | exit; |
| 52 | 52 | } |
| 53 | 53 | ?> |
@@ -43,11 +43,11 @@ |
||
| 43 | 43 | } |
| 44 | 44 | |
| 45 | 45 | /* do checks */ |
| 46 | -require_once $SETTINGS['cpassman_dir'] . '/sources/checks.php'; |
|
| 46 | +require_once $SETTINGS['cpassman_dir'].'/sources/checks.php'; |
|
| 47 | 47 | if (checkUser($_SESSION['user_id'], $_SESSION['key'], 'profile', $SETTINGS) === false) { |
| 48 | 48 | $_SESSION['error']['code'] = ERR_NOT_ALLOWED; |
| 49 | 49 | //not allowed page |
| 50 | - include $SETTINGS['cpassman_dir'] . '/error.php'; |
|
| 50 | + include $SETTINGS['cpassman_dir'].'/error.php'; |
|
| 51 | 51 | exit; |
| 52 | 52 | } |
| 53 | 53 | ?> |
@@ -43,11 +43,11 @@ |
||
| 43 | 43 | } |
| 44 | 44 | |
| 45 | 45 | /* do checks */ |
| 46 | -require_once $SETTINGS['cpassman_dir'] . '/sources/checks.php'; |
|
| 46 | +require_once $SETTINGS['cpassman_dir'].'/sources/checks.php'; |
|
| 47 | 47 | if (checkUser($_SESSION['user_id'], $_SESSION['key'], 'profile', $SETTINGS) === false) { |
| 48 | 48 | $_SESSION['error']['code'] = ERR_NOT_ALLOWED; |
| 49 | 49 | //not allowed page |
| 50 | - include $SETTINGS['cpassman_dir'] . '/error.php'; |
|
| 50 | + include $SETTINGS['cpassman_dir'].'/error.php'; |
|
| 51 | 51 | exit; |
| 52 | 52 | } |
| 53 | 53 | ?> |
@@ -43,11 +43,11 @@ |
||
| 43 | 43 | } |
| 44 | 44 | |
| 45 | 45 | /* do checks */ |
| 46 | -require_once $SETTINGS['cpassman_dir'] . '/sources/checks.php'; |
|
| 46 | +require_once $SETTINGS['cpassman_dir'].'/sources/checks.php'; |
|
| 47 | 47 | if (checkUser($_SESSION['user_id'], $_SESSION['key'], 'profile', $SETTINGS) === false) { |
| 48 | 48 | $_SESSION['error']['code'] = ERR_NOT_ALLOWED; |
| 49 | 49 | //not allowed page |
| 50 | - include $SETTINGS['cpassman_dir'] . '/error.php'; |
|
| 50 | + include $SETTINGS['cpassman_dir'].'/error.php'; |
|
| 51 | 51 | exit; |
| 52 | 52 | } |
| 53 | 53 | ?> |
@@ -43,16 +43,16 @@ |
||
| 43 | 43 | } |
| 44 | 44 | |
| 45 | 45 | /* do checks */ |
| 46 | -require_once $SETTINGS['cpassman_dir'] . '/sources/checks.php'; |
|
| 46 | +require_once $SETTINGS['cpassman_dir'].'/sources/checks.php'; |
|
| 47 | 47 | if (checkUser($_SESSION['user_id'], $_SESSION['key'], curPage($SETTINGS), $SETTINGS) === false) { |
| 48 | 48 | $_SESSION['error']['code'] = ERR_NOT_ALLOWED; |
| 49 | 49 | //not allowed page |
| 50 | - include $SETTINGS['cpassman_dir'] . '/error.php'; |
|
| 50 | + include $SETTINGS['cpassman_dir'].'/error.php'; |
|
| 51 | 51 | exit; |
| 52 | 52 | } |
| 53 | 53 | |
| 54 | 54 | // Load |
| 55 | -require_once $SETTINGS['cpassman_dir'] . '/sources/main.functions.php'; |
|
| 55 | +require_once $SETTINGS['cpassman_dir'].'/sources/main.functions.php'; |
|
| 56 | 56 | |
| 57 | 57 | ?> |
| 58 | 58 | |
@@ -2226,7 +2226,7 @@ |
||
| 2226 | 2226 | * <tt>exec("find ".$path." -type d -exec chmod 755 {} \;");</tt> |
| 2227 | 2227 | * |
| 2228 | 2228 | * @author Jeppe Toustrup (tenzer at tenzer dot dk) |
| 2229 | - * |
|
| 2229 | + * |
|
| 2230 | 2230 | * @param string $path An either relative or absolute path to a file or directory which should be processed. |
| 2231 | 2231 | * @param int $filePerm The permissions any found files should get. |
| 2232 | 2232 | * @param int $dirPerm The permissions any found folder should get. |
@@ -122,29 +122,29 @@ discard block |
||
| 122 | 122 | */ |
| 123 | 123 | function cryption(string $message, string $ascii_key, string $type, array $SETTINGS): array |
| 124 | 124 | { |
| 125 | - $ascii_key = empty($ascii_key) === true ? file_get_contents(SECUREPATH . '/teampass-seckey.txt') : $ascii_key; |
|
| 125 | + $ascii_key = empty($ascii_key) === true ? file_get_contents(SECUREPATH.'/teampass-seckey.txt') : $ascii_key; |
|
| 126 | 126 | $err = false; |
| 127 | 127 | // load PhpEncryption library |
| 128 | 128 | if (isset($SETTINGS['cpassman_dir']) === false || empty($SETTINGS['cpassman_dir']) === true) { |
| 129 | 129 | $path = '../includes/libraries/Encryption/Encryption/'; |
| 130 | 130 | } else { |
| 131 | - $path = $SETTINGS['cpassman_dir'] . '/includes/libraries/Encryption/Encryption/'; |
|
| 132 | - } |
|
| 133 | - |
|
| 134 | - include_once $path . 'Exception/CryptoException.php'; |
|
| 135 | - include_once $path . 'Exception/BadFormatException.php'; |
|
| 136 | - include_once $path . 'Exception/EnvironmentIsBrokenException.php'; |
|
| 137 | - include_once $path . 'Exception/IOException.php'; |
|
| 138 | - include_once $path . 'Exception/WrongKeyOrModifiedCiphertextException.php'; |
|
| 139 | - include_once $path . 'Crypto.php'; |
|
| 140 | - include_once $path . 'Encoding.php'; |
|
| 141 | - include_once $path . 'DerivedKeys.php'; |
|
| 142 | - include_once $path . 'Key.php'; |
|
| 143 | - include_once $path . 'KeyOrPassword.php'; |
|
| 144 | - include_once $path . 'File.php'; |
|
| 145 | - include_once $path . 'RuntimeTests.php'; |
|
| 146 | - include_once $path . 'KeyProtectedByPassword.php'; |
|
| 147 | - include_once $path . 'Core.php'; |
|
| 131 | + $path = $SETTINGS['cpassman_dir'].'/includes/libraries/Encryption/Encryption/'; |
|
| 132 | + } |
|
| 133 | + |
|
| 134 | + include_once $path.'Exception/CryptoException.php'; |
|
| 135 | + include_once $path.'Exception/BadFormatException.php'; |
|
| 136 | + include_once $path.'Exception/EnvironmentIsBrokenException.php'; |
|
| 137 | + include_once $path.'Exception/IOException.php'; |
|
| 138 | + include_once $path.'Exception/WrongKeyOrModifiedCiphertextException.php'; |
|
| 139 | + include_once $path.'Crypto.php'; |
|
| 140 | + include_once $path.'Encoding.php'; |
|
| 141 | + include_once $path.'DerivedKeys.php'; |
|
| 142 | + include_once $path.'Key.php'; |
|
| 143 | + include_once $path.'KeyOrPassword.php'; |
|
| 144 | + include_once $path.'File.php'; |
|
| 145 | + include_once $path.'RuntimeTests.php'; |
|
| 146 | + include_once $path.'KeyProtectedByPassword.php'; |
|
| 147 | + include_once $path.'Core.php'; |
|
| 148 | 148 | |
| 149 | 149 | // convert KEY |
| 150 | 150 | $key = \Defuse\Crypto\Key::loadFromAsciiSafeString($ascii_key); |
@@ -189,20 +189,20 @@ discard block |
||
| 189 | 189 | $path = '../includes/libraries/Encryption/Encryption/'; |
| 190 | 190 | } |
| 191 | 191 | |
| 192 | - include_once $path . 'Exception/CryptoException.php'; |
|
| 193 | - include_once $path . 'Exception/BadFormatException.php'; |
|
| 194 | - include_once $path . 'Exception/EnvironmentIsBrokenException.php'; |
|
| 195 | - include_once $path . 'Exception/IOException.php'; |
|
| 196 | - include_once $path . 'Exception/WrongKeyOrModifiedCiphertextException.php'; |
|
| 197 | - include_once $path . 'Crypto.php'; |
|
| 198 | - include_once $path . 'Encoding.php'; |
|
| 199 | - include_once $path . 'DerivedKeys.php'; |
|
| 200 | - include_once $path . 'Key.php'; |
|
| 201 | - include_once $path . 'KeyOrPassword.php'; |
|
| 202 | - include_once $path . 'File.php'; |
|
| 203 | - include_once $path . 'RuntimeTests.php'; |
|
| 204 | - include_once $path . 'KeyProtectedByPassword.php'; |
|
| 205 | - include_once $path . 'Core.php'; |
|
| 192 | + include_once $path.'Exception/CryptoException.php'; |
|
| 193 | + include_once $path.'Exception/BadFormatException.php'; |
|
| 194 | + include_once $path.'Exception/EnvironmentIsBrokenException.php'; |
|
| 195 | + include_once $path.'Exception/IOException.php'; |
|
| 196 | + include_once $path.'Exception/WrongKeyOrModifiedCiphertextException.php'; |
|
| 197 | + include_once $path.'Crypto.php'; |
|
| 198 | + include_once $path.'Encoding.php'; |
|
| 199 | + include_once $path.'DerivedKeys.php'; |
|
| 200 | + include_once $path.'Key.php'; |
|
| 201 | + include_once $path.'KeyOrPassword.php'; |
|
| 202 | + include_once $path.'File.php'; |
|
| 203 | + include_once $path.'RuntimeTests.php'; |
|
| 204 | + include_once $path.'KeyProtectedByPassword.php'; |
|
| 205 | + include_once $path.'Core.php'; |
|
| 206 | 206 | |
| 207 | 207 | $key = \Defuse\Crypto\Key::createNewRandomKey(); |
| 208 | 208 | $key = $key->saveToAsciiSafeString(); |
@@ -227,20 +227,20 @@ discard block |
||
| 227 | 227 | $path = '../includes/libraries/Encryption/Encryption/'; |
| 228 | 228 | } |
| 229 | 229 | |
| 230 | - include_once $path . 'Exception/CryptoException.php'; |
|
| 231 | - include_once $path . 'Exception/BadFormatException.php'; |
|
| 232 | - include_once $path . 'Exception/EnvironmentIsBrokenException.php'; |
|
| 233 | - include_once $path . 'Exception/IOException.php'; |
|
| 234 | - include_once $path . 'Exception/WrongKeyOrModifiedCiphertextException.php'; |
|
| 235 | - include_once $path . 'Crypto.php'; |
|
| 236 | - include_once $path . 'Encoding.php'; |
|
| 237 | - include_once $path . 'DerivedKeys.php'; |
|
| 238 | - include_once $path . 'Key.php'; |
|
| 239 | - include_once $path . 'KeyOrPassword.php'; |
|
| 240 | - include_once $path . 'File.php'; |
|
| 241 | - include_once $path . 'RuntimeTests.php'; |
|
| 242 | - include_once $path . 'KeyProtectedByPassword.php'; |
|
| 243 | - include_once $path . 'Core.php'; |
|
| 230 | + include_once $path.'Exception/CryptoException.php'; |
|
| 231 | + include_once $path.'Exception/BadFormatException.php'; |
|
| 232 | + include_once $path.'Exception/EnvironmentIsBrokenException.php'; |
|
| 233 | + include_once $path.'Exception/IOException.php'; |
|
| 234 | + include_once $path.'Exception/WrongKeyOrModifiedCiphertextException.php'; |
|
| 235 | + include_once $path.'Crypto.php'; |
|
| 236 | + include_once $path.'Encoding.php'; |
|
| 237 | + include_once $path.'DerivedKeys.php'; |
|
| 238 | + include_once $path.'Key.php'; |
|
| 239 | + include_once $path.'KeyOrPassword.php'; |
|
| 240 | + include_once $path.'File.php'; |
|
| 241 | + include_once $path.'RuntimeTests.php'; |
|
| 242 | + include_once $path.'KeyProtectedByPassword.php'; |
|
| 243 | + include_once $path.'Core.php'; |
|
| 244 | 244 | |
| 245 | 245 | $protected_key = \Defuse\Crypto\KeyProtectedByPassword::createRandomPasswordProtectedKey($psk); |
| 246 | 246 | return $protected_key->saveToAsciiSafeString(); // save this in user table |
@@ -265,20 +265,20 @@ discard block |
||
| 265 | 265 | $path = '../includes/libraries/Encryption/Encryption/'; |
| 266 | 266 | } |
| 267 | 267 | |
| 268 | - include_once $path . 'Exception/CryptoException.php'; |
|
| 269 | - include_once $path . 'Exception/BadFormatException.php'; |
|
| 270 | - include_once $path . 'Exception/EnvironmentIsBrokenException.php'; |
|
| 271 | - include_once $path . 'Exception/IOException.php'; |
|
| 272 | - include_once $path . 'Exception/WrongKeyOrModifiedCiphertextException.php'; |
|
| 273 | - include_once $path . 'Crypto.php'; |
|
| 274 | - include_once $path . 'Encoding.php'; |
|
| 275 | - include_once $path . 'DerivedKeys.php'; |
|
| 276 | - include_once $path . 'Key.php'; |
|
| 277 | - include_once $path . 'KeyOrPassword.php'; |
|
| 278 | - include_once $path . 'File.php'; |
|
| 279 | - include_once $path . 'RuntimeTests.php'; |
|
| 280 | - include_once $path . 'KeyProtectedByPassword.php'; |
|
| 281 | - include_once $path . 'Core.php'; |
|
| 268 | + include_once $path.'Exception/CryptoException.php'; |
|
| 269 | + include_once $path.'Exception/BadFormatException.php'; |
|
| 270 | + include_once $path.'Exception/EnvironmentIsBrokenException.php'; |
|
| 271 | + include_once $path.'Exception/IOException.php'; |
|
| 272 | + include_once $path.'Exception/WrongKeyOrModifiedCiphertextException.php'; |
|
| 273 | + include_once $path.'Crypto.php'; |
|
| 274 | + include_once $path.'Encoding.php'; |
|
| 275 | + include_once $path.'DerivedKeys.php'; |
|
| 276 | + include_once $path.'Key.php'; |
|
| 277 | + include_once $path.'KeyOrPassword.php'; |
|
| 278 | + include_once $path.'File.php'; |
|
| 279 | + include_once $path.'RuntimeTests.php'; |
|
| 280 | + include_once $path.'KeyProtectedByPassword.php'; |
|
| 281 | + include_once $path.'Core.php'; |
|
| 282 | 282 | |
| 283 | 283 | try { |
| 284 | 284 | $protected_key = \Defuse\Crypto\KeyProtectedByPassword::loadFromAsciiSafeString($protected_key_encoded); |
@@ -320,7 +320,7 @@ discard block |
||
| 320 | 320 | */ |
| 321 | 321 | function trimElement($chaine, string $element): string |
| 322 | 322 | { |
| 323 | - if (! empty($chaine)) { |
|
| 323 | + if (!empty($chaine)) { |
|
| 324 | 324 | if (is_array($chaine) === true) { |
| 325 | 325 | $chaine = implode(';', $chaine); |
| 326 | 326 | } |
@@ -368,8 +368,8 @@ discard block |
||
| 368 | 368 | */ |
| 369 | 369 | function db_error_handler(array $params): void |
| 370 | 370 | { |
| 371 | - echo 'Error: ' . $params['error'] . "<br>\n"; |
|
| 372 | - echo 'Query: ' . $params['query'] . "<br>\n"; |
|
| 371 | + echo 'Error: '.$params['error']."<br>\n"; |
|
| 372 | + echo 'Query: '.$params['query']."<br>\n"; |
|
| 373 | 373 | throw new Exception('Error - Query', 1); |
| 374 | 374 | } |
| 375 | 375 | |
@@ -391,12 +391,12 @@ discard block |
||
| 391 | 391 | $SETTINGS |
| 392 | 392 | ) { |
| 393 | 393 | //load ClassLoader |
| 394 | - include_once $SETTINGS['cpassman_dir'] . '/sources/SplClassLoader.php'; |
|
| 394 | + include_once $SETTINGS['cpassman_dir'].'/sources/SplClassLoader.php'; |
|
| 395 | 395 | // Load superglobal |
| 396 | - include_once $SETTINGS['cpassman_dir'] . '/includes/libraries/protect/SuperGlobal/SuperGlobal.php'; |
|
| 396 | + include_once $SETTINGS['cpassman_dir'].'/includes/libraries/protect/SuperGlobal/SuperGlobal.php'; |
|
| 397 | 397 | $superGlobal = new protect\SuperGlobal\SuperGlobal(); |
| 398 | 398 | //Connect to DB |
| 399 | - include_once $SETTINGS['cpassman_dir'] . '/includes/libraries/Database/Meekrodb/db.class.php'; |
|
| 399 | + include_once $SETTINGS['cpassman_dir'].'/includes/libraries/Database/Meekrodb/db.class.php'; |
|
| 400 | 400 | if (defined('DB_PASSWD_CLEAR') === false) { |
| 401 | 401 | define('DB_PASSWD_CLEAR', defuseReturnDecrypted(DB_PASSWD, $SETTINGS)); |
| 402 | 402 | } |
@@ -407,7 +407,7 @@ discard block |
||
| 407 | 407 | DB::$port = DB_PORT; |
| 408 | 408 | DB::$encoding = DB_ENCODING; |
| 409 | 409 | //Build tree |
| 410 | - $tree = new SplClassLoader('Tree\NestedTree', $SETTINGS['cpassman_dir'] . '/includes/libraries'); |
|
| 410 | + $tree = new SplClassLoader('Tree\NestedTree', $SETTINGS['cpassman_dir'].'/includes/libraries'); |
|
| 411 | 411 | $tree->register(); |
| 412 | 412 | $tree = new Tree\NestedTree\NestedTree(prefixTable('nested_tree'), 'id', 'parent_id', 'title'); |
| 413 | 413 | |
@@ -452,7 +452,7 @@ discard block |
||
| 452 | 452 | function identAdmin($idFonctions, $SETTINGS, $tree) |
| 453 | 453 | { |
| 454 | 454 | // Load superglobal |
| 455 | - include_once $SETTINGS['cpassman_dir'] . '/includes/libraries/protect/SuperGlobal/SuperGlobal.php'; |
|
| 455 | + include_once $SETTINGS['cpassman_dir'].'/includes/libraries/protect/SuperGlobal/SuperGlobal.php'; |
|
| 456 | 456 | $superGlobal = new protect\SuperGlobal\SuperGlobal(); |
| 457 | 457 | // Init |
| 458 | 458 | $groupesVisibles = []; |
@@ -471,7 +471,7 @@ discard block |
||
| 471 | 471 | $globalsVisibleFolders = $superGlobal->get('groupes_visibles', 'SESSION'); |
| 472 | 472 | $globalsPersonalVisibleFolders = $superGlobal->get('personal_visible_groups', 'SESSION'); |
| 473 | 473 | // Get list of Folders |
| 474 | - $rows = DB::query('SELECT id FROM ' . prefixTable('nested_tree') . ' WHERE personal_folder = %i', 0); |
|
| 474 | + $rows = DB::query('SELECT id FROM '.prefixTable('nested_tree').' WHERE personal_folder = %i', 0); |
|
| 475 | 475 | foreach ($rows as $record) { |
| 476 | 476 | array_push($groupesVisibles, $record['id']); |
| 477 | 477 | } |
@@ -490,7 +490,7 @@ discard block |
||
| 490 | 490 | } |
| 491 | 491 | // Get ID of personal folder |
| 492 | 492 | $persfld = DB::queryfirstrow( |
| 493 | - 'SELECT id FROM ' . prefixTable('nested_tree') . ' WHERE title = %s', |
|
| 493 | + 'SELECT id FROM '.prefixTable('nested_tree').' WHERE title = %s', |
|
| 494 | 494 | $globalsUserId |
| 495 | 495 | ); |
| 496 | 496 | if (empty($persfld['id']) === false) { |
@@ -511,20 +511,20 @@ discard block |
||
| 511 | 511 | // get complete list of ROLES |
| 512 | 512 | $tmp = explode(';', $idFonctions); |
| 513 | 513 | $rows = DB::query( |
| 514 | - 'SELECT * FROM ' . prefixTable('roles_title') . ' |
|
| 514 | + 'SELECT * FROM '.prefixTable('roles_title').' |
|
| 515 | 515 | ORDER BY title ASC' |
| 516 | 516 | ); |
| 517 | 517 | foreach ($rows as $record) { |
| 518 | - if (! empty($record['id']) && ! in_array($record['id'], $tmp)) { |
|
| 518 | + if (!empty($record['id']) && !in_array($record['id'], $tmp)) { |
|
| 519 | 519 | array_push($tmp, $record['id']); |
| 520 | 520 | } |
| 521 | 521 | } |
| 522 | 522 | $superGlobal->put('fonction_id', implode(';', $tmp), 'SESSION'); |
| 523 | 523 | $superGlobal->put('is_admin', 1, 'SESSION'); |
| 524 | 524 | // Check if admin has created Folders and Roles |
| 525 | - DB::query('SELECT * FROM ' . prefixTable('nested_tree') . ''); |
|
| 525 | + DB::query('SELECT * FROM '.prefixTable('nested_tree').''); |
|
| 526 | 526 | $superGlobal->put('nb_folders', DB::count(), 'SESSION'); |
| 527 | - DB::query('SELECT * FROM ' . prefixTable('roles_title')); |
|
| 527 | + DB::query('SELECT * FROM '.prefixTable('roles_title')); |
|
| 528 | 528 | $superGlobal->put('nb_roles', DB::count(), 'SESSION'); |
| 529 | 529 | |
| 530 | 530 | return true; |
@@ -570,7 +570,7 @@ discard block |
||
| 570 | 570 | object $tree |
| 571 | 571 | ) { |
| 572 | 572 | // Load superglobal |
| 573 | - include_once $SETTINGS['cpassman_dir'] . '/includes/libraries/protect/SuperGlobal/SuperGlobal.php'; |
|
| 573 | + include_once $SETTINGS['cpassman_dir'].'/includes/libraries/protect/SuperGlobal/SuperGlobal.php'; |
|
| 574 | 574 | $superGlobal = new protect\SuperGlobal\SuperGlobal(); |
| 575 | 575 | // Init |
| 576 | 576 | $superGlobal->put('groupes_visibles', [], 'SESSION'); |
@@ -609,10 +609,10 @@ discard block |
||
| 609 | 609 | // Does this user is allowed to see other items |
| 610 | 610 | $inc = 0; |
| 611 | 611 | $rows = DB::query( |
| 612 | - 'SELECT id, id_tree FROM ' . prefixTable('items') . ' |
|
| 612 | + 'SELECT id, id_tree FROM '.prefixTable('items').' |
|
| 613 | 613 | WHERE restricted_to LIKE %ss AND inactif = %s'. |
| 614 | 614 | (count($allowedFolders) > 0 ? ' AND id_tree NOT IN ('.implode(',', $allowedFolders).')' : ''), |
| 615 | - $globalsUserId . ';', |
|
| 615 | + $globalsUserId.';', |
|
| 616 | 616 | '0' |
| 617 | 617 | ); |
| 618 | 618 | foreach ($rows as $record) { |
@@ -626,8 +626,8 @@ discard block |
||
| 626 | 626 | // Check for the users roles if some specific rights exist on items |
| 627 | 627 | $rows = DB::query( |
| 628 | 628 | 'SELECT i.id_tree, r.item_id |
| 629 | - FROM ' . prefixTable('items') . ' as i |
|
| 630 | - INNER JOIN ' . prefixTable('restriction_to_roles') . ' as r ON (r.item_id=i.id) |
|
| 629 | + FROM ' . prefixTable('items').' as i |
|
| 630 | + INNER JOIN ' . prefixTable('restriction_to_roles').' as r ON (r.item_id=i.id) |
|
| 631 | 631 | WHERE r.role_id IN %li AND i.id_tree <> "" |
| 632 | 632 | ORDER BY i.id_tree ASC', |
| 633 | 633 | $userRoles |
@@ -681,16 +681,16 @@ discard block |
||
| 681 | 681 | 'SESSION' |
| 682 | 682 | ); |
| 683 | 683 | // Folders and Roles numbers |
| 684 | - DB::queryfirstrow('SELECT id FROM ' . prefixTable('nested_tree') . ''); |
|
| 684 | + DB::queryfirstrow('SELECT id FROM '.prefixTable('nested_tree').''); |
|
| 685 | 685 | $superGlobal->put('nb_folders', DB::count(), 'SESSION'); |
| 686 | - DB::queryfirstrow('SELECT id FROM ' . prefixTable('roles_title')); |
|
| 686 | + DB::queryfirstrow('SELECT id FROM '.prefixTable('roles_title')); |
|
| 687 | 687 | $superGlobal->put('nb_roles', DB::count(), 'SESSION'); |
| 688 | 688 | // check if change proposals on User's items |
| 689 | 689 | if (isset($SETTINGS['enable_suggestion']) === true && (int) $SETTINGS['enable_suggestion'] === 1) { |
| 690 | 690 | $countNewItems = DB::query( |
| 691 | 691 | 'SELECT COUNT(*) |
| 692 | - FROM ' . prefixTable('items_change') . ' AS c |
|
| 693 | - LEFT JOIN ' . prefixTable('log_items') . ' AS i ON (c.item_id = i.id_item) |
|
| 692 | + FROM ' . prefixTable('items_change').' AS c |
|
| 693 | + LEFT JOIN ' . prefixTable('log_items').' AS i ON (c.item_id = i.id_item) |
|
| 694 | 694 | WHERE i.action = %s AND i.id_user = %i', |
| 695 | 695 | 'at_creation', |
| 696 | 696 | $globalsUserId |
@@ -718,7 +718,7 @@ discard block |
||
| 718 | 718 | |
| 719 | 719 | $rows = DB::query( |
| 720 | 720 | 'SELECT * |
| 721 | - FROM ' . prefixTable('roles_values') . ' |
|
| 721 | + FROM ' . prefixTable('roles_values').' |
|
| 722 | 722 | WHERE role_id IN %li AND type IN %ls', |
| 723 | 723 | $userRoles, |
| 724 | 724 | ['W', 'ND', 'NE', 'NDNE', 'R'] |
@@ -785,7 +785,7 @@ discard block |
||
| 785 | 785 | ) { |
| 786 | 786 | $persoFld = DB::queryfirstrow( |
| 787 | 787 | 'SELECT id |
| 788 | - FROM ' . prefixTable('nested_tree') . ' |
|
| 788 | + FROM ' . prefixTable('nested_tree').' |
|
| 789 | 789 | WHERE title = %s AND personal_folder = %i'. |
| 790 | 790 | (count($allowedFolders) > 0 ? ' AND id NOT IN ('.implode(',', $allowedFolders).')' : ''), |
| 791 | 791 | $globalsUserId, |
@@ -819,7 +819,7 @@ discard block |
||
| 819 | 819 | } |
| 820 | 820 | $persoFlds = DB::query( |
| 821 | 821 | 'SELECT id |
| 822 | - FROM ' . prefixTable('nested_tree') . ' |
|
| 822 | + FROM ' . prefixTable('nested_tree').' |
|
| 823 | 823 | WHERE %l', |
| 824 | 824 | $where |
| 825 | 825 | ); |
@@ -883,9 +883,9 @@ discard block |
||
| 883 | 883 | */ |
| 884 | 884 | function cacheTableRefresh(array $SETTINGS): void |
| 885 | 885 | { |
| 886 | - include_once $SETTINGS['cpassman_dir'] . '/sources/SplClassLoader.php'; |
|
| 886 | + include_once $SETTINGS['cpassman_dir'].'/sources/SplClassLoader.php'; |
|
| 887 | 887 | //Connect to DB |
| 888 | - include_once $SETTINGS['cpassman_dir'] . '/includes/libraries/Database/Meekrodb/db.class.php'; |
|
| 888 | + include_once $SETTINGS['cpassman_dir'].'/includes/libraries/Database/Meekrodb/db.class.php'; |
|
| 889 | 889 | if (defined('DB_PASSWD_CLEAR') === false) { |
| 890 | 890 | define('DB_PASSWD_CLEAR', defuseReturnDecrypted(DB_PASSWD, $SETTINGS)); |
| 891 | 891 | } |
@@ -900,12 +900,12 @@ discard block |
||
| 900 | 900 | $tree->register(); |
| 901 | 901 | $tree = new Tree\NestedTree\NestedTree(prefixTable('nested_tree'), 'id', 'parent_id', 'title'); |
| 902 | 902 | // truncate table |
| 903 | - DB::query('TRUNCATE TABLE ' . prefixTable('cache')); |
|
| 903 | + DB::query('TRUNCATE TABLE '.prefixTable('cache')); |
|
| 904 | 904 | // reload date |
| 905 | 905 | $rows = DB::query( |
| 906 | 906 | 'SELECT * |
| 907 | - FROM ' . prefixTable('items') . ' as i |
|
| 908 | - INNER JOIN ' . prefixTable('log_items') . ' as l ON (l.id_item = i.id) |
|
| 907 | + FROM ' . prefixTable('items').' as i |
|
| 908 | + INNER JOIN ' . prefixTable('log_items').' as l ON (l.id_item = i.id) |
|
| 909 | 909 | AND l.action = %s |
| 910 | 910 | AND i.inactif = %i', |
| 911 | 911 | 'at_creation', |
@@ -917,18 +917,18 @@ discard block |
||
| 917 | 917 | $tags = ''; |
| 918 | 918 | $itemTags = DB::query( |
| 919 | 919 | 'SELECT tag |
| 920 | - FROM ' . prefixTable('tags') . ' |
|
| 920 | + FROM ' . prefixTable('tags').' |
|
| 921 | 921 | WHERE item_id = %i AND tag != ""', |
| 922 | 922 | $record['id'] |
| 923 | 923 | ); |
| 924 | 924 | foreach ($itemTags as $itemTag) { |
| 925 | - $tags .= $itemTag['tag'] . ' '; |
|
| 925 | + $tags .= $itemTag['tag'].' '; |
|
| 926 | 926 | } |
| 927 | 927 | |
| 928 | 928 | // Get renewal period |
| 929 | 929 | $resNT = DB::queryfirstrow( |
| 930 | 930 | 'SELECT renewal_period |
| 931 | - FROM ' . prefixTable('nested_tree') . ' |
|
| 931 | + FROM ' . prefixTable('nested_tree').' |
|
| 932 | 932 | WHERE id = %i', |
| 933 | 933 | $record['id_tree'] |
| 934 | 934 | ); |
@@ -941,7 +941,7 @@ discard block |
||
| 941 | 941 | // Is this a User id? |
| 942 | 942 | $user = DB::queryfirstrow( |
| 943 | 943 | 'SELECT id, login |
| 944 | - FROM ' . prefixTable('users') . ' |
|
| 944 | + FROM ' . prefixTable('users').' |
|
| 945 | 945 | WHERE id = %i', |
| 946 | 946 | $elem->title |
| 947 | 947 | ); |
@@ -959,11 +959,11 @@ discard block |
||
| 959 | 959 | 'id' => $record['id'], |
| 960 | 960 | 'label' => $record['label'], |
| 961 | 961 | 'description' => $record['description'] ?? '', |
| 962 | - 'url' => isset($record['url']) && ! empty($record['url']) ? $record['url'] : '0', |
|
| 962 | + 'url' => isset($record['url']) && !empty($record['url']) ? $record['url'] : '0', |
|
| 963 | 963 | 'tags' => $tags, |
| 964 | 964 | 'id_tree' => $record['id_tree'], |
| 965 | 965 | 'perso' => $record['perso'], |
| 966 | - 'restricted_to' => isset($record['restricted_to']) && ! empty($record['restricted_to']) ? $record['restricted_to'] : '0', |
|
| 966 | + 'restricted_to' => isset($record['restricted_to']) && !empty($record['restricted_to']) ? $record['restricted_to'] : '0', |
|
| 967 | 967 | 'login' => $record['login'] ?? '', |
| 968 | 968 | 'folder' => implode(' > ', $folder), |
| 969 | 969 | 'author' => $record['id_user'], |
@@ -985,12 +985,12 @@ discard block |
||
| 985 | 985 | */ |
| 986 | 986 | function cacheTableUpdate(array $SETTINGS, ?int $ident = null): void |
| 987 | 987 | { |
| 988 | - include_once $SETTINGS['cpassman_dir'] . '/sources/SplClassLoader.php'; |
|
| 988 | + include_once $SETTINGS['cpassman_dir'].'/sources/SplClassLoader.php'; |
|
| 989 | 989 | // Load superglobal |
| 990 | - include_once $SETTINGS['cpassman_dir'] . '/includes/libraries/protect/SuperGlobal/SuperGlobal.php'; |
|
| 990 | + include_once $SETTINGS['cpassman_dir'].'/includes/libraries/protect/SuperGlobal/SuperGlobal.php'; |
|
| 991 | 991 | $superGlobal = new protect\SuperGlobal\SuperGlobal(); |
| 992 | 992 | //Connect to DB |
| 993 | - include_once $SETTINGS['cpassman_dir'] . '/includes/libraries/Database/Meekrodb/db.class.php'; |
|
| 993 | + include_once $SETTINGS['cpassman_dir'].'/includes/libraries/Database/Meekrodb/db.class.php'; |
|
| 994 | 994 | if (defined('DB_PASSWD_CLEAR') === false) { |
| 995 | 995 | define('DB_PASSWD_CLEAR', defuseReturnDecrypted(DB_PASSWD, $SETTINGS)); |
| 996 | 996 | } |
@@ -1007,7 +1007,7 @@ discard block |
||
| 1007 | 1007 | // get new value from db |
| 1008 | 1008 | $data = DB::queryfirstrow( |
| 1009 | 1009 | 'SELECT label, description, id_tree, perso, restricted_to, login, url |
| 1010 | - FROM ' . prefixTable('items') . ' |
|
| 1010 | + FROM ' . prefixTable('items').' |
|
| 1011 | 1011 | WHERE id=%i', |
| 1012 | 1012 | $ident |
| 1013 | 1013 | ); |
@@ -1015,12 +1015,12 @@ discard block |
||
| 1015 | 1015 | $tags = ''; |
| 1016 | 1016 | $itemTags = DB::query( |
| 1017 | 1017 | 'SELECT tag |
| 1018 | - FROM ' . prefixTable('tags') . ' |
|
| 1018 | + FROM ' . prefixTable('tags').' |
|
| 1019 | 1019 | WHERE item_id = %i AND tag != ""', |
| 1020 | 1020 | $ident |
| 1021 | 1021 | ); |
| 1022 | 1022 | foreach ($itemTags as $itemTag) { |
| 1023 | - $tags .= $itemTag['tag'] . ' '; |
|
| 1023 | + $tags .= $itemTag['tag'].' '; |
|
| 1024 | 1024 | } |
| 1025 | 1025 | // form id_tree to full foldername |
| 1026 | 1026 | $folder = []; |
@@ -1031,7 +1031,7 @@ discard block |
||
| 1031 | 1031 | // Is this a User id? |
| 1032 | 1032 | $user = DB::queryfirstrow( |
| 1033 | 1033 | 'SELECT id, login |
| 1034 | - FROM ' . prefixTable('users') . ' |
|
| 1034 | + FROM ' . prefixTable('users').' |
|
| 1035 | 1035 | WHERE id = %i', |
| 1036 | 1036 | $elem->title |
| 1037 | 1037 | ); |
@@ -1049,10 +1049,10 @@ discard block |
||
| 1049 | 1049 | 'label' => $data['label'], |
| 1050 | 1050 | 'description' => $data['description'], |
| 1051 | 1051 | 'tags' => $tags, |
| 1052 | - 'url' => isset($data['url']) && ! empty($data['url']) ? $data['url'] : '0', |
|
| 1052 | + 'url' => isset($data['url']) && !empty($data['url']) ? $data['url'] : '0', |
|
| 1053 | 1053 | 'id_tree' => $data['id_tree'], |
| 1054 | 1054 | 'perso' => $data['perso'], |
| 1055 | - 'restricted_to' => isset($data['restricted_to']) && ! empty($data['restricted_to']) ? $data['restricted_to'] : '0', |
|
| 1055 | + 'restricted_to' => isset($data['restricted_to']) && !empty($data['restricted_to']) ? $data['restricted_to'] : '0', |
|
| 1056 | 1056 | 'login' => $data['login'] ?? '', |
| 1057 | 1057 | 'folder' => implode(' » ', $folder), |
| 1058 | 1058 | 'author' => $superGlobal->get('user_id', 'SESSION'), |
@@ -1072,14 +1072,14 @@ discard block |
||
| 1072 | 1072 | */ |
| 1073 | 1073 | function cacheTableAdd(array $SETTINGS, ?int $ident = null): void |
| 1074 | 1074 | { |
| 1075 | - include_once $SETTINGS['cpassman_dir'] . '/sources/SplClassLoader.php'; |
|
| 1075 | + include_once $SETTINGS['cpassman_dir'].'/sources/SplClassLoader.php'; |
|
| 1076 | 1076 | // Load superglobal |
| 1077 | - include_once $SETTINGS['cpassman_dir'] . '/includes/libraries/protect/SuperGlobal/SuperGlobal.php'; |
|
| 1077 | + include_once $SETTINGS['cpassman_dir'].'/includes/libraries/protect/SuperGlobal/SuperGlobal.php'; |
|
| 1078 | 1078 | $superGlobal = new protect\SuperGlobal\SuperGlobal(); |
| 1079 | 1079 | // Get superglobals |
| 1080 | 1080 | $globalsUserId = $superGlobal->get('user_id', 'SESSION'); |
| 1081 | 1081 | //Connect to DB |
| 1082 | - include_once $SETTINGS['cpassman_dir'] . '/includes/libraries/Database/Meekrodb/db.class.php'; |
|
| 1082 | + include_once $SETTINGS['cpassman_dir'].'/includes/libraries/Database/Meekrodb/db.class.php'; |
|
| 1083 | 1083 | if (defined('DB_PASSWD_CLEAR') === false) { |
| 1084 | 1084 | define('DB_PASSWD_CLEAR', defuseReturnDecrypted(DB_PASSWD, $SETTINGS)); |
| 1085 | 1085 | } |
@@ -1096,8 +1096,8 @@ discard block |
||
| 1096 | 1096 | // get new value from db |
| 1097 | 1097 | $data = DB::queryFirstRow( |
| 1098 | 1098 | 'SELECT i.label, i.description, i.id_tree as id_tree, i.perso, i.restricted_to, i.id, i.login, i.url, l.date |
| 1099 | - FROM ' . prefixTable('items') . ' as i |
|
| 1100 | - INNER JOIN ' . prefixTable('log_items') . ' as l ON (l.id_item = i.id) |
|
| 1099 | + FROM ' . prefixTable('items').' as i |
|
| 1100 | + INNER JOIN ' . prefixTable('log_items').' as l ON (l.id_item = i.id) |
|
| 1101 | 1101 | WHERE i.id = %i |
| 1102 | 1102 | AND l.action = %s', |
| 1103 | 1103 | $ident, |
@@ -1107,12 +1107,12 @@ discard block |
||
| 1107 | 1107 | $tags = ''; |
| 1108 | 1108 | $itemTags = DB::query( |
| 1109 | 1109 | 'SELECT tag |
| 1110 | - FROM ' . prefixTable('tags') . ' |
|
| 1110 | + FROM ' . prefixTable('tags').' |
|
| 1111 | 1111 | WHERE item_id = %i AND tag != ""', |
| 1112 | 1112 | $ident |
| 1113 | 1113 | ); |
| 1114 | 1114 | foreach ($itemTags as $itemTag) { |
| 1115 | - $tags .= $itemTag['tag'] . ' '; |
|
| 1115 | + $tags .= $itemTag['tag'].' '; |
|
| 1116 | 1116 | } |
| 1117 | 1117 | // form id_tree to full foldername |
| 1118 | 1118 | $folder = []; |
@@ -1123,7 +1123,7 @@ discard block |
||
| 1123 | 1123 | // Is this a User id? |
| 1124 | 1124 | $user = DB::queryfirstrow( |
| 1125 | 1125 | 'SELECT id, login |
| 1126 | - FROM ' . prefixTable('users') . ' |
|
| 1126 | + FROM ' . prefixTable('users').' |
|
| 1127 | 1127 | WHERE id = %i', |
| 1128 | 1128 | $elem->title |
| 1129 | 1129 | ); |
@@ -1142,7 +1142,7 @@ discard block |
||
| 1142 | 1142 | 'label' => $data['label'], |
| 1143 | 1143 | 'description' => $data['description'], |
| 1144 | 1144 | 'tags' => isset($tags) && empty($tags) === false ? $tags : 'None', |
| 1145 | - 'url' => isset($data['url']) && ! empty($data['url']) ? $data['url'] : '0', |
|
| 1145 | + 'url' => isset($data['url']) && !empty($data['url']) ? $data['url'] : '0', |
|
| 1146 | 1146 | 'id_tree' => $data['id_tree'], |
| 1147 | 1147 | 'perso' => isset($data['perso']) && empty($data['perso']) === false && $data['perso'] !== 'None' ? $data['perso'] : '0', |
| 1148 | 1148 | 'restricted_to' => isset($data['restricted_to']) && empty($data['restricted_to']) === false ? $data['restricted_to'] : '0', |
@@ -1164,52 +1164,52 @@ discard block |
||
| 1164 | 1164 | function getStatisticsData(array $SETTINGS): array |
| 1165 | 1165 | { |
| 1166 | 1166 | DB::query( |
| 1167 | - 'SELECT id FROM ' . prefixTable('nested_tree') . ' WHERE personal_folder = %i', |
|
| 1167 | + 'SELECT id FROM '.prefixTable('nested_tree').' WHERE personal_folder = %i', |
|
| 1168 | 1168 | 0 |
| 1169 | 1169 | ); |
| 1170 | 1170 | $counter_folders = DB::count(); |
| 1171 | 1171 | DB::query( |
| 1172 | - 'SELECT id FROM ' . prefixTable('nested_tree') . ' WHERE personal_folder = %i', |
|
| 1172 | + 'SELECT id FROM '.prefixTable('nested_tree').' WHERE personal_folder = %i', |
|
| 1173 | 1173 | 1 |
| 1174 | 1174 | ); |
| 1175 | 1175 | $counter_folders_perso = DB::count(); |
| 1176 | 1176 | DB::query( |
| 1177 | - 'SELECT id FROM ' . prefixTable('items') . ' WHERE perso = %i', |
|
| 1177 | + 'SELECT id FROM '.prefixTable('items').' WHERE perso = %i', |
|
| 1178 | 1178 | 0 |
| 1179 | 1179 | ); |
| 1180 | 1180 | $counter_items = DB::count(); |
| 1181 | 1181 | DB::query( |
| 1182 | - 'SELECT id FROM ' . prefixTable('items') . ' WHERE perso = %i', |
|
| 1182 | + 'SELECT id FROM '.prefixTable('items').' WHERE perso = %i', |
|
| 1183 | 1183 | 1 |
| 1184 | 1184 | ); |
| 1185 | 1185 | $counter_items_perso = DB::count(); |
| 1186 | 1186 | DB::query( |
| 1187 | - 'SELECT id FROM ' . prefixTable('users') . '' |
|
| 1187 | + 'SELECT id FROM '.prefixTable('users').'' |
|
| 1188 | 1188 | ); |
| 1189 | 1189 | $counter_users = DB::count(); |
| 1190 | 1190 | DB::query( |
| 1191 | - 'SELECT id FROM ' . prefixTable('users') . ' WHERE admin = %i', |
|
| 1191 | + 'SELECT id FROM '.prefixTable('users').' WHERE admin = %i', |
|
| 1192 | 1192 | 1 |
| 1193 | 1193 | ); |
| 1194 | 1194 | $admins = DB::count(); |
| 1195 | 1195 | DB::query( |
| 1196 | - 'SELECT id FROM ' . prefixTable('users') . ' WHERE gestionnaire = %i', |
|
| 1196 | + 'SELECT id FROM '.prefixTable('users').' WHERE gestionnaire = %i', |
|
| 1197 | 1197 | 1 |
| 1198 | 1198 | ); |
| 1199 | 1199 | $managers = DB::count(); |
| 1200 | 1200 | DB::query( |
| 1201 | - 'SELECT id FROM ' . prefixTable('users') . ' WHERE read_only = %i', |
|
| 1201 | + 'SELECT id FROM '.prefixTable('users').' WHERE read_only = %i', |
|
| 1202 | 1202 | 1 |
| 1203 | 1203 | ); |
| 1204 | 1204 | $readOnly = DB::count(); |
| 1205 | 1205 | // list the languages |
| 1206 | 1206 | $usedLang = []; |
| 1207 | 1207 | $tp_languages = DB::query( |
| 1208 | - 'SELECT name FROM ' . prefixTable('languages') |
|
| 1208 | + 'SELECT name FROM '.prefixTable('languages') |
|
| 1209 | 1209 | ); |
| 1210 | 1210 | foreach ($tp_languages as $tp_language) { |
| 1211 | 1211 | DB::query( |
| 1212 | - 'SELECT * FROM ' . prefixTable('users') . ' WHERE user_language = %s', |
|
| 1212 | + 'SELECT * FROM '.prefixTable('users').' WHERE user_language = %s', |
|
| 1213 | 1213 | $tp_language['name'] |
| 1214 | 1214 | ); |
| 1215 | 1215 | $usedLang[$tp_language['name']] = round((DB::count() * 100 / $counter_users), 0); |
@@ -1218,12 +1218,12 @@ discard block |
||
| 1218 | 1218 | // get list of ips |
| 1219 | 1219 | $usedIp = []; |
| 1220 | 1220 | $tp_ips = DB::query( |
| 1221 | - 'SELECT user_ip FROM ' . prefixTable('users') |
|
| 1221 | + 'SELECT user_ip FROM '.prefixTable('users') |
|
| 1222 | 1222 | ); |
| 1223 | 1223 | foreach ($tp_ips as $ip) { |
| 1224 | 1224 | if (array_key_exists($ip['user_ip'], $usedIp)) { |
| 1225 | 1225 | $usedIp[$ip['user_ip']] += $usedIp[$ip['user_ip']]; |
| 1226 | - } elseif (! empty($ip['user_ip']) && $ip['user_ip'] !== 'none') { |
|
| 1226 | + } elseif (!empty($ip['user_ip']) && $ip['user_ip'] !== 'none') { |
|
| 1227 | 1227 | $usedIp[$ip['user_ip']] = 1; |
| 1228 | 1228 | } |
| 1229 | 1229 | } |
@@ -1289,14 +1289,14 @@ discard block |
||
| 1289 | 1289 | } |
| 1290 | 1290 | |
| 1291 | 1291 | // Load settings |
| 1292 | - include_once $SETTINGS['cpassman_dir'] . '/includes/config/settings.php'; |
|
| 1292 | + include_once $SETTINGS['cpassman_dir'].'/includes/config/settings.php'; |
|
| 1293 | 1293 | // Load superglobal |
| 1294 | - include_once $SETTINGS['cpassman_dir'] . '/includes/libraries/protect/SuperGlobal/SuperGlobal.php'; |
|
| 1294 | + include_once $SETTINGS['cpassman_dir'].'/includes/libraries/protect/SuperGlobal/SuperGlobal.php'; |
|
| 1295 | 1295 | $superGlobal = new protect\SuperGlobal\SuperGlobal(); |
| 1296 | 1296 | // Get user language |
| 1297 | - include_once $SETTINGS['cpassman_dir'] . '/includes/language/' . $superGlobal->get('user_language', 'SESSION') . '.php'; |
|
| 1297 | + include_once $SETTINGS['cpassman_dir'].'/includes/language/'.$superGlobal->get('user_language', 'SESSION').'.php'; |
|
| 1298 | 1298 | // Load library |
| 1299 | - include_once $SETTINGS['cpassman_dir'] . '/sources/SplClassLoader.php'; |
|
| 1299 | + include_once $SETTINGS['cpassman_dir'].'/sources/SplClassLoader.php'; |
|
| 1300 | 1300 | // load PHPMailer |
| 1301 | 1301 | $mail = new SplClassLoader('PHPMailer\PHPMailer', '../includes/libraries'); |
| 1302 | 1302 | $mail->register(); |
@@ -1304,7 +1304,7 @@ discard block |
||
| 1304 | 1304 | |
| 1305 | 1305 | try { |
| 1306 | 1306 | // send to user |
| 1307 | - $mail->setLanguage('en', $SETTINGS['cpassman_dir'] . '/includes/libraries/PHPMailer/PHPMailer/language/'); |
|
| 1307 | + $mail->setLanguage('en', $SETTINGS['cpassman_dir'].'/includes/libraries/PHPMailer/PHPMailer/language/'); |
|
| 1308 | 1308 | $mail->SMTPDebug = isset($SETTINGS['email_debug_level']) === true ? $SETTINGS['email_debug_level'] : 0; |
| 1309 | 1309 | $mail->Port = $SETTINGS['email_port']; |
| 1310 | 1310 | //COULD BE USED |
@@ -1404,7 +1404,7 @@ discard block |
||
| 1404 | 1404 | <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;"> |
| 1405 | 1405 | <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;"> |
| 1406 | 1406 | <br><div style="float:right;">' . |
| 1407 | - $textMail . |
|
| 1407 | + $textMail. |
|
| 1408 | 1408 | '<br><br></td></tr></table> |
| 1409 | 1409 | </td></tr></table> |
| 1410 | 1410 | <br></body></html>'; |
@@ -1417,7 +1417,7 @@ discard block |
||
| 1417 | 1417 | */ |
| 1418 | 1418 | function generateKey(): string |
| 1419 | 1419 | { |
| 1420 | - return substr(md5(rand() . rand()), 0, 15); |
|
| 1420 | + return substr(md5(rand().rand()), 0, 15); |
|
| 1421 | 1421 | } |
| 1422 | 1422 | |
| 1423 | 1423 | /** |
@@ -1488,7 +1488,7 @@ discard block |
||
| 1488 | 1488 | { |
| 1489 | 1489 | array_walk_recursive( |
| 1490 | 1490 | $array, |
| 1491 | - static function (&$item): void { |
|
| 1491 | + static function(&$item): void { |
|
| 1492 | 1492 | if (mb_detect_encoding((string) $item, 'utf-8', true) === false) { |
| 1493 | 1493 | $item = utf8_encode($item); |
| 1494 | 1494 | } |
@@ -1510,7 +1510,7 @@ discard block |
||
| 1510 | 1510 | function prepareExchangedData($teampassDir, $data, string $type, ?string $key = null) |
| 1511 | 1511 | { |
| 1512 | 1512 | // Load superglobal |
| 1513 | - include_once $teampassDir . '/includes/libraries/protect/SuperGlobal/SuperGlobal.php'; |
|
| 1513 | + include_once $teampassDir.'/includes/libraries/protect/SuperGlobal/SuperGlobal.php'; |
|
| 1514 | 1514 | $superGlobal = new protect\SuperGlobal\SuperGlobal(); |
| 1515 | 1515 | // Get superglobals |
| 1516 | 1516 | if ($key !== null) { |
@@ -1521,9 +1521,9 @@ discard block |
||
| 1521 | 1521 | } |
| 1522 | 1522 | |
| 1523 | 1523 | //load ClassLoader |
| 1524 | - include_once $teampassDir . '/sources/SplClassLoader.php'; |
|
| 1524 | + include_once $teampassDir.'/sources/SplClassLoader.php'; |
|
| 1525 | 1525 | //Load AES |
| 1526 | - $aes = new SplClassLoader('Encryption\Crypt', $teampassDir . '/includes/libraries'); |
|
| 1526 | + $aes = new SplClassLoader('Encryption\Crypt', $teampassDir.'/includes/libraries'); |
|
| 1527 | 1527 | $aes->register(); |
| 1528 | 1528 | if ($type === 'encode' && is_array($data) === true) { |
| 1529 | 1529 | // Ensure UTF8 format |
@@ -1597,8 +1597,8 @@ discard block |
||
| 1597 | 1597 | */ |
| 1598 | 1598 | function prefixTable(string $table): string |
| 1599 | 1599 | { |
| 1600 | - $safeTable = htmlspecialchars(DB_PREFIX . $table); |
|
| 1601 | - if (! empty($safeTable)) { |
|
| 1600 | + $safeTable = htmlspecialchars(DB_PREFIX.$table); |
|
| 1601 | + if (!empty($safeTable)) { |
|
| 1602 | 1602 | // sanitize string |
| 1603 | 1603 | return $safeTable; |
| 1604 | 1604 | } |
@@ -1628,13 +1628,13 @@ discard block |
||
| 1628 | 1628 | bool $lowercase = false, |
| 1629 | 1629 | array $SETTINGS = [] |
| 1630 | 1630 | ): string { |
| 1631 | - include_once $SETTINGS['cpassman_dir'] . '/sources/SplClassLoader.php'; |
|
| 1632 | - $generator = new SplClassLoader('PasswordGenerator\Generator', $SETTINGS['cpassman_dir'] . '/includes/libraries'); |
|
| 1631 | + include_once $SETTINGS['cpassman_dir'].'/sources/SplClassLoader.php'; |
|
| 1632 | + $generator = new SplClassLoader('PasswordGenerator\Generator', $SETTINGS['cpassman_dir'].'/includes/libraries'); |
|
| 1633 | 1633 | $generator->register(); |
| 1634 | 1634 | $generator = new PasswordGenerator\Generator\ComputerPasswordGenerator(); |
| 1635 | 1635 | // Is PHP7 being used? |
| 1636 | 1636 | if (version_compare(PHP_VERSION, '7.0.0', '>=')) { |
| 1637 | - $php7generator = new SplClassLoader('PasswordGenerator\RandomGenerator', $SETTINGS['cpassman_dir'] . '/includes/libraries'); |
|
| 1637 | + $php7generator = new SplClassLoader('PasswordGenerator\RandomGenerator', $SETTINGS['cpassman_dir'].'/includes/libraries'); |
|
| 1638 | 1638 | $php7generator->register(); |
| 1639 | 1639 | $generator->setRandomGenerator(new PasswordGenerator\RandomGenerator\Php7RandomGenerator()); |
| 1640 | 1640 | } |
@@ -1669,7 +1669,7 @@ discard block |
||
| 1669 | 1669 | function send_syslog($message, $host, $port, $component = 'teampass'): void |
| 1670 | 1670 | { |
| 1671 | 1671 | $sock = socket_create(AF_INET, SOCK_DGRAM, SOL_UDP); |
| 1672 | - $syslog_message = '<123>' . date('M d H:i:s ') . $component . ': ' . $message; |
|
| 1672 | + $syslog_message = '<123>'.date('M d H:i:s ').$component.': '.$message; |
|
| 1673 | 1673 | socket_sendto($sock, $syslog_message, strlen($syslog_message), 0, $host, $port); |
| 1674 | 1674 | socket_close($sock); |
| 1675 | 1675 | } |
@@ -1693,7 +1693,7 @@ discard block |
||
| 1693 | 1693 | } |
| 1694 | 1694 | |
| 1695 | 1695 | // include librairies & connect to DB |
| 1696 | - include_once $SETTINGS['cpassman_dir'] . '/includes/libraries/Database/Meekrodb/db.class.php'; |
|
| 1696 | + include_once $SETTINGS['cpassman_dir'].'/includes/libraries/Database/Meekrodb/db.class.php'; |
|
| 1697 | 1697 | if (defined('DB_PASSWD_CLEAR') === false) { |
| 1698 | 1698 | define('DB_PASSWD_CLEAR', defuseReturnDecrypted(DB_PASSWD, $SETTINGS)); |
| 1699 | 1699 | } |
@@ -1717,14 +1717,14 @@ discard block |
||
| 1717 | 1717 | if (isset($SETTINGS['syslog_enable']) === true && (int) $SETTINGS['syslog_enable'] === 1) { |
| 1718 | 1718 | if ($type === 'user_mngt') { |
| 1719 | 1719 | send_syslog( |
| 1720 | - 'action=' . str_replace('at_', '', $label) . ' attribute=user user=' . $who . ' userid="' . $login . '" change="' . $field_1 . '" ', |
|
| 1720 | + 'action='.str_replace('at_', '', $label).' attribute=user user='.$who.' userid="'.$login.'" change="'.$field_1.'" ', |
|
| 1721 | 1721 | $SETTINGS['syslog_host'], |
| 1722 | 1722 | $SETTINGS['syslog_port'], |
| 1723 | 1723 | 'teampass' |
| 1724 | 1724 | ); |
| 1725 | 1725 | } else { |
| 1726 | 1726 | send_syslog( |
| 1727 | - 'action=' . $type . ' attribute=' . $label . ' user=' . $who . ' userid="' . $login . '" ', |
|
| 1727 | + 'action='.$type.' attribute='.$label.' user='.$who.' userid="'.$login.'" ', |
|
| 1728 | 1728 | $SETTINGS['syslog_host'], |
| 1729 | 1729 | $SETTINGS['syslog_port'], |
| 1730 | 1730 | 'teampass' |
@@ -1758,7 +1758,7 @@ discard block |
||
| 1758 | 1758 | ?string $encryption_type = null |
| 1759 | 1759 | ): void { |
| 1760 | 1760 | // include librairies & connect to DB |
| 1761 | - include_once $SETTINGS['cpassman_dir'] . '/includes/libraries/Database/Meekrodb/db.class.php'; |
|
| 1761 | + include_once $SETTINGS['cpassman_dir'].'/includes/libraries/Database/Meekrodb/db.class.php'; |
|
| 1762 | 1762 | if (defined('DB_PASSWD_CLEAR') === false) { |
| 1763 | 1763 | define('DB_PASSWD_CLEAR', defuseReturnDecrypted(DB_PASSWD, $SETTINGS)); |
| 1764 | 1764 | } |
@@ -1802,7 +1802,7 @@ discard block |
||
| 1802 | 1802 | if (empty($item_label) === true) { |
| 1803 | 1803 | $dataItem = DB::queryfirstrow( |
| 1804 | 1804 | 'SELECT id, id_tree, label |
| 1805 | - FROM ' . prefixTable('items') . ' |
|
| 1805 | + FROM ' . prefixTable('items').' |
|
| 1806 | 1806 | WHERE id = %i', |
| 1807 | 1807 | $item_id |
| 1808 | 1808 | ); |
@@ -1810,11 +1810,11 @@ discard block |
||
| 1810 | 1810 | } |
| 1811 | 1811 | |
| 1812 | 1812 | send_syslog( |
| 1813 | - 'action=' . str_replace('at_', '', $action) . |
|
| 1814 | - ' attribute=' . str_replace('at_', '', $attribute[0]) . |
|
| 1815 | - ' itemno=' . $item_id . |
|
| 1816 | - ' user=' . is_null($login) === true ? '' : addslashes((string) $login) . |
|
| 1817 | - ' itemname="' . addslashes($item_label) . '"', |
|
| 1813 | + 'action='.str_replace('at_', '', $action). |
|
| 1814 | + ' attribute='.str_replace('at_', '', $attribute[0]). |
|
| 1815 | + ' itemno='.$item_id. |
|
| 1816 | + ' user='.is_null($login) === true ? '' : addslashes((string) $login). |
|
| 1817 | + ' itemname="'.addslashes($item_label).'"', |
|
| 1818 | 1818 | $SETTINGS['syslog_host'], |
| 1819 | 1819 | $SETTINGS['syslog_port'], |
| 1820 | 1820 | 'teampass' |
@@ -1842,7 +1842,7 @@ discard block |
||
| 1842 | 1842 | && $action === 'at_shown' |
| 1843 | 1843 | ) { |
| 1844 | 1844 | // Load superglobal |
| 1845 | - include_once $SETTINGS['cpassman_dir'] . '/includes/libraries/protect/SuperGlobal/SuperGlobal.php'; |
|
| 1845 | + include_once $SETTINGS['cpassman_dir'].'/includes/libraries/protect/SuperGlobal/SuperGlobal.php'; |
|
| 1846 | 1846 | $superGlobal = new protect\SuperGlobal\SuperGlobal(); |
| 1847 | 1847 | // Get superglobals |
| 1848 | 1848 | $globalsLastname = $superGlobal->get('lastname', 'SESSION'); |
@@ -1851,7 +1851,7 @@ discard block |
||
| 1851 | 1851 | // Get info about item |
| 1852 | 1852 | $dataItem = DB::queryfirstrow( |
| 1853 | 1853 | 'SELECT id, id_tree, label |
| 1854 | - FROM ' . prefixTable('items') . ' |
|
| 1854 | + FROM ' . prefixTable('items').' |
|
| 1855 | 1855 | WHERE id = %i', |
| 1856 | 1856 | $item_id |
| 1857 | 1857 | ); |
@@ -1865,9 +1865,9 @@ discard block |
||
| 1865 | 1865 | 'body' => str_replace( |
| 1866 | 1866 | ['#tp_user#', '#tp_item#', '#tp_link#'], |
| 1867 | 1867 | [ |
| 1868 | - addslashes($globalsName . ' ' . $globalsLastname), |
|
| 1868 | + addslashes($globalsName.' '.$globalsLastname), |
|
| 1869 | 1869 | addslashes($item_label), |
| 1870 | - $SETTINGS['cpassman_url'] . '/index.php?page=items&group=' . $dataItem['id_tree'] . '&id=' . $item_id, |
|
| 1870 | + $SETTINGS['cpassman_url'].'/index.php?page=items&group='.$dataItem['id_tree'].'&id='.$item_id, |
|
| 1871 | 1871 | ], |
| 1872 | 1872 | langHdl('email_on_open_notification_mail') |
| 1873 | 1873 | ), |
@@ -1891,7 +1891,7 @@ discard block |
||
| 1891 | 1891 | function notifyChangesToSubscribers(int $item_id, string $label, array $changes, array $SETTINGS): void |
| 1892 | 1892 | { |
| 1893 | 1893 | // Load superglobal |
| 1894 | - include_once $SETTINGS['cpassman_dir'] . '/includes/libraries/protect/SuperGlobal/SuperGlobal.php'; |
|
| 1894 | + include_once $SETTINGS['cpassman_dir'].'/includes/libraries/protect/SuperGlobal/SuperGlobal.php'; |
|
| 1895 | 1895 | $superGlobal = new protect\SuperGlobal\SuperGlobal(); |
| 1896 | 1896 | // Get superglobals |
| 1897 | 1897 | $globalsUserId = $superGlobal->get('user_id', 'SESSION'); |
@@ -1901,8 +1901,8 @@ discard block |
||
| 1901 | 1901 | $notification = DB::queryOneColumn( |
| 1902 | 1902 | 'email', |
| 1903 | 1903 | 'SELECT * |
| 1904 | - FROM ' . prefixTable('notification') . ' AS n |
|
| 1905 | - INNER JOIN ' . prefixTable('users') . ' AS u ON (n.user_id = u.id) |
|
| 1904 | + FROM ' . prefixTable('notification').' AS n |
|
| 1905 | + INNER JOIN ' . prefixTable('users').' AS u ON (n.user_id = u.id) |
|
| 1906 | 1906 | WHERE n.item_id = %i AND n.user_id != %i', |
| 1907 | 1907 | $item_id, |
| 1908 | 1908 | $globalsUserId |
@@ -1913,7 +1913,7 @@ discard block |
||
| 1913 | 1913 | // Get list of changes |
| 1914 | 1914 | $htmlChanges = '<ul>'; |
| 1915 | 1915 | foreach ($changes as $change) { |
| 1916 | - $htmlChanges .= '<li>' . $change . '</li>'; |
|
| 1916 | + $htmlChanges .= '<li>'.$change.'</li>'; |
|
| 1917 | 1917 | } |
| 1918 | 1918 | $htmlChanges .= '</ul>'; |
| 1919 | 1919 | // send email |
@@ -1946,7 +1946,7 @@ discard block |
||
| 1946 | 1946 | function geItemReadablePath(int $id_tree, string $label, array $SETTINGS): string |
| 1947 | 1947 | { |
| 1948 | 1948 | // Class loader |
| 1949 | - include_once $SETTINGS['cpassman_dir'] . '/sources/SplClassLoader.php'; |
|
| 1949 | + include_once $SETTINGS['cpassman_dir'].'/sources/SplClassLoader.php'; |
|
| 1950 | 1950 | //Load Tree |
| 1951 | 1951 | $tree = new SplClassLoader('Tree\NestedTree', '../includes/libraries'); |
| 1952 | 1952 | $tree->register(); |
@@ -1955,15 +1955,15 @@ discard block |
||
| 1955 | 1955 | $path = ''; |
| 1956 | 1956 | foreach ($arbo as $elem) { |
| 1957 | 1957 | if (empty($path) === true) { |
| 1958 | - $path = htmlspecialchars(stripslashes(htmlspecialchars_decode($elem->title, ENT_QUOTES)), ENT_QUOTES) . ' '; |
|
| 1958 | + $path = htmlspecialchars(stripslashes(htmlspecialchars_decode($elem->title, ENT_QUOTES)), ENT_QUOTES).' '; |
|
| 1959 | 1959 | } else { |
| 1960 | - $path .= '→ ' . htmlspecialchars(stripslashes(htmlspecialchars_decode($elem->title, ENT_QUOTES)), ENT_QUOTES); |
|
| 1960 | + $path .= '→ '.htmlspecialchars(stripslashes(htmlspecialchars_decode($elem->title, ENT_QUOTES)), ENT_QUOTES); |
|
| 1961 | 1961 | } |
| 1962 | 1962 | } |
| 1963 | 1963 | |
| 1964 | 1964 | // Build text to show user |
| 1965 | 1965 | if (empty($label) === false) { |
| 1966 | - return empty($path) === true ? addslashes($label) : addslashes($label) . ' (' . $path . ')'; |
|
| 1966 | + return empty($path) === true ? addslashes($label) : addslashes($label).' ('.$path.')'; |
|
| 1967 | 1967 | } |
| 1968 | 1968 | return empty($path) === true ? '' : $path; |
| 1969 | 1969 | } |
@@ -2020,9 +2020,9 @@ discard block |
||
| 2020 | 2020 | */ |
| 2021 | 2021 | function handleConfigFile($action, $SETTINGS, $field = null, $value = null) |
| 2022 | 2022 | { |
| 2023 | - $tp_config_file = $SETTINGS['cpassman_dir'] . '/includes/config/tp.config.php'; |
|
| 2023 | + $tp_config_file = $SETTINGS['cpassman_dir'].'/includes/config/tp.config.php'; |
|
| 2024 | 2024 | // include librairies & connect to DB |
| 2025 | - include_once $SETTINGS['cpassman_dir'] . '/includes/libraries/Database/Meekrodb/db.class.php'; |
|
| 2025 | + include_once $SETTINGS['cpassman_dir'].'/includes/libraries/Database/Meekrodb/db.class.php'; |
|
| 2026 | 2026 | if (defined('DB_PASSWD_CLEAR') === false) { |
| 2027 | 2027 | define('DB_PASSWD_CLEAR', defuseReturnDecrypted(DB_PASSWD, $SETTINGS)); |
| 2028 | 2028 | } |
@@ -2035,8 +2035,8 @@ discard block |
||
| 2035 | 2035 | if (file_exists($tp_config_file) === false || $action === 'rebuild') { |
| 2036 | 2036 | // perform a copy |
| 2037 | 2037 | if (file_exists($tp_config_file)) { |
| 2038 | - if (! copy($tp_config_file, $tp_config_file . '.' . date('Y_m_d_His', time()))) { |
|
| 2039 | - return "ERROR: Could not copy file '" . $tp_config_file . "'"; |
|
| 2038 | + if (!copy($tp_config_file, $tp_config_file.'.'.date('Y_m_d_His', time()))) { |
|
| 2039 | + return "ERROR: Could not copy file '".$tp_config_file."'"; |
|
| 2040 | 2040 | } |
| 2041 | 2041 | } |
| 2042 | 2042 | |
@@ -2046,11 +2046,11 @@ discard block |
||
| 2046 | 2046 | $data[1] = "global \$SETTINGS;\n"; |
| 2047 | 2047 | $data[2] = "\$SETTINGS = array (\n"; |
| 2048 | 2048 | $rows = DB::query( |
| 2049 | - 'SELECT * FROM ' . prefixTable('misc') . ' WHERE type=%s', |
|
| 2049 | + 'SELECT * FROM '.prefixTable('misc').' WHERE type=%s', |
|
| 2050 | 2050 | 'admin' |
| 2051 | 2051 | ); |
| 2052 | 2052 | foreach ($rows as $record) { |
| 2053 | - array_push($data, " '" . $record['intitule'] . "' => '" . $record['valeur'] . "',\n"); |
|
| 2053 | + array_push($data, " '".$record['intitule']."' => '".$record['valeur']."',\n"); |
|
| 2054 | 2054 | } |
| 2055 | 2055 | array_push($data, ");\n"); |
| 2056 | 2056 | $data = array_unique($data); |
@@ -2064,15 +2064,15 @@ discard block |
||
| 2064 | 2064 | break; |
| 2065 | 2065 | } |
| 2066 | 2066 | |
| 2067 | - if (stristr($line, "'" . $field . "' => '")) { |
|
| 2068 | - $data[$inc] = " '" . $field . "' => '" . filter_var($value, FILTER_SANITIZE_STRING) . "',\n"; |
|
| 2067 | + if (stristr($line, "'".$field."' => '")) { |
|
| 2068 | + $data[$inc] = " '".$field."' => '".filter_var($value, FILTER_SANITIZE_STRING)."',\n"; |
|
| 2069 | 2069 | $bFound = true; |
| 2070 | 2070 | break; |
| 2071 | 2071 | } |
| 2072 | 2072 | ++$inc; |
| 2073 | 2073 | } |
| 2074 | 2074 | if ($bFound === false) { |
| 2075 | - $data[$inc] = " '" . $field . "' => '" . filter_var($value, FILTER_SANITIZE_STRING) . "',\n);\n"; |
|
| 2075 | + $data[$inc] = " '".$field."' => '".filter_var($value, FILTER_SANITIZE_STRING)."',\n);\n"; |
|
| 2076 | 2076 | } |
| 2077 | 2077 | } |
| 2078 | 2078 | |
@@ -2102,7 +2102,7 @@ discard block |
||
| 2102 | 2102 | { |
| 2103 | 2103 | global $SETTINGS; |
| 2104 | 2104 | /* LOAD CPASSMAN SETTINGS */ |
| 2105 | - if (! isset($SETTINGS['loaded']) || $SETTINGS['loaded'] !== 1) { |
|
| 2105 | + if (!isset($SETTINGS['loaded']) || $SETTINGS['loaded'] !== 1) { |
|
| 2106 | 2106 | $SETTINGS = []; |
| 2107 | 2107 | $SETTINGS['duplicate_folder'] = 0; |
| 2108 | 2108 | //by default, this is set to 0; |
@@ -2112,7 +2112,7 @@ discard block |
||
| 2112 | 2112 | //by default, this value is set to 5; |
| 2113 | 2113 | $settings = []; |
| 2114 | 2114 | $rows = DB::query( |
| 2115 | - 'SELECT * FROM ' . prefixTable('misc') . ' WHERE type=%s_type OR type=%s_type2', |
|
| 2115 | + 'SELECT * FROM '.prefixTable('misc').' WHERE type=%s_type OR type=%s_type2', |
|
| 2116 | 2116 | [ |
| 2117 | 2117 | 'type' => 'admin', |
| 2118 | 2118 | 'type2' => 'settings', |
@@ -2144,7 +2144,7 @@ discard block |
||
| 2144 | 2144 | $source_cf = []; |
| 2145 | 2145 | $rows = DB::QUERY( |
| 2146 | 2146 | 'SELECT id_category |
| 2147 | - FROM ' . prefixTable('categories_folders') . ' |
|
| 2147 | + FROM ' . prefixTable('categories_folders').' |
|
| 2148 | 2148 | WHERE id_folder = %i', |
| 2149 | 2149 | $source_id |
| 2150 | 2150 | ); |
@@ -2155,7 +2155,7 @@ discard block |
||
| 2155 | 2155 | $target_cf = []; |
| 2156 | 2156 | $rows = DB::QUERY( |
| 2157 | 2157 | 'SELECT id_category |
| 2158 | - FROM ' . prefixTable('categories_folders') . ' |
|
| 2158 | + FROM ' . prefixTable('categories_folders').' |
|
| 2159 | 2159 | WHERE id_folder = %i', |
| 2160 | 2160 | $target_id |
| 2161 | 2161 | ); |
@@ -2190,9 +2190,9 @@ discard block |
||
| 2190 | 2190 | string $password = null |
| 2191 | 2191 | ) { |
| 2192 | 2192 | // Load AntiXSS |
| 2193 | - include_once $SETTINGS['cpassman_dir'] . '/includes/libraries/voku/helper/AntiXSS.php'; |
|
| 2194 | - include_once $SETTINGS['cpassman_dir'] . '/includes/libraries/voku/helper/ASCII.php'; |
|
| 2195 | - include_once $SETTINGS['cpassman_dir'] . '/includes/libraries/voku/helper/UTF8.php'; |
|
| 2193 | + include_once $SETTINGS['cpassman_dir'].'/includes/libraries/voku/helper/AntiXSS.php'; |
|
| 2194 | + include_once $SETTINGS['cpassman_dir'].'/includes/libraries/voku/helper/ASCII.php'; |
|
| 2195 | + include_once $SETTINGS['cpassman_dir'].'/includes/libraries/voku/helper/UTF8.php'; |
|
| 2196 | 2196 | $antiXss = new voku\helper\AntiXSS(); |
| 2197 | 2197 | // Protect against bad inputs |
| 2198 | 2198 | if (is_array($source_file) === true || is_array($target_file) === true) { |
@@ -2204,7 +2204,7 @@ discard block |
||
| 2204 | 2204 | $target_file = $antiXss->xss_clean($target_file); |
| 2205 | 2205 | if (empty($password) === true || is_null($password) === true) { |
| 2206 | 2206 | // get KEY to define password |
| 2207 | - $ascii_key = file_get_contents(SECUREPATH . '/teampass-seckey.txt'); |
|
| 2207 | + $ascii_key = file_get_contents(SECUREPATH.'/teampass-seckey.txt'); |
|
| 2208 | 2208 | $password = \Defuse\Crypto\Key::loadFromAsciiSafeString($ascii_key); |
| 2209 | 2209 | } |
| 2210 | 2210 | |
@@ -2249,15 +2249,15 @@ discard block |
||
| 2249 | 2249 | ) { |
| 2250 | 2250 | // load PhpEncryption library |
| 2251 | 2251 | $path_to_encryption = '/includes/libraries/Encryption/Encryption/'; |
| 2252 | - include_once $SETTINGS['cpassman_dir'] . $path_to_encryption . 'Crypto.php'; |
|
| 2253 | - include_once $SETTINGS['cpassman_dir'] . $path_to_encryption . 'Encoding.php'; |
|
| 2254 | - include_once $SETTINGS['cpassman_dir'] . $path_to_encryption . 'DerivedKeys.php'; |
|
| 2255 | - include_once $SETTINGS['cpassman_dir'] . $path_to_encryption . 'Key.php'; |
|
| 2256 | - include_once $SETTINGS['cpassman_dir'] . $path_to_encryption . 'KeyOrPassword.php'; |
|
| 2257 | - include_once $SETTINGS['cpassman_dir'] . $path_to_encryption . 'File.php'; |
|
| 2258 | - include_once $SETTINGS['cpassman_dir'] . $path_to_encryption . 'RuntimeTests.php'; |
|
| 2259 | - include_once $SETTINGS['cpassman_dir'] . $path_to_encryption . 'KeyProtectedByPassword.php'; |
|
| 2260 | - include_once $SETTINGS['cpassman_dir'] . $path_to_encryption . 'Core.php'; |
|
| 2252 | + include_once $SETTINGS['cpassman_dir'].$path_to_encryption.'Crypto.php'; |
|
| 2253 | + include_once $SETTINGS['cpassman_dir'].$path_to_encryption.'Encoding.php'; |
|
| 2254 | + include_once $SETTINGS['cpassman_dir'].$path_to_encryption.'DerivedKeys.php'; |
|
| 2255 | + include_once $SETTINGS['cpassman_dir'].$path_to_encryption.'Key.php'; |
|
| 2256 | + include_once $SETTINGS['cpassman_dir'].$path_to_encryption.'KeyOrPassword.php'; |
|
| 2257 | + include_once $SETTINGS['cpassman_dir'].$path_to_encryption.'File.php'; |
|
| 2258 | + include_once $SETTINGS['cpassman_dir'].$path_to_encryption.'RuntimeTests.php'; |
|
| 2259 | + include_once $SETTINGS['cpassman_dir'].$path_to_encryption.'KeyProtectedByPassword.php'; |
|
| 2260 | + include_once $SETTINGS['cpassman_dir'].$path_to_encryption.'Core.php'; |
|
| 2261 | 2261 | try { |
| 2262 | 2262 | \Defuse\Crypto\File::encryptFileWithPassword( |
| 2263 | 2263 | $source_file, |
@@ -2294,15 +2294,15 @@ discard block |
||
| 2294 | 2294 | ) { |
| 2295 | 2295 | // load PhpEncryption library |
| 2296 | 2296 | $path_to_encryption = '/includes/libraries/Encryption/Encryption/'; |
| 2297 | - include_once $SETTINGS['cpassman_dir'] . $path_to_encryption . 'Crypto.php'; |
|
| 2298 | - include_once $SETTINGS['cpassman_dir'] . $path_to_encryption . 'Encoding.php'; |
|
| 2299 | - include_once $SETTINGS['cpassman_dir'] . $path_to_encryption . 'DerivedKeys.php'; |
|
| 2300 | - include_once $SETTINGS['cpassman_dir'] . $path_to_encryption . 'Key.php'; |
|
| 2301 | - include_once $SETTINGS['cpassman_dir'] . $path_to_encryption . 'KeyOrPassword.php'; |
|
| 2302 | - include_once $SETTINGS['cpassman_dir'] . $path_to_encryption . 'File.php'; |
|
| 2303 | - include_once $SETTINGS['cpassman_dir'] . $path_to_encryption . 'RuntimeTests.php'; |
|
| 2304 | - include_once $SETTINGS['cpassman_dir'] . $path_to_encryption . 'KeyProtectedByPassword.php'; |
|
| 2305 | - include_once $SETTINGS['cpassman_dir'] . $path_to_encryption . 'Core.php'; |
|
| 2297 | + include_once $SETTINGS['cpassman_dir'].$path_to_encryption.'Crypto.php'; |
|
| 2298 | + include_once $SETTINGS['cpassman_dir'].$path_to_encryption.'Encoding.php'; |
|
| 2299 | + include_once $SETTINGS['cpassman_dir'].$path_to_encryption.'DerivedKeys.php'; |
|
| 2300 | + include_once $SETTINGS['cpassman_dir'].$path_to_encryption.'Key.php'; |
|
| 2301 | + include_once $SETTINGS['cpassman_dir'].$path_to_encryption.'KeyOrPassword.php'; |
|
| 2302 | + include_once $SETTINGS['cpassman_dir'].$path_to_encryption.'File.php'; |
|
| 2303 | + include_once $SETTINGS['cpassman_dir'].$path_to_encryption.'RuntimeTests.php'; |
|
| 2304 | + include_once $SETTINGS['cpassman_dir'].$path_to_encryption.'KeyProtectedByPassword.php'; |
|
| 2305 | + include_once $SETTINGS['cpassman_dir'].$path_to_encryption.'Core.php'; |
|
| 2306 | 2306 | try { |
| 2307 | 2307 | \Defuse\Crypto\File::decryptFileWithPassword( |
| 2308 | 2308 | $source_file, |
@@ -2349,9 +2349,9 @@ discard block |
||
| 2349 | 2349 | function fileDelete(string $file, array $SETTINGS): void |
| 2350 | 2350 | { |
| 2351 | 2351 | // Load AntiXSS |
| 2352 | - include_once $SETTINGS['cpassman_dir'] . '/includes/libraries/voku/helper/ASCII.php'; |
|
| 2353 | - include_once $SETTINGS['cpassman_dir'] . '/includes/libraries/voku/helper/UTF8.php'; |
|
| 2354 | - include_once $SETTINGS['cpassman_dir'] . '/includes/libraries/voku/helper/AntiXSS.php'; |
|
| 2352 | + include_once $SETTINGS['cpassman_dir'].'/includes/libraries/voku/helper/ASCII.php'; |
|
| 2353 | + include_once $SETTINGS['cpassman_dir'].'/includes/libraries/voku/helper/UTF8.php'; |
|
| 2354 | + include_once $SETTINGS['cpassman_dir'].'/includes/libraries/voku/helper/AntiXSS.php'; |
|
| 2355 | 2355 | $antiXss = new voku\helper\AntiXSS(); |
| 2356 | 2356 | $file = $antiXss->xss_clean($file); |
| 2357 | 2357 | if (is_file($file)) { |
@@ -2401,7 +2401,7 @@ discard block |
||
| 2401 | 2401 | int $dirPerm = 0755 |
| 2402 | 2402 | ) { |
| 2403 | 2403 | // Check if the path exists |
| 2404 | - if (! file_exists($path)) { |
|
| 2404 | + if (!file_exists($path)) { |
|
| 2405 | 2405 | return false; |
| 2406 | 2406 | } |
| 2407 | 2407 | |
@@ -2439,7 +2439,7 @@ discard block |
||
| 2439 | 2439 | */ |
| 2440 | 2440 | function accessToItemIsGranted(int $item_id, array $SETTINGS) |
| 2441 | 2441 | { |
| 2442 | - include_once $SETTINGS['cpassman_dir'] . '/includes/libraries/protect/SuperGlobal/SuperGlobal.php'; |
|
| 2442 | + include_once $SETTINGS['cpassman_dir'].'/includes/libraries/protect/SuperGlobal/SuperGlobal.php'; |
|
| 2443 | 2443 | $superGlobal = new protect\SuperGlobal\SuperGlobal(); |
| 2444 | 2444 | // Prepare superGlobal variables |
| 2445 | 2445 | $session_groupes_visibles = $superGlobal->get('groupes_visibles', 'SESSION'); |
@@ -2447,7 +2447,7 @@ discard block |
||
| 2447 | 2447 | // Load item data |
| 2448 | 2448 | $data = DB::queryFirstRow( |
| 2449 | 2449 | 'SELECT id_tree |
| 2450 | - FROM ' . prefixTable('items') . ' |
|
| 2450 | + FROM ' . prefixTable('items').' |
|
| 2451 | 2451 | WHERE id = %i', |
| 2452 | 2452 | $item_id |
| 2453 | 2453 | ); |
@@ -2510,7 +2510,7 @@ discard block |
||
| 2510 | 2510 | } |
| 2511 | 2511 | $host .= substr(explode(".", $email[1])[0], -1, 1); |
| 2512 | 2512 | } |
| 2513 | - $email = $name . "@" . $host . "." . explode(".", $email[1])[1]; |
|
| 2513 | + $email = $name."@".$host.".".explode(".", $email[1])[1]; |
|
| 2514 | 2514 | return $email; |
| 2515 | 2515 | } |
| 2516 | 2516 | |
@@ -2526,8 +2526,8 @@ discard block |
||
| 2526 | 2526 | function performDBQuery(array $SETTINGS, string $fields, string $table): array |
| 2527 | 2527 | { |
| 2528 | 2528 | // include librairies & connect to DB |
| 2529 | - include_once $SETTINGS['cpassman_dir'] . '/includes/config/settings.php'; |
|
| 2530 | - include_once $SETTINGS['cpassman_dir'] . '/includes/libraries/Database/Meekrodb/db.class.php'; |
|
| 2529 | + include_once $SETTINGS['cpassman_dir'].'/includes/config/settings.php'; |
|
| 2530 | + include_once $SETTINGS['cpassman_dir'].'/includes/libraries/Database/Meekrodb/db.class.php'; |
|
| 2531 | 2531 | if (defined('DB_PASSWD_CLEAR') === false) { |
| 2532 | 2532 | define('DB_PASSWD_CLEAR', defuseReturnDecrypted(DB_PASSWD, $SETTINGS)); |
| 2533 | 2533 | } |
@@ -2539,7 +2539,7 @@ discard block |
||
| 2539 | 2539 | DB::$encoding = DB_ENCODING; |
| 2540 | 2540 | // Insert log in DB |
| 2541 | 2541 | return DB::query( |
| 2542 | - 'SELECT ' . $fields . ' |
|
| 2542 | + 'SELECT '.$fields.' |
|
| 2543 | 2543 | FROM ' . prefixTable($table) |
| 2544 | 2544 | ); |
| 2545 | 2545 | } |
@@ -2554,11 +2554,11 @@ discard block |
||
| 2554 | 2554 | function formatSizeUnits(int $bytes): string |
| 2555 | 2555 | { |
| 2556 | 2556 | if ($bytes >= 1073741824) { |
| 2557 | - $bytes = number_format($bytes / 1073741824, 2) . ' GB'; |
|
| 2557 | + $bytes = number_format($bytes / 1073741824, 2).' GB'; |
|
| 2558 | 2558 | } elseif ($bytes >= 1048576) { |
| 2559 | - $bytes = number_format($bytes / 1048576, 2) . ' MB'; |
|
| 2559 | + $bytes = number_format($bytes / 1048576, 2).' MB'; |
|
| 2560 | 2560 | } elseif ($bytes >= 1024) { |
| 2561 | - $bytes = number_format($bytes / 1024, 2) . ' KB'; |
|
| 2561 | + $bytes = number_format($bytes / 1024, 2).' KB'; |
|
| 2562 | 2562 | } elseif ($bytes > 1) { |
| 2563 | 2563 | $bytes .= ' bytes'; |
| 2564 | 2564 | } elseif ($bytes === 1) { |
@@ -2767,14 +2767,14 @@ discard block |
||
| 2767 | 2767 | |
| 2768 | 2768 | // Encrypt the file content |
| 2769 | 2769 | $plaintext = file_get_contents( |
| 2770 | - filter_var($fileInPath . '/' . $fileInName, FILTER_SANITIZE_URL) |
|
| 2770 | + filter_var($fileInPath.'/'.$fileInName, FILTER_SANITIZE_URL) |
|
| 2771 | 2771 | ); |
| 2772 | 2772 | $ciphertext = $cipher->encrypt($plaintext); |
| 2773 | 2773 | // Save new file |
| 2774 | 2774 | $hash = md5($plaintext); |
| 2775 | - $fileOut = $fileInPath . '/' . TP_FILE_PREFIX . $hash; |
|
| 2775 | + $fileOut = $fileInPath.'/'.TP_FILE_PREFIX.$hash; |
|
| 2776 | 2776 | file_put_contents($fileOut, $ciphertext); |
| 2777 | - unlink($fileInPath . '/' . $fileInName); |
|
| 2777 | + unlink($fileInPath.'/'.$fileInName); |
|
| 2778 | 2778 | return [ |
| 2779 | 2779 | 'fileHash' => base64_encode($hash), |
| 2780 | 2780 | 'objectKey' => base64_encode($objectKey), |
@@ -2792,7 +2792,7 @@ discard block |
||
| 2792 | 2792 | */ |
| 2793 | 2793 | function decryptFile(string $fileName, string $filePath, string $key): string |
| 2794 | 2794 | { |
| 2795 | - if (! defined('FILE_BUFFER_SIZE')) { |
|
| 2795 | + if (!defined('FILE_BUFFER_SIZE')) { |
|
| 2796 | 2796 | define('FILE_BUFFER_SIZE', 128 * 1024); |
| 2797 | 2797 | } |
| 2798 | 2798 | |
@@ -2811,7 +2811,7 @@ discard block |
||
| 2811 | 2811 | $cipher->enableContinuousBuffer(); |
| 2812 | 2812 | $cipher->disablePadding(); |
| 2813 | 2813 | // Get file content |
| 2814 | - $ciphertext = file_get_contents($filePath . '/' . TP_FILE_PREFIX . $fileName); |
|
| 2814 | + $ciphertext = file_get_contents($filePath.'/'.TP_FILE_PREFIX.$fileName); |
|
| 2815 | 2815 | // Decrypt file content and return |
| 2816 | 2816 | return base64_encode($cipher->decrypt($ciphertext)); |
| 2817 | 2817 | } |
@@ -2865,8 +2865,8 @@ discard block |
||
| 2865 | 2865 | array $SETTINGS |
| 2866 | 2866 | ): void { |
| 2867 | 2867 | // include librairies & connect to DB |
| 2868 | - include_once $SETTINGS['cpassman_dir'] . '/includes/config/settings.php'; |
|
| 2869 | - include_once $SETTINGS['cpassman_dir'] . '/includes/libraries/Database/Meekrodb/db.class.php'; |
|
| 2868 | + include_once $SETTINGS['cpassman_dir'].'/includes/config/settings.php'; |
|
| 2869 | + include_once $SETTINGS['cpassman_dir'].'/includes/libraries/Database/Meekrodb/db.class.php'; |
|
| 2870 | 2870 | if (defined('DB_PASSWD_CLEAR') === false) { |
| 2871 | 2871 | define('DB_PASSWD_CLEAR', defuseReturnDecrypted(DB_PASSWD, $SETTINGS)); |
| 2872 | 2872 | } |
@@ -2883,7 +2883,7 @@ discard block |
||
| 2883 | 2883 | $post_object_id |
| 2884 | 2884 | ); |
| 2885 | 2885 | // Superglobals |
| 2886 | - include_once $SETTINGS['cpassman_dir'] . '/includes/libraries/protect/SuperGlobal/SuperGlobal.php'; |
|
| 2886 | + include_once $SETTINGS['cpassman_dir'].'/includes/libraries/protect/SuperGlobal/SuperGlobal.php'; |
|
| 2887 | 2887 | $superGlobal = new protect\SuperGlobal\SuperGlobal(); |
| 2888 | 2888 | // Prepare superGlobal variables |
| 2889 | 2889 | $sessionPpersonaFolders = $superGlobal->get('personal_folders', 'SESSION'); |
@@ -2908,8 +2908,8 @@ discard block |
||
| 2908 | 2908 | // Create sharekey for each user |
| 2909 | 2909 | $users = DB::query( |
| 2910 | 2910 | 'SELECT id, public_key |
| 2911 | - FROM ' . prefixTable('users') . ' |
|
| 2912 | - WHERE id NOT IN ("' . OTV_USER_ID . '","' . SSH_USER_ID . '","' . API_USER_ID . '") |
|
| 2911 | + FROM ' . prefixTable('users').' |
|
| 2912 | + WHERE id NOT IN ("' . OTV_USER_ID.'","'.SSH_USER_ID.'","'.API_USER_ID.'") |
|
| 2913 | 2913 | AND public_key != ""' |
| 2914 | 2914 | ); |
| 2915 | 2915 | foreach ($users as $user) { |
@@ -2939,7 +2939,7 @@ discard block |
||
| 2939 | 2939 | function isBase64(string $str): bool |
| 2940 | 2940 | { |
| 2941 | 2941 | $str = (string) trim($str); |
| 2942 | - if (! isset($str[0])) { |
|
| 2942 | + if (!isset($str[0])) { |
|
| 2943 | 2943 | return false; |
| 2944 | 2944 | } |
| 2945 | 2945 | |
@@ -3007,12 +3007,12 @@ discard block |
||
| 3007 | 3007 | ], |
| 3008 | 3008 | ]; |
| 3009 | 3009 | // Load expected libraries |
| 3010 | - require_once $SETTINGS['cpassman_dir'] . '/includes/libraries/Tightenco/Collect/Support/Traits/Macroable.php'; |
|
| 3011 | - require_once $SETTINGS['cpassman_dir'] . '/includes/libraries/Tightenco/Collect/Support/Arr.php'; |
|
| 3012 | - require_once $SETTINGS['cpassman_dir'] . '/includes/libraries/LdapRecord/DetectsErrors.php'; |
|
| 3013 | - require_once $SETTINGS['cpassman_dir'] . '/includes/libraries/LdapRecord/Connection.php'; |
|
| 3014 | - require_once $SETTINGS['cpassman_dir'] . '/includes/libraries/LdapRecord/LdapInterface.php'; |
|
| 3015 | - require_once $SETTINGS['cpassman_dir'] . '/includes/libraries/LdapRecord/Ldap.php'; |
|
| 3010 | + require_once $SETTINGS['cpassman_dir'].'/includes/libraries/Tightenco/Collect/Support/Traits/Macroable.php'; |
|
| 3011 | + require_once $SETTINGS['cpassman_dir'].'/includes/libraries/Tightenco/Collect/Support/Arr.php'; |
|
| 3012 | + require_once $SETTINGS['cpassman_dir'].'/includes/libraries/LdapRecord/DetectsErrors.php'; |
|
| 3013 | + require_once $SETTINGS['cpassman_dir'].'/includes/libraries/LdapRecord/Connection.php'; |
|
| 3014 | + require_once $SETTINGS['cpassman_dir'].'/includes/libraries/LdapRecord/LdapInterface.php'; |
|
| 3015 | + require_once $SETTINGS['cpassman_dir'].'/includes/libraries/LdapRecord/Ldap.php'; |
|
| 3016 | 3016 | $ad = new SplClassLoader('LdapRecord', '../includes/libraries'); |
| 3017 | 3017 | $ad->register(); |
| 3018 | 3018 | $connection = new Connection($config); |
@@ -3021,7 +3021,7 @@ discard block |
||
| 3021 | 3021 | $connection->connect(); |
| 3022 | 3022 | } catch (\LdapRecord\Auth\BindException $e) { |
| 3023 | 3023 | $error = $e->getDetailedError(); |
| 3024 | - echo 'Error : '.$error->getErrorCode().' - '.$error->getErrorMessage(). '<br>'.$error->getDiagnosticMessage(); |
|
| 3024 | + echo 'Error : '.$error->getErrorCode().' - '.$error->getErrorMessage().'<br>'.$error->getDiagnosticMessage(); |
|
| 3025 | 3025 | return false; |
| 3026 | 3026 | } |
| 3027 | 3027 | |
@@ -3034,7 +3034,7 @@ discard block |
||
| 3034 | 3034 | } |
| 3035 | 3035 | } catch (\LdapRecord\Auth\BindException $e) { |
| 3036 | 3036 | $error = $e->getDetailedError(); |
| 3037 | - echo 'Error : '.$error->getErrorCode().' - '.$error->getErrorMessage(). '<br>'.$error->getDiagnosticMessage(); |
|
| 3037 | + echo 'Error : '.$error->getErrorCode().' - '.$error->getErrorMessage().'<br>'.$error->getDiagnosticMessage(); |
|
| 3038 | 3038 | return false; |
| 3039 | 3039 | } |
| 3040 | 3040 | |
@@ -3052,8 +3052,8 @@ discard block |
||
| 3052 | 3052 | function deleteUserObjetsKeys(int $userId, array $SETTINGS): bool |
| 3053 | 3053 | { |
| 3054 | 3054 | // include librairies & connect to DB |
| 3055 | - include_once $SETTINGS['cpassman_dir'] . '/includes/config/settings.php'; |
|
| 3056 | - include_once $SETTINGS['cpassman_dir'] . '/includes/libraries/Database/Meekrodb/db.class.php'; |
|
| 3055 | + include_once $SETTINGS['cpassman_dir'].'/includes/config/settings.php'; |
|
| 3056 | + include_once $SETTINGS['cpassman_dir'].'/includes/libraries/Database/Meekrodb/db.class.php'; |
|
| 3057 | 3057 | if (defined('DB_PASSWD_CLEAR') === false) { |
| 3058 | 3058 | define('DB_PASSWD_CLEAR', defuseReturnDecrypted(DB_PASSWD, $SETTINGS)); |
| 3059 | 3059 | } |
@@ -3111,7 +3111,7 @@ discard block |
||
| 3111 | 3111 | foreach (DateTimeZone::listIdentifiers() as $timezone) { |
| 3112 | 3112 | $now->setTimezone(new DateTimeZone($timezone)); |
| 3113 | 3113 | $offsets[] = $offset = $now->getOffset(); |
| 3114 | - $timezones[$timezone] = '(' . format_GMT_offset($offset) . ') ' . format_timezone_name($timezone); |
|
| 3114 | + $timezones[$timezone] = '('.format_GMT_offset($offset).') '.format_timezone_name($timezone); |
|
| 3115 | 3115 | } |
| 3116 | 3116 | |
| 3117 | 3117 | array_multisort($offsets, $timezones); |
@@ -3131,7 +3131,7 @@ discard block |
||
| 3131 | 3131 | { |
| 3132 | 3132 | $hours = intval($offset / 3600); |
| 3133 | 3133 | $minutes = abs(intval($offset % 3600 / 60)); |
| 3134 | - return 'GMT' . ($offset ? sprintf('%+03d:%02d', $hours, $minutes) : ''); |
|
| 3134 | + return 'GMT'.($offset ? sprintf('%+03d:%02d', $hours, $minutes) : ''); |
|
| 3135 | 3135 | } |
| 3136 | 3136 | |
| 3137 | 3137 | /** |
@@ -54,12 +54,12 @@ discard block |
||
| 54 | 54 | && filter_input(INPUT_POST, 'session', FILTER_SANITIZE_STRING) === 'expired' |
| 55 | 55 | ) { |
| 56 | 56 | //Include files |
| 57 | - require_once $SETTINGS['cpassman_dir'] . '/includes/config/settings.php'; |
|
| 58 | - require_once $SETTINGS['cpassman_dir'] . '/includes/config/include.php'; |
|
| 59 | - require_once $SETTINGS['cpassman_dir'] . '/sources/SplClassLoader.php'; |
|
| 60 | - require_once $SETTINGS['cpassman_dir'] . '/sources/main.functions.php'; |
|
| 57 | + require_once $SETTINGS['cpassman_dir'].'/includes/config/settings.php'; |
|
| 58 | + require_once $SETTINGS['cpassman_dir'].'/includes/config/include.php'; |
|
| 59 | + require_once $SETTINGS['cpassman_dir'].'/sources/SplClassLoader.php'; |
|
| 60 | + require_once $SETTINGS['cpassman_dir'].'/sources/main.functions.php'; |
|
| 61 | 61 | // connect to DB |
| 62 | - require_once $SETTINGS['cpassman_dir'] . '/includes/libraries/Database/Meekrodb/db.class.php'; |
|
| 62 | + require_once $SETTINGS['cpassman_dir'].'/includes/libraries/Database/Meekrodb/db.class.php'; |
|
| 63 | 63 | if (defined('DB_PASSWD_CLEAR') === false) { |
| 64 | 64 | define('DB_PASSWD_CLEAR', defuseReturnDecrypted(DB_PASSWD, $SETTINGS)); |
| 65 | 65 | } |
@@ -69,7 +69,7 @@ discard block |
||
| 69 | 69 | // Update table by deleting ID |
| 70 | 70 | if (isset($_SESSION['user_id'])) { |
| 71 | 71 | DB::update( |
| 72 | - DB_PREFIX . 'users', |
|
| 72 | + DB_PREFIX.'users', |
|
| 73 | 73 | [ |
| 74 | 74 | 'key_tempo' => '', |
| 75 | 75 | ], |
@@ -83,7 +83,7 @@ discard block |
||
| 83 | 83 | logEvents($SETTINGS, 'user_connection', 'disconnection', (string) $_SESSION['user_id'], $_SESSION['login']); |
| 84 | 84 | } |
| 85 | 85 | } else { |
| 86 | - require_once $SETTINGS['cpassman_dir'] . '/sources/main.queries.php'; |
|
| 86 | + require_once $SETTINGS['cpassman_dir'].'/sources/main.queries.php'; |
|
| 87 | 87 | $errorCode = ''; |
| 88 | 88 | if (@$_SESSION['error']['code'] === ERR_NOT_ALLOWED) { |
| 89 | 89 | $errorCode = 'ERROR NOT ALLOWED'; |
@@ -43,15 +43,15 @@ discard block |
||
| 43 | 43 | } |
| 44 | 44 | |
| 45 | 45 | /* do checks */ |
| 46 | -require_once $SETTINGS['cpassman_dir'] . '/sources/checks.php'; |
|
| 46 | +require_once $SETTINGS['cpassman_dir'].'/sources/checks.php'; |
|
| 47 | 47 | if (checkUser($_SESSION['user_id'], $_SESSION['key'], 'roles', $SETTINGS) === false) { |
| 48 | 48 | $_SESSION['error']['code'] = ERR_NOT_ALLOWED; |
| 49 | - include $SETTINGS['cpassman_dir'] . '/error.php'; |
|
| 49 | + include $SETTINGS['cpassman_dir'].'/error.php'; |
|
| 50 | 50 | exit; |
| 51 | 51 | } |
| 52 | 52 | |
| 53 | 53 | // Load template |
| 54 | -require_once $SETTINGS['cpassman_dir'] . '/sources/main.functions.php'; |
|
| 54 | +require_once $SETTINGS['cpassman_dir'].'/sources/main.functions.php'; |
|
| 55 | 55 | |
| 56 | 56 | ?> |
| 57 | 57 | |
@@ -94,17 +94,17 @@ discard block |
||
| 94 | 94 | $arrUserRoles = array_filter($_SESSION['user_roles']); |
| 95 | 95 | $where = ''; |
| 96 | 96 | if (count($arrUserRoles) > 0 && (int) $_SESSION['is_admin'] !== 1) { |
| 97 | - $where = ' WHERE id IN (' . implode(',', $arrUserRoles) . ')'; |
|
| 97 | + $where = ' WHERE id IN ('.implode(',', $arrUserRoles).')'; |
|
| 98 | 98 | } |
| 99 | - $rows = DB::query('SELECT * FROM ' . prefixTable('roles_title') . $where); |
|
| 99 | + $rows = DB::query('SELECT * FROM '.prefixTable('roles_title').$where); |
|
| 100 | 100 | foreach ($rows as $reccord) { |
| 101 | 101 | echo ' |
| 102 | - <option value="' . $reccord['id'] . '" |
|
| 103 | - data-complexity-text="' . addslashes(TP_PW_COMPLEXITY[$reccord['complexity']][1]) . '" |
|
| 104 | - data-complexity-icon="' . TP_PW_COMPLEXITY[$reccord['complexity']][2] . '" |
|
| 105 | - data-complexity="' . TP_PW_COMPLEXITY[$reccord['complexity']][0] . '" |
|
| 106 | - data-allow-edit-all="' . $reccord['allow_pw_change'] . '">'. |
|
| 107 | - $reccord['title'] . '</option>'; |
|
| 102 | + <option value="' . $reccord['id'].'" |
|
| 103 | + data-complexity-text="' . addslashes(TP_PW_COMPLEXITY[$reccord['complexity']][1]).'" |
|
| 104 | + data-complexity-icon="' . TP_PW_COMPLEXITY[$reccord['complexity']][2].'" |
|
| 105 | + data-complexity="' . TP_PW_COMPLEXITY[$reccord['complexity']][0].'" |
|
| 106 | + data-allow-edit-all="' . $reccord['allow_pw_change'].'">'. |
|
| 107 | + $reccord['title'].'</option>'; |
|
| 108 | 108 | } |
| 109 | 109 | ?> |
| 110 | 110 | </select> |
@@ -125,7 +125,7 @@ discard block |
||
| 125 | 125 | <?php |
| 126 | 126 | foreach (TP_PW_COMPLEXITY as $entry) { |
| 127 | 127 | echo ' |
| 128 | - <option value="' . $entry[0] . '">' . addslashes($entry[1]) . '</option>'; |
|
| 128 | + <option value="' . $entry[0].'">'.addslashes($entry[1]).'</option>'; |
|
| 129 | 129 | } |
| 130 | 130 | ?> |
| 131 | 131 | </select> |
@@ -43,11 +43,11 @@ |
||
| 43 | 43 | } |
| 44 | 44 | echo "ici"; |
| 45 | 45 | /* do checks */ |
| 46 | -require_once $SETTINGS['cpassman_dir'] . '/sources/checks.php'; |
|
| 46 | +require_once $SETTINGS['cpassman_dir'].'/sources/checks.php'; |
|
| 47 | 47 | if (checkUser($_SESSION['user_id'], $_SESSION['key'], '2fa', $SETTINGS) === false) { |
| 48 | 48 | $_SESSION['error']['code'] = ERR_NOT_ALLOWED; |
| 49 | 49 | //not allowed page |
| 50 | - include $SETTINGS['cpassman_dir'] . '/error.php'; |
|
| 50 | + include $SETTINGS['cpassman_dir'].'/error.php'; |
|
| 51 | 51 | exit; |
| 52 | 52 | } |
| 53 | 53 | ?> |