@@ -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', $_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'; |
@@ -71,8 +71,8 @@ discard block |
||
| 71 | 71 | } |
| 72 | 72 | |
| 73 | 73 | // Include files |
| 74 | -require_once $SETTINGS['cpassman_dir'] . '/includes/config/settings.php'; |
|
| 75 | -require_once $SETTINGS['cpassman_dir'] . '/includes/config/include.php'; |
|
| 74 | +require_once $SETTINGS['cpassman_dir'].'/includes/config/settings.php'; |
|
| 75 | +require_once $SETTINGS['cpassman_dir'].'/includes/config/include.php'; |
|
| 76 | 76 | // Quick major version check -> upgrade needed? |
| 77 | 77 | if (isset($SETTINGS['cpassman_version']) === true && version_compare(TP_VERSION, $SETTINGS['cpassman_version']) > 0) { |
| 78 | 78 | // Perform redirection |
@@ -85,7 +85,7 @@ discard block |
||
| 85 | 85 | exit; |
| 86 | 86 | } |
| 87 | 87 | |
| 88 | -require_once $SETTINGS['cpassman_dir'] . '/includes/libraries/protect/SuperGlobal/SuperGlobal.php'; |
|
| 88 | +require_once $SETTINGS['cpassman_dir'].'/includes/libraries/protect/SuperGlobal/SuperGlobal.php'; |
|
| 89 | 89 | $superGlobal = new protect\SuperGlobal\SuperGlobal(); |
| 90 | 90 | |
| 91 | 91 | if (isset($SETTINGS['cpassman_url']) === false || $SETTINGS['cpassman_url'] === '') { |
@@ -93,8 +93,8 @@ discard block |
||
| 93 | 93 | } |
| 94 | 94 | |
| 95 | 95 | // Include files |
| 96 | -require_once $SETTINGS['cpassman_dir'] . '/sources/SplClassLoader.php'; |
|
| 97 | -require_once $SETTINGS['cpassman_dir'] . '/sources/main.functions.php'; |
|
| 96 | +require_once $SETTINGS['cpassman_dir'].'/sources/SplClassLoader.php'; |
|
| 97 | +require_once $SETTINGS['cpassman_dir'].'/sources/main.functions.php'; |
|
| 98 | 98 | // Open MYSQL database connection |
| 99 | 99 | require_once './includes/libraries/Database/Meekrodb/db.class.php'; |
| 100 | 100 | if (defined('DB_PASSWD_CLEAR') === false) { |
@@ -107,7 +107,7 @@ discard block |
||
| 107 | 107 | DB::$port = DB_PORT; |
| 108 | 108 | DB::$encoding = DB_ENCODING; |
| 109 | 109 | // Load Core library |
| 110 | -require_once $SETTINGS['cpassman_dir'] . '/sources/core.php'; |
|
| 110 | +require_once $SETTINGS['cpassman_dir'].'/sources/core.php'; |
|
| 111 | 111 | // Prepare POST variables |
| 112 | 112 | $post_language = filter_input(INPUT_POST, 'language', FILTER_SANITIZE_STRING); |
| 113 | 113 | // Prepare superGlobal variables |
@@ -137,7 +137,7 @@ discard block |
||
| 137 | 137 | // case of user has change language in the login page |
| 138 | 138 | $dataLanguage = DB::queryFirstRow( |
| 139 | 139 | 'SELECT flag, name |
| 140 | - FROM ' . prefixTable('languages') . ' |
|
| 140 | + FROM ' . prefixTable('languages').' |
|
| 141 | 141 | WHERE name = %s', |
| 142 | 142 | $get['language'] |
| 143 | 143 | ); |
@@ -147,8 +147,8 @@ discard block |
||
| 147 | 147 | //get default language |
| 148 | 148 | $dataLanguage = DB::queryFirstRow( |
| 149 | 149 | 'SELECT m.valeur AS valeur, l.flag AS flag |
| 150 | - FROM ' . prefixTable('misc') . ' AS m |
|
| 151 | - INNER JOIN ' . prefixTable('languages') . ' AS l ON (m.valeur = l.name) |
|
| 150 | + FROM ' . prefixTable('misc').' AS m |
|
| 151 | + INNER JOIN ' . prefixTable('languages').' AS l ON (m.valeur = l.name) |
|
| 152 | 152 | WHERE m.type=%s_type AND m.intitule=%s_intitule', |
| 153 | 153 | [ |
| 154 | 154 | 'type' => 'admin', |
@@ -190,23 +190,23 @@ discard block |
||
| 190 | 190 | |
| 191 | 191 | // Load user languages files |
| 192 | 192 | if (in_array($session_user_language, $languagesList) === true) { |
| 193 | - if (file_exists($SETTINGS['cpassman_dir'] . '/includes/language/' . $session_user_language . '.php') === true) { |
|
| 194 | - $_SESSION['teampass']['lang'] = include $SETTINGS['cpassman_dir'] . '/includes/language/' . $session_user_language . '.php'; |
|
| 193 | + if (file_exists($SETTINGS['cpassman_dir'].'/includes/language/'.$session_user_language.'.php') === true) { |
|
| 194 | + $_SESSION['teampass']['lang'] = include $SETTINGS['cpassman_dir'].'/includes/language/'.$session_user_language.'.php'; |
|
| 195 | 195 | } |
| 196 | 196 | } else { |
| 197 | 197 | $_SESSION['error']['code'] = ERR_NOT_ALLOWED; |
| 198 | 198 | //not allowed page |
| 199 | - include $SETTINGS['cpassman_dir'] . '/error.php'; |
|
| 199 | + include $SETTINGS['cpassman_dir'].'/error.php'; |
|
| 200 | 200 | } |
| 201 | 201 | |
| 202 | 202 | // load 2FA Google |
| 203 | 203 | if (isset($SETTINGS['google_authentication']) === true && $SETTINGS['google_authentication'] === '1') { |
| 204 | - include_once $SETTINGS['cpassman_dir'] . '/includes/libraries/Authentication/TwoFactorAuth/TwoFactorAuth.php'; |
|
| 204 | + include_once $SETTINGS['cpassman_dir'].'/includes/libraries/Authentication/TwoFactorAuth/TwoFactorAuth.php'; |
|
| 205 | 205 | } |
| 206 | 206 | |
| 207 | 207 | // load 2FA Yubico |
| 208 | 208 | if (isset($SETTINGS['yubico_authentication']) === true && $SETTINGS['yubico_authentication'] === '1') { |
| 209 | - include_once $SETTINGS['cpassman_dir'] . '/includes/libraries/Authentication/Yubico/Yubico.php'; |
|
| 209 | + include_once $SETTINGS['cpassman_dir'].'/includes/libraries/Authentication/Yubico/Yubico.php'; |
|
| 210 | 210 | } |
| 211 | 211 | |
| 212 | 212 | // Some template adjust |
@@ -263,7 +263,7 @@ discard block |
||
| 263 | 263 | <!-- Toastr --> |
| 264 | 264 | <link rel="stylesheet" href="plugins/toastr/toastr.min.css" /> |
| 265 | 265 | <!-- favicon --> |
| 266 | - <link rel="shortcut icon" type="image/png" href="<?php echo $SETTINGS['favicon'];?>"/> |
|
| 266 | + <link rel="shortcut icon" type="image/png" href="<?php echo $SETTINGS['favicon']; ?>"/> |
|
| 267 | 267 | </head> |
| 268 | 268 | |
| 269 | 269 | |
@@ -294,7 +294,7 @@ discard block |
||
| 294 | 294 | ), |
| 295 | 295 | 'SESSION' |
| 296 | 296 | ); |
| 297 | - include $SETTINGS['cpassman_dir'] . '/error.php'; |
|
| 297 | + include $SETTINGS['cpassman_dir'].'/error.php'; |
|
| 298 | 298 | } |
| 299 | 299 | } elseif ( |
| 300 | 300 | $session_validite_pw !== null |
@@ -338,7 +338,7 @@ discard block |
||
| 338 | 338 | <div class="dropdown show"> |
| 339 | 339 | <a class="btn btn-primary dropdown-toggle" href="#" data-toggle="dropdown"> |
| 340 | 340 | <?php |
| 341 | - echo $session_name . ' ' . $session_lastname; ?> |
|
| 341 | + echo $session_name.' '.$session_lastname; ?> |
|
| 342 | 342 | </a> |
| 343 | 343 | |
| 344 | 344 | <div class="dropdown-menu dropdown-menu-right"> |
@@ -376,7 +376,7 @@ discard block |
||
| 376 | 376 | <!-- Main Sidebar Container --> |
| 377 | 377 | <aside class="main-sidebar sidebar-dark-primary elevation-4"> |
| 378 | 378 | <!-- Brand Logo --> |
| 379 | - <a href="<?php echo $SETTINGS['cpassman_url'] . '/index.php?page=items'; ?>" class="brand-link"> |
|
| 379 | + <a href="<?php echo $SETTINGS['cpassman_url'].'/index.php?page=items'; ?>" class="brand-link"> |
|
| 380 | 380 | <img src="includes/images/teampass-logo2-home.png" alt="Teampass Logo" class="brand-image"> |
| 381 | 381 | <span class="brand-text font-weight-light"><?php echo TP_TOOL_NAME; ?></span> |
| 382 | 382 | </a> |
@@ -394,7 +394,7 @@ discard block |
||
| 394 | 394 | <a href="#" data-name="items" class="nav-link', $get['page'] === 'items' ? ' active' : '', '"> |
| 395 | 395 | <i class="nav-icon fas fa-key"></i> |
| 396 | 396 | <p> |
| 397 | - ' . langHdl('pw') . ' |
|
| 397 | + ' . langHdl('pw').' |
|
| 398 | 398 | </p> |
| 399 | 399 | </a> |
| 400 | 400 | </li>'; |
@@ -410,7 +410,7 @@ discard block |
||
| 410 | 410 | <a href="#" data-name="import" class="nav-link', $get['page'] === 'import' ? ' active' : '', '"> |
| 411 | 411 | <i class="nav-icon fas fa-file-import"></i> |
| 412 | 412 | <p> |
| 413 | - ' . langHdl('import') . ' |
|
| 413 | + ' . langHdl('import').' |
|
| 414 | 414 | </p> |
| 415 | 415 | </a> |
| 416 | 416 | </li>'; |
@@ -431,7 +431,7 @@ discard block |
||
| 431 | 431 | <a href="#" data-name="export" class="nav-link', $get['page'] === 'export' ? ' active' : '', '"> |
| 432 | 432 | <i class="nav-icon fas fa-file-export"></i> |
| 433 | 433 | <p> |
| 434 | - ' . langHdl('export') . ' |
|
| 434 | + ' . langHdl('export').' |
|
| 435 | 435 | </p> |
| 436 | 436 | </a> |
| 437 | 437 | </li>'; |
@@ -458,7 +458,7 @@ discard block |
||
| 458 | 458 | <a href="#" data-name="search" class="nav-link', $get['page'] === 'search' ? ' active' : '', '"> |
| 459 | 459 | <i class="nav-icon fas fa-search"></i> |
| 460 | 460 | <p> |
| 461 | - ' . langHdl('find') . ' |
|
| 461 | + ' . langHdl('find').' |
|
| 462 | 462 | </p> |
| 463 | 463 | </a> |
| 464 | 464 | </li>'; |
@@ -475,7 +475,7 @@ discard block |
||
| 475 | 475 | <a href="#" data-name="favourites" class="nav-link', $get['page'] === 'admin' ? ' favourites' : '', '"> |
| 476 | 476 | <i class="nav-icon fas fa-star"></i> |
| 477 | 477 | <p> |
| 478 | - ' . langHdl('favorites') . ' |
|
| 478 | + ' . langHdl('favorites').' |
|
| 479 | 479 | </p> |
| 480 | 480 | </a> |
| 481 | 481 | </li>'; |
@@ -505,7 +505,7 @@ discard block |
||
| 505 | 505 | <a href="#" data-name="suggestion" class="nav-link', $get['page'] === 'suggestion' ? ' active' : '', '"> |
| 506 | 506 | <i class="nav-icon fas fa-lightbulb"></i> |
| 507 | 507 | <p> |
| 508 | - ' . langHdl('suggestion_menu') . ' |
|
| 508 | + ' . langHdl('suggestion_menu').' |
|
| 509 | 509 | </p> |
| 510 | 510 | </a> |
| 511 | 511 | </li>'; |
@@ -518,7 +518,7 @@ discard block |
||
| 518 | 518 | <a href="#" data-name="admin" class="nav-link', $get['page'] === 'admin' ? ' active' : '', '"> |
| 519 | 519 | <i class="nav-icon fas fa-info"></i> |
| 520 | 520 | <p> |
| 521 | - ' . langHdl('admin_main') . ' |
|
| 521 | + ' . langHdl('admin_main').' |
|
| 522 | 522 | </p> |
| 523 | 523 | </a> |
| 524 | 524 | </li> |
@@ -526,7 +526,7 @@ discard block |
||
| 526 | 526 | <a href="#" class="nav-link"> |
| 527 | 527 | <i class="nav-icon fas fa-wrench"></i> |
| 528 | 528 | <p> |
| 529 | - ' . langHdl('admin_settings') . ' |
|
| 529 | + ' . langHdl('admin_settings').' |
|
| 530 | 530 | <i class="fas fa-angle-left right"></i> |
| 531 | 531 | </p> |
| 532 | 532 | </a> |
@@ -534,55 +534,55 @@ discard block |
||
| 534 | 534 | <li class="nav-item"> |
| 535 | 535 | <a href="#" data-name="options" class="nav-link', $get['page'] === 'options' ? ' active' : '', '"> |
| 536 | 536 | <i class="fas fa-check-double nav-icon"></i> |
| 537 | - <p>' . langHdl('options') . '</p> |
|
| 537 | + <p>' . langHdl('options').'</p> |
|
| 538 | 538 | </a> |
| 539 | 539 | </li> |
| 540 | 540 | <li class="nav-item"> |
| 541 | 541 | <a href="#" data-name="2fa" class="nav-link', $get['page'] === '2fa' ? ' active' : '', '"> |
| 542 | 542 | <i class="fas fa-qrcode nav-icon"></i> |
| 543 | - <p>' . langHdl('mfa_short') . '</p> |
|
| 543 | + <p>' . langHdl('mfa_short').'</p> |
|
| 544 | 544 | </a> |
| 545 | 545 | </li> |
| 546 | 546 | <li class="nav-item"> |
| 547 | 547 | <a href="#" data-name="api" class="nav-link', $get['page'] === 'api' ? ' active' : '', '"> |
| 548 | 548 | <i class="fas fa-cubes nav-icon"></i> |
| 549 | - <p>' . langHdl('api') . '</p> |
|
| 549 | + <p>' . langHdl('api').'</p> |
|
| 550 | 550 | </a> |
| 551 | 551 | </li> |
| 552 | 552 | <li class="nav-item"> |
| 553 | 553 | <a href="#" data-name="backups" class="nav-link', $get['page'] === 'backups' ? ' active' : '', '"> |
| 554 | 554 | <i class="fas fa-database nav-icon"></i> |
| 555 | - <p>' . langHdl('backups') . '</p> |
|
| 555 | + <p>' . langHdl('backups').'</p> |
|
| 556 | 556 | </a> |
| 557 | 557 | </li> |
| 558 | 558 | <li class="nav-item"> |
| 559 | 559 | <a href="#" data-name="emails" class="nav-link', $get['page'] === 'emails' ? ' active' : '', '"> |
| 560 | 560 | <i class="fas fa-envelope nav-icon"></i> |
| 561 | - <p>' . langHdl('emails') . '</p> |
|
| 561 | + <p>' . langHdl('emails').'</p> |
|
| 562 | 562 | </a> |
| 563 | 563 | </li> |
| 564 | 564 | <li class="nav-item"> |
| 565 | 565 | <a href="#" data-name="fields" class="nav-link', $get['page'] === 'fields' ? ' active' : '', '"> |
| 566 | 566 | <i class="fas fa-keyboard nav-icon"></i> |
| 567 | - <p>' . langHdl('fields') . '</p> |
|
| 567 | + <p>' . langHdl('fields').'</p> |
|
| 568 | 568 | </a> |
| 569 | 569 | </li> |
| 570 | 570 | <li class="nav-item"> |
| 571 | 571 | <a href="#" data-name="ldap" class="nav-link', $get['page'] === 'ldap' ? ' active' : '', '"> |
| 572 | 572 | <i class="fas fa-id-card nav-icon"></i> |
| 573 | - <p>' . langHdl('ldap') . '</p> |
|
| 573 | + <p>' . langHdl('ldap').'</p> |
|
| 574 | 574 | </a> |
| 575 | 575 | </li> |
| 576 | 576 | <li class="nav-item"> |
| 577 | 577 | <a href="#" data-name="uploads" class="nav-link', $get['page'] === 'uploads' ? ' active' : '', '"> |
| 578 | 578 | <i class="fas fa-file-upload nav-icon"></i> |
| 579 | - <p>' . langHdl('uploads') . '</p> |
|
| 579 | + <p>' . langHdl('uploads').'</p> |
|
| 580 | 580 | </a> |
| 581 | 581 | </li> |
| 582 | 582 | <li class="nav-item"> |
| 583 | 583 | <a href="#" data-name="statistics" class="nav-link', $get['page'] === 'statistics' ? ' active' : '', '"> |
| 584 | 584 | <i class="fas fa-chart-bar nav-icon"></i> |
| 585 | - <p>' . langHdl('statistics') . '</p> |
|
| 585 | + <p>' . langHdl('statistics').'</p> |
|
| 586 | 586 | </a> |
| 587 | 587 | </li> |
| 588 | 588 | </ul> |
@@ -591,7 +591,7 @@ discard block |
||
| 591 | 591 | <a href="#" data-name="actions" class="nav-link', $get['page'] === 'actions' ? ' active' : '', '"> |
| 592 | 592 | <i class="nav-icon fas fa-cogs"></i> |
| 593 | 593 | <p> |
| 594 | - ' . langHdl('actions') . ' |
|
| 594 | + ' . langHdl('actions').' |
|
| 595 | 595 | </p> |
| 596 | 596 | </a> |
| 597 | 597 | </li>'; |
@@ -607,7 +607,7 @@ discard block |
||
| 607 | 607 | <a href="#" data-name="folders" class="nav-link', $get['page'] === 'folders' ? ' active' : '', '"> |
| 608 | 608 | <i class="nav-icon fas fa-folder-open"></i> |
| 609 | 609 | <p> |
| 610 | - ' . langHdl('folders') . ' |
|
| 610 | + ' . langHdl('folders').' |
|
| 611 | 611 | </p> |
| 612 | 612 | </a> |
| 613 | 613 | </li> |
@@ -615,7 +615,7 @@ discard block |
||
| 615 | 615 | <a href="#" data-name="roles" class="nav-link', $get['page'] === 'roles' ? ' active' : '', '"> |
| 616 | 616 | <i class="nav-icon fas fa-graduation-cap"></i> |
| 617 | 617 | <p> |
| 618 | - ' . langHdl('roles') . ' |
|
| 618 | + ' . langHdl('roles').' |
|
| 619 | 619 | </p> |
| 620 | 620 | </a> |
| 621 | 621 | </li> |
@@ -623,38 +623,38 @@ discard block |
||
| 623 | 623 | <a href="#" data-name="users" class="nav-link', $get['page'] === 'users' ? ' active' : '', '"> |
| 624 | 624 | <i class="nav-icon fas fa-users"></i> |
| 625 | 625 | <p> |
| 626 | - ' . langHdl('users') . ' |
|
| 626 | + ' . langHdl('users').' |
|
| 627 | 627 | </p> |
| 628 | 628 | </a> |
| 629 | 629 | </li> |
| 630 | 630 | <li class="nav-item has-treeview', $menuUtilities === true ? ' menu-open' : '', '"> |
| 631 | 631 | <a href="#" class="nav-link"> |
| 632 | 632 | <i class="nav-icon fas fa-cubes"></i> |
| 633 | - <p>' . langHdl('admin_views') . '<i class="fas fa-angle-left right"></i></p> |
|
| 633 | + <p>' . langHdl('admin_views').'<i class="fas fa-angle-left right"></i></p> |
|
| 634 | 634 | </a> |
| 635 | 635 | <ul class="nav nav-treeview"> |
| 636 | 636 | <li class="nav-item"> |
| 637 | 637 | <a href="#" data-name="utilities.renewal" class="nav-link', $get['page'] === 'utilities.renewal' ? ' active' : '', '"> |
| 638 | 638 | <i class="far fa-calendar-alt nav-icon"></i> |
| 639 | - <p>' . langHdl('renewal') . '</p> |
|
| 639 | + <p>' . langHdl('renewal').'</p> |
|
| 640 | 640 | </a> |
| 641 | 641 | </li> |
| 642 | 642 | <li class="nav-item"> |
| 643 | 643 | <a href="#" data-name="utilities.deletion" class="nav-link', $get['page'] === 'utilities.deletion' ? ' active' : '', '"> |
| 644 | 644 | <i class="fas fa-trash-alt nav-icon"></i> |
| 645 | - <p>' . langHdl('deletion') . '</p> |
|
| 645 | + <p>' . langHdl('deletion').'</p> |
|
| 646 | 646 | </a> |
| 647 | 647 | </li> |
| 648 | 648 | <li class="nav-item"> |
| 649 | 649 | <a href="#" data-name="utilities.logs" class="nav-link', $get['page'] === 'utilities.logs' ? ' active' : '', '"> |
| 650 | 650 | <i class="fas fa-history nav-icon"></i> |
| 651 | - <p>' . langHdl('logs') . '</p> |
|
| 651 | + <p>' . langHdl('logs').'</p> |
|
| 652 | 652 | </a> |
| 653 | 653 | </li> |
| 654 | 654 | <li class="nav-item"> |
| 655 | 655 | <a href="#" data-name="utilities.database" class="nav-link', $get['page'] === 'utilities.database' ? ' active' : '', '"> |
| 656 | 656 | <i class="fas fa-database nav-icon"></i> |
| 657 | - <p>' . langHdl('database') . '</p> |
|
| 657 | + <p>' . langHdl('database').'</p> |
|
| 658 | 658 | </a> |
| 659 | 659 | </li> |
| 660 | 660 | </ul> |
@@ -665,10 +665,10 @@ discard block |
||
| 665 | 665 | <!-- /.sidebar-menu --> |
| 666 | 666 | <div class="menu-footer"> |
| 667 | 667 | <div class="" id="sidebar-footer"> |
| 668 | - <i class="fas fa-clock-o mr-2 infotip text-info pointer" title="<?php echo langHdl('server_time') . ' ' . |
|
| 669 | - date($SETTINGS['date_format'], $server['request_time']) . ' - ' . |
|
| 668 | + <i class="fas fa-clock-o mr-2 infotip text-info pointer" title="<?php echo langHdl('server_time').' '. |
|
| 669 | + date($SETTINGS['date_format'], $server['request_time']).' - '. |
|
| 670 | 670 | date($SETTINGS['time_format'], $server['request_time']); ?>"></i> |
| 671 | - <i class="fas fa-users mr-2 infotip text-info pointer" title="<?php echo $session_nb_users_online . ' ' . langHdl('users_online'); ?>"></i> |
|
| 671 | + <i class="fas fa-users mr-2 infotip text-info pointer" title="<?php echo $session_nb_users_online.' '.langHdl('users_online'); ?>"></i> |
|
| 672 | 672 | <a href="<?php echo READTHEDOC_URL; ?>" target="_blank" class="text-info"><i class="fas fa-book mr-2 infotip" title="<?php echo langHdl('documentation_canal'); ?> ReadTheDocs"></i></a> |
| 673 | 673 | <a href="<?php echo REDDIT_URL; ?>" target="_blank" class="text-info"><i class="fab fa-reddit-alien mr-2 infotip" title="<?php echo langHdl('admin_help'); ?>"></i></a> |
| 674 | 674 | <i class="fas fa-bug infotip pointer text-info" title="<?php echo langHdl('bugs_page'); ?>" onclick="generateBugReport()"></i> |
@@ -971,18 +971,18 @@ discard block |
||
| 971 | 971 | } elseif ($get['page'] === 'items') { |
| 972 | 972 | // SHow page with Items |
| 973 | 973 | if ((int) $session_user_admin !== 1) { |
| 974 | - include $SETTINGS['cpassman_dir'] . '/pages/items.php'; |
|
| 974 | + include $SETTINGS['cpassman_dir'].'/pages/items.php'; |
|
| 975 | 975 | } elseif ((int) $session_user_admin === 1) { |
| 976 | - include $SETTINGS['cpassman_dir'] . '/pages/admin.php'; |
|
| 976 | + include $SETTINGS['cpassman_dir'].'/pages/admin.php'; |
|
| 977 | 977 | } else { |
| 978 | 978 | $_SESSION['error']['code'] = ERR_NOT_ALLOWED; |
| 979 | 979 | //not allowed page |
| 980 | - include $SETTINGS['cpassman_dir'] . '/error.php'; |
|
| 980 | + include $SETTINGS['cpassman_dir'].'/error.php'; |
|
| 981 | 981 | } |
| 982 | 982 | } elseif (in_array($get['page'], array_keys($mngPages)) === true) { |
| 983 | 983 | // Define if user is allowed to see management pages |
| 984 | 984 | if ($session_user_admin === 1) { |
| 985 | - include $SETTINGS['cpassman_dir'] . '/pages/' . $mngPages[$get['page']]; |
|
| 985 | + include $SETTINGS['cpassman_dir'].'/pages/'.$mngPages[$get['page']]; |
|
| 986 | 986 | } elseif ($session_user_manager === 1 || $session_user_human_resources === 1) { |
| 987 | 987 | if ($get['page'] !== 'manage_main' |
| 988 | 988 | && $get['page'] !== 'manage_settings' |
@@ -991,15 +991,15 @@ discard block |
||
| 991 | 991 | } else { |
| 992 | 992 | $_SESSION['error']['code'] = ERR_NOT_ALLOWED; |
| 993 | 993 | //not allowed page |
| 994 | - include $SETTINGS['cpassman_dir'] . '/error.php'; |
|
| 994 | + include $SETTINGS['cpassman_dir'].'/error.php'; |
|
| 995 | 995 | } |
| 996 | 996 | } else { |
| 997 | 997 | $_SESSION['error']['code'] = ERR_NOT_ALLOWED; |
| 998 | 998 | //not allowed page |
| 999 | - include $SETTINGS['cpassman_dir'] . '/error.php'; |
|
| 999 | + include $SETTINGS['cpassman_dir'].'/error.php'; |
|
| 1000 | 1000 | } |
| 1001 | 1001 | } elseif (empty($get['page']) === false) { |
| 1002 | - include $SETTINGS['cpassman_dir'] . '/pages/' . $get['page'] . '.php'; |
|
| 1002 | + include $SETTINGS['cpassman_dir'].'/pages/'.$get['page'].'.php'; |
|
| 1003 | 1003 | } else { |
| 1004 | 1004 | $_SESSION['error']['code'] = ERR_NOT_EXIST; |
| 1005 | 1005 | //page doesn't exist |
@@ -1089,7 +1089,7 @@ discard block |
||
| 1089 | 1089 | $superGlobal->put('initialUrl', '', 'SESSION'); |
| 1090 | 1090 | |
| 1091 | 1091 | // LOGIN form |
| 1092 | - include $SETTINGS['cpassman_dir'] . '/includes/core/login.php'; |
|
| 1092 | + include $SETTINGS['cpassman_dir'].'/includes/core/login.php'; |
|
| 1093 | 1093 | } |
| 1094 | 1094 | |
| 1095 | 1095 | ?> |
@@ -1275,61 +1275,61 @@ discard block |
||
| 1275 | 1275 | isset($_SESSION['CPM']) === true |
| 1276 | 1276 | && isset($SETTINGS['cpassman_dir']) === true |
| 1277 | 1277 | ) { |
| 1278 | - include_once $SETTINGS['cpassman_dir'] . '/includes/core/load.js.php'; |
|
| 1278 | + include_once $SETTINGS['cpassman_dir'].'/includes/core/load.js.php'; |
|
| 1279 | 1279 | if ($menuAdmin === true) { |
| 1280 | - include_once $SETTINGS['cpassman_dir'] . '/pages/admin.js.php'; |
|
| 1280 | + include_once $SETTINGS['cpassman_dir'].'/pages/admin.js.php'; |
|
| 1281 | 1281 | if ($get['page'] === '2fa') { |
| 1282 | - include_once $SETTINGS['cpassman_dir'] . '/pages/2fa.js.php'; |
|
| 1282 | + include_once $SETTINGS['cpassman_dir'].'/pages/2fa.js.php'; |
|
| 1283 | 1283 | } elseif ($get['page'] === 'api') { |
| 1284 | - include_once $SETTINGS['cpassman_dir'] . '/pages/api.js.php'; |
|
| 1284 | + include_once $SETTINGS['cpassman_dir'].'/pages/api.js.php'; |
|
| 1285 | 1285 | } elseif ($get['page'] === 'backups') { |
| 1286 | - include_once $SETTINGS['cpassman_dir'] . '/pages/backups.js.php'; |
|
| 1286 | + include_once $SETTINGS['cpassman_dir'].'/pages/backups.js.php'; |
|
| 1287 | 1287 | } elseif ($get['page'] === 'emails') { |
| 1288 | - include_once $SETTINGS['cpassman_dir'] . '/pages/emails.js.php'; |
|
| 1288 | + include_once $SETTINGS['cpassman_dir'].'/pages/emails.js.php'; |
|
| 1289 | 1289 | } elseif ($get['page'] === 'ldap') { |
| 1290 | - include_once $SETTINGS['cpassman_dir'] . '/pages/ldap.js.php'; |
|
| 1290 | + include_once $SETTINGS['cpassman_dir'].'/pages/ldap.js.php'; |
|
| 1291 | 1291 | } elseif ($get['page'] === 'uploads') { |
| 1292 | - include_once $SETTINGS['cpassman_dir'] . '/pages/uploads.js.php'; |
|
| 1292 | + include_once $SETTINGS['cpassman_dir'].'/pages/uploads.js.php'; |
|
| 1293 | 1293 | } elseif ($get['page'] === 'actions') { |
| 1294 | - include_once $SETTINGS['cpassman_dir'] . '/pages/actions.js.php'; |
|
| 1294 | + include_once $SETTINGS['cpassman_dir'].'/pages/actions.js.php'; |
|
| 1295 | 1295 | } elseif ($get['page'] === 'fields') { |
| 1296 | - include_once $SETTINGS['cpassman_dir'] . '/pages/fields.js.php'; |
|
| 1296 | + include_once $SETTINGS['cpassman_dir'].'/pages/fields.js.php'; |
|
| 1297 | 1297 | } elseif ($get['page'] === 'options') { |
| 1298 | - include_once $SETTINGS['cpassman_dir'] . '/pages/options.js.php'; |
|
| 1298 | + include_once $SETTINGS['cpassman_dir'].'/pages/options.js.php'; |
|
| 1299 | 1299 | } elseif ($get['page'] === 'statistics') { |
| 1300 | - include_once $SETTINGS['cpassman_dir'] . '/pages/statistics.js.php'; |
|
| 1300 | + include_once $SETTINGS['cpassman_dir'].'/pages/statistics.js.php'; |
|
| 1301 | 1301 | } |
| 1302 | 1302 | } elseif (isset($get['page']) === true) { |
| 1303 | 1303 | if ($get['page'] === 'items') { |
| 1304 | - include_once $SETTINGS['cpassman_dir'] . '/pages/items.js.php'; |
|
| 1304 | + include_once $SETTINGS['cpassman_dir'].'/pages/items.js.php'; |
|
| 1305 | 1305 | } elseif ($get['page'] === 'import') { |
| 1306 | - include_once $SETTINGS['cpassman_dir'] . '/pages/import.js.php'; |
|
| 1306 | + include_once $SETTINGS['cpassman_dir'].'/pages/import.js.php'; |
|
| 1307 | 1307 | } elseif ($get['page'] === 'export') { |
| 1308 | - include_once $SETTINGS['cpassman_dir'] . '/pages/export.js.php'; |
|
| 1308 | + include_once $SETTINGS['cpassman_dir'].'/pages/export.js.php'; |
|
| 1309 | 1309 | } elseif ($get['page'] === 'offline') { |
| 1310 | - include_once $SETTINGS['cpassman_dir'] . '/pages/offline.js.php'; |
|
| 1310 | + include_once $SETTINGS['cpassman_dir'].'/pages/offline.js.php'; |
|
| 1311 | 1311 | } elseif ($get['page'] === 'search') { |
| 1312 | - include_once $SETTINGS['cpassman_dir'] . '/pages/search.js.php'; |
|
| 1312 | + include_once $SETTINGS['cpassman_dir'].'/pages/search.js.php'; |
|
| 1313 | 1313 | } elseif ($get['page'] === 'profile') { |
| 1314 | - include_once $SETTINGS['cpassman_dir'] . '/pages/profile.js.php'; |
|
| 1314 | + include_once $SETTINGS['cpassman_dir'].'/pages/profile.js.php'; |
|
| 1315 | 1315 | } elseif ($get['page'] === 'favourites') { |
| 1316 | - include_once $SETTINGS['cpassman_dir'] . '/pages/favorites.js.php'; |
|
| 1316 | + include_once $SETTINGS['cpassman_dir'].'/pages/favorites.js.php'; |
|
| 1317 | 1317 | } elseif ($get['page'] === 'folders') { |
| 1318 | - include_once $SETTINGS['cpassman_dir'] . '/pages/folders.js.php'; |
|
| 1318 | + include_once $SETTINGS['cpassman_dir'].'/pages/folders.js.php'; |
|
| 1319 | 1319 | } elseif ($get['page'] === 'users') { |
| 1320 | - include_once $SETTINGS['cpassman_dir'] . '/pages/users.js.php'; |
|
| 1320 | + include_once $SETTINGS['cpassman_dir'].'/pages/users.js.php'; |
|
| 1321 | 1321 | } elseif ($get['page'] === 'roles') { |
| 1322 | - include_once $SETTINGS['cpassman_dir'] . '/pages/roles.js.php'; |
|
| 1322 | + include_once $SETTINGS['cpassman_dir'].'/pages/roles.js.php'; |
|
| 1323 | 1323 | } elseif ($get['page'] === 'utilities.deletion') { |
| 1324 | - include_once $SETTINGS['cpassman_dir'] . '/pages/utilities.deletion.js.php'; |
|
| 1324 | + include_once $SETTINGS['cpassman_dir'].'/pages/utilities.deletion.js.php'; |
|
| 1325 | 1325 | } elseif ($get['page'] === 'utilities.logs') { |
| 1326 | - include_once $SETTINGS['cpassman_dir'] . '/pages/utilities.logs.js.php'; |
|
| 1326 | + include_once $SETTINGS['cpassman_dir'].'/pages/utilities.logs.js.php'; |
|
| 1327 | 1327 | } elseif ($get['page'] === 'utilities.database') { |
| 1328 | - include_once $SETTINGS['cpassman_dir'] . '/pages/utilities.database.js.php'; |
|
| 1328 | + include_once $SETTINGS['cpassman_dir'].'/pages/utilities.database.js.php'; |
|
| 1329 | 1329 | } elseif ($get['page'] === 'utilities.renewal') { |
| 1330 | - include_once $SETTINGS['cpassman_dir'] . '/pages/utilities.renewal.js.php'; |
|
| 1330 | + include_once $SETTINGS['cpassman_dir'].'/pages/utilities.renewal.js.php'; |
|
| 1331 | 1331 | } |
| 1332 | 1332 | } else { |
| 1333 | - include_once $SETTINGS['cpassman_dir'] . '/includes/core/login.js.php'; |
|
| 1333 | + include_once $SETTINGS['cpassman_dir'].'/includes/core/login.js.php'; |
|
| 1334 | 1334 | } |
| 1335 | 1335 | } |
@@ -48,7 +48,7 @@ |
||
| 48 | 48 | } else { |
| 49 | 49 | throw new Exception("Error file '/includes/config/tp.config.php' not exists", 1); |
| 50 | 50 | } |
| 51 | -require_once $SETTINGS['cpassman_dir'] . '/includes/libraries/protect/SuperGlobal/SuperGlobal.php'; |
|
| 51 | +require_once $SETTINGS['cpassman_dir'].'/includes/libraries/protect/SuperGlobal/SuperGlobal.php'; |
|
| 52 | 52 | $superGlobal = new protect\SuperGlobal\SuperGlobal(); |
| 53 | 53 | ?> |
| 54 | 54 | <body class="hold-transition otv-page"> |
@@ -48,13 +48,13 @@ discard block |
||
| 48 | 48 | <div class="login-logo">', |
| 49 | 49 | isset($SETTINGS['custom_logo']) === true |
| 50 | 50 | && empty($SETTINGS['custom_logo']) === false ? |
| 51 | - '<img src="' . (string) $SETTINGS['custom_logo'] . '" alt="" style="text-align:center;" />' : '', |
|
| 51 | + '<img src="'.(string) $SETTINGS['custom_logo'].'" alt="" style="text-align:center;" />' : '', |
|
| 52 | 52 | ' |
| 53 | 53 | <div style="margin-top:20px;"> |
| 54 | 54 | <img src="includes/images/teampass-logo2-login.png" alt="Teampass Logo"> |
| 55 | 55 | </div> |
| 56 | 56 | <div style="font-weight:bold;"> |
| 57 | - ' . TP_TOOL_NAME . ' |
|
| 57 | + ' . TP_TOOL_NAME.' |
|
| 58 | 58 | </div> |
| 59 | 59 | </div> |
| 60 | 60 | |
@@ -77,7 +77,7 @@ discard block |
||
| 77 | 77 | isset($SETTINGS['enable_http_request_login']) === true |
| 78 | 78 | && (int) $SETTINGS['enable_http_request_login'] === 1 |
| 79 | 79 | && $superGlobal('PHP_AUTH_USER', 'SERVER') !== null |
| 80 | - && ! (isset($SETTINGS['maintenance_mode']) === true |
|
| 80 | + && !(isset($SETTINGS['maintenance_mode']) === true |
|
| 81 | 81 | && (int) $SETTINGS['maintenance_mode'] === 1) |
| 82 | 82 | ) { |
| 83 | 83 | if (strpos($superGlobal('PHP_AUTH_USER', 'SERVER'), '@') !== false) { |
@@ -91,22 +91,22 @@ discard block |
||
| 91 | 91 | <input type="text" id="login" class="form-control" placeholder="', filter_var($username, FILTER_SANITIZE_STRING), '" readonly>'; |
| 92 | 92 | } else { |
| 93 | 93 | echo ' |
| 94 | - <input type="text" id="login" class="form-control" placeholder="' . langHdl('index_login') . '">'; |
|
| 94 | + <input type="text" id="login" class="form-control" placeholder="' . langHdl('index_login').'">'; |
|
| 95 | 95 | } |
| 96 | 96 | |
| 97 | 97 | echo ' |
| 98 | 98 | </div>'; |
| 99 | -if (! (isset($SETTINGS['enable_http_request_login']) === true |
|
| 99 | +if (!(isset($SETTINGS['enable_http_request_login']) === true |
|
| 100 | 100 | && (int) $SETTINGS['enable_http_request_login'] === 1 |
| 101 | 101 | && $superGlobal('PHP_AUTH_USER', 'SERVER') !== null |
| 102 | - && ! (isset($SETTINGS['maintenance_mode']) === true |
|
| 102 | + && !(isset($SETTINGS['maintenance_mode']) === true |
|
| 103 | 103 | && (int) $SETTINGS['maintenance_mode'] === 1))) { |
| 104 | 104 | echo ' |
| 105 | 105 | <div class="input-group has-feedback mb-2"> |
| 106 | 106 | <div class="input-group-prepend"> |
| 107 | 107 | <span class="input-group-text"><i class="fas fa-lock fa-fw"></i></span> |
| 108 | 108 | </div> |
| 109 | - <input type="password" id="pw" class="form-control submit-button" placeholder="' . langHdl('index_password') . '"> |
|
| 109 | + <input type="password" id="pw" class="form-control submit-button" placeholder="' . langHdl('index_password').'"> |
|
| 110 | 110 | </div>'; |
| 111 | 111 | } |
| 112 | 112 | |
@@ -116,7 +116,7 @@ discard block |
||
| 116 | 116 | <span class="input-group-text"><i class="fas fa-clock fa-fw"></i></span> |
| 117 | 117 | </div> |
| 118 | 118 | <input type="text" id="session_duration" class="form-control submit-button" |
| 119 | - placeholder="' . langHdl('index_session_duration') .' (' . langHdl('minutes') . ')" |
|
| 119 | + placeholder="' . langHdl('index_session_duration').' ('.langHdl('minutes').')" |
|
| 120 | 120 | value="', isset($SETTINGS['default_session_expiration_time']) === true ? $SETTINGS['default_session_expiration_time'] : '', '"> |
| 121 | 121 | </div>'; |
| 122 | 122 | // 2FA auth selector |
@@ -129,7 +129,7 @@ discard block |
||
| 129 | 129 | '" /> |
| 130 | 130 | <div class="row mb-3 hidden" id="2fa_methods_selector"> |
| 131 | 131 | <div class="col-12"> |
| 132 | - <h8 class="login-box-msg">' . langHdl('2fa_authentication_selector') . '</h8> |
|
| 132 | + <h8 class="login-box-msg">' . langHdl('2fa_authentication_selector').'</h8> |
|
| 133 | 133 | <div class="2fa-methods text-center mt-2">', |
| 134 | 134 | isset($SETTINGS['google_authentication']) === true && (int) $SETTINGS['google_authentication'] === 1 ? |
| 135 | 135 | ' |
@@ -177,11 +177,11 @@ discard block |
||
| 177 | 177 | <div class="col-1"> |
| 178 | 178 | </div> |
| 179 | 179 | <div class="col-8"> |
| 180 | - <input type="text" id="ga_code" class="form-control submit-button" placeholder="' . langHdl('ga_identification_code') . '" /> |
|
| 180 | + <input type="text" id="ga_code" class="form-control submit-button" placeholder="' . langHdl('ga_identification_code').'" /> |
|
| 181 | 181 | </div> |
| 182 | 182 | <div class="col-1"> |
| 183 | 183 | <i class="fas fa-envelope form-control-feedback pointer infotip text-info" |
| 184 | - title="' . langHdl('i_need_to_generate_new_ga_code') . '" onclick="send_user_new_temporary_ga_code()"></i> |
|
| 184 | + title="' . langHdl('i_need_to_generate_new_ga_code').'" onclick="send_user_new_temporary_ga_code()"></i> |
|
| 185 | 185 | </div> |
| 186 | 186 | </div> |
| 187 | 187 | <div id="div-2fa-google-qr" class="row mt-2 "></div> |
@@ -198,7 +198,7 @@ discard block |
||
| 198 | 198 | <script> |
| 199 | 199 | var seconds = 1; |
| 200 | 200 | function updateLogonButton(timeToGo){ |
| 201 | - document.getElementById("but_identify_user").value = "' . langHdl('duration_login_attempt') . ' " + timeToGo; |
|
| 201 | + document.getElementById("but_identify_user").value = "' . langHdl('duration_login_attempt').' " + timeToGo; |
|
| 202 | 202 | } |
| 203 | 203 | $( window ).on( "load", function() { |
| 204 | 204 | updateLogonButton(seconds); |
@@ -207,7 +207,7 @@ discard block |
||
| 207 | 207 | if (seconds >= 0) { |
| 208 | 208 | updateLogonButton(seconds); |
| 209 | 209 | } else if(seconds === 0) { |
| 210 | - launchIdentify("", "' . $nextUrl . '"); |
|
| 210 | + launchIdentify("", "' . $nextUrl.'"); |
|
| 211 | 211 | } |
| 212 | 212 | updateLogonButton(seconds); |
| 213 | 213 | }, |
@@ -228,15 +228,15 @@ discard block |
||
| 228 | 228 | <div class="col-8"> |
| 229 | 229 | <div id="yubiko-new-key" class="alert alert-info hidden"> |
| 230 | 230 | <p> |
| 231 | - <input type="text" size="10" id="yubico_user_id" class="form-control" placeholder="' . langHdl('yubico_user_id') . '"> |
|
| 231 | + <input type="text" size="10" id="yubico_user_id" class="form-control" placeholder="' . langHdl('yubico_user_id').'"> |
|
| 232 | 232 | </p> |
| 233 | 233 | <p> |
| 234 | - <input type="text" size="10" id="yubico_user_key" class="form-control" placeholder="' . langHdl('yubico_user_key') . '"> |
|
| 234 | + <input type="text" size="10" id="yubico_user_key" class="form-control" placeholder="' . langHdl('yubico_user_key').'"> |
|
| 235 | 235 | </p> |
| 236 | 236 | </div> |
| 237 | - <input autocomplete="off" type="text" id="yubico_key" class="form-control submit-button" placeholder="' . langHdl('press_your_yubico_key') . '"> |
|
| 237 | + <input autocomplete="off" type="text" id="yubico_key" class="form-control submit-button" placeholder="' . langHdl('press_your_yubico_key').'"> |
|
| 238 | 238 | <div class="row"> |
| 239 | - <span class="ml-2 mt-1 font-weight-light small pointer" id="register-yubiko-key">' . langHdl('register_new_yubiko_key') . '</span> |
|
| 239 | + <span class="ml-2 mt-1 font-weight-light small pointer" id="register-yubiko-key">' . langHdl('register_new_yubiko_key').'</span> |
|
| 240 | 240 | </div> |
| 241 | 241 | </div> |
| 242 | 242 | </div>'; |
@@ -245,22 +245,22 @@ discard block |
||
| 245 | 245 | echo ' |
| 246 | 246 | <div class="row mb-3 mt-5"> |
| 247 | 247 | <div class="col-12"> |
| 248 | - <button id="but_identify_user" class="btn btn-primary btn-block">' . langHdl('log_in') . '</button> |
|
| 248 | + <button id="but_identify_user" class="btn btn-primary btn-block">' . langHdl('log_in').'</button> |
|
| 249 | 249 | |
| 250 | 250 | <!-- In case of upgrade, the user has to provide his One Time Code --> |
| 251 | 251 | <div class="card-body user-one-time-code-card-body hidden"> |
| 252 | - <h5 class="login-box-msg">' . langHdl('provide_personal_one_time_code') . '</h5> |
|
| 252 | + <h5 class="login-box-msg">' . langHdl('provide_personal_one_time_code').'</h5> |
|
| 253 | 253 | |
| 254 | 254 | <div class="input-group has-feedback mb-2 mt-4"> |
| 255 | 255 | <div class="input-group-prepend"> |
| 256 | 256 | <span class="input-group-text"><i class="fas fa-unlock-alt"></i></span> |
| 257 | 257 | </div> |
| 258 | - <input type="password" id="user-one-time-code" class="form-control" placeholder="' . langHdl('one_time_code') . '"> |
|
| 258 | + <input type="password" id="user-one-time-code" class="form-control" placeholder="' . langHdl('one_time_code').'"> |
|
| 259 | 259 | </div> |
| 260 | 260 | |
| 261 | 261 | <div class="row mb-3"> |
| 262 | 262 | <div class="col-12"> |
| 263 | - <button id="but_confirm_otc" class="btn btn-primary btn-block">' . langHdl('confirm') . '</button> |
|
| 263 | + <button id="but_confirm_otc" class="btn btn-primary btn-block">' . langHdl('confirm').'</button> |
|
| 264 | 264 | </div> |
| 265 | 265 | </div> |
| 266 | 266 | </div> |
@@ -275,10 +275,10 @@ discard block |
||
| 275 | 275 | // In case of password change |
| 276 | 276 | echo ' |
| 277 | 277 | <div class="card-body confirm-password-card-body hidden"> |
| 278 | - <h5 class="login-box-msg">' . langHdl('new_password_required') . '</h5> |
|
| 278 | + <h5 class="login-box-msg">' . langHdl('new_password_required').'</h5> |
|
| 279 | 279 | |
| 280 | 280 | <div class="alert alert-info"> |
| 281 | - <div class="text-center"><i class="icon fa fa-info"></i>' . langHdl('password_strength') . ' |
|
| 281 | + <div class="text-center"><i class="icon fa fa-info"></i>' . langHdl('password_strength').' |
|
| 282 | 282 | <span id="confirm-password-level" class="ml-2 font-weight-bold"></span></div> |
| 283 | 283 | </div> |
| 284 | 284 | |
@@ -288,20 +288,20 @@ discard block |
||
| 288 | 288 | <div class="input-group-prepend"> |
| 289 | 289 | <span class="input-group-text"><i class="fa fa-key"></i></span> |
| 290 | 290 | </div> |
| 291 | - <input type="password" id="current-user-password" class="form-control" placeholder="' . langHdl('current_password') . '"> |
|
| 291 | + <input type="password" id="current-user-password" class="form-control" placeholder="' . langHdl('current_password').'"> |
|
| 292 | 292 | </div> |
| 293 | 293 | </div> |
| 294 | 294 | <div class="input-group has-feedback mb-2 mt-4"> |
| 295 | 295 | <div class="input-group-prepend"> |
| 296 | 296 | <span class="input-group-text"><i class="fa fa-key"></i></span> |
| 297 | 297 | </div> |
| 298 | - <input type="password" id="new-user-password" class="form-control" placeholder="' . langHdl('index_new_pw') . '"> |
|
| 298 | + <input type="password" id="new-user-password" class="form-control" placeholder="' . langHdl('index_new_pw').'"> |
|
| 299 | 299 | </div> |
| 300 | 300 | <div class="input-group has-feedback mb-2"> |
| 301 | 301 | <div class="input-group-prepend"> |
| 302 | 302 | <span class="input-group-text"><i class="fa fa-key"></i></span> |
| 303 | 303 | </div> |
| 304 | - <input type="password" id="new-user-password-confirm" class="form-control" placeholder="' . langHdl('index_change_pw_confirmation') . '"> |
|
| 304 | + <input type="password" id="new-user-password-confirm" class="form-control" placeholder="' . langHdl('index_change_pw_confirmation').'"> |
|
| 305 | 305 | </div> |
| 306 | 306 | <div class="row mb-3"> |
| 307 | 307 | <div class="col-md-12 offset-sm-4 text-center"> |
@@ -312,7 +312,7 @@ discard block |
||
| 312 | 312 | </div> |
| 313 | 313 | <div class="row mb-3"> |
| 314 | 314 | <div class="col-12"> |
| 315 | - <button id="but_confirm_new_password" class="btn btn-primary btn-block">' . langHdl('confirm') . '</button> |
|
| 315 | + <button id="but_confirm_new_password" class="btn btn-primary btn-block">' . langHdl('confirm').'</button> |
|
| 316 | 316 | </div> |
| 317 | 317 | </div> |
| 318 | 318 | </div> |
@@ -320,20 +320,20 @@ discard block |
||
| 320 | 320 | |
| 321 | 321 | <div class="card-body hidden" id="card-user-treat-psk"> |
| 322 | 322 | <div class="alert alert-info"> |
| 323 | - <div class="text-center"><i class="icon fa fa-info"></i>' . langHdl('user_has_psk_info') . '</div> |
|
| 323 | + <div class="text-center"><i class="icon fa fa-info"></i>' . langHdl('user_has_psk_info').'</div> |
|
| 324 | 324 | </div> |
| 325 | 325 | <div class="input-group has-feedback mb-2"> |
| 326 | 326 | <div class="input-group-prepend"> |
| 327 | 327 | <span class="input-group-text"><i class="fa fa-key"></i></span> |
| 328 | 328 | </div> |
| 329 | - <input type="password" id="user-old-defuse-psk" class="form-control" placeholder="' . langHdl('home_personal_saltkey') . '"> |
|
| 329 | + <input type="password" id="user-old-defuse-psk" class="form-control" placeholder="' . langHdl('home_personal_saltkey').'"> |
|
| 330 | 330 | </div> |
| 331 | 331 | <div class="row mb-3 mt-4"> |
| 332 | 332 | <div class="col-12"> |
| 333 | - <button id="but_confirm_defuse_psk" class="btn btn-primary btn-block">' . langHdl('launch') . '</button> |
|
| 333 | + <button id="but_confirm_defuse_psk" class="btn btn-primary btn-block">' . langHdl('launch').'</button> |
|
| 334 | 334 | </div> |
| 335 | 335 | <div class="col-12 mt-3"> |
| 336 | - <button id="but_confirm_forgot_defuse_psk" class="btn btn-danger btn-block text-bold">' . langHdl('i_cannot_remember') . '</button> |
|
| 336 | + <button id="but_confirm_forgot_defuse_psk" class="btn btn-danger btn-block text-bold">' . langHdl('i_cannot_remember').'</button> |
|
| 337 | 337 | </div> |
| 338 | 338 | </div> |
| 339 | 339 | </div> |
@@ -44,28 +44,28 @@ discard block |
||
| 44 | 44 | throw new Exception("Error file '/includes/config/tp.config.php' not exists", 1); |
| 45 | 45 | } |
| 46 | 46 | |
| 47 | -if (! isset($SETTINGS['cpassman_dir']) || empty($SETTINGS['cpassman_dir']) === true || $SETTINGS['cpassman_dir'] === '.') { |
|
| 47 | +if (!isset($SETTINGS['cpassman_dir']) || empty($SETTINGS['cpassman_dir']) === true || $SETTINGS['cpassman_dir'] === '.') { |
|
| 48 | 48 | $SETTINGS['cpassman_dir'] = '..'; |
| 49 | 49 | } |
| 50 | 50 | |
| 51 | 51 | // Load AntiXSS |
| 52 | -require_once $SETTINGS['cpassman_dir'] . '/includes/libraries/voku/helper/AntiXSS.php'; |
|
| 52 | +require_once $SETTINGS['cpassman_dir'].'/includes/libraries/voku/helper/AntiXSS.php'; |
|
| 53 | 53 | $antiXss = new voku\helper\AntiXSS(); |
| 54 | -require_once $SETTINGS['cpassman_dir'] . '/sources/main.functions.php'; |
|
| 55 | -require_once $SETTINGS['cpassman_dir'] . '/includes/config/include.php'; |
|
| 56 | -require_once $SETTINGS['cpassman_dir'] . '/includes/config/settings.php'; |
|
| 54 | +require_once $SETTINGS['cpassman_dir'].'/sources/main.functions.php'; |
|
| 55 | +require_once $SETTINGS['cpassman_dir'].'/includes/config/include.php'; |
|
| 56 | +require_once $SETTINGS['cpassman_dir'].'/includes/config/settings.php'; |
|
| 57 | 57 | // init |
| 58 | 58 | $ldap_suffix = ''; |
| 59 | 59 | $result = ''; |
| 60 | 60 | $adldap = ''; |
| 61 | 61 | // If Debug then clean the files |
| 62 | 62 | if (DEBUGLDAP === true) { |
| 63 | - define('DEBUGLDAPFILE', $SETTINGS['path_to_files_folder'] . '/ldap.debug.txt'); |
|
| 63 | + define('DEBUGLDAPFILE', $SETTINGS['path_to_files_folder'].'/ldap.debug.txt'); |
|
| 64 | 64 | $fp = fopen(DEBUGLDAPFILE, 'w'); |
| 65 | 65 | fclose($fp); |
| 66 | 66 | } |
| 67 | 67 | if (DEBUGDUO === true) { |
| 68 | - define('DEBUGDUOFILE', $SETTINGS['path_to_files_folder'] . '/duo.debug.txt'); |
|
| 68 | + define('DEBUGDUOFILE', $SETTINGS['path_to_files_folder'].'/duo.debug.txt'); |
|
| 69 | 69 | $fp = fopen(DEBUGDUOFILE, 'w'); |
| 70 | 70 | fclose($fp); |
| 71 | 71 | } |
@@ -81,7 +81,7 @@ discard block |
||
| 81 | 81 | if (defined('DB_PASSWD_CLEAR') === false) { |
| 82 | 82 | define('DB_PASSWD_CLEAR', defuseReturnDecrypted(DB_PASSWD, $SETTINGS)); |
| 83 | 83 | } |
| 84 | -require_once $SETTINGS['cpassman_dir'] . '/includes/libraries/Database/Meekrodb/db.class.php'; |
|
| 84 | +require_once $SETTINGS['cpassman_dir'].'/includes/libraries/Database/Meekrodb/db.class.php'; |
|
| 85 | 85 | if (defined('DB_PASSWD_CLEAR') === false) { |
| 86 | 86 | define('DB_PASSWD_CLEAR', defuseReturnDecrypted(DB_PASSWD, $SETTINGS)); |
| 87 | 87 | } |
@@ -100,7 +100,7 @@ discard block |
||
| 100 | 100 | // Get DUO keys |
| 101 | 101 | $duoData = DB::query( |
| 102 | 102 | 'SELECT intitule, valeur |
| 103 | - FROM ' . prefixTable('misc') . ' |
|
| 103 | + FROM ' . prefixTable('misc').' |
|
| 104 | 104 | WHERE type = %s', |
| 105 | 105 | 'duoSecurity' |
| 106 | 106 | ); |
@@ -109,7 +109,7 @@ discard block |
||
| 109 | 109 | } |
| 110 | 110 | |
| 111 | 111 | // load library |
| 112 | - include_once $SETTINGS['cpassman_dir'] . '/includes/libraries/Authentication/DuoSecurity/Duo.php'; |
|
| 112 | + include_once $SETTINGS['cpassman_dir'].'/includes/libraries/Authentication/DuoSecurity/Duo.php'; |
|
| 113 | 113 | $sig_request = Duo::signRequest( |
| 114 | 114 | $_GLOBALS['IKEY'], |
| 115 | 115 | $_GLOBALS['SKEY'], |
@@ -120,16 +120,16 @@ discard block |
||
| 120 | 120 | debugIdentify( |
| 121 | 121 | DEBUGDUO, |
| 122 | 122 | DEBUGDUOFILE, |
| 123 | - "\n\n-----\n\n" . |
|
| 124 | - 'sig request : ' . $post_login . "\n" . |
|
| 125 | - 'resp : ' . $sig_request . "\n" |
|
| 123 | + "\n\n-----\n\n". |
|
| 124 | + 'sig request : '.$post_login."\n". |
|
| 125 | + 'resp : '.$sig_request."\n" |
|
| 126 | 126 | ); |
| 127 | 127 | } |
| 128 | 128 | |
| 129 | 129 | // load csrfprotector |
| 130 | - $csrfp_config = include_once $SETTINGS['cpassman_dir'] . '/includes/libraries/csrfp/libs/csrfp.config.php'; |
|
| 130 | + $csrfp_config = include_once $SETTINGS['cpassman_dir'].'/includes/libraries/csrfp/libs/csrfp.config.php'; |
|
| 131 | 131 | // return result |
| 132 | - echo '[{"sig_request" : "' . $sig_request . '" , "csrfp_token" : "' . $csrfp_config['CSRFP_TOKEN'] . '" , "csrfp_key" : "' . filter_var($_COOKIE[$csrfp_config['CSRFP_TOKEN']], FILTER_SANITIZE_STRING) . '"}]'; |
|
| 132 | + echo '[{"sig_request" : "'.$sig_request.'" , "csrfp_token" : "'.$csrfp_config['CSRFP_TOKEN'].'" , "csrfp_key" : "'.filter_var($_COOKIE[$csrfp_config['CSRFP_TOKEN']], FILTER_SANITIZE_STRING).'"}]'; |
|
| 133 | 133 | // --- |
| 134 | 134 | // --- |
| 135 | 135 | } elseif ($post_type === 'identify_duo_user_check') { |
@@ -139,7 +139,7 @@ discard block |
||
| 139 | 139 | //-------- |
| 140 | 140 | |
| 141 | 141 | // load library |
| 142 | - include_once $SETTINGS['cpassman_dir'] . '/includes/libraries/Authentication/DuoSecurity/Duo.php'; |
|
| 142 | + include_once $SETTINGS['cpassman_dir'].'/includes/libraries/Authentication/DuoSecurity/Duo.php'; |
|
| 143 | 143 | $authenticated_username = Duo::verifyResponse( |
| 144 | 144 | $SETTINGS['duo_ikey'], |
| 145 | 145 | $SETTINGS['duo_skey'], |
@@ -150,9 +150,9 @@ discard block |
||
| 150 | 150 | debugIdentify( |
| 151 | 151 | DEBUGDUO, |
| 152 | 152 | DEBUGDUOFILE, |
| 153 | - "\n\n-----\n\n" . |
|
| 154 | - 'sig response : ' . $post_sig_response . "\n" . |
|
| 155 | - 'resp : ' . $authenticated_username . "\n" |
|
| 153 | + "\n\n-----\n\n". |
|
| 154 | + 'sig response : '.$post_sig_response."\n". |
|
| 155 | + 'resp : '.$authenticated_username."\n" |
|
| 156 | 156 | ); |
| 157 | 157 | } |
| 158 | 158 | |
@@ -163,7 +163,7 @@ discard block |
||
| 163 | 163 | // is user in Teampass? |
| 164 | 164 | $userInfo = DB::queryfirstrow( |
| 165 | 165 | 'SELECT id |
| 166 | - FROM ' . prefixTable('users') . ' |
|
| 166 | + FROM ' . prefixTable('users').' |
|
| 167 | 167 | WHERE login = %s', |
| 168 | 168 | $post_login |
| 169 | 169 | ); |
@@ -173,9 +173,9 @@ discard block |
||
| 173 | 173 | } |
| 174 | 174 | } |
| 175 | 175 | |
| 176 | - echo '[{"authenticated_username" : "' . $authenticated_username . '"}]'; |
|
| 176 | + echo '[{"authenticated_username" : "'.$authenticated_username.'"}]'; |
|
| 177 | 177 | } else { |
| 178 | - echo '[{"authenticated_username" : "' . $authenticated_username . '"}]'; |
|
| 178 | + echo '[{"authenticated_username" : "'.$authenticated_username.'"}]'; |
|
| 179 | 179 | } |
| 180 | 180 | // --- |
| 181 | 181 | // --- |
@@ -185,7 +185,7 @@ discard block |
||
| 185 | 185 | //-------- |
| 186 | 186 | |
| 187 | 187 | // Load superGlobals |
| 188 | - include_once $SETTINGS['cpassman_dir'] . '/includes/libraries/protect/SuperGlobal/SuperGlobal.php'; |
|
| 188 | + include_once $SETTINGS['cpassman_dir'].'/includes/libraries/protect/SuperGlobal/SuperGlobal.php'; |
|
| 189 | 189 | $superGlobal = new protect\SuperGlobal\SuperGlobal(); |
| 190 | 190 | // Prepare GET variables |
| 191 | 191 | $sessionPwdAttempts = $superGlobal->get('pwd_attempts', 'SESSION'); |
@@ -270,16 +270,16 @@ discard block |
||
| 270 | 270 | } else { |
| 271 | 271 | throw new Exception("Error file '/includes/config/tp.config.php' not exists", 1); |
| 272 | 272 | } |
| 273 | - include_once $SETTINGS['cpassman_dir'] . '/includes/config/settings.php'; |
|
| 273 | + include_once $SETTINGS['cpassman_dir'].'/includes/config/settings.php'; |
|
| 274 | 274 | header('Content-type: text/html; charset=utf-8'); |
| 275 | 275 | error_reporting(E_ERROR); |
| 276 | - include_once $SETTINGS['cpassman_dir'] . '/sources/main.functions.php'; |
|
| 277 | - include_once $SETTINGS['cpassman_dir'] . '/sources/SplClassLoader.php'; |
|
| 276 | + include_once $SETTINGS['cpassman_dir'].'/sources/main.functions.php'; |
|
| 277 | + include_once $SETTINGS['cpassman_dir'].'/sources/SplClassLoader.php'; |
|
| 278 | 278 | // Load AntiXSS |
| 279 | - include_once $SETTINGS['cpassman_dir'] . '/includes/libraries/voku/helper/AntiXSS.php'; |
|
| 279 | + include_once $SETTINGS['cpassman_dir'].'/includes/libraries/voku/helper/AntiXSS.php'; |
|
| 280 | 280 | $antiXss = new voku\helper\AntiXSS(); |
| 281 | 281 | // Load superGlobals |
| 282 | - include_once $SETTINGS['cpassman_dir'] . '/includes/libraries/protect/SuperGlobal/SuperGlobal.php'; |
|
| 282 | + include_once $SETTINGS['cpassman_dir'].'/includes/libraries/protect/SuperGlobal/SuperGlobal.php'; |
|
| 283 | 283 | $superGlobal = new protect\SuperGlobal\SuperGlobal(); |
| 284 | 284 | // Prepare GET variables |
| 285 | 285 | $sessionUserLanguage = $superGlobal->get('user_language', 'SESSION'); |
@@ -288,7 +288,7 @@ discard block |
||
| 288 | 288 | $sessionPwdAttempts = $superGlobal->get('pwd_attempts', 'SESSION'); |
| 289 | 289 | $sessionUrl = $superGlobal->get('initial_url', 'SESSION'); |
| 290 | 290 | // connect to the server |
| 291 | - include_once $SETTINGS['cpassman_dir'] . '/includes/libraries/Database/Meekrodb/db.class.php'; |
|
| 291 | + include_once $SETTINGS['cpassman_dir'].'/includes/libraries/Database/Meekrodb/db.class.php'; |
|
| 292 | 292 | if (defined('DB_PASSWD_CLEAR') === false) { |
| 293 | 293 | define('DB_PASSWD_CLEAR', defuseReturnDecrypted(DB_PASSWD, $SETTINGS)); |
| 294 | 294 | } |
@@ -299,7 +299,7 @@ discard block |
||
| 299 | 299 | DB::$port = DB_PORT; |
| 300 | 300 | DB::$encoding = DB_ENCODING; |
| 301 | 301 | // User's language loading |
| 302 | - include_once $SETTINGS['cpassman_dir'] . '/includes/language/' . $sessionUserLanguage . '.php'; |
|
| 302 | + include_once $SETTINGS['cpassman_dir'].'/includes/language/'.$sessionUserLanguage.'.php'; |
|
| 303 | 303 | //echo $dataReceived." -->".empty($sessionKey)."<-- ".$sessionKey." ** " ; |
| 304 | 304 | // decrypt and retreive data in JSON format |
| 305 | 305 | if (empty($sessionKey) === true) { |
@@ -374,7 +374,7 @@ discard block |
||
| 374 | 374 | // Check if user exists |
| 375 | 375 | $userInfo = DB::queryFirstRow( |
| 376 | 376 | 'SELECT * |
| 377 | - FROM ' . prefixTable('users') . ' |
|
| 377 | + FROM ' . prefixTable('users').' |
|
| 378 | 378 | WHERE login=%s', |
| 379 | 379 | $username |
| 380 | 380 | ); |
@@ -570,7 +570,7 @@ discard block |
||
| 570 | 570 | //$arrAttempts = array(); |
| 571 | 571 | $rows = DB::query( |
| 572 | 572 | 'SELECT date |
| 573 | - FROM ' . prefixTable('log_system') . " |
|
| 573 | + FROM ' . prefixTable('log_system')." |
|
| 574 | 574 | WHERE field_1 = %s |
| 575 | 575 | AND type = 'failed_auth' |
| 576 | 576 | AND label = 'user_password_not_correct' |
@@ -586,7 +586,7 @@ discard block |
||
| 586 | 586 | foreach ($rows as $record) { |
| 587 | 587 | array_push( |
| 588 | 588 | $arrAttempts, |
| 589 | - date($SETTINGS['date_format'] . ' ' . $SETTINGS['time_format'], $record['date']) |
|
| 589 | + date($SETTINGS['date_format'].' '.$SETTINGS['time_format'], $record['date']) |
|
| 590 | 590 | ); |
| 591 | 591 | } |
| 592 | 592 | } |
@@ -622,7 +622,7 @@ discard block |
||
| 622 | 622 | $superGlobal->put('user_upgrade_needed', $userInfo['upgrade_needed'], 'SESSION'); |
| 623 | 623 | $superGlobal->put('user_force_relog', $userInfo['force-relog'], 'SESSION'); |
| 624 | 624 | // get personal settings |
| 625 | - if (! isset($userInfo['treeloadstrategy']) || empty($userInfo['treeloadstrategy'])) { |
|
| 625 | + if (!isset($userInfo['treeloadstrategy']) || empty($userInfo['treeloadstrategy'])) { |
|
| 626 | 626 | $userInfo['treeloadstrategy'] = 'full'; |
| 627 | 627 | } |
| 628 | 628 | $superGlobal->put('treeloadstrategy', $userInfo['treeloadstrategy'], 'SESSION', 'user'); |
@@ -722,7 +722,7 @@ discard block |
||
| 722 | 722 | foreach ($superGlobal->get('user_roles', 'SESSION') as $role) { |
| 723 | 723 | $resRoles = DB::queryFirstRow( |
| 724 | 724 | 'SELECT title, complexity |
| 725 | - FROM ' . prefixTable('roles_title') . ' |
|
| 725 | + FROM ' . prefixTable('roles_title').' |
|
| 726 | 726 | WHERE id=%i', |
| 727 | 727 | $role |
| 728 | 728 | ); |
@@ -743,7 +743,7 @@ discard block |
||
| 743 | 743 | |
| 744 | 744 | // build complete array of roles |
| 745 | 745 | $superGlobal->put('arr_roles_full', [], 'SESSION'); |
| 746 | - $rows = DB::query('SELECT id, title FROM ' . prefixTable('roles_title') . ' ORDER BY title ASC'); |
|
| 746 | + $rows = DB::query('SELECT id, title FROM '.prefixTable('roles_title').' ORDER BY title ASC'); |
|
| 747 | 747 | foreach ($rows as $record) { |
| 748 | 748 | $superGlobal->put( |
| 749 | 749 | $record['id'], |
@@ -832,10 +832,10 @@ discard block |
||
| 832 | 832 | $superGlobal->put('latest_items_tab', [], 'SESSION'); |
| 833 | 833 | $superGlobal->put('nb_roles', 0, 'SESSION'); |
| 834 | 834 | foreach ($superGlobal->get('latest_items', 'SESSION') as $item) { |
| 835 | - if (! empty($item)) { |
|
| 835 | + if (!empty($item)) { |
|
| 836 | 836 | $dataLastItems = DB::queryFirstRow( |
| 837 | 837 | 'SELECT id,label,id_tree |
| 838 | - FROM ' . prefixTable('items') . ' |
|
| 838 | + FROM ' . prefixTable('items').' |
|
| 839 | 839 | WHERE id=%i', |
| 840 | 840 | $item |
| 841 | 841 | ); |
@@ -844,7 +844,7 @@ discard block |
||
| 844 | 844 | [ |
| 845 | 845 | 'id' => $item, |
| 846 | 846 | 'label' => $dataLastItems['label'], |
| 847 | - 'url' => 'index.php?page=items&group=' . $dataLastItems['id_tree'] . '&id=' . $item, |
|
| 847 | + 'url' => 'index.php?page=items&group='.$dataLastItems['id_tree'].'&id='.$item, |
|
| 848 | 848 | ], |
| 849 | 849 | 'SESSION', |
| 850 | 850 | 'latest_items_tab' |
@@ -861,12 +861,12 @@ discard block |
||
| 861 | 861 | ) { |
| 862 | 862 | // get all Admin users |
| 863 | 863 | $receivers = ''; |
| 864 | - $rows = DB::query('SELECT email FROM ' . prefixTable('users') . " WHERE admin = %i and email != ''", 1); |
|
| 864 | + $rows = DB::query('SELECT email FROM '.prefixTable('users')." WHERE admin = %i and email != ''", 1); |
|
| 865 | 865 | foreach ($rows as $record) { |
| 866 | 866 | if (empty($receivers)) { |
| 867 | 867 | $receivers = $record['email']; |
| 868 | 868 | } else { |
| 869 | - $receivers = ',' . $record['email']; |
|
| 869 | + $receivers = ','.$record['email']; |
|
| 870 | 870 | } |
| 871 | 871 | } |
| 872 | 872 | // Add email to table |
@@ -882,7 +882,7 @@ discard block |
||
| 882 | 882 | '#tp_time#', |
| 883 | 883 | ], |
| 884 | 884 | [ |
| 885 | - ' ' . $superGlobal->get('login', 'SESSION') . ' (IP: ' . getClientIpServer() . ')', |
|
| 885 | + ' '.$superGlobal->get('login', 'SESSION').' (IP: '.getClientIpServer().')', |
|
| 886 | 886 | date($SETTINGS['date_format'], $superGlobal->get('last_connection', 'SESSION')), |
| 887 | 887 | date($SETTINGS['time_format'], $superGlobal->get('last_connection', 'SESSION')), |
| 888 | 888 | ], |
@@ -1027,8 +1027,8 @@ discard block |
||
| 1027 | 1027 | debugIdentify( |
| 1028 | 1028 | DEBUGDUO, |
| 1029 | 1029 | DEBUGDUOFILE, |
| 1030 | - "\n\n----\n" . |
|
| 1031 | - 'Identified : ' . filter_var($return, FILTER_SANITIZE_STRING) . "\n\n" |
|
| 1030 | + "\n\n----\n". |
|
| 1031 | + 'Identified : '.filter_var($return, FILTER_SANITIZE_STRING)."\n\n" |
|
| 1032 | 1032 | ); |
| 1033 | 1033 | echo prepareExchangedData( |
| 1034 | 1034 | [ |
@@ -1092,44 +1092,44 @@ discard block |
||
| 1092 | 1092 | ], |
| 1093 | 1093 | ]; |
| 1094 | 1094 | // Load expected libraries |
| 1095 | - require_once $SETTINGS['cpassman_dir'] . '/includes/libraries/Illuminate/Contracts/Auth/Authenticatable.php'; |
|
| 1096 | - require_once $SETTINGS['cpassman_dir'] . '/includes/libraries/Tightenco/Collect/Support/Traits/EnumeratesValues.php'; |
|
| 1097 | - require_once $SETTINGS['cpassman_dir'] . '/includes/libraries/Tightenco/Collect/Support/Traits/Macroable.php'; |
|
| 1098 | - require_once $SETTINGS['cpassman_dir'] . '/includes/libraries/Tightenco/Collect/Support/helpers.php'; |
|
| 1099 | - require_once $SETTINGS['cpassman_dir'] . '/includes/libraries/Tightenco/Collect/Support/Arr.php'; |
|
| 1100 | - require_once $SETTINGS['cpassman_dir'] . '/includes/libraries/Tightenco/Collect/Contracts/Support/Jsonable.php'; |
|
| 1101 | - require_once $SETTINGS['cpassman_dir'] . '/includes/libraries/Tightenco/Collect/Contracts/Support/Arrayable.php'; |
|
| 1102 | - require_once $SETTINGS['cpassman_dir'] . '/includes/libraries/Tightenco/Collect/Support/Enumerable.php'; |
|
| 1103 | - require_once $SETTINGS['cpassman_dir'] . '/includes/libraries/Tightenco/Collect/Support/Collection.php'; |
|
| 1104 | - require_once $SETTINGS['cpassman_dir'] . '/includes/libraries/Carbon/CarbonTimeZone.php'; |
|
| 1105 | - require_once $SETTINGS['cpassman_dir'] . '/includes/libraries/Carbon/Traits/Units.php'; |
|
| 1106 | - require_once $SETTINGS['cpassman_dir'] . '/includes/libraries/Carbon/Traits/Week.php'; |
|
| 1107 | - require_once $SETTINGS['cpassman_dir'] . '/includes/libraries/Carbon/Traits/Timestamp.php'; |
|
| 1108 | - require_once $SETTINGS['cpassman_dir'] . '/includes/libraries/Carbon/Traits/Test.php'; |
|
| 1109 | - require_once $SETTINGS['cpassman_dir'] . '/includes/libraries/Carbon/Traits/ObjectInitialisation.php'; |
|
| 1110 | - require_once $SETTINGS['cpassman_dir'] . '/includes/libraries/Carbon/Traits/Serialization.php'; |
|
| 1111 | - require_once $SETTINGS['cpassman_dir'] . '/includes/libraries/Carbon/Traits/IntervalRounding.php'; |
|
| 1112 | - require_once $SETTINGS['cpassman_dir'] . '/includes/libraries/Carbon/Traits/Rounding.php'; |
|
| 1113 | - require_once $SETTINGS['cpassman_dir'] . '/includes/libraries/Carbon/Traits/Localization.php'; |
|
| 1114 | - require_once $SETTINGS['cpassman_dir'] . '/includes/libraries/Carbon/Traits/Options.php'; |
|
| 1115 | - require_once $SETTINGS['cpassman_dir'] . '/includes/libraries/Carbon/Traits/Cast.php'; |
|
| 1116 | - require_once $SETTINGS['cpassman_dir'] . '/includes/libraries/Carbon/Traits/Mutability.php'; |
|
| 1117 | - require_once $SETTINGS['cpassman_dir'] . '/includes/libraries/Carbon/Traits/Modifiers.php'; |
|
| 1118 | - require_once $SETTINGS['cpassman_dir'] . '/includes/libraries/Carbon/Traits/Mixin.php'; |
|
| 1119 | - require_once $SETTINGS['cpassman_dir'] . '/includes/libraries/Carbon/Traits/Macro.php'; |
|
| 1120 | - require_once $SETTINGS['cpassman_dir'] . '/includes/libraries/Carbon/Traits/Difference.php'; |
|
| 1121 | - require_once $SETTINGS['cpassman_dir'] . '/includes/libraries/Carbon/Traits/Creator.php'; |
|
| 1122 | - require_once $SETTINGS['cpassman_dir'] . '/includes/libraries/Carbon/Traits/Converter.php'; |
|
| 1123 | - require_once $SETTINGS['cpassman_dir'] . '/includes/libraries/Carbon/Traits/Comparison.php'; |
|
| 1124 | - require_once $SETTINGS['cpassman_dir'] . '/includes/libraries/Carbon/Traits/Boundaries.php'; |
|
| 1125 | - require_once $SETTINGS['cpassman_dir'] . '/includes/libraries/Carbon/Traits/Date.php'; |
|
| 1126 | - require_once $SETTINGS['cpassman_dir'] . '/includes/libraries/Carbon/CarbonInterface.php'; |
|
| 1127 | - require_once $SETTINGS['cpassman_dir'] . '/includes/libraries/Carbon/Carbon.php'; |
|
| 1128 | - require_once $SETTINGS['cpassman_dir'] . '/includes/libraries/LdapRecord/DetectsErrors.php'; |
|
| 1129 | - require_once $SETTINGS['cpassman_dir'] . '/includes/libraries/LdapRecord/Connection.php'; |
|
| 1130 | - require_once $SETTINGS['cpassman_dir'] . '/includes/libraries/LdapRecord/LdapInterface.php'; |
|
| 1131 | - require_once $SETTINGS['cpassman_dir'] . '/includes/libraries/LdapRecord/LdapBase.php'; |
|
| 1132 | - require_once $SETTINGS['cpassman_dir'] . '/includes/libraries/LdapRecord/Ldap.php'; |
|
| 1095 | + require_once $SETTINGS['cpassman_dir'].'/includes/libraries/Illuminate/Contracts/Auth/Authenticatable.php'; |
|
| 1096 | + require_once $SETTINGS['cpassman_dir'].'/includes/libraries/Tightenco/Collect/Support/Traits/EnumeratesValues.php'; |
|
| 1097 | + require_once $SETTINGS['cpassman_dir'].'/includes/libraries/Tightenco/Collect/Support/Traits/Macroable.php'; |
|
| 1098 | + require_once $SETTINGS['cpassman_dir'].'/includes/libraries/Tightenco/Collect/Support/helpers.php'; |
|
| 1099 | + require_once $SETTINGS['cpassman_dir'].'/includes/libraries/Tightenco/Collect/Support/Arr.php'; |
|
| 1100 | + require_once $SETTINGS['cpassman_dir'].'/includes/libraries/Tightenco/Collect/Contracts/Support/Jsonable.php'; |
|
| 1101 | + require_once $SETTINGS['cpassman_dir'].'/includes/libraries/Tightenco/Collect/Contracts/Support/Arrayable.php'; |
|
| 1102 | + require_once $SETTINGS['cpassman_dir'].'/includes/libraries/Tightenco/Collect/Support/Enumerable.php'; |
|
| 1103 | + require_once $SETTINGS['cpassman_dir'].'/includes/libraries/Tightenco/Collect/Support/Collection.php'; |
|
| 1104 | + require_once $SETTINGS['cpassman_dir'].'/includes/libraries/Carbon/CarbonTimeZone.php'; |
|
| 1105 | + require_once $SETTINGS['cpassman_dir'].'/includes/libraries/Carbon/Traits/Units.php'; |
|
| 1106 | + require_once $SETTINGS['cpassman_dir'].'/includes/libraries/Carbon/Traits/Week.php'; |
|
| 1107 | + require_once $SETTINGS['cpassman_dir'].'/includes/libraries/Carbon/Traits/Timestamp.php'; |
|
| 1108 | + require_once $SETTINGS['cpassman_dir'].'/includes/libraries/Carbon/Traits/Test.php'; |
|
| 1109 | + require_once $SETTINGS['cpassman_dir'].'/includes/libraries/Carbon/Traits/ObjectInitialisation.php'; |
|
| 1110 | + require_once $SETTINGS['cpassman_dir'].'/includes/libraries/Carbon/Traits/Serialization.php'; |
|
| 1111 | + require_once $SETTINGS['cpassman_dir'].'/includes/libraries/Carbon/Traits/IntervalRounding.php'; |
|
| 1112 | + require_once $SETTINGS['cpassman_dir'].'/includes/libraries/Carbon/Traits/Rounding.php'; |
|
| 1113 | + require_once $SETTINGS['cpassman_dir'].'/includes/libraries/Carbon/Traits/Localization.php'; |
|
| 1114 | + require_once $SETTINGS['cpassman_dir'].'/includes/libraries/Carbon/Traits/Options.php'; |
|
| 1115 | + require_once $SETTINGS['cpassman_dir'].'/includes/libraries/Carbon/Traits/Cast.php'; |
|
| 1116 | + require_once $SETTINGS['cpassman_dir'].'/includes/libraries/Carbon/Traits/Mutability.php'; |
|
| 1117 | + require_once $SETTINGS['cpassman_dir'].'/includes/libraries/Carbon/Traits/Modifiers.php'; |
|
| 1118 | + require_once $SETTINGS['cpassman_dir'].'/includes/libraries/Carbon/Traits/Mixin.php'; |
|
| 1119 | + require_once $SETTINGS['cpassman_dir'].'/includes/libraries/Carbon/Traits/Macro.php'; |
|
| 1120 | + require_once $SETTINGS['cpassman_dir'].'/includes/libraries/Carbon/Traits/Difference.php'; |
|
| 1121 | + require_once $SETTINGS['cpassman_dir'].'/includes/libraries/Carbon/Traits/Creator.php'; |
|
| 1122 | + require_once $SETTINGS['cpassman_dir'].'/includes/libraries/Carbon/Traits/Converter.php'; |
|
| 1123 | + require_once $SETTINGS['cpassman_dir'].'/includes/libraries/Carbon/Traits/Comparison.php'; |
|
| 1124 | + require_once $SETTINGS['cpassman_dir'].'/includes/libraries/Carbon/Traits/Boundaries.php'; |
|
| 1125 | + require_once $SETTINGS['cpassman_dir'].'/includes/libraries/Carbon/Traits/Date.php'; |
|
| 1126 | + require_once $SETTINGS['cpassman_dir'].'/includes/libraries/Carbon/CarbonInterface.php'; |
|
| 1127 | + require_once $SETTINGS['cpassman_dir'].'/includes/libraries/Carbon/Carbon.php'; |
|
| 1128 | + require_once $SETTINGS['cpassman_dir'].'/includes/libraries/LdapRecord/DetectsErrors.php'; |
|
| 1129 | + require_once $SETTINGS['cpassman_dir'].'/includes/libraries/LdapRecord/Connection.php'; |
|
| 1130 | + require_once $SETTINGS['cpassman_dir'].'/includes/libraries/LdapRecord/LdapInterface.php'; |
|
| 1131 | + require_once $SETTINGS['cpassman_dir'].'/includes/libraries/LdapRecord/LdapBase.php'; |
|
| 1132 | + require_once $SETTINGS['cpassman_dir'].'/includes/libraries/LdapRecord/Ldap.php'; |
|
| 1133 | 1133 | $ad = new SplClassLoader('LdapRecord', '../includes/libraries'); |
| 1134 | 1134 | $ad->register(); |
| 1135 | 1135 | $connection = new Connection($config); |
@@ -1141,7 +1141,7 @@ discard block |
||
| 1141 | 1141 | $error = $e->getDetailedError(); |
| 1142 | 1142 | return [ |
| 1143 | 1143 | 'error' => true, |
| 1144 | - 'message' => langHdl('error').' : '.$error->getErrorCode().' - '.$error->getErrorMessage(). '<br>'.$error->getDiagnosticMessage().' '.$config['username'], |
|
| 1144 | + 'message' => langHdl('error').' : '.$error->getErrorCode().' - '.$error->getErrorMessage().'<br>'.$error->getDiagnosticMessage().' '.$config['username'], |
|
| 1145 | 1145 | |
| 1146 | 1146 | ]; |
| 1147 | 1147 | } |
@@ -1169,7 +1169,7 @@ discard block |
||
| 1169 | 1169 | } |
| 1170 | 1170 | |
| 1171 | 1171 | // load passwordLib library |
| 1172 | - $pwdlib = new SplClassLoader('PasswordLib', $SETTINGS['cpassman_dir'] . '/includes/libraries'); |
|
| 1172 | + $pwdlib = new SplClassLoader('PasswordLib', $SETTINGS['cpassman_dir'].'/includes/libraries'); |
|
| 1173 | 1173 | $pwdlib->register(); |
| 1174 | 1174 | $pwdlib = new PasswordLib\PasswordLib(); |
| 1175 | 1175 | $hashedPassword = $pwdlib->createPasswordHash($passwordClear); |
@@ -1234,7 +1234,7 @@ discard block |
||
| 1234 | 1234 | function yubicoMFACheck($dataReceived, string $userInfo, array $SETTINGS): array |
| 1235 | 1235 | { |
| 1236 | 1236 | // Load superGlobals |
| 1237 | - include_once $SETTINGS['cpassman_dir'] . '/includes/libraries/protect/SuperGlobal/SuperGlobal.php'; |
|
| 1237 | + include_once $SETTINGS['cpassman_dir'].'/includes/libraries/protect/SuperGlobal/SuperGlobal.php'; |
|
| 1238 | 1238 | $superGlobal = new protect\SuperGlobal\SuperGlobal(); |
| 1239 | 1239 | $sessionAdmin = $superGlobal->get('user_admin', 'SESSION'); |
| 1240 | 1240 | $sessionUrl = $superGlobal->get('initial_url', 'SESSION'); |
@@ -1273,7 +1273,7 @@ discard block |
||
| 1273 | 1273 | } |
| 1274 | 1274 | |
| 1275 | 1275 | // Now check yubico validity |
| 1276 | - include_once $SETTINGS['cpassman_dir'] . '/includes/libraries/Authentication/Yubico/Yubico.php'; |
|
| 1276 | + include_once $SETTINGS['cpassman_dir'].'/includes/libraries/Authentication/Yubico/Yubico.php'; |
|
| 1277 | 1277 | $yubi = new Auth_Yubico($yubico_user_id, $yubico_user_key); |
| 1278 | 1278 | $auth = $yubi->verify($yubico_key); |
| 1279 | 1279 | //, null, null, null, 60 |
@@ -1325,7 +1325,7 @@ discard block |
||
| 1325 | 1325 | 'gestionnaire' => '0', |
| 1326 | 1326 | 'can_manage_all_users' => '0', |
| 1327 | 1327 | 'personal_folder' => $SETTINGS['enable_pf_feature'] === '1' ? '1' : '0', |
| 1328 | - 'fonction_id' => (empty($retLDAP['user_info_from_ad'][0]['commonGroupsLdapVsTeampass']) === false ? $retLDAP['user_info_from_ad'][0]['commonGroupsLdapVsTeampass'] . ';' : '') . (isset($SETTINGS['ldap_new_user_role']) === true ? $SETTINGS['ldap_new_user_role'] : '0'), |
|
| 1328 | + 'fonction_id' => (empty($retLDAP['user_info_from_ad'][0]['commonGroupsLdapVsTeampass']) === false ? $retLDAP['user_info_from_ad'][0]['commonGroupsLdapVsTeampass'].';' : '').(isset($SETTINGS['ldap_new_user_role']) === true ? $SETTINGS['ldap_new_user_role'] : '0'), |
|
| 1329 | 1329 | 'groupes_interdits' => '', |
| 1330 | 1330 | 'groupes_visibles' => '', |
| 1331 | 1331 | 'last_pw_change' => time(), |
@@ -1350,7 +1350,7 @@ discard block |
||
| 1350 | 1350 | ] |
| 1351 | 1351 | ); |
| 1352 | 1352 | // Rebuild tree |
| 1353 | - $tree = new SplClassLoader('Tree\NestedTree', $SETTINGS['cpassman_dir'] . '/includes/libraries'); |
|
| 1353 | + $tree = new SplClassLoader('Tree\NestedTree', $SETTINGS['cpassman_dir'].'/includes/libraries'); |
|
| 1354 | 1354 | $tree->register(); |
| 1355 | 1355 | $tree = new Tree\NestedTree\NestedTree(prefixTable('nested_tree'), 'id', 'parent_id', 'title'); |
| 1356 | 1356 | $tree->rebuild(); |
@@ -1381,13 +1381,13 @@ discard block |
||
| 1381 | 1381 | && empty($dataReceived['GACode']) === false |
| 1382 | 1382 | ) { |
| 1383 | 1383 | // Load superGlobals |
| 1384 | - include_once $SETTINGS['cpassman_dir'] . '/includes/libraries/protect/SuperGlobal/SuperGlobal.php'; |
|
| 1384 | + include_once $SETTINGS['cpassman_dir'].'/includes/libraries/protect/SuperGlobal/SuperGlobal.php'; |
|
| 1385 | 1385 | $superGlobal = new protect\SuperGlobal\SuperGlobal(); |
| 1386 | 1386 | $sessionAdmin = $superGlobal->get('user_admin', 'SESSION'); |
| 1387 | 1387 | $sessionUrl = $superGlobal->get('initial_url', 'SESSION'); |
| 1388 | 1388 | $sessionPwdAttempts = $superGlobal->get('pwd_attempts', 'SESSION'); |
| 1389 | 1389 | // load library |
| 1390 | - include_once $SETTINGS['cpassman_dir'] . '/includes/libraries/Authentication/TwoFactorAuth/TwoFactorAuth.php'; |
|
| 1390 | + include_once $SETTINGS['cpassman_dir'].'/includes/libraries/Authentication/TwoFactorAuth/TwoFactorAuth.php'; |
|
| 1391 | 1391 | // create new instance |
| 1392 | 1392 | $tfa = new Authentication\TwoFactorAuth\TwoFactorAuth($SETTINGS['ga_website_name']); |
| 1393 | 1393 | // Init |
@@ -1409,7 +1409,7 @@ discard block |
||
| 1409 | 1409 | $mfaMessage = langHdl('ga_flash_qr_and_login'); |
| 1410 | 1410 | // generate new QR |
| 1411 | 1411 | $new_2fa_qr = $tfa->getQRCodeImageAsDataUri( |
| 1412 | - 'Teampass - ' . $username, |
|
| 1412 | + 'Teampass - '.$username, |
|
| 1413 | 1413 | $userInfo['ga'] |
| 1414 | 1414 | ); |
| 1415 | 1415 | // clear temporary code from DB |
@@ -1422,7 +1422,7 @@ discard block |
||
| 1422 | 1422 | $userInfo['id'] |
| 1423 | 1423 | ); |
| 1424 | 1424 | $firstTime = [ |
| 1425 | - 'value' => '<img src="' . $new_2fa_qr . '">', |
|
| 1425 | + 'value' => '<img src="'.$new_2fa_qr.'">', |
|
| 1426 | 1426 | 'user_admin' => isset($sessionAdmin) ? (int) $sessionAdmin : '', |
| 1427 | 1427 | 'initial_url' => isset($sessionUrl) === true ? $sessionUrl : '', |
| 1428 | 1428 | 'pwd_attempts' => (int) $sessionPwdAttempts, |
@@ -1467,13 +1467,13 @@ discard block |
||
| 1467 | 1467 | * @param string $username User name |
| 1468 | 1468 | * @param array $SETTINGS Teampass settings |
| 1469 | 1469 | */ |
| 1470 | -function checkCredentials(string $passwordClear, array|string $userInfo, $dataReceived, string $username, array $SETTINGS): bool |
|
| 1470 | +function checkCredentials(string $passwordClear, array | string $userInfo, $dataReceived, string $username, array $SETTINGS): bool |
|
| 1471 | 1471 | { |
| 1472 | 1472 | // Set to false |
| 1473 | 1473 | $userPasswordVerified = false; |
| 1474 | 1474 | // load passwordLib library |
| 1475 | - include_once $SETTINGS['cpassman_dir'] . '/sources/SplClassLoader.php'; |
|
| 1476 | - $pwdlib = new SplClassLoader('PasswordLib', $SETTINGS['cpassman_dir'] . '/includes/libraries'); |
|
| 1475 | + include_once $SETTINGS['cpassman_dir'].'/sources/SplClassLoader.php'; |
|
| 1476 | + $pwdlib = new SplClassLoader('PasswordLib', $SETTINGS['cpassman_dir'].'/includes/libraries'); |
|
| 1477 | 1477 | $pwdlib->register(); |
| 1478 | 1478 | $pwdlib = new PasswordLib\PasswordLib(); |
| 1479 | 1479 | // Check if old encryption used |
@@ -54,24 +54,24 @@ discard block |
||
| 54 | 54 | } |
| 55 | 55 | |
| 56 | 56 | // Do checks |
| 57 | -require_once $SETTINGS['cpassman_dir'] . '/includes/config/include.php'; |
|
| 58 | -require_once $SETTINGS['cpassman_dir'] . '/sources/checks.php'; |
|
| 57 | +require_once $SETTINGS['cpassman_dir'].'/includes/config/include.php'; |
|
| 58 | +require_once $SETTINGS['cpassman_dir'].'/sources/checks.php'; |
|
| 59 | 59 | if (checkUser($_SESSION['user_id'], $_SESSION['key'], 'items', $SETTINGS) === false) { |
| 60 | 60 | // Not allowed page |
| 61 | 61 | $_SESSION['error']['code'] = ERR_NOT_ALLOWED; |
| 62 | - include $SETTINGS['cpassman_dir'] . '/error.php'; |
|
| 62 | + include $SETTINGS['cpassman_dir'].'/error.php'; |
|
| 63 | 63 | exit; |
| 64 | 64 | } |
| 65 | 65 | |
| 66 | 66 | // No time limit |
| 67 | 67 | set_time_limit(0); |
| 68 | -require_once $SETTINGS['cpassman_dir'] . '/includes/config/settings.php'; |
|
| 68 | +require_once $SETTINGS['cpassman_dir'].'/includes/config/settings.php'; |
|
| 69 | 69 | header('Content-type: text/html; charset=utf-8'); |
| 70 | 70 | error_reporting(E_ERROR); |
| 71 | -require_once $SETTINGS['cpassman_dir'] . '/sources/main.functions.php'; |
|
| 72 | -require_once $SETTINGS['cpassman_dir'] . '/sources/SplClassLoader.php'; |
|
| 71 | +require_once $SETTINGS['cpassman_dir'].'/sources/main.functions.php'; |
|
| 72 | +require_once $SETTINGS['cpassman_dir'].'/sources/SplClassLoader.php'; |
|
| 73 | 73 | // Connect to mysql server |
| 74 | -require_once $SETTINGS['cpassman_dir'] . '/includes/libraries/Database/Meekrodb/db.class.php'; |
|
| 74 | +require_once $SETTINGS['cpassman_dir'].'/includes/libraries/Database/Meekrodb/db.class.php'; |
|
| 75 | 75 | if (defined('DB_PASSWD_CLEAR') === false) { |
| 76 | 76 | define('DB_PASSWD_CLEAR', defuseReturnDecrypted(DB_PASSWD, $SETTINGS)); |
| 77 | 77 | } |
@@ -82,11 +82,11 @@ discard block |
||
| 82 | 82 | DB::$port = DB_PORT; |
| 83 | 83 | DB::$encoding = DB_ENCODING; |
| 84 | 84 | // Build tree |
| 85 | -$tree = new SplClassLoader('Tree\NestedTree', $SETTINGS['cpassman_dir'] . '/includes/libraries'); |
|
| 85 | +$tree = new SplClassLoader('Tree\NestedTree', $SETTINGS['cpassman_dir'].'/includes/libraries'); |
|
| 86 | 86 | $tree->register(); |
| 87 | -$tree = new Tree\NestedTree\NestedTree($pre . 'nested_tree', 'id', 'parent_id', 'title'); |
|
| 87 | +$tree = new Tree\NestedTree\NestedTree($pre.'nested_tree', 'id', 'parent_id', 'title'); |
|
| 88 | 88 | // User's language loading |
| 89 | -require_once $SETTINGS['cpassman_dir'] . '/includes/language/' . $_SESSION['user_language'] . '.php'; |
|
| 89 | +require_once $SETTINGS['cpassman_dir'].'/includes/language/'.$_SESSION['user_language'].'.php'; |
|
| 90 | 90 | // Prepare POST variables |
| 91 | 91 | $id = filter_input(INPUT_POST, 'id', FILTER_SANITIZE_NUMBER_INT); |
| 92 | 92 | $post_type = filter_input(INPUT_POST, 'type', FILTER_SANITIZE_STRING); |
@@ -133,9 +133,9 @@ discard block |
||
| 133 | 133 | 'SELECT i.id as id, i.id_tree as id_tree, i.restricted_to as restricted_to, i.perso as perso, |
| 134 | 134 | i.label as label, i.description as description, i.pw as pw, i.login as login, i.url as url, |
| 135 | 135 | i.email as email,l.date as date, i.pw_iv as pw_iv,n.renewal_period as renewal_period |
| 136 | - FROM ' . prefixTable('items') . ' as i |
|
| 137 | - INNER JOIN ' . prefixTable('nested_tree') . ' as n ON (i.id_tree = n.id) |
|
| 138 | - INNER JOIN ' . prefixTable('log_items') . ' as l ON (i.id = l.id_item) |
|
| 136 | + FROM ' . prefixTable('items').' as i |
|
| 137 | + INNER JOIN ' . prefixTable('nested_tree').' as n ON (i.id_tree = n.id) |
|
| 138 | + INNER JOIN ' . prefixTable('log_items').' as l ON (i.id = l.id_item) |
|
| 139 | 139 | WHERE i.inactif = %i |
| 140 | 140 | AND i.id_tree= %i |
| 141 | 141 | AND (l.action = %s OR (l.action = %s AND l.raison LIKE %s)) |
@@ -158,8 +158,8 @@ discard block |
||
| 158 | 158 | // Run query |
| 159 | 159 | $dataItem = DB::queryfirstrow( |
| 160 | 160 | 'SELECT i.pw AS pw, s.share_key AS share_key |
| 161 | - FROM ' . prefixTable('items') . ' AS i |
|
| 162 | - INNER JOIN ' . prefixTable('sharekeys_items') . ' AS s ON (s.object_id = i.id) |
|
| 161 | + FROM ' . prefixTable('items').' AS i |
|
| 162 | + INNER JOIN ' . prefixTable('sharekeys_items').' AS s ON (s.object_id = i.id) |
|
| 163 | 163 | WHERE user_id = %i AND i.id = %i', |
| 164 | 164 | $_SESSION['user_id'], |
| 165 | 165 | $record['id'] |
@@ -182,8 +182,8 @@ discard block |
||
| 182 | 182 | $arr_kbs = []; |
| 183 | 183 | $rows_kb = DB::query( |
| 184 | 184 | 'SELECT b.label, b.id |
| 185 | - FROM ' . prefixTable('kb_items') . ' AS a |
|
| 186 | - INNER JOIN ' . prefixTable('kb') . ' AS b ON (a.kb_id = b.id) |
|
| 185 | + FROM ' . prefixTable('kb_items').' AS a |
|
| 186 | + INNER JOIN ' . prefixTable('kb').' AS b ON (a.kb_id = b.id) |
|
| 187 | 187 | WHERE a.item_id = %i', |
| 188 | 188 | $record['id'] |
| 189 | 189 | ); |
@@ -195,7 +195,7 @@ discard block |
||
| 195 | 195 | $arr_tags = []; |
| 196 | 196 | $rows_tag = DB::query( |
| 197 | 197 | 'SELECT tag |
| 198 | - FROM ' . prefixTable('tags') . ' |
|
| 198 | + FROM ' . prefixTable('tags').' |
|
| 199 | 199 | WHERE item_id = %i', |
| 200 | 200 | $record['id'] |
| 201 | 201 | ); |
@@ -241,14 +241,14 @@ discard block |
||
| 241 | 241 | $tmp .= array2csv($value); |
| 242 | 242 | } |
| 243 | 243 | |
| 244 | - echo '[{"content":"' . base64_encode($tmp) . '"}]'; |
|
| 244 | + echo '[{"content":"'.base64_encode($tmp).'"}]'; |
|
| 245 | 245 | |
| 246 | 246 | break; |
| 247 | 247 | /* |
| 248 | 248 | * PDF - step 1 - Prepare database |
| 249 | 249 | */ |
| 250 | 250 | case 'initialize_export_table': |
| 251 | - DB::query('TRUNCATE TABLE ' . prefixTable('export')); |
|
| 251 | + DB::query('TRUNCATE TABLE '.prefixTable('export')); |
|
| 252 | 252 | |
| 253 | 253 | break; |
| 254 | 254 | /* |
@@ -290,9 +290,9 @@ discard block |
||
| 290 | 290 | 'SELECT i.id as id, i.restricted_to as restricted_to, i.perso as perso, i.label as label, i.description as description, i.pw as pw, i.login as login, i.url as url, i.email as email, |
| 291 | 291 | l.date as date, i.pw_iv as pw_iv, |
| 292 | 292 | n.renewal_period as renewal_period |
| 293 | - FROM ' . prefixTable('items') . ' as i |
|
| 294 | - INNER JOIN ' . prefixTable('nested_tree') . ' as n ON (i.id_tree = n.id) |
|
| 295 | - INNER JOIN ' . prefixTable('log_items') . ' as l ON (i.id = l.id_item) |
|
| 293 | + FROM ' . prefixTable('items').' as i |
|
| 294 | + INNER JOIN ' . prefixTable('nested_tree').' as n ON (i.id_tree = n.id) |
|
| 295 | + INNER JOIN ' . prefixTable('log_items').' as l ON (i.id = l.id_item) |
|
| 296 | 296 | WHERE i.inactif = %i |
| 297 | 297 | AND i.id_tree= %i |
| 298 | 298 | AND (l.action = %s OR (l.action = %s AND l.raison LIKE %s)) |
@@ -310,16 +310,16 @@ discard block |
||
| 310 | 310 | $restricted_users_array = explode(';', $record['restricted_to']); |
| 311 | 311 | //exclude all results except the first one returned by query |
| 312 | 312 | if (empty($id_managed) || $id_managed !== $record['id']) { |
| 313 | - if ((in_array($post_id, $_SESSION['personal_visible_groups']) && ! ($record['perso'] === 1 && $_SESSION['user_id'] === $record['restricted_to']) && ! empty($record['restricted_to'])) |
|
| 314 | - || (! empty($record['restricted_to']) && ! in_array($_SESSION['user_id'], $restricted_users_array)) |
|
| 313 | + if ((in_array($post_id, $_SESSION['personal_visible_groups']) && !($record['perso'] === 1 && $_SESSION['user_id'] === $record['restricted_to']) && !empty($record['restricted_to'])) |
|
| 314 | + || (!empty($record['restricted_to']) && !in_array($_SESSION['user_id'], $restricted_users_array)) |
|
| 315 | 315 | ) { |
| 316 | 316 | //exclude this case |
| 317 | 317 | } else { |
| 318 | 318 | // Run query |
| 319 | 319 | $dataItem = DB::queryfirstrow( |
| 320 | 320 | 'SELECT i.pw AS pw, s.share_key AS share_key |
| 321 | - FROM ' . prefixTable('items') . ' AS i |
|
| 322 | - INNER JOIN ' . prefixTable('sharekeys_items') . ' AS s ON (s.object_id = i.id) |
|
| 321 | + FROM ' . prefixTable('items').' AS i |
|
| 322 | + INNER JOIN ' . prefixTable('sharekeys_items').' AS s ON (s.object_id = i.id) |
|
| 323 | 323 | WHERE user_id = %i AND i.id = %i', |
| 324 | 324 | $_SESSION['user_id'], |
| 325 | 325 | $record['id'] |
@@ -342,8 +342,8 @@ discard block |
||
| 342 | 342 | $arr_kbs = ''; |
| 343 | 343 | $rows_kb = DB::query( |
| 344 | 344 | 'SELECT b.label, b.id |
| 345 | - FROM ' . prefixTable('kb_items') . ' AS a |
|
| 346 | - INNER JOIN ' . prefixTable('kb') . ' AS b ON (a.kb_id = b.id) |
|
| 345 | + FROM ' . prefixTable('kb_items').' AS a |
|
| 346 | + INNER JOIN ' . prefixTable('kb').' AS b ON (a.kb_id = b.id) |
|
| 347 | 347 | WHERE a.item_id = %i', |
| 348 | 348 | $record['id'] |
| 349 | 349 | ); |
@@ -351,7 +351,7 @@ discard block |
||
| 351 | 351 | if (empty($arr_kbs)) { |
| 352 | 352 | $arr_kbs = $rec_kb['label']; |
| 353 | 353 | } else { |
| 354 | - $arr_kbs .= ' | ' . $rec_kb['label']; |
|
| 354 | + $arr_kbs .= ' | '.$rec_kb['label']; |
|
| 355 | 355 | } |
| 356 | 356 | } |
| 357 | 357 | |
@@ -359,7 +359,7 @@ discard block |
||
| 359 | 359 | $arr_tags = ''; |
| 360 | 360 | $rows_tag = DB::query( |
| 361 | 361 | 'SELECT tag |
| 362 | - FROM ' . prefixTable('tags') . ' |
|
| 362 | + FROM ' . prefixTable('tags').' |
|
| 363 | 363 | WHERE item_id = %i', |
| 364 | 364 | $record['id'] |
| 365 | 365 | ); |
@@ -367,7 +367,7 @@ discard block |
||
| 367 | 367 | if (empty($arr_tags)) { |
| 368 | 368 | $arr_tags = $rec_tag['tag']; |
| 369 | 369 | } else { |
| 370 | - $arr_tags .= ' ' . $rec_tag['tag']; |
|
| 370 | + $arr_tags .= ' '.$rec_tag['tag']; |
|
| 371 | 371 | } |
| 372 | 372 | } |
| 373 | 373 | |
@@ -432,7 +432,7 @@ discard block |
||
| 432 | 432 | // Adapt header to pdf |
| 433 | 433 | header('Content-type: application/pdf'); |
| 434 | 434 | // query |
| 435 | - $rows = DB::query('SELECT * FROM ' . prefixTable('export')); |
|
| 435 | + $rows = DB::query('SELECT * FROM '.prefixTable('export')); |
|
| 436 | 436 | $counter = DB::count(); |
| 437 | 437 | if ($counter > 0) { |
| 438 | 438 | |
@@ -441,8 +441,8 @@ discard block |
||
| 441 | 441 | $table_col_width = [40, 30, 30, 60, 27, 40, 25, 25]; |
| 442 | 442 | $prev_path = ''; |
| 443 | 443 | //Prepare the PDF file |
| 444 | - require_once $SETTINGS['cpassman_dir'] . '/includes/libraries/Pdf/tcpdf/config/tcpdf_config.php'; |
|
| 445 | - include $SETTINGS['cpassman_dir'] . '/includes/libraries/Pdf/tcpdf/tcpdf.php'; |
|
| 444 | + require_once $SETTINGS['cpassman_dir'].'/includes/libraries/Pdf/tcpdf/config/tcpdf_config.php'; |
|
| 445 | + include $SETTINGS['cpassman_dir'].'/includes/libraries/Pdf/tcpdf/tcpdf.php'; |
|
| 446 | 446 | $pdf = new TCPDF(PDF_PAGE_ORIENTATION, PDF_UNIT, PDF_PAGE_FORMAT, true, 'UTF-8', false); |
| 447 | 447 | $pdf->SetProtection(['print'], $dataReceived['pdf_password'], null); |
| 448 | 448 | // set document information |
@@ -451,7 +451,7 @@ discard block |
||
| 451 | 451 | $pdf->SetTitle('Teampass export'); |
| 452 | 452 | // set default header data |
| 453 | 453 | $pdf->SetHeaderData( |
| 454 | - $SETTINGS['cpassman_dir'] . '/includes/images/teampass-logo2-home.png', |
|
| 454 | + $SETTINGS['cpassman_dir'].'/includes/images/teampass-logo2-home.png', |
|
| 455 | 455 | PDF_HEADER_LOGO_WIDTH, |
| 456 | 456 | 'Teampass export', |
| 457 | 457 | $_SESSION['lastname'].' '.$_SESSION['name'].' @ '.date($SETTINGS['date_format'].' '.$SETTINGS['time_format'], time()) |
@@ -543,7 +543,7 @@ discard block |
||
| 543 | 543 | //log |
| 544 | 544 | logEvents($SETTINGS, 'pdf_export', '', $_SESSION['user_id'], $_SESSION['login']); |
| 545 | 545 | //clean table |
| 546 | - DB::query('TRUNCATE TABLE ' . prefixTable('export')); |
|
| 546 | + DB::query('TRUNCATE TABLE '.prefixTable('export')); |
|
| 547 | 547 | // Send back the file in Blob |
| 548 | 548 | echo $pdf->Output(null, 'I'); |
| 549 | 549 | } |
@@ -555,8 +555,8 @@ discard block |
||
| 555 | 555 | |
| 556 | 556 | // - prepare export file |
| 557 | 557 | // - get full list of objects id to export |
| 558 | - include $SETTINGS['cpassman_dir'] . '/includes/config/include.php'; |
|
| 559 | -include_once $SETTINGS['cpassman_dir'] . '/includes/libraries/Encryption/GibberishAES/GibberishAES.php'; |
|
| 558 | + include $SETTINGS['cpassman_dir'].'/includes/config/include.php'; |
|
| 559 | +include_once $SETTINGS['cpassman_dir'].'/includes/libraries/Encryption/GibberishAES/GibberishAES.php'; |
|
| 560 | 560 | $idsList = []; |
| 561 | 561 | $objNumber = 0; |
| 562 | 562 | foreach (explode(';', $post_ids) as $id) { |
@@ -568,9 +568,9 @@ discard block |
||
| 568 | 568 | // count elements to display |
| 569 | 569 | $result = DB::query( |
| 570 | 570 | 'SELECT i.id AS id, i.label AS label, i.restricted_to AS restricted_to, i.perso AS perso |
| 571 | - FROM ' . prefixTable('items') . ' as i |
|
| 572 | - INNER JOIN ' . prefixTable('nested_tree') . ' as n ON (i.id_tree = n.id) |
|
| 573 | - INNER JOIN ' . prefixTable('log_items') . ' as l ON (i.id = l.id_item) |
|
| 571 | + FROM ' . prefixTable('items').' as i |
|
| 572 | + INNER JOIN ' . prefixTable('nested_tree').' as n ON (i.id_tree = n.id) |
|
| 573 | + INNER JOIN ' . prefixTable('log_items').' as l ON (i.id = l.id_item) |
|
| 574 | 574 | WHERE i.inactif = %i |
| 575 | 575 | AND i.id_tree= %i |
| 576 | 576 | AND (l.action = %s OR (l.action = %s AND l.raison LIKE %s)) |
@@ -584,7 +584,7 @@ discard block |
||
| 584 | 584 | foreach ($result as $record) { |
| 585 | 585 | $restricted_users_array = explode(';', $record['restricted_to']); |
| 586 | 586 | if (((in_array($id, $_SESSION['personal_visible_groups']) === true |
| 587 | - && ! ($record['perso'] === 1 && $_SESSION['user_id'] === $record['restricted_to']) |
|
| 587 | + && !($record['perso'] === 1 && $_SESSION['user_id'] === $record['restricted_to']) |
|
| 588 | 588 | && empty($record['restricted_to']) === false) |
| 589 | 589 | || (empty($record['restricted_to']) === false |
| 590 | 590 | && in_array($_SESSION['user_id'], $restricted_users_array) === false) |
@@ -599,9 +599,9 @@ discard block |
||
| 599 | 599 | |
| 600 | 600 | // prepare export file |
| 601 | 601 | //save the file |
| 602 | - $html_file = '/teampass_export_' . time() . '_' . generateKey() . '.html'; |
|
| 602 | + $html_file = '/teampass_export_'.time().'_'.generateKey().'.html'; |
|
| 603 | 603 | //print_r($full_listing); |
| 604 | - $outstream = fopen($SETTINGS['path_to_files_folder'] . $html_file, 'w'); |
|
| 604 | + $outstream = fopen($SETTINGS['path_to_files_folder'].$html_file, 'w'); |
|
| 605 | 605 | if ($outstream === false) { |
| 606 | 606 | echo '[{"error":"true"}]'; |
| 607 | 607 | break; |
@@ -625,12 +625,12 @@ discard block |
||
| 625 | 625 | </style> |
| 626 | 626 | </head> |
| 627 | 627 | <body> |
| 628 | - <input type="hidden" id="generation_date" value="' . GibberishAES::enc(/** @scrutinizer ignore-type */ (string) time(), $post_pdf_password) . '" /> |
|
| 628 | + <input type="hidden" id="generation_date" value="' . GibberishAES::enc(/** @scrutinizer ignore-type */ (string) time(), $post_pdf_password).'" /> |
|
| 629 | 629 | <div id="header"> |
| 630 | - ' . TP_TOOL_NAME . ' - Off Line mode |
|
| 630 | + ' . TP_TOOL_NAME.' - Off Line mode |
|
| 631 | 631 | </div> |
| 632 | 632 | <div style="margin:10px; font-size:9px;"> |
| 633 | - <i>This page was generated by <b>' . $_SESSION['name'] . ' ' . $_SESSION['lastname'] . '</b>, the ' . date('Y/m/d H:i:s') . '.</i> |
|
| 633 | + <i>This page was generated by <b>' . $_SESSION['name'].' '.$_SESSION['lastname'].'</b>, the '.date('Y/m/d H:i:s').'.</i> |
|
| 634 | 634 | <span id="info_page" style="margin-left:20px; font-weight:bold; font-size: 14px; color:red;"></span> |
| 635 | 635 | </div> |
| 636 | 636 | <div id="information"></div> |
@@ -641,11 +641,11 @@ discard block |
||
| 641 | 641 | <div> |
| 642 | 642 | <table id="itemsTable"> |
| 643 | 643 | <thead><tr> |
| 644 | - <th style="width:15%;">' . $LANG['label'] . '</th> |
|
| 645 | - <th style="width:10%;">' . $LANG['pw'] . '</th> |
|
| 646 | - <th style="width:30%;">' . $LANG['description'] . '</th> |
|
| 647 | - <th style="width:5%;">' . $LANG['user_login'] . '</th> |
|
| 648 | - <th style="width:20%;">' . $LANG['url'] . '</th> |
|
| 644 | + <th style="width:15%;">' . $LANG['label'].'</th> |
|
| 645 | + <th style="width:10%;">' . $LANG['pw'].'</th> |
|
| 646 | + <th style="width:30%;">' . $LANG['description'].'</th> |
|
| 647 | + <th style="width:5%;">' . $LANG['user_login'].'</th> |
|
| 648 | + <th style="width:20%;">' . $LANG['url'].'</th> |
|
| 649 | 649 | </tr></thead> |
| 650 | 650 | <tbody id="itemsTable_tbody">' |
| 651 | 651 | ); |
@@ -669,21 +669,21 @@ discard block |
||
| 669 | 669 | || in_array($post_idTree, $_SESSION['groupes_visibles']) === false |
| 670 | 670 | || (in_array($post_idTree, $_SESSION['no_access_folders']) === true) |
| 671 | 671 | ) { |
| 672 | - echo '[{"loop":"true", "number":"' . $post_number . '", "cpt":"' . $post_cpt . '", "file":"' . $post_file . '", "idsList":"' . $post_idsList . '" , "file_link":"' . $post_file_link . '"}]'; |
|
| 672 | + echo '[{"loop":"true", "number":"'.$post_number.'", "cpt":"'.$post_cpt.'", "file":"'.$post_file.'", "idsList":"'.$post_idsList.'" , "file_link":"'.$post_file_link.'"}]'; |
|
| 673 | 673 | break; |
| 674 | 674 | } |
| 675 | 675 | |
| 676 | 676 | $full_listing = []; |
| 677 | 677 | $items_id_list = []; |
| 678 | -include $SETTINGS['cpassman_dir'] . '/includes/config/include.php'; |
|
| 679 | -include_once $SETTINGS['cpassman_dir'] . '/includes/libraries/Encryption/GibberishAES/GibberishAES.php'; |
|
| 678 | +include $SETTINGS['cpassman_dir'].'/includes/config/include.php'; |
|
| 679 | +include_once $SETTINGS['cpassman_dir'].'/includes/libraries/Encryption/GibberishAES/GibberishAES.php'; |
|
| 680 | 680 | $rows = DB::query( |
| 681 | 681 | 'SELECT i.id as id, i.url as url, i.perso as perso, i.label as label, i.description as description, i.pw as pw, i.login as login, i.id_tree as id_tree, |
| 682 | 682 | l.date as date, i.pw_iv as pw_iv, |
| 683 | 683 | n.renewal_period as renewal_period |
| 684 | - FROM ' . prefixTable('items') . ' as i |
|
| 685 | - INNER JOIN ' . prefixTable('nested_tree') . ' as n ON (i.id_tree = n.id) |
|
| 686 | - INNER JOIN ' . prefixTable('log_items') . ' as l ON (i.id = l.id_item) |
|
| 684 | + FROM ' . prefixTable('items').' as i |
|
| 685 | + INNER JOIN ' . prefixTable('nested_tree').' as n ON (i.id_tree = n.id) |
|
| 686 | + INNER JOIN ' . prefixTable('log_items').' as l ON (i.id = l.id_item) |
|
| 687 | 687 | WHERE i.inactif = %i |
| 688 | 688 | AND i.id_tree= %i |
| 689 | 689 | AND (l.action = %s OR (l.action = %s AND l.raison LIKE %s)) |
@@ -742,7 +742,7 @@ discard block |
||
| 742 | 742 | } |
| 743 | 743 | |
| 744 | 744 | //save in export file |
| 745 | - $outstream = fopen($post_file . '.txt', 'a'); |
|
| 745 | + $outstream = fopen($post_file.'.txt', 'a'); |
|
| 746 | 746 | if ($outstream === false) { |
| 747 | 747 | echo '[{"error":"true"}]'; |
| 748 | 748 | break; |
@@ -780,13 +780,13 @@ discard block |
||
| 780 | 780 | if (empty($arboHtml)) { |
| 781 | 781 | $arboHtml = $arboHtml_tmp; |
| 782 | 782 | } else { |
| 783 | - $arboHtml .= ' » ' . $arboHtml_tmp; |
|
| 783 | + $arboHtml .= ' » '.$arboHtml_tmp; |
|
| 784 | 784 | } |
| 785 | 785 | } |
| 786 | 786 | fputs( |
| 787 | 787 | $outstream, |
| 788 | 788 | ' |
| 789 | - <tr class="path"><td colspan="5">' . $arboHtml . '</td></tr>' |
|
| 789 | + <tr class="path"><td colspan="5">' . $arboHtml.'</td></tr>' |
|
| 790 | 790 | ); |
| 791 | 791 | $idTree = $elem['id_tree']; |
| 792 | 792 | } |
@@ -795,41 +795,41 @@ discard block |
||
| 795 | 795 | fputs( |
| 796 | 796 | $outstream, |
| 797 | 797 | ' |
| 798 | - <tr class="' . $lineType . '"> |
|
| 799 | - <td>' . addslashes($elem['label']) . '</td> |
|
| 800 | - <td align="center"><span class="span_pw" id="span_' . $elem['id'] . '"><a href="#" onclick="decryptme(' . $elem['id'] . ', \'' . $encPw . '\');return false;">Decrypt </a></span><input type="hidden" id="hide_' . $elem['id'] . '" value="' . $encPw . '" /></td> |
|
| 801 | - <td>' . $desc . '</td> |
|
| 802 | - <td align="center">' . $login . '</td> |
|
| 803 | - <td align="center">' . $url . '</td> |
|
| 798 | + <tr class="' . $lineType.'"> |
|
| 799 | + <td>' . addslashes($elem['label']).'</td> |
|
| 800 | + <td align="center"><span class="span_pw" id="span_' . $elem['id'].'"><a href="#" onclick="decryptme('.$elem['id'].', \''.$encPw.'\');return false;">Decrypt </a></span><input type="hidden" id="hide_'.$elem['id'].'" value="'.$encPw.'" /></td> |
|
| 801 | + <td>' . $desc.'</td> |
|
| 802 | + <td align="center">' . $login.'</td> |
|
| 803 | + <td align="center">' . $url.'</td> |
|
| 804 | 804 | </tr>' |
| 805 | 805 | ); |
| 806 | 806 | } |
| 807 | 807 | |
| 808 | 808 | fclose($outstream); |
| 809 | 809 | // send back and continue |
| 810 | - echo '[{"loop":"true", "number":"' . $post_number . '", "cpt":"' . $post_cpt . '", "file":"' . $post_file . '", "idsList":"' . $post_idsList . '" , "file_link":"' . $post_file_link . '"}]'; |
|
| 810 | + echo '[{"loop":"true", "number":"'.$post_number.'", "cpt":"'.$post_cpt.'", "file":"'.$post_file.'", "idsList":"'.$post_idsList.'" , "file_link":"'.$post_file_link.'"}]'; |
|
| 811 | 811 | |
| 812 | 812 | break; |
| 813 | 813 | //CASE export in HTML format - Iteration loop |
| 814 | 814 | case 'export_to_html_format_finalize': |
| 815 | 815 | // Load includes |
| 816 | 816 | |
| 817 | - include $SETTINGS['cpassman_dir'] . '/includes/config/include.php'; |
|
| 818 | -require_once $SETTINGS['cpassman_dir'] . '/includes/libraries/Encryption/GibberishAES/GibberishAES.php'; |
|
| 817 | + include $SETTINGS['cpassman_dir'].'/includes/config/include.php'; |
|
| 818 | +require_once $SETTINGS['cpassman_dir'].'/includes/libraries/Encryption/GibberishAES/GibberishAES.php'; |
|
| 819 | 819 | // read the content of the temporary file |
| 820 | - $handle = fopen($post_file . '.txt', 'r'); |
|
| 820 | + $handle = fopen($post_file.'.txt', 'r'); |
|
| 821 | 821 | if ($handle === false) { |
| 822 | 822 | echo '[{"error":"true"}]'; |
| 823 | 823 | break; |
| 824 | 824 | } |
| 825 | - $contents = fread($handle, filesize($post_file . '.txt')); |
|
| 825 | + $contents = fread($handle, filesize($post_file.'.txt')); |
|
| 826 | 826 | if ($contents === false) { |
| 827 | 827 | echo '[{"error":"true"}]'; |
| 828 | 828 | break; |
| 829 | 829 | } |
| 830 | 830 | fclose($handle); |
| 831 | -if (is_file($post_file . '.txt')) { |
|
| 832 | - unlink($post_file . '.txt'); |
|
| 831 | +if (is_file($post_file.'.txt')) { |
|
| 832 | + unlink($post_file.'.txt'); |
|
| 833 | 833 | } |
| 834 | 834 | |
| 835 | 835 | // Encrypt its content |
@@ -840,7 +840,7 @@ discard block |
||
| 840 | 840 | if (empty($encrypted_text) === true) { |
| 841 | 841 | $encrypted_text = GibberishAES::enc(/** @scrutinizer ignore-type */ $chunk, $post_pdf_password); |
| 842 | 842 | } else { |
| 843 | - $encrypted_text .= '|#|#|' . GibberishAES::enc(/** @scrutinizer ignore-type */ $chunk, $post_pdf_password); |
|
| 843 | + $encrypted_text .= '|#|#|'.GibberishAES::enc(/** @scrutinizer ignore-type */ $chunk, $post_pdf_password); |
|
| 844 | 844 | } |
| 845 | 845 | } |
| 846 | 846 | |
@@ -857,9 +857,9 @@ discard block |
||
| 857 | 857 | </table></div> |
| 858 | 858 | <input type="button" value="Hide all" onclick="hideAll()" /> |
| 859 | 859 | <div id="footer" style="text-align:center;"> |
| 860 | - <a href="https://teampass.net/about/" target="_blank" style="">' . TP_TOOL_NAME . ' ' . TP_VERSION_FULL . ' ' . TP_COPYRIGHT . '</a> |
|
| 860 | + <a href="https://teampass.net/about/" target="_blank" style="">' . TP_TOOL_NAME.' '.TP_VERSION_FULL.' '.TP_COPYRIGHT.'</a> |
|
| 861 | 861 | </div> |
| 862 | - <div id="enc_html" style="display:none;">' . $encrypted_text . '</div> |
|
| 862 | + <div id="enc_html" style="display:none;">' . $encrypted_text.'</div> |
|
| 863 | 863 | </body> |
| 864 | 864 | </html> |
| 865 | 865 | <script type="text/javascript"> |
@@ -963,9 +963,9 @@ discard block |
||
| 963 | 963 | </script>' |
| 964 | 964 | ); |
| 965 | 965 | fclose($outstream); |
| 966 | -echo '[{"text":"<a href=\'' . |
|
| 967 | - $post_file_link . |
|
| 968 | - '\' target=\'_blank\'>' . $LANG['pdf_download'] . '</a>"}]'; |
|
| 966 | +echo '[{"text":"<a href=\''. |
|
| 967 | + $post_file_link. |
|
| 968 | + '\' target=\'_blank\'>'.$LANG['pdf_download'].'</a>"}]'; |
|
| 969 | 969 | |
| 970 | 970 | break; |
| 971 | 971 | |
@@ -28,7 +28,7 @@ discard block |
||
| 28 | 28 | require_once 'SecureHandler.php'; |
| 29 | 29 | session_name('teampass_session'); |
| 30 | 30 | session_start(); |
| 31 | -if (! isset($_SESSION['CPM']) || $_SESSION['CPM'] === false || ! isset($_SESSION['key']) || empty($_SESSION['key'])) { |
|
| 31 | +if (!isset($_SESSION['CPM']) || $_SESSION['CPM'] === false || !isset($_SESSION['key']) || empty($_SESSION['key'])) { |
|
| 32 | 32 | die('Hacking attempt...'); |
| 33 | 33 | } |
| 34 | 34 | |
@@ -100,7 +100,7 @@ discard block |
||
| 100 | 100 | 'perso' => 'perso', |
| 101 | 101 | ]; |
| 102 | 102 | foreach (explode(';', $post_ids) as $id) { |
| 103 | - if (! in_array($id, $_SESSION['forbiden_pfs']) && in_array($id, $_SESSION['groupes_visibles'])) { |
|
| 103 | + if (!in_array($id, $_SESSION['forbiden_pfs']) && in_array($id, $_SESSION['groupes_visibles'])) { |
|
| 104 | 104 | $rows = DB::query( |
| 105 | 105 | 'SELECT i.id as id, i.restricted_to as restricted_to, i.perso as perso, |
| 106 | 106 | i.label as label, i.description as description, i.pw as pw, i.login as login, i.pw_iv as pw_iv |
@@ -127,12 +127,12 @@ discard block |
||
| 127 | 127 | //exclude all results except the first one returned by query |
| 128 | 128 | if (empty($id_managed) || $id_managed !== $record['id']) { |
| 129 | 129 | if ((in_array($id, $_SESSION['personal_visible_groups']) |
| 130 | - && ! ($record['perso'] === '1' |
|
| 130 | + && !($record['perso'] === '1' |
|
| 131 | 131 | && $_SESSION['user_id'] === $record['restricted_to']) |
| 132 | - && ! empty($record['restricted_to'])) |
|
| 132 | + && !empty($record['restricted_to'])) |
|
| 133 | 133 | || |
| 134 | - (! empty($record['restricted_to']) |
|
| 135 | - && ! in_array($_SESSION['user_id'], $restricted_users_array)) |
|
| 134 | + (!empty($record['restricted_to']) |
|
| 135 | + && !in_array($_SESSION['user_id'], $restricted_users_array)) |
|
| 136 | 136 | ) { |
| 137 | 137 | //exclude this case |
| 138 | 138 | } else { |
@@ -264,7 +264,7 @@ discard block |
||
| 264 | 264 | $ret = ''; |
| 265 | 265 | require $SETTINGS['cpassman_dir'].'/includes/libraries/Authentication/phpseclib/Net/SSH2.php'; |
| 266 | 266 | $parse = parse_url($dataItem['url']); |
| 267 | -if (! isset($parse['host']) || empty($parse['host']) || ! isset($parse['port']) || empty($parse['port'])) { |
|
| 267 | +if (!isset($parse['host']) || empty($parse['host']) || !isset($parse['port']) || empty($parse['port'])) { |
|
| 268 | 268 | // error in parsing the url |
| 269 | 269 | echo prepareExchangedData( |
| 270 | 270 | [ |
@@ -277,7 +277,7 @@ discard block |
||
| 277 | 277 | break; |
| 278 | 278 | } |
| 279 | 279 | $ssh = new phpseclib\Net\SSH2($parse['host'], $parse['port']); |
| 280 | -if (! $ssh->login($dataReceived['ssh_root'], $dataReceived['ssh_pwd'])) { |
|
| 280 | +if (!$ssh->login($dataReceived['ssh_root'], $dataReceived['ssh_pwd'])) { |
|
| 281 | 281 | echo prepareExchangedData( |
| 282 | 282 | [ |
| 283 | 283 | 'error' => true, |
@@ -28,7 +28,7 @@ |
||
| 28 | 28 | require_once 'SecureHandler.php'; |
| 29 | 29 | session_name('teampass_session'); |
| 30 | 30 | session_start(); |
| 31 | -if (! isset($_SESSION['CPM']) || $_SESSION['CPM'] === false || ! isset($_SESSION['key']) || empty($_SESSION['key'])) { |
|
| 31 | +if (!isset($_SESSION['CPM']) || $_SESSION['CPM'] === false || !isset($_SESSION['key']) || empty($_SESSION['key'])) { |
|
| 32 | 32 | die('Hacking attempt...'); |
| 33 | 33 | } |
| 34 | 34 | |
@@ -52,7 +52,7 @@ |
||
| 52 | 52 | /* do checks */ |
| 53 | 53 | require_once $SETTINGS['cpassman_dir'].'/includes/config/include.php'; |
| 54 | 54 | require_once $SETTINGS['cpassman_dir'].'/sources/checks.php'; |
| 55 | -if (! checkUser($_SESSION['user_id'], $_SESSION['key'], 'items', $SETTINGS)) { |
|
| 55 | +if (!checkUser($_SESSION['user_id'], $_SESSION['key'], 'items', $SETTINGS)) { |
|
| 56 | 56 | $_SESSION['error']['code'] = ERR_NOT_ALLOWED; |
| 57 | 57 | //not allowed page |
| 58 | 58 | include $SETTINGS['cpassman_dir'].'/error.php'; |