@@ -50,26 +50,26 @@ discard block |
||
| 50 | 50 | } |
| 51 | 51 | |
| 52 | 52 | // Do checks |
| 53 | -require_once $SETTINGS['cpassman_dir'] . '/includes/config/include.php'; |
|
| 54 | -require_once $SETTINGS['cpassman_dir'] . '/sources/checks.php'; |
|
| 53 | +require_once $SETTINGS['cpassman_dir'].'/includes/config/include.php'; |
|
| 54 | +require_once $SETTINGS['cpassman_dir'].'/sources/checks.php'; |
|
| 55 | 55 | if (checkUser($_SESSION['user_id'], $_SESSION['key'], 'items', $SETTINGS) === false) { |
| 56 | 56 | // Not allowed page |
| 57 | 57 | $_SESSION['error']['code'] = ERR_NOT_ALLOWED; |
| 58 | - include $SETTINGS['cpassman_dir'] . '/error.php'; |
|
| 58 | + include $SETTINGS['cpassman_dir'].'/error.php'; |
|
| 59 | 59 | exit(); |
| 60 | 60 | } |
| 61 | 61 | |
| 62 | 62 | // No time limit |
| 63 | 63 | set_time_limit(0); |
| 64 | 64 | |
| 65 | -require_once $SETTINGS['cpassman_dir'] . '/includes/config/settings.php'; |
|
| 65 | +require_once $SETTINGS['cpassman_dir'].'/includes/config/settings.php'; |
|
| 66 | 66 | header('Content-type: text/html; charset=utf-8'); |
| 67 | 67 | error_reporting(E_ERROR); |
| 68 | -require_once $SETTINGS['cpassman_dir'] . '/sources/main.functions.php'; |
|
| 69 | -require_once $SETTINGS['cpassman_dir'] . '/sources/SplClassLoader.php'; |
|
| 68 | +require_once $SETTINGS['cpassman_dir'].'/sources/main.functions.php'; |
|
| 69 | +require_once $SETTINGS['cpassman_dir'].'/sources/SplClassLoader.php'; |
|
| 70 | 70 | |
| 71 | 71 | // Connect to mysql server |
| 72 | -require_once $SETTINGS['cpassman_dir'] . '/includes/libraries/Database/Meekrodb/db.class.php'; |
|
| 72 | +require_once $SETTINGS['cpassman_dir'].'/includes/libraries/Database/Meekrodb/db.class.php'; |
|
| 73 | 73 | if (defined('DB_PASSWD_CLEAR') === false) { |
| 74 | 74 | define('DB_PASSWD_CLEAR', defuseReturnDecrypted(DB_PASSWD, $SETTINGS)); |
| 75 | 75 | } |
@@ -81,12 +81,12 @@ discard block |
||
| 81 | 81 | DB::$encoding = DB_ENCODING; |
| 82 | 82 | |
| 83 | 83 | // Build tree |
| 84 | -$tree = new SplClassLoader('Tree\NestedTree', $SETTINGS['cpassman_dir'] . '/includes/libraries'); |
|
| 84 | +$tree = new SplClassLoader('Tree\NestedTree', $SETTINGS['cpassman_dir'].'/includes/libraries'); |
|
| 85 | 85 | $tree->register(); |
| 86 | -$tree = new Tree\NestedTree\NestedTree($pre . 'nested_tree', 'id', 'parent_id', 'title'); |
|
| 86 | +$tree = new Tree\NestedTree\NestedTree($pre.'nested_tree', 'id', 'parent_id', 'title'); |
|
| 87 | 87 | |
| 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 | |
| 91 | 91 | // Prepare POST variables |
| 92 | 92 | $id = filter_input(INPUT_POST, 'id', FILTER_SANITIZE_NUMBER_INT); |
@@ -137,9 +137,9 @@ discard block |
||
| 137 | 137 | 'SELECT i.id as id, i.id_tree as id_tree, i.restricted_to as restricted_to, i.perso as perso, |
| 138 | 138 | i.label as label, i.description as description, i.pw as pw, i.login as login, i.url as url, |
| 139 | 139 | i.email as email,l.date as date, i.pw_iv as pw_iv,n.renewal_period as renewal_period |
| 140 | - FROM ' . prefixTable('items') . ' as i |
|
| 141 | - INNER JOIN ' . prefixTable('nested_tree') . ' as n ON (i.id_tree = n.id) |
|
| 142 | - INNER JOIN ' . prefixTable('log_items') . ' as l ON (i.id = l.id_item) |
|
| 140 | + FROM ' . prefixTable('items').' as i |
|
| 141 | + INNER JOIN ' . prefixTable('nested_tree').' as n ON (i.id_tree = n.id) |
|
| 142 | + INNER JOIN ' . prefixTable('log_items').' as l ON (i.id = l.id_item) |
|
| 143 | 143 | WHERE i.inactif = %i |
| 144 | 144 | AND i.id_tree= %i |
| 145 | 145 | AND (l.action = %s OR (l.action = %s AND l.raison LIKE %s)) |
@@ -162,8 +162,8 @@ discard block |
||
| 162 | 162 | // Run query |
| 163 | 163 | $dataItem = DB::queryfirstrow( |
| 164 | 164 | 'SELECT i.pw AS pw, s.share_key AS share_key |
| 165 | - FROM ' . prefixTable('items') . ' AS i |
|
| 166 | - INNER JOIN ' . prefixTable('sharekeys_items') . ' AS s ON (s.object_id = i.id) |
|
| 165 | + FROM ' . prefixTable('items').' AS i |
|
| 166 | + INNER JOIN ' . prefixTable('sharekeys_items').' AS s ON (s.object_id = i.id) |
|
| 167 | 167 | WHERE user_id = %i AND i.id = %i', |
| 168 | 168 | $_SESSION['user_id'], |
| 169 | 169 | $record['id'] |
@@ -187,8 +187,8 @@ discard block |
||
| 187 | 187 | $arr_kbs = []; |
| 188 | 188 | $rows_kb = DB::query( |
| 189 | 189 | 'SELECT b.label, b.id |
| 190 | - FROM ' . prefixTable('kb_items') . ' AS a |
|
| 191 | - INNER JOIN ' . prefixTable('kb') . ' AS b ON (a.kb_id = b.id) |
|
| 190 | + FROM ' . prefixTable('kb_items').' AS a |
|
| 191 | + INNER JOIN ' . prefixTable('kb').' AS b ON (a.kb_id = b.id) |
|
| 192 | 192 | WHERE a.item_id = %i', |
| 193 | 193 | $record['id'] |
| 194 | 194 | ); |
@@ -200,7 +200,7 @@ discard block |
||
| 200 | 200 | $arr_tags = []; |
| 201 | 201 | $rows_tag = DB::query( |
| 202 | 202 | 'SELECT tag |
| 203 | - FROM ' . prefixTable('tags') . ' |
|
| 203 | + FROM ' . prefixTable('tags').' |
|
| 204 | 204 | WHERE item_id = %i', |
| 205 | 205 | $record['id'] |
| 206 | 206 | ); |
@@ -247,14 +247,14 @@ discard block |
||
| 247 | 247 | $tmp .= array2csv($value); |
| 248 | 248 | } |
| 249 | 249 | |
| 250 | - echo '[{"content":"' . base64_encode($tmp) . '"}]'; |
|
| 250 | + echo '[{"content":"'.base64_encode($tmp).'"}]'; |
|
| 251 | 251 | break; |
| 252 | 252 | |
| 253 | 253 | /* |
| 254 | 254 | * PDF - step 1 - Prepare database |
| 255 | 255 | */ |
| 256 | 256 | case 'initialize_export_table': |
| 257 | - DB::query('TRUNCATE TABLE ' . prefixTable('export')); |
|
| 257 | + DB::query('TRUNCATE TABLE '.prefixTable('export')); |
|
| 258 | 258 | break; |
| 259 | 259 | |
| 260 | 260 | /* |
@@ -298,9 +298,9 @@ discard block |
||
| 298 | 298 | '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, |
| 299 | 299 | l.date as date, i.pw_iv as pw_iv, |
| 300 | 300 | n.renewal_period as renewal_period |
| 301 | - FROM ' . prefixTable('items') . ' as i |
|
| 302 | - INNER JOIN ' . prefixTable('nested_tree') . ' as n ON (i.id_tree = n.id) |
|
| 303 | - INNER JOIN ' . prefixTable('log_items') . ' as l ON (i.id = l.id_item) |
|
| 301 | + FROM ' . prefixTable('items').' as i |
|
| 302 | + INNER JOIN ' . prefixTable('nested_tree').' as n ON (i.id_tree = n.id) |
|
| 303 | + INNER JOIN ' . prefixTable('log_items').' as l ON (i.id = l.id_item) |
|
| 304 | 304 | WHERE i.inactif = %i |
| 305 | 305 | AND i.id_tree= %i |
| 306 | 306 | AND (l.action = %s OR (l.action = %s AND l.raison LIKE %s)) |
@@ -326,8 +326,8 @@ discard block |
||
| 326 | 326 | // Run query |
| 327 | 327 | $dataItem = DB::queryfirstrow( |
| 328 | 328 | 'SELECT i.pw AS pw, s.share_key AS share_key |
| 329 | - FROM ' . prefixTable('items') . ' AS i |
|
| 330 | - INNER JOIN ' . prefixTable('sharekeys_items') . ' AS s ON (s.object_id = i.id) |
|
| 329 | + FROM ' . prefixTable('items').' AS i |
|
| 330 | + INNER JOIN ' . prefixTable('sharekeys_items').' AS s ON (s.object_id = i.id) |
|
| 331 | 331 | WHERE user_id = %i AND i.id = %i', |
| 332 | 332 | $_SESSION['user_id'], |
| 333 | 333 | $record['id'] |
@@ -351,8 +351,8 @@ discard block |
||
| 351 | 351 | $arr_kbs = ''; |
| 352 | 352 | $rows_kb = DB::query( |
| 353 | 353 | 'SELECT b.label, b.id |
| 354 | - FROM ' . prefixTable('kb_items') . ' AS a |
|
| 355 | - INNER JOIN ' . prefixTable('kb') . ' AS b ON (a.kb_id = b.id) |
|
| 354 | + FROM ' . prefixTable('kb_items').' AS a |
|
| 355 | + INNER JOIN ' . prefixTable('kb').' AS b ON (a.kb_id = b.id) |
|
| 356 | 356 | WHERE a.item_id = %i', |
| 357 | 357 | $record['id'] |
| 358 | 358 | ); |
@@ -360,7 +360,7 @@ discard block |
||
| 360 | 360 | if (empty($arr_kbs)) { |
| 361 | 361 | $arr_kbs = $rec_kb['label']; |
| 362 | 362 | } else { |
| 363 | - $arr_kbs .= ' | ' . $rec_kb['label']; |
|
| 363 | + $arr_kbs .= ' | '.$rec_kb['label']; |
|
| 364 | 364 | } |
| 365 | 365 | } |
| 366 | 366 | |
@@ -368,7 +368,7 @@ discard block |
||
| 368 | 368 | $arr_tags = ''; |
| 369 | 369 | $rows_tag = DB::query( |
| 370 | 370 | 'SELECT tag |
| 371 | - FROM ' . prefixTable('tags') . ' |
|
| 371 | + FROM ' . prefixTable('tags').' |
|
| 372 | 372 | WHERE item_id = %i', |
| 373 | 373 | $record['id'] |
| 374 | 374 | ); |
@@ -376,7 +376,7 @@ discard block |
||
| 376 | 376 | if (empty($arr_tags)) { |
| 377 | 377 | $arr_tags = $rec_tag['tag']; |
| 378 | 378 | } else { |
| 379 | - $arr_tags .= ' ' . $rec_tag['tag']; |
|
| 379 | + $arr_tags .= ' '.$rec_tag['tag']; |
|
| 380 | 380 | } |
| 381 | 381 | } |
| 382 | 382 | |
@@ -444,7 +444,7 @@ discard block |
||
| 444 | 444 | header('Content-type: application/pdf'); |
| 445 | 445 | |
| 446 | 446 | // query |
| 447 | - $rows = DB::query('SELECT * FROM ' . prefixTable('export')); |
|
| 447 | + $rows = DB::query('SELECT * FROM '.prefixTable('export')); |
|
| 448 | 448 | $counter = DB::count(); |
| 449 | 449 | if ($counter > 0) { |
| 450 | 450 | |
@@ -452,8 +452,8 @@ discard block |
||
| 452 | 452 | $prev_path = ''; |
| 453 | 453 | |
| 454 | 454 | //Prepare the PDF file |
| 455 | - require_once($SETTINGS['cpassman_dir'] . '/includes/libraries/Pdf/tcpdf/config/tcpdf_config.php'); |
|
| 456 | - include $SETTINGS['cpassman_dir'] . '/includes/libraries/Pdf/tcpdf/tcpdf.php'; |
|
| 455 | + require_once($SETTINGS['cpassman_dir'].'/includes/libraries/Pdf/tcpdf/config/tcpdf_config.php'); |
|
| 456 | + include $SETTINGS['cpassman_dir'].'/includes/libraries/Pdf/tcpdf/tcpdf.php'; |
|
| 457 | 457 | |
| 458 | 458 | $pdf = new TCPDF(PDF_PAGE_ORIENTATION, PDF_UNIT, PDF_PAGE_FORMAT, true, 'UTF-8', false); |
| 459 | 459 | $pdf->SetProtection(array('print'), $dataReceived['pdf_password'], null); |
@@ -465,7 +465,7 @@ discard block |
||
| 465 | 465 | |
| 466 | 466 | // set default header data |
| 467 | 467 | $pdf->SetHeaderData( |
| 468 | - $SETTINGS['cpassman_dir'] . '/includes/images/teampass-logo2-home.png', |
|
| 468 | + $SETTINGS['cpassman_dir'].'/includes/images/teampass-logo2-home.png', |
|
| 469 | 469 | PDF_HEADER_LOGO_WIDTH, |
| 470 | 470 | 'Teampass export', |
| 471 | 471 | $_SESSION['lastname']." ".$_SESSION['name'].' @ '.date($SETTINGS['date_format']." ".$SETTINGS['time_format'], (int) time()) |
@@ -569,7 +569,7 @@ discard block |
||
| 569 | 569 | logEvents($SETTINGS, 'pdf_export', '', (string) $_SESSION['user_id'], $_SESSION['login']); |
| 570 | 570 | |
| 571 | 571 | //clean table |
| 572 | - DB::query('TRUNCATE TABLE ' . prefixTable('export')); |
|
| 572 | + DB::query('TRUNCATE TABLE '.prefixTable('export')); |
|
| 573 | 573 | |
| 574 | 574 | // Send back the file in Blob |
| 575 | 575 | echo $pdf->Output(null, 'I'); |
@@ -581,8 +581,8 @@ discard block |
||
| 581 | 581 | // step 1: |
| 582 | 582 | // - prepare export file |
| 583 | 583 | // - get full list of objects id to export |
| 584 | - include $SETTINGS['cpassman_dir'] . '/includes/config/include.php'; |
|
| 585 | - include_once $SETTINGS['cpassman_dir'] . '/includes/libraries/Encryption/GibberishAES/GibberishAES.php'; |
|
| 584 | + include $SETTINGS['cpassman_dir'].'/includes/config/include.php'; |
|
| 585 | + include_once $SETTINGS['cpassman_dir'].'/includes/libraries/Encryption/GibberishAES/GibberishAES.php'; |
|
| 586 | 586 | $idsList = array(); |
| 587 | 587 | |
| 588 | 588 | foreach (explode(';', $post_ids) as $id) { |
@@ -594,9 +594,9 @@ discard block |
||
| 594 | 594 | // count elements to display |
| 595 | 595 | $result = DB::query( |
| 596 | 596 | 'SELECT i.id AS id, i.label AS label, i.restricted_to AS restricted_to, i.perso AS perso |
| 597 | - FROM ' . prefixTable('items') . ' as i |
|
| 598 | - INNER JOIN ' . prefixTable('nested_tree') . ' as n ON (i.id_tree = n.id) |
|
| 599 | - INNER JOIN ' . prefixTable('log_items') . ' as l ON (i.id = l.id_item) |
|
| 597 | + FROM ' . prefixTable('items').' as i |
|
| 598 | + INNER JOIN ' . prefixTable('nested_tree').' as n ON (i.id_tree = n.id) |
|
| 599 | + INNER JOIN ' . prefixTable('log_items').' as l ON (i.id = l.id_item) |
|
| 600 | 600 | WHERE i.inactif = %i |
| 601 | 601 | AND i.id_tree= %i |
| 602 | 602 | AND (l.action = %s OR (l.action = %s AND l.raison LIKE %s)) |
@@ -624,9 +624,9 @@ discard block |
||
| 624 | 624 | |
| 625 | 625 | // prepare export file |
| 626 | 626 | //save the file |
| 627 | - $html_file = '/teampass_export_' . time() . '_' . generateKey() . '.html'; |
|
| 627 | + $html_file = '/teampass_export_'.time().'_'.generateKey().'.html'; |
|
| 628 | 628 | //print_r($full_listing); |
| 629 | - $outstream = fopen($SETTINGS['path_to_files_folder'] . $html_file, 'w'); |
|
| 629 | + $outstream = fopen($SETTINGS['path_to_files_folder'].$html_file, 'w'); |
|
| 630 | 630 | if ($outstream === false) { |
| 631 | 631 | echo '[{"error":"true"}]'; |
| 632 | 632 | break; |
@@ -650,12 +650,12 @@ discard block |
||
| 650 | 650 | </style> |
| 651 | 651 | </head> |
| 652 | 652 | <body> |
| 653 | - <input type="hidden" id="generation_date" value="' . GibberishAES::enc(/** @scrutinizer ignore-type */ (string) time(), $post_pdf_password) . '" /> |
|
| 653 | + <input type="hidden" id="generation_date" value="' . GibberishAES::enc(/** @scrutinizer ignore-type */ (string) time(), $post_pdf_password).'" /> |
|
| 654 | 654 | <div id="header"> |
| 655 | - ' . TP_TOOL_NAME . ' - Off Line mode |
|
| 655 | + ' . TP_TOOL_NAME.' - Off Line mode |
|
| 656 | 656 | </div> |
| 657 | 657 | <div style="margin:10px; font-size:9px;"> |
| 658 | - <i>This page was generated by <b>' . $_SESSION['name'] . ' ' . $_SESSION['lastname'] . '</b>, the ' . date('Y/m/d H:i:s') . '.</i> |
|
| 658 | + <i>This page was generated by <b>' . $_SESSION['name'].' '.$_SESSION['lastname'].'</b>, the '.date('Y/m/d H:i:s').'.</i> |
|
| 659 | 659 | <span id="info_page" style="margin-left:20px; font-weight:bold; font-size: 14px; color:red;"></span> |
| 660 | 660 | </div> |
| 661 | 661 | <div id="information"></div> |
@@ -666,11 +666,11 @@ discard block |
||
| 666 | 666 | <div> |
| 667 | 667 | <table id="itemsTable"> |
| 668 | 668 | <thead><tr> |
| 669 | - <th style="width:15%;">' . $LANG['label'] . '</th> |
|
| 670 | - <th style="width:10%;">' . $LANG['pw'] . '</th> |
|
| 671 | - <th style="width:30%;">' . $LANG['description'] . '</th> |
|
| 672 | - <th style="width:5%;">' . $LANG['user_login'] . '</th> |
|
| 673 | - <th style="width:20%;">' . $LANG['url'] . '</th> |
|
| 669 | + <th style="width:15%;">' . $LANG['label'].'</th> |
|
| 670 | + <th style="width:10%;">' . $LANG['pw'].'</th> |
|
| 671 | + <th style="width:30%;">' . $LANG['description'].'</th> |
|
| 672 | + <th style="width:5%;">' . $LANG['user_login'].'</th> |
|
| 673 | + <th style="width:20%;">' . $LANG['url'].'</th> |
|
| 674 | 674 | </tr></thead> |
| 675 | 675 | <tbody id="itemsTable_tbody">' |
| 676 | 676 | ); |
@@ -695,22 +695,22 @@ discard block |
||
| 695 | 695 | || in_array($post_idTree, $_SESSION['groupes_visibles']) === false |
| 696 | 696 | || (in_array($post_idTree, $_SESSION['no_access_folders']) === true) |
| 697 | 697 | ) { |
| 698 | - echo '[{"loop":"true", "number":"' . $post_number . '", "cpt":"' . $post_cpt . '", "file":"' . $post_file . '", "idsList":"' . $post_idsList . '" , "file_link":"' . $post_file_link . '"}]'; |
|
| 698 | + echo '[{"loop":"true", "number":"'.$post_number.'", "cpt":"'.$post_cpt.'", "file":"'.$post_file.'", "idsList":"'.$post_idsList.'" , "file_link":"'.$post_file_link.'"}]'; |
|
| 699 | 699 | break; |
| 700 | 700 | } |
| 701 | 701 | |
| 702 | 702 | $full_listing = array(); |
| 703 | 703 | $items_id_list = array(); |
| 704 | - include $SETTINGS['cpassman_dir'] . '/includes/config/include.php'; |
|
| 705 | - include_once $SETTINGS['cpassman_dir'] . '/includes/libraries/Encryption/GibberishAES/GibberishAES.php'; |
|
| 704 | + include $SETTINGS['cpassman_dir'].'/includes/config/include.php'; |
|
| 705 | + include_once $SETTINGS['cpassman_dir'].'/includes/libraries/Encryption/GibberishAES/GibberishAES.php'; |
|
| 706 | 706 | |
| 707 | 707 | $rows = DB::query( |
| 708 | 708 | '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, |
| 709 | 709 | l.date as date, i.pw_iv as pw_iv, |
| 710 | 710 | n.renewal_period as renewal_period |
| 711 | - FROM ' . prefixTable('items') . ' as i |
|
| 712 | - INNER JOIN ' . prefixTable('nested_tree') . ' as n ON (i.id_tree = n.id) |
|
| 713 | - INNER JOIN ' . prefixTable('log_items') . ' as l ON (i.id = l.id_item) |
|
| 711 | + FROM ' . prefixTable('items').' as i |
|
| 712 | + INNER JOIN ' . prefixTable('nested_tree').' as n ON (i.id_tree = n.id) |
|
| 713 | + INNER JOIN ' . prefixTable('log_items').' as l ON (i.id = l.id_item) |
|
| 714 | 714 | WHERE i.inactif = %i |
| 715 | 715 | AND i.id_tree= %i |
| 716 | 716 | AND (l.action = %s OR (l.action = %s AND l.raison LIKE %s)) |
@@ -770,7 +770,7 @@ discard block |
||
| 770 | 770 | } |
| 771 | 771 | |
| 772 | 772 | //save in export file |
| 773 | - $outstream = fopen($post_file . '.txt', 'a'); |
|
| 773 | + $outstream = fopen($post_file.'.txt', 'a'); |
|
| 774 | 774 | if ($outstream === false) { |
| 775 | 775 | echo '[{"error":"true"}]'; |
| 776 | 776 | break; |
@@ -808,13 +808,13 @@ discard block |
||
| 808 | 808 | if (empty($arboHtml)) { |
| 809 | 809 | $arboHtml = $arboHtml_tmp; |
| 810 | 810 | } else { |
| 811 | - $arboHtml .= ' » ' . $arboHtml_tmp; |
|
| 811 | + $arboHtml .= ' » '.$arboHtml_tmp; |
|
| 812 | 812 | } |
| 813 | 813 | } |
| 814 | 814 | fputs( |
| 815 | 815 | $outstream, |
| 816 | 816 | ' |
| 817 | - <tr class="path"><td colspan="5">' . $arboHtml . '</td></tr>' |
|
| 817 | + <tr class="path"><td colspan="5">' . $arboHtml.'</td></tr>' |
|
| 818 | 818 | ); |
| 819 | 819 | $idTree = $elem['id_tree']; |
| 820 | 820 | } |
@@ -823,12 +823,12 @@ discard block |
||
| 823 | 823 | fputs( |
| 824 | 824 | $outstream, |
| 825 | 825 | ' |
| 826 | - <tr class="' . $lineType . '"> |
|
| 827 | - <td>' . addslashes($elem['label']) . '</td> |
|
| 828 | - <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> |
|
| 829 | - <td>' . $desc . '</td> |
|
| 830 | - <td align="center">' . $login . '</td> |
|
| 831 | - <td align="center">' . $url . '</td> |
|
| 826 | + <tr class="' . $lineType.'"> |
|
| 827 | + <td>' . addslashes($elem['label']).'</td> |
|
| 828 | + <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> |
|
| 829 | + <td>' . $desc.'</td> |
|
| 830 | + <td align="center">' . $login.'</td> |
|
| 831 | + <td align="center">' . $url.'</td> |
|
| 832 | 832 | </tr>' |
| 833 | 833 | ); |
| 834 | 834 | } |
@@ -836,29 +836,29 @@ discard block |
||
| 836 | 836 | fclose($outstream); |
| 837 | 837 | |
| 838 | 838 | // send back and continue |
| 839 | - echo '[{"loop":"true", "number":"' . $post_number . '", "cpt":"' . $post_cpt . '", "file":"' . $post_file . '", "idsList":"' . $post_idsList . '" , "file_link":"' . $post_file_link . '"}]'; |
|
| 839 | + echo '[{"loop":"true", "number":"'.$post_number.'", "cpt":"'.$post_cpt.'", "file":"'.$post_file.'", "idsList":"'.$post_idsList.'" , "file_link":"'.$post_file_link.'"}]'; |
|
| 840 | 840 | break; |
| 841 | 841 | |
| 842 | 842 | //CASE export in HTML format - Iteration loop |
| 843 | 843 | case 'export_to_html_format_finalize': |
| 844 | 844 | // Load includes |
| 845 | - include $SETTINGS['cpassman_dir'] . '/includes/config/include.php'; |
|
| 846 | - require_once $SETTINGS['cpassman_dir'] . '/includes/libraries/Encryption/GibberishAES/GibberishAES.php'; |
|
| 845 | + include $SETTINGS['cpassman_dir'].'/includes/config/include.php'; |
|
| 846 | + require_once $SETTINGS['cpassman_dir'].'/includes/libraries/Encryption/GibberishAES/GibberishAES.php'; |
|
| 847 | 847 | |
| 848 | 848 | // read the content of the temporary file |
| 849 | - $handle = fopen($post_file . '.txt', 'r'); |
|
| 849 | + $handle = fopen($post_file.'.txt', 'r'); |
|
| 850 | 850 | if ($handle === false) { |
| 851 | 851 | echo '[{"error":"true"}]'; |
| 852 | 852 | break; |
| 853 | 853 | } |
| 854 | - $contents = fread($handle, filesize($post_file . '.txt')); |
|
| 854 | + $contents = fread($handle, filesize($post_file.'.txt')); |
|
| 855 | 855 | if ($contents === false) { |
| 856 | 856 | echo '[{"error":"true"}]'; |
| 857 | 857 | break; |
| 858 | 858 | } |
| 859 | 859 | fclose($handle); |
| 860 | - if (is_file($post_file . '.txt')) { |
|
| 861 | - unlink($post_file . '.txt'); |
|
| 860 | + if (is_file($post_file.'.txt')) { |
|
| 861 | + unlink($post_file.'.txt'); |
|
| 862 | 862 | } |
| 863 | 863 | |
| 864 | 864 | // Encrypt its content |
@@ -869,7 +869,7 @@ discard block |
||
| 869 | 869 | if (empty($encrypted_text) === true) { |
| 870 | 870 | $encrypted_text = GibberishAES::enc(/** @scrutinizer ignore-type */ $chunk, $post_pdf_password); |
| 871 | 871 | } else { |
| 872 | - $encrypted_text .= '|#|#|' . GibberishAES::enc(/** @scrutinizer ignore-type */ $chunk, $post_pdf_password); |
|
| 872 | + $encrypted_text .= '|#|#|'.GibberishAES::enc(/** @scrutinizer ignore-type */ $chunk, $post_pdf_password); |
|
| 873 | 873 | } |
| 874 | 874 | } |
| 875 | 875 | |
@@ -886,9 +886,9 @@ discard block |
||
| 886 | 886 | </table></div> |
| 887 | 887 | <input type="button" value="Hide all" onclick="hideAll()" /> |
| 888 | 888 | <div id="footer" style="text-align:center;"> |
| 889 | - <a href="https://teampass.net/about/" target="_blank" style="">' . TP_TOOL_NAME . ' ' . TP_VERSION_FULL . ' ' . TP_COPYRIGHT . '</a> |
|
| 889 | + <a href="https://teampass.net/about/" target="_blank" style="">' . TP_TOOL_NAME.' '.TP_VERSION_FULL.' '.TP_COPYRIGHT.'</a> |
|
| 890 | 890 | </div> |
| 891 | - <div id="enc_html" style="display:none;">' . $encrypted_text . '</div> |
|
| 891 | + <div id="enc_html" style="display:none;">' . $encrypted_text.'</div> |
|
| 892 | 892 | </body> |
| 893 | 893 | </html> |
| 894 | 894 | <script type="text/javascript"> |
@@ -994,9 +994,9 @@ discard block |
||
| 994 | 994 | |
| 995 | 995 | fclose($outstream); |
| 996 | 996 | |
| 997 | - echo '[{"text":"<a href=\'' . |
|
| 998 | - $post_file_link . |
|
| 999 | - '\' target=\'_blank\'>' . $LANG['pdf_download'] . '</a>"}]'; |
|
| 997 | + echo '[{"text":"<a href=\''. |
|
| 998 | + $post_file_link. |
|
| 999 | + '\' target=\'_blank\'>'.$LANG['pdf_download'].'</a>"}]'; |
|
| 1000 | 1000 | break; |
| 1001 | 1001 | } |
| 1002 | 1002 | } |
@@ -50,22 +50,22 @@ discard block |
||
| 50 | 50 | // Load AntiXSS |
| 51 | 51 | include_once '../includes/libraries/voku/helper/AntiXSS.php'; |
| 52 | 52 | $antiXss = new voku\helper\AntiXSS(); |
| 53 | - if (! headers_sent()) { //If headers not sent yet... then do php redirect |
|
| 54 | - header('Location: ' . $antiXss->xss_clean($url)); |
|
| 53 | + if (!headers_sent()) { //If headers not sent yet... then do php redirect |
|
| 54 | + header('Location: '.$antiXss->xss_clean($url)); |
|
| 55 | 55 | exit; |
| 56 | 56 | } |
| 57 | 57 | |
| 58 | 58 | //If headers are sent... do java redirect... if java disabled, do html redirect. |
| 59 | 59 | echo '<script type="text/javascript">'; |
| 60 | - echo 'window.location.href="' . $antiXss->xss_clean($url) . '";'; |
|
| 60 | + echo 'window.location.href="'.$antiXss->xss_clean($url).'";'; |
|
| 61 | 61 | echo '</script>'; |
| 62 | 62 | echo '<noscript>'; |
| 63 | - echo '<meta http-equiv="refresh" content="0;url=' . $antiXss->xss_clean($url) . '" />'; |
|
| 63 | + echo '<meta http-equiv="refresh" content="0;url='.$antiXss->xss_clean($url).'" />'; |
|
| 64 | 64 | echo '</noscript>'; |
| 65 | 65 | } |
| 66 | 66 | |
| 67 | 67 | // Include files |
| 68 | -require_once $SETTINGS['cpassman_dir'] . '/includes/libraries/protect/SuperGlobal/SuperGlobal.php'; |
|
| 68 | +require_once $SETTINGS['cpassman_dir'].'/includes/libraries/protect/SuperGlobal/SuperGlobal.php'; |
|
| 69 | 69 | $superGlobal = new protect\SuperGlobal\SuperGlobal(); |
| 70 | 70 | // Prepare GET variables |
| 71 | 71 | $server = []; |
@@ -88,7 +88,7 @@ discard block |
||
| 88 | 88 | && isset($SETTINGS['enable_sts']) === true |
| 89 | 89 | && (int) $SETTINGS['enable_sts'] === 1 |
| 90 | 90 | ) { |
| 91 | - redirect('https://' . $server['http_host'] . $server['request_uri']); |
|
| 91 | + redirect('https://'.$server['http_host'].$server['request_uri']); |
|
| 92 | 92 | } |
| 93 | 93 | |
| 94 | 94 | // Load pwComplexity |
@@ -113,11 +113,11 @@ discard block |
||
| 113 | 113 | // LOAD CPASSMAN SETTINGS |
| 114 | 114 | if ( |
| 115 | 115 | isset($SETTINGS['cpassman_dir']) === true |
| 116 | - && is_dir($SETTINGS['cpassman_dir'] . '/install') === true |
|
| 116 | + && is_dir($SETTINGS['cpassman_dir'].'/install') === true |
|
| 117 | 117 | ) { |
| 118 | 118 | // Should we delete folder INSTALL? |
| 119 | 119 | $row = DB::queryFirstRow( |
| 120 | - 'SELECT valeur FROM ' . prefixTable('misc') . ' WHERE type=%s AND intitule=%s', |
|
| 120 | + 'SELECT valeur FROM '.prefixTable('misc').' WHERE type=%s AND intitule=%s', |
|
| 121 | 121 | 'install', |
| 122 | 122 | 'clear_install_folder' |
| 123 | 123 | ); |
@@ -135,11 +135,11 @@ discard block |
||
| 135 | 135 | if ($directories !== false) { |
| 136 | 136 | $files = array_diff($directories, ['.', '..']); |
| 137 | 137 | foreach ($files as $file) { |
| 138 | - if (is_dir($dir . '/' . $file)) { |
|
| 139 | - delTree($dir . '/' . $file); |
|
| 138 | + if (is_dir($dir.'/'.$file)) { |
|
| 139 | + delTree($dir.'/'.$file); |
|
| 140 | 140 | } else { |
| 141 | 141 | try { |
| 142 | - unlink($dir . '/' . $file); |
|
| 142 | + unlink($dir.'/'.$file); |
|
| 143 | 143 | } catch (Exception $e) { |
| 144 | 144 | // do nothing... php will ignore and continue |
| 145 | 145 | } |
@@ -152,13 +152,13 @@ discard block |
||
| 152 | 152 | } |
| 153 | 153 | } |
| 154 | 154 | |
| 155 | - if (is_dir($SETTINGS['cpassman_dir'] . '/install')) { |
|
| 155 | + if (is_dir($SETTINGS['cpassman_dir'].'/install')) { |
|
| 156 | 156 | // Set the permissions on the install directory and delete |
| 157 | 157 | // is server Windows or Linux? |
| 158 | 158 | if (strtoupper(substr(PHP_OS, 0, 3)) !== 'WIN') { |
| 159 | - recursiveChmod($SETTINGS['cpassman_dir'] . '/install', 0755, 0440); |
|
| 159 | + recursiveChmod($SETTINGS['cpassman_dir'].'/install', 0755, 0440); |
|
| 160 | 160 | } |
| 161 | - delTree($SETTINGS['cpassman_dir'] . '/install'); |
|
| 161 | + delTree($SETTINGS['cpassman_dir'].'/install'); |
|
| 162 | 162 | } |
| 163 | 163 | |
| 164 | 164 | // Delete temporary install table |
@@ -176,7 +176,7 @@ discard block |
||
| 176 | 176 | // Load Languages stuff |
| 177 | 177 | if (isset($languagesList) === false) { |
| 178 | 178 | $languagesList = []; |
| 179 | - $rows = DB::query('SELECT * FROM ' . prefixTable('languages') . ' GROUP BY name, label, code, flag, id ORDER BY name ASC'); |
|
| 179 | + $rows = DB::query('SELECT * FROM '.prefixTable('languages').' GROUP BY name, label, code, flag, id ORDER BY name ASC'); |
|
| 180 | 180 | foreach ($rows as $record) { |
| 181 | 181 | array_push($languagesList, $record['name']); |
| 182 | 182 | if (isset($_SESSION['user_language']) && $record['name'] === $_SESSION['user_language']) { |
@@ -234,7 +234,7 @@ discard block |
||
| 234 | 234 | // CHECK IF SESSION EXISTS AND IF SESSION IS VALID |
| 235 | 235 | if (empty($_SESSION['sessionDuration']) === false) { |
| 236 | 236 | $dataSession = DB::queryFirstRow( |
| 237 | - 'SELECT key_tempo FROM ' . prefixTable('users') . ' WHERE id=%i', |
|
| 237 | + 'SELECT key_tempo FROM '.prefixTable('users').' WHERE id=%i', |
|
| 238 | 238 | $_SESSION['user_id'] |
| 239 | 239 | ); |
| 240 | 240 | } else { |
@@ -298,7 +298,7 @@ discard block |
||
| 298 | 298 | && (isset($_SESSION['user_admin']) === true && $_SESSION['user_admin'] === 1) |
| 299 | 299 | ) { |
| 300 | 300 | $row = DB::queryFirstRow( |
| 301 | - 'SELECT valeur FROM ' . prefixTable('misc') . ' WHERE type=%s_type AND intitule=%s_intitule', |
|
| 301 | + 'SELECT valeur FROM '.prefixTable('misc').' WHERE type=%s_type AND intitule=%s_intitule', |
|
| 302 | 302 | [ |
| 303 | 303 | 'type' => 'admin', |
| 304 | 304 | 'intitule' => 'cpassman_version', |
@@ -358,7 +358,7 @@ discard block |
||
| 358 | 358 | |
| 359 | 359 | syslog( |
| 360 | 360 | LOG_WARNING, |
| 361 | - 'Unlog user: ' . date('Y/m/d H:i:s') . " {$server['remote_addr']} ({$server['http_user_agent']})" |
|
| 361 | + 'Unlog user: '.date('Y/m/d H:i:s')." {$server['remote_addr']} ({$server['http_user_agent']})" |
|
| 362 | 362 | ); |
| 363 | 363 | // erase session table |
| 364 | 364 | $_SESSION = []; |
@@ -409,7 +409,7 @@ discard block |
||
| 409 | 409 | if (isset($_SESSION['user_id']) === true && empty($_SESSION['user_id']) === false) { |
| 410 | 410 | // query on user |
| 411 | 411 | $data = DB::queryfirstrow( |
| 412 | - 'SELECT login, admin, gestionnaire, can_manage_all_users, groupes_visibles, groupes_interdits, fonction_id, last_connexion FROM ' . prefixTable('users') . ' WHERE id=%i', |
|
| 412 | + 'SELECT login, admin, gestionnaire, can_manage_all_users, groupes_visibles, groupes_interdits, fonction_id, last_connexion FROM '.prefixTable('users').' WHERE id=%i', |
|
| 413 | 413 | $_SESSION['user_id'] |
| 414 | 414 | ); |
| 415 | 415 | //Check if user has been deleted or unlogged |
@@ -490,7 +490,7 @@ discard block |
||
| 490 | 490 | $_SESSION['item_fields'] = []; |
| 491 | 491 | $rows = DB::query( |
| 492 | 492 | 'SELECT * |
| 493 | - FROM ' . prefixTable('categories') . ' |
|
| 493 | + FROM ' . prefixTable('categories').' |
|
| 494 | 494 | WHERE level=%i', |
| 495 | 495 | '0' |
| 496 | 496 | ); |
@@ -499,7 +499,7 @@ discard block |
||
| 499 | 499 | // get each field |
| 500 | 500 | $rows2 = DB::query( |
| 501 | 501 | 'SELECT * |
| 502 | - FROM ' . prefixTable('categories') . ' |
|
| 502 | + FROM ' . prefixTable('categories').' |
|
| 503 | 503 | WHERE parent_id=%i |
| 504 | 504 | ORDER BY `order` ASC', |
| 505 | 505 | $record['id'] |
@@ -576,7 +576,7 @@ discard block |
||
| 576 | 576 | if ( |
| 577 | 577 | isset($SETTINGS['roles_allowed_to_print']) === true |
| 578 | 578 | && isset($_SESSION['user_roles']) === true |
| 579 | - && (! isset($_SESSION['temporary']['user_can_printout']) || empty($_SESSION['temporary']['user_can_printout'])) |
|
| 579 | + && (!isset($_SESSION['temporary']['user_can_printout']) || empty($_SESSION['temporary']['user_can_printout'])) |
|
| 580 | 580 | ) { |
| 581 | 581 | foreach (explode(';', $SETTINGS['roles_allowed_to_print']) as $role) { |
| 582 | 582 | if (in_array($role, $_SESSION['user_roles']) === true) { |
@@ -586,5 +586,5 @@ discard block |
||
| 586 | 586 | } |
| 587 | 587 | |
| 588 | 588 | /* CHECK NUMBER OF USER ONLINE */ |
| 589 | -DB::query('SELECT * FROM ' . prefixTable('users') . ' WHERE timestamp>=%i', time() - 600); |
|
| 589 | +DB::query('SELECT * FROM '.prefixTable('users').' WHERE timestamp>=%i', time() - 600); |
|
| 590 | 590 | $_SESSION['nb_users_online'] = DB::count(); |
@@ -43,15 +43,15 @@ discard block |
||
| 43 | 43 | } |
| 44 | 44 | |
| 45 | 45 | /* do checks */ |
| 46 | -require_once $SETTINGS['cpassman_dir'] . '/sources/checks.php'; |
|
| 46 | +require_once $SETTINGS['cpassman_dir'].'/sources/checks.php'; |
|
| 47 | 47 | if (checkUser($_SESSION['user_id'], $_SESSION['key'], 'emails', $SETTINGS) === false) { |
| 48 | 48 | $_SESSION['error']['code'] = ERR_NOT_ALLOWED; |
| 49 | - include $SETTINGS['cpassman_dir'] . '/error.php'; |
|
| 49 | + include $SETTINGS['cpassman_dir'].'/error.php'; |
|
| 50 | 50 | exit; |
| 51 | 51 | } |
| 52 | 52 | |
| 53 | 53 | // Load template |
| 54 | -require_once $SETTINGS['cpassman_dir'] . '/sources/main.functions.php'; |
|
| 54 | +require_once $SETTINGS['cpassman_dir'].'/sources/main.functions.php'; |
|
| 55 | 55 | |
| 56 | 56 | ?> |
| 57 | 57 | <!-- Content Header (Page header) --> |
@@ -199,7 +199,7 @@ discard block |
||
| 199 | 199 | <div class="card-body"> |
| 200 | 200 | <div id="unsent-emails"> |
| 201 | 201 | <?php |
| 202 | - DB::query('SELECT * FROM ' . prefixTable('emails') . ' WHERE status = %s OR status = %s', 'not_sent', ''); |
|
| 202 | + DB::query('SELECT * FROM '.prefixTable('emails').' WHERE status = %s OR status = %s', 'not_sent', ''); |
|
| 203 | 203 | echo str_replace('#nb_emails#', (string) DB::count(), langHdl('email_send_backlog')); |
| 204 | 204 | ?> |
| 205 | 205 | </div> |
@@ -43,18 +43,18 @@ discard block |
||
| 43 | 43 | } |
| 44 | 44 | |
| 45 | 45 | /* do checks */ |
| 46 | -require_once $SETTINGS['cpassman_dir'] . '/sources/checks.php'; |
|
| 46 | +require_once $SETTINGS['cpassman_dir'].'/sources/checks.php'; |
|
| 47 | 47 | if (checkUser($_SESSION['user_id'], $_SESSION['key'], curPage($SETTINGS), $SETTINGS) === false) { |
| 48 | 48 | $_SESSION['error']['code'] = ERR_NOT_ALLOWED; |
| 49 | 49 | //not allowed page |
| 50 | - include $SETTINGS['cpassman_dir'] . '/error.php'; |
|
| 50 | + include $SETTINGS['cpassman_dir'].'/error.php'; |
|
| 51 | 51 | exit; |
| 52 | 52 | } |
| 53 | 53 | |
| 54 | 54 | // Load |
| 55 | -require_once $SETTINGS['cpassman_dir'] . '/sources/SplClassLoader.php'; |
|
| 56 | -require_once $SETTINGS['cpassman_dir'] . '/sources/main.functions.php'; |
|
| 57 | -require_once $SETTINGS['cpassman_dir'] . '/includes/libraries/protect/SuperGlobal/SuperGlobal.php'; |
|
| 55 | +require_once $SETTINGS['cpassman_dir'].'/sources/SplClassLoader.php'; |
|
| 56 | +require_once $SETTINGS['cpassman_dir'].'/sources/main.functions.php'; |
|
| 57 | +require_once $SETTINGS['cpassman_dir'].'/includes/libraries/protect/SuperGlobal/SuperGlobal.php'; |
|
| 58 | 58 | $superGlobal = new protect\SuperGlobal\SuperGlobal(); |
| 59 | 59 | |
| 60 | 60 | // Prepare SESSION variables |
@@ -69,7 +69,7 @@ discard block |
||
| 69 | 69 | |
| 70 | 70 | // Get list of users |
| 71 | 71 | $usersList = []; |
| 72 | -$rows = DB::query('SELECT id,login,email FROM ' . prefixTable('users') . ' ORDER BY login ASC'); |
|
| 72 | +$rows = DB::query('SELECT id,login,email FROM '.prefixTable('users').' ORDER BY login ASC'); |
|
| 73 | 73 | foreach ($rows as $record) { |
| 74 | 74 | $usersList[$record['login']] = [ |
| 75 | 75 | 'id' => $record['id'], |
@@ -80,16 +80,16 @@ discard block |
||
| 80 | 80 | // Get list of roles |
| 81 | 81 | $arrRoles = []; |
| 82 | 82 | $listRoles = ''; |
| 83 | -$rows = DB::query('SELECT id,title FROM ' . prefixTable('roles_title') . ' ORDER BY title ASC'); |
|
| 83 | +$rows = DB::query('SELECT id,title FROM '.prefixTable('roles_title').' ORDER BY title ASC'); |
|
| 84 | 84 | foreach ($rows as $reccord) { |
| 85 | 85 | $arrRoles[$reccord['title']] = [ |
| 86 | 86 | 'id' => $reccord['id'], |
| 87 | 87 | 'title' => $reccord['title'], |
| 88 | 88 | ]; |
| 89 | 89 | if (empty($listRoles)) { |
| 90 | - $listRoles = $reccord['id'] . '#' . $reccord['title']; |
|
| 90 | + $listRoles = $reccord['id'].'#'.$reccord['title']; |
|
| 91 | 91 | } else { |
| 92 | - $listRoles .= ';' . $reccord['id'] . '#' . $reccord['title']; |
|
| 92 | + $listRoles .= ';'.$reccord['id'].'#'.$reccord['title']; |
|
| 93 | 93 | } |
| 94 | 94 | } |
| 95 | 95 | ?> |
@@ -163,9 +163,9 @@ discard block |
||
| 163 | 163 | <li class="nav-item"><a class="nav-link" href="#tab_3" data-toggle="tab"><i class="fas fa-archive mr-2"></i><?php echo langHdl('attachments'); ?></a></li> |
| 164 | 164 | <?php |
| 165 | 165 | echo isset($SETTINGS['item_extra_fields']) === true && (int) $SETTINGS['item_extra_fields'] === 1 ? ' |
| 166 | - <li class="nav-item"><a class="nav-link" href="#tab_4" data-toggle="tab"><i class="fas fa-cubes mr-2"></i>' . langHdl('fields') . '</a></li>' : ''; |
|
| 166 | + <li class="nav-item"><a class="nav-link" href="#tab_4" data-toggle="tab"><i class="fas fa-cubes mr-2"></i>' . langHdl('fields').'</a></li>' : ''; |
|
| 167 | 167 | echo isset($SETTINGS['insert_manual_entry_item_history']) === true && (int) $SETTINGS['insert_manual_entry_item_history'] === 1 ? ' |
| 168 | - <li class="nav-item"><a class="nav-link" href="#tab_5" data-toggle="tab"><i class="fas fa-history mr-2"></i>' . langHdl('history') . '</a></li>' : ''; |
|
| 168 | + <li class="nav-item"><a class="nav-link" href="#tab_5" data-toggle="tab"><i class="fas fa-history mr-2"></i>' . langHdl('history').'</a></li>' : ''; |
|
| 169 | 169 | ?> |
| 170 | 170 | </ul> |
| 171 | 171 | </div><!-- /.card-header --> |
@@ -234,7 +234,7 @@ discard block |
||
| 234 | 234 | <?php |
| 235 | 235 | for ($i = 4; $i <= $SETTINGS['pwd_maximum_length']; ++$i) { |
| 236 | 236 | echo ' |
| 237 | - <option>' . $i . '</option>'; |
|
| 237 | + <option>' . $i.'</option>'; |
|
| 238 | 238 | } |
| 239 | 239 | ?> |
| 240 | 240 | </select> |
@@ -403,29 +403,29 @@ discard block |
||
| 403 | 403 | if (isset($_SESSION['item_fields']) === true) { |
| 404 | 404 | foreach ($_SESSION['item_fields'] as $category) { |
| 405 | 405 | echo ' |
| 406 | - <div class="callout callout-info form-item-category hidden" id="form-item-category-' . $category['id'] . '"> |
|
| 407 | - <h5>' . $category['title'] . '</h5> |
|
| 406 | + <div class="callout callout-info form-item-category hidden" id="form-item-category-' . $category['id'].'"> |
|
| 407 | + <h5>' . $category['title'].'</h5> |
|
| 408 | 408 | <p>'; |
| 409 | 409 | foreach ($category['fields'] as $field) { |
| 410 | 410 | if ($field['type'] === 'textarea') { |
| 411 | 411 | echo ' |
| 412 | - <div class="form-group mb-3 form-item-field" id="form-item-field-' . $field['id'] . '" data-field-id="' . $field['id'] . '"> |
|
| 412 | + <div class="form-group mb-3 form-item-field" id="form-item-field-' . $field['id'].'" data-field-id="'.$field['id'].'"> |
|
| 413 | 413 | <label>' . $field['title'], |
| 414 | 414 | $field['is_mandatory'] === '1' ? |
| 415 | - '<span class="fas fa-fire text-danger ml-1 infotip" title="' . langHdl('is_mandatory') . '"></span>' : '', |
|
| 415 | + '<span class="fas fa-fire text-danger ml-1 infotip" title="'.langHdl('is_mandatory').'"></span>' : '', |
|
| 416 | 416 | '</label> |
| 417 | - <textarea class="form-control form-item-control form-item-field-custom" rows="2" data-field-name="' . $field['id'] . '" data-field-mandatory="' . $field['is_mandatory'] . '" data-change-ongoing="0"></textarea> |
|
| 417 | + <textarea class="form-control form-item-control form-item-field-custom" rows="2" data-field-name="' . $field['id'].'" data-field-mandatory="'.$field['is_mandatory'].'" data-change-ongoing="0"></textarea> |
|
| 418 | 418 | </div>'; |
| 419 | 419 | } else { |
| 420 | 420 | echo ' |
| 421 | - <div class="input-group mb-3 form-item-field" id="form-item-field-' . $field['id'] . '" data-field-id="' . $field['id'] . '"> |
|
| 421 | + <div class="input-group mb-3 form-item-field" id="form-item-field-' . $field['id'].'" data-field-id="'.$field['id'].'"> |
|
| 422 | 422 | <div class="input-group-prepend"> |
| 423 | 423 | <span class="input-group-text">' . $field['title'], |
| 424 | 424 | $field['is_mandatory'] === '1' ? |
| 425 | - '<span class="fas fa-fire text-danger ml-1 infotip" title="' . langHdl('is_mandatory') . '"></span>' : '', |
|
| 425 | + '<span class="fas fa-fire text-danger ml-1 infotip" title="'.langHdl('is_mandatory').'"></span>' : '', |
|
| 426 | 426 | '</span> |
| 427 | 427 | </div> |
| 428 | - <input type="' . $field['type'] . '" class="form-control form-item-control form-item-field-custom" data-field-name="' . $field['id'] . '" data-field-mandatory="' . $field['is_mandatory'] . '" data-change-ongoing="0"> |
|
| 428 | + <input type="' . $field['type'].'" class="form-control form-item-control form-item-field-custom" data-field-name="'.$field['id'].'" data-field-mandatory="'.$field['is_mandatory'].'" data-change-ongoing="0"> |
|
| 429 | 429 | </div>'; |
| 430 | 430 | } |
| 431 | 431 | } |
@@ -436,8 +436,8 @@ discard block |
||
| 436 | 436 | ) { |
| 437 | 437 | echo ' |
| 438 | 438 | <div class="form-check icheck-blue"> |
| 439 | - <input type="checkbox" class="form-check-input form-check-input-template form-item-control flat-blue" data-category-id="' . $category['id'] . '" data-change-ongoing="0" data-field-name="template" id="template_' . $category['id'] . '"> |
|
| 440 | - <label class="form-check-label ml-3" for="template_' . $category['id'] . '">' . langHdl('main_template') . '</label> |
|
| 439 | + <input type="checkbox" class="form-check-input form-check-input-template form-item-control flat-blue" data-category-id="' . $category['id'].'" data-change-ongoing="0" data-field-name="template" id="template_'.$category['id'].'"> |
|
| 440 | + <label class="form-check-label ml-3" for="template_' . $category['id'].'">'.langHdl('main_template').'</label> |
|
| 441 | 441 | </div>'; |
| 442 | 442 | } |
| 443 | 443 | echo ' |
@@ -667,18 +667,18 @@ discard block |
||
| 667 | 667 | <?php |
| 668 | 668 | foreach ($_SESSION['item_fields'] as $elem) { |
| 669 | 669 | echo ' |
| 670 | - <div class="callout callout-info card-item-category hidden" id="card-item-category-' . $elem['id'] . '"> |
|
| 671 | - <h5>' . $elem['title'] . '</h5> |
|
| 670 | + <div class="callout callout-info card-item-category hidden" id="card-item-category-' . $elem['id'].'"> |
|
| 671 | + <h5>' . $elem['title'].'</h5> |
|
| 672 | 672 | <p> |
| 673 | 673 | <ul class="list-group list-group-unbordered mb-3">'; |
| 674 | 674 | foreach ($elem['fields'] as $field) { |
| 675 | 675 | echo ' |
| 676 | - <li class="list-group-item card-item-field hidden" id="card-item-field-' . $field['id'] . '"> |
|
| 677 | - <b>' . $field['title'] . '</b> |
|
| 678 | - <button type="button" class="float-right btn btn-outline-info btn-sm ml-1 btn-copy-clipboard-clear" data-clipboard-target="#card-item-field-value-' . $field['id'] . '"> |
|
| 676 | + <li class="list-group-item card-item-field hidden" id="card-item-field-' . $field['id'].'"> |
|
| 677 | + <b>' . $field['title'].'</b> |
|
| 678 | + <button type="button" class="float-right btn btn-outline-info btn-sm ml-1 btn-copy-clipboard-clear" data-clipboard-target="#card-item-field-value-' . $field['id'].'"> |
|
| 679 | 679 | <i class="fas fa-copy"></i> |
| 680 | 680 | </button> |
| 681 | - <span class="card-item-field-value float-right ml-1" id="card-item-field-value-' . $field['id'] . '"></span> |
|
| 681 | + <span class="card-item-field-value float-right ml-1" id="card-item-field-value-' . $field['id'].'"></span> |
|
| 682 | 682 | </li>'; |
| 683 | 683 | } |
| 684 | 684 | echo ' |
@@ -1050,7 +1050,7 @@ discard block |
||
| 1050 | 1050 | <p><?php |
| 1051 | 1051 | echo str_replace( |
| 1052 | 1052 | ['##otv_expiration_period##', '. '], |
| 1053 | - ['<span class="text-bold text-primary">' . $SETTINGS['otv_expiration_period'] . '</span>', '<br>'], |
|
| 1053 | + ['<span class="text-bold text-primary">'.$SETTINGS['otv_expiration_period'].'</span>', '<br>'], |
|
| 1054 | 1054 | langHdl('otv_message') |
| 1055 | 1055 | ); |
| 1056 | 1056 | ?></p> |
@@ -1124,7 +1124,7 @@ discard block |
||
| 1124 | 1124 | <select class="form-control form-folder-control select2" style="width:100%;" id="form-folder-add-complexicity" required> |
| 1125 | 1125 | <?php |
| 1126 | 1126 | foreach (TP_PW_COMPLEXITY as $key => $value) { |
| 1127 | - echo '<option value="' . $key . '">' . $value[1] . '</option>'; |
|
| 1127 | + echo '<option value="'.$key.'">'.$value[1].'</option>'; |
|
| 1128 | 1128 | } |
| 1129 | 1129 | ?> |
| 1130 | 1130 | </select> |
@@ -117,7 +117,7 @@ discard block |
||
| 117 | 117 | console.log('User has to regenerate keys') |
| 118 | 118 | // HIde |
| 119 | 119 | $('.content-header, .content').addClass('hidden'); |
| 120 | - $('#dialog-user-temporary-code-info').html('<i class="icon fas fa-info mr-2"></i><?php echo langHdl('renecyption_expected');?>'); |
|
| 120 | + $('#dialog-user-temporary-code-info').html('<i class="icon fas fa-info mr-2"></i><?php echo langHdl('renecyption_expected'); ?>'); |
|
| 121 | 121 | |
| 122 | 122 | // Show passwords inputs and form |
| 123 | 123 | $('#dialog-user-temporary-code').removeClass('hidden'); |
@@ -131,7 +131,7 @@ discard block |
||
| 131 | 131 | |
| 132 | 132 | // Show passwords inputs and form |
| 133 | 133 | $('#dialog-user-change-password-info') |
| 134 | - .html('<i class="icon fas fa-info mr-2"></i><?php echo langHdl('user_has_to_change_password_info');?>') |
|
| 134 | + .html('<i class="icon fas fa-info mr-2"></i><?php echo langHdl('user_has_to_change_password_info'); ?>') |
|
| 135 | 135 | .removeClass('hidden'); |
| 136 | 136 | $('#dialog-user-change-password').removeClass('hidden'); |
| 137 | 137 | |
@@ -144,7 +144,7 @@ discard block |
||
| 144 | 144 | |
| 145 | 145 | // Show passwords inputs and form |
| 146 | 146 | $('#dialog-ldap-user-change-password-info') |
| 147 | - .html('<i class="icon fas fa-info mr-2"></i><?php echo langHdl('ldap_user_has_changed_his_password');?>') |
|
| 147 | + .html('<i class="icon fas fa-info mr-2"></i><?php echo langHdl('ldap_user_has_changed_his_password'); ?>') |
|
| 148 | 148 | .removeClass('hidden'); |
| 149 | 149 | $('#dialog-ldap-user-change-password').removeClass('hidden'); |
| 150 | 150 | |
@@ -218,7 +218,7 @@ discard block |
||
| 218 | 218 | console.log('User has to regenerate keys') |
| 219 | 219 | // HIde |
| 220 | 220 | $('.content-header, .content').addClass('hidden'); |
| 221 | - $('#dialog-user-temporary-code-info').html('<i class="icon fas fa-info mr-2"></i><?php echo langHdl('renecyption_expected');?>'); |
|
| 221 | + $('#dialog-user-temporary-code-info').html('<i class="icon fas fa-info mr-2"></i><?php echo langHdl('renecyption_expected'); ?>'); |
|
| 222 | 222 | |
| 223 | 223 | // Show passwords inputs and form |
| 224 | 224 | $('#dialog-user-temporary-code').removeClass('hidden'); |
@@ -296,7 +296,7 @@ discard block |
||
| 296 | 296 | { |
| 297 | 297 | if (step === 'psk') { |
| 298 | 298 | // Inform user |
| 299 | - $("#user-current-defuse-psk-progress").html('<b><?php echo langHdl('encryption_keys'); ?> </b> [' + start + ' - ' + (parseInt(start) + <?php echo NUMBER_ITEMS_IN_BATCH;?>) + '] ' + |
|
| 299 | + $("#user-current-defuse-psk-progress").html('<b><?php echo langHdl('encryption_keys'); ?> </b> [' + start + ' - ' + (parseInt(start) + <?php echo NUMBER_ITEMS_IN_BATCH; ?>) + '] ' + |
|
| 300 | 300 | '... <?php echo langHdl('please_wait'); ?><i class="fas fa-spinner fa-pulse ml-3 text-primary"></i>'); |
| 301 | 301 | |
| 302 | 302 | var data = {'userPsk' : $('#user-current-defuse-psk').val()}; |
@@ -305,7 +305,7 @@ discard block |
||
| 305 | 305 | "sources/main.queries.php", { |
| 306 | 306 | type: "user_psk_reencryption", |
| 307 | 307 | 'start': start, |
| 308 | - 'length': <?php echo NUMBER_ITEMS_IN_BATCH;?>, |
|
| 308 | + 'length': <?php echo NUMBER_ITEMS_IN_BATCH; ?>, |
|
| 309 | 309 | userId: userId, |
| 310 | 310 | data: prepareExchangedData(JSON.stringify(data), "encode", "<?php echo $_SESSION['key']; ?>"), |
| 311 | 311 | key: '<?php echo $_SESSION['key']; ?>' |
@@ -794,15 +794,15 @@ discard block |
||
| 794 | 794 | // Prepare data |
| 795 | 795 | var data = { |
| 796 | 796 | 'receipt': $('#temp-user-email').val(), |
| 797 | - 'subject': '[Teampass] <?php echo langHdl('your_new_password');?>', |
|
| 798 | - 'body': '<?php echo langHdl('email_body_temporary_login_password');?>', |
|
| 797 | + 'subject': '[Teampass] <?php echo langHdl('your_new_password'); ?>', |
|
| 798 | + 'body': '<?php echo langHdl('email_body_temporary_login_password'); ?>', |
|
| 799 | 799 | 'pre_replace' : { |
| 800 | 800 | '#enc_code#' : $('#temp-user-pwd').val(), |
| 801 | 801 | } |
| 802 | 802 | } |
| 803 | 803 | console.log(data); |
| 804 | 804 | // Prepare form |
| 805 | - $('#dialog-admin-change-user-password-info').html('<?php echo langHdl('sending_email_message');?>'); |
|
| 805 | + $('#dialog-admin-change-user-password-info').html('<?php echo langHdl('sending_email_message'); ?>'); |
|
| 806 | 806 | toastr.remove(); |
| 807 | 807 | toastr.info( |
| 808 | 808 | '<?php echo langHdl('in_progress'); ?><i class="fas fa-circle-notch fa-spin fa-2x ml-3"></i>' |
@@ -1270,7 +1270,7 @@ discard block |
||
| 1270 | 1270 | '#warningModal', |
| 1271 | 1271 | '<i class="fas fa-clock fa-lg warning mr-2"></i><?php echo langHdl('index_add_one_hour'); ?>', |
| 1272 | 1272 | '<div class="form-group">' + |
| 1273 | - '<label for="warningModal-input" class="col-form-label"><?php echo langHdl('index_session_duration') . ' (' . langHdl('minutes') . ')'; ?>:</label>' + |
|
| 1273 | + '<label for="warningModal-input" class="col-form-label"><?php echo langHdl('index_session_duration').' ('.langHdl('minutes').')'; ?>:</label>' + |
|
| 1274 | 1274 | '<input type="text" class="form-control" id="warningModal-input" value="<?php echo isset($_SESSION['user']['session_duration']) === true ? (int) $_SESSION['user']['session_duration'] / 60 : 60; ?>">' + |
| 1275 | 1275 | '</div>', |
| 1276 | 1276 | '<?php echo langHdl('confirm'); ?>', |
@@ -1522,13 +1522,13 @@ discard block |
||
| 1522 | 1522 | if (step !== 'finished') { |
| 1523 | 1523 | // Inform user |
| 1524 | 1524 | $("#"+divIdDialog+'-progress').html('<b><?php echo langHdl('encryption_keys'); ?> - ' + |
| 1525 | - stepText + '</b> [' + start + ' - ' + (parseInt(start) + <?php echo NUMBER_ITEMS_IN_BATCH;?>) + '] ' + |
|
| 1525 | + stepText + '</b> [' + start + ' - ' + (parseInt(start) + <?php echo NUMBER_ITEMS_IN_BATCH; ?>) + '] ' + |
|
| 1526 | 1526 | '... <?php echo langHdl('please_wait'); ?><i class="fas fa-spinner fa-pulse ml-3 text-primary"></i>'); |
| 1527 | 1527 | |
| 1528 | 1528 | var data = { |
| 1529 | 1529 | 'action': step, |
| 1530 | 1530 | 'start': start, |
| 1531 | - 'length': <?php echo NUMBER_ITEMS_IN_BATCH;?>, |
|
| 1531 | + 'length': <?php echo NUMBER_ITEMS_IN_BATCH; ?>, |
|
| 1532 | 1532 | 'user_id': userId, |
| 1533 | 1533 | } |
| 1534 | 1534 | // Do query |
@@ -43,16 +43,16 @@ discard block |
||
| 43 | 43 | } |
| 44 | 44 | |
| 45 | 45 | /* do checks */ |
| 46 | -require_once $SETTINGS['cpassman_dir'] . '/sources/checks.php'; |
|
| 46 | +require_once $SETTINGS['cpassman_dir'].'/sources/checks.php'; |
|
| 47 | 47 | if (checkUser($_SESSION['user_id'], $_SESSION['key'], curPage($SETTINGS), $SETTINGS) === false) { |
| 48 | 48 | $_SESSION['error']['code'] = ERR_NOT_ALLOWED; |
| 49 | - include $SETTINGS['cpassman_dir'] . '/error.php'; |
|
| 49 | + include $SETTINGS['cpassman_dir'].'/error.php'; |
|
| 50 | 50 | exit; |
| 51 | 51 | } |
| 52 | 52 | |
| 53 | 53 | // Load template |
| 54 | -require_once $SETTINGS['cpassman_dir'] . '/sources/main.functions.php'; |
|
| 55 | -require_once $SETTINGS['cpassman_dir'] . '/includes/libraries/protect/SuperGlobal/SuperGlobal.php'; |
|
| 54 | +require_once $SETTINGS['cpassman_dir'].'/sources/main.functions.php'; |
|
| 55 | +require_once $SETTINGS['cpassman_dir'].'/includes/libraries/protect/SuperGlobal/SuperGlobal.php'; |
|
| 56 | 56 | $superGlobal = new protect\SuperGlobal\SuperGlobal(); |
| 57 | 57 | // Prepare GET variables |
| 58 | 58 | $get = []; |
@@ -73,25 +73,25 @@ discard block |
||
| 73 | 73 | // prepare list of timezones |
| 74 | 74 | $zones = timezone_list(); |
| 75 | 75 | // prepare list of languages |
| 76 | -$languages = DB::query('SELECT label FROM ' . prefixTable('languages') . ' ORDER BY label ASC'); |
|
| 76 | +$languages = DB::query('SELECT label FROM '.prefixTable('languages').' ORDER BY label ASC'); |
|
| 77 | 77 | // Do some stats |
| 78 | -DB::query('SELECT id_item FROM ' . prefixTable('log_items') . ' WHERE action = "at_creation" AND id_user = "' . $_SESSION['user_id'] . '"'); |
|
| 78 | +DB::query('SELECT id_item FROM '.prefixTable('log_items').' WHERE action = "at_creation" AND id_user = "'.$_SESSION['user_id'].'"'); |
|
| 79 | 79 | $userItemsNumber = DB::count(); |
| 80 | -DB::query('SELECT id_item FROM ' . prefixTable('log_items') . ' WHERE action = "at_modification" AND id_user = "' . $_SESSION['user_id'] . '"'); |
|
| 80 | +DB::query('SELECT id_item FROM '.prefixTable('log_items').' WHERE action = "at_modification" AND id_user = "'.$_SESSION['user_id'].'"'); |
|
| 81 | 81 | $userModificationNumber = DB::count(); |
| 82 | -DB::query('SELECT id_item FROM ' . prefixTable('log_items') . ' WHERE action = "at_shown" AND id_user = "' . $_SESSION['user_id'] . '"'); |
|
| 82 | +DB::query('SELECT id_item FROM '.prefixTable('log_items').' WHERE action = "at_shown" AND id_user = "'.$_SESSION['user_id'].'"'); |
|
| 83 | 83 | $userSeenItemsNumber = DB::count(); |
| 84 | -DB::query('SELECT id_item FROM ' . prefixTable('log_items') . ' WHERE action = "at_password_shown" AND id_user = "' . $_SESSION['user_id'] . '"'); |
|
| 84 | +DB::query('SELECT id_item FROM '.prefixTable('log_items').' WHERE action = "at_password_shown" AND id_user = "'.$_SESSION['user_id'].'"'); |
|
| 85 | 85 | $userSeenPasswordsNumber = DB::count(); |
| 86 | 86 | $userInfo = DB::queryFirstRow( |
| 87 | 87 | 'SELECT avatar |
| 88 | - FROM ' . prefixTable('users') . ' |
|
| 89 | - WHERE id = "' . $_SESSION['user_id'] . '"' |
|
| 88 | + FROM ' . prefixTable('users').' |
|
| 89 | + WHERE id = "' . $_SESSION['user_id'].'"' |
|
| 90 | 90 | ); |
| 91 | 91 | if (empty($userInfo['avatar']) === true) { |
| 92 | - $avatar = $SETTINGS['cpassman_url'] . '/includes/images/photo.jpg'; |
|
| 92 | + $avatar = $SETTINGS['cpassman_url'].'/includes/images/photo.jpg'; |
|
| 93 | 93 | } else { |
| 94 | - $avatar = $SETTINGS['cpassman_url'] . '/includes/avatars/' . $userInfo['avatar']; |
|
| 94 | + $avatar = $SETTINGS['cpassman_url'].'/includes/avatars/'.$userInfo['avatar']; |
|
| 95 | 95 | } |
| 96 | 96 | |
| 97 | 97 | // Get Groups name |
@@ -99,8 +99,8 @@ discard block |
||
| 99 | 99 | foreach ($_SESSION['user_roles'] as $role) { |
| 100 | 100 | $tmp = DB::queryFirstRow( |
| 101 | 101 | 'SELECT title |
| 102 | - FROM ' . prefixTable('roles_title') . ' |
|
| 103 | - WHERE id = "' . $role . '"' |
|
| 102 | + FROM ' . prefixTable('roles_title').' |
|
| 103 | + WHERE id = "' . $role.'"' |
|
| 104 | 104 | ); |
| 105 | 105 | if ($tmp !== null) { |
| 106 | 106 | array_push($userParOfGroups, $tmp['title']); |
@@ -144,7 +144,7 @@ discard block |
||
| 144 | 144 | <h3 id="profile-username" class="text-center"> |
| 145 | 145 | <?php |
| 146 | 146 | if (isset($_SESSION['name']) === true && empty($_SESSION['name']) === false) { |
| 147 | - echo $_SESSION['name'] . ' ' . $_SESSION['lastname']; |
|
| 147 | + echo $_SESSION['name'].' '.$_SESSION['lastname']; |
|
| 148 | 148 | } else { |
| 149 | 149 | echo $_SESSION['login']; |
| 150 | 150 | } |
@@ -211,7 +211,7 @@ discard block |
||
| 211 | 211 | } else { |
| 212 | 212 | echo date('d/m/Y', (int) $_SESSION['last_connection']); |
| 213 | 213 | } |
| 214 | - echo ' ' . langHdl('at') . ' '; |
|
| 214 | + echo ' '.langHdl('at').' '; |
|
| 215 | 215 | if (isset($SETTINGS['time_format']) === true) { |
| 216 | 216 | echo date($SETTINGS['time_format'], (int) $_SESSION['last_connection']); |
| 217 | 217 | } else { |
@@ -221,7 +221,7 @@ discard block |
||
| 221 | 221 | </a> |
| 222 | 222 | </li> |
| 223 | 223 | <?php |
| 224 | - if (isset($_SESSION['last_pw_change']) && ! empty($_SESSION['last_pw_change'])) { |
|
| 224 | + if (isset($_SESSION['last_pw_change']) && !empty($_SESSION['last_pw_change'])) { |
|
| 225 | 225 | // Handle last password change string |
| 226 | 226 | if (isset($_SESSION['last_pw_change']) === true) { |
| 227 | 227 | if (isset($SETTINGS['date_format']) === true) { |
@@ -241,12 +241,12 @@ discard block |
||
| 241 | 241 | ) { |
| 242 | 242 | $numDaysBeforePwExpiration = ''; |
| 243 | 243 | } else { |
| 244 | - $numDaysBeforePwExpiration = $LANG['index_pw_expiration'] . ' ' . $_SESSION['numDaysBeforePwExpiration'] . ' ' . $LANG['days'] . '.'; |
|
| 244 | + $numDaysBeforePwExpiration = $LANG['index_pw_expiration'].' '.$_SESSION['numDaysBeforePwExpiration'].' '.$LANG['days'].'.'; |
|
| 245 | 245 | } |
| 246 | 246 | echo ' |
| 247 | 247 | <li class="list-group-item"> |
| 248 | - <b><i class="fas fa-calendar-alt fa-fw fa-lg mr-2"></i>' . langHdl('index_last_pw_change') . '</b> |
|
| 249 | - <a class="float-right">' . $last_pw_change . ' ' . $numDaysBeforePwExpiration . '</a> |
|
| 248 | + <b><i class="fas fa-calendar-alt fa-fw fa-lg mr-2"></i>' . langHdl('index_last_pw_change').'</b> |
|
| 249 | + <a class="float-right">' . $last_pw_change.' '.$numDaysBeforePwExpiration.'</a> |
|
| 250 | 250 | </li>'; |
| 251 | 251 | } |
| 252 | 252 | ?> |
@@ -266,7 +266,7 @@ discard block |
||
| 266 | 266 | if (isset($SETTINGS['api']) === true && (int) $SETTINGS['api'] === 1) { |
| 267 | 267 | echo ' |
| 268 | 268 | <li class="list-group-item"> |
| 269 | - <b><i class="fas fa-paper-plane fa-fw fa-lg mr-2"></i>' . langHdl('user_profile_api_key') . '</b> |
|
| 269 | + <b><i class="fas fa-paper-plane fa-fw fa-lg mr-2"></i>' . langHdl('user_profile_api_key').'</b> |
|
| 270 | 270 | <a class="float-right" id="profile-user-api-token">', |
| 271 | 271 | isset($_SESSION['user']['api-key']) === true ? $_SESSION['user']['api-key'] : '', |
| 272 | 272 | '</a> |
@@ -278,7 +278,7 @@ discard block |
||
| 278 | 278 | ) { |
| 279 | 279 | echo ' |
| 280 | 280 | <li class="list-group-item"> |
| 281 | - <b><i class="fas fa-id-card-o fa-fw fa-lg mr-2"></i>' . langHdl('user_profile_agses_card_id') . '</b> |
|
| 281 | + <b><i class="fas fa-id-card-o fa-fw fa-lg mr-2"></i>' . langHdl('user_profile_agses_card_id').'</b> |
|
| 282 | 282 | <a class="float-right">', |
| 283 | 283 | $_SESSION['user_agsescardid'] ?? '', |
| 284 | 284 | '</a> |
@@ -302,7 +302,7 @@ discard block |
||
| 302 | 302 | <ul class=""> |
| 303 | 303 | <?php |
| 304 | 304 | foreach ($_SESSION['user']['unsuccessfull_login_attempts_list'] as $entry) { |
| 305 | - echo '<li class="">' . $entry . '</li>'; |
|
| 305 | + echo '<li class="">'.$entry.'</li>'; |
|
| 306 | 306 | } ?> |
| 307 | 307 | </ul> |
| 308 | 308 | </div> |
@@ -315,12 +315,12 @@ discard block |
||
| 315 | 315 | <?php |
| 316 | 316 | $rows = DB::query( |
| 317 | 317 | 'SELECT label AS labelAction, date, null |
| 318 | - FROM ' . prefixTable('log_system') . ' |
|
| 318 | + FROM ' . prefixTable('log_system').' |
|
| 319 | 319 | WHERE qui = %i |
| 320 | 320 | UNION |
| 321 | 321 | SELECT l.action, l.date, i.label AS itemLabel |
| 322 | - FROM ' . prefixTable('log_items') . ' AS l |
|
| 323 | - INNER JOIN ' . prefixTable('items') . ' AS i ON (l.id_item = i.id) |
|
| 322 | + FROM ' . prefixTable('log_items').' AS l |
|
| 323 | + INNER JOIN ' . prefixTable('items').' AS i ON (l.id_item = i.id) |
|
| 324 | 324 | WHERE l.id_user = %i AND l.action IN ("at_access") |
| 325 | 325 | ORDER BY date DESC |
| 326 | 326 | LIMIT 0, 40', |
@@ -334,9 +334,9 @@ discard block |
||
| 334 | 334 | $text = langHdl($record['labelAction']); |
| 335 | 335 | } |
| 336 | 336 | if (empty($record['NULL']) === false) { |
| 337 | - $text .= ' ' . langHdl('for') . ' <span class="font-weight-light">' . addslashes($record['NULL']) . '</span>'; |
|
| 337 | + $text .= ' '.langHdl('for').' <span class="font-weight-light">'.addslashes($record['NULL']).'</span>'; |
|
| 338 | 338 | } |
| 339 | - echo '<li class="list-group-item">' . date($SETTINGS['date_format'] . ' ' . $SETTINGS['time_format'], (int) $record['date']) . ' - ' . $text . '</li>'; |
|
| 339 | + echo '<li class="list-group-item">'.date($SETTINGS['date_format'].' '.$SETTINGS['time_format'], (int) $record['date']).' - '.$text.'</li>'; |
|
| 340 | 340 | } |
| 341 | 341 | ?> |
| 342 | 342 | </ul> |
@@ -374,11 +374,10 @@ discard block |
||
| 374 | 374 | <?php |
| 375 | 375 | foreach ($zones as $key => $zone) { |
| 376 | 376 | echo ' |
| 377 | - <option value="' . $key . '"', |
|
| 377 | + <option value="' . $key.'"', |
|
| 378 | 378 | isset($_SESSION['user_timezone']) === true && $_SESSION['user_timezone'] === $key ? |
| 379 | - ' selected' : |
|
| 380 | - (isset($SETTINGS['timezone']) === true && $SETTINGS['timezone'] === $key ? ' selected' : ''), |
|
| 381 | - '>' . $zone . '</option>'; |
|
| 379 | + ' selected' : (isset($SETTINGS['timezone']) === true && $SETTINGS['timezone'] === $key ? ' selected' : ''), |
|
| 380 | + '>'.$zone.'</option>'; |
|
| 382 | 381 | } |
| 383 | 382 | ?> |
| 384 | 383 | </select> |
@@ -390,11 +389,10 @@ discard block |
||
| 390 | 389 | <select class="form-control" id="profile-user-language"> |
| 391 | 390 | <?php |
| 392 | 391 | foreach ($languages as $language) { |
| 393 | - echo '<option value="' . $language['label'] . '"', |
|
| 392 | + echo '<option value="'.$language['label'].'"', |
|
| 394 | 393 | $_SESSION['user_language'] === strtolower($language['label']) ? |
| 395 | - ' selected="selected"' : |
|
| 396 | - ($SETTINGS['default_language'] === strtolower($language['label']) ? ' selected="selected"' : ''), |
|
| 397 | - '>' . $language['label'] . '</option>'; |
|
| 394 | + ' selected="selected"' : ($SETTINGS['default_language'] === strtolower($language['label']) ? ' selected="selected"' : ''), |
|
| 395 | + '>'.$language['label'].'</option>'; |
|
| 398 | 396 | } |
| 399 | 397 | ?> |
| 400 | 398 | </select> |
@@ -406,10 +404,10 @@ discard block |
||
| 406 | 404 | <div class="col-sm-10"> |
| 407 | 405 | <select class="form-control" id="profile-user-treeloadstrategy"> |
| 408 | 406 | <option value="<?php echo langHdl('sequential'); ?>" |
| 409 | - <?php echo isset($_SESSION['user_treeloadstrategy']) === true && $_SESSION['user_treeloadstrategy'] === 'sequential' ? ' selected' : '';?> |
|
| 407 | + <?php echo isset($_SESSION['user_treeloadstrategy']) === true && $_SESSION['user_treeloadstrategy'] === 'sequential' ? ' selected' : ''; ?> |
|
| 410 | 408 | ><?php echo langHdl('sequential'); ?></option> |
| 411 | 409 | <option value="<?php echo langHdl('full'); ?>" |
| 412 | - <?php echo isset($_SESSION['user_treeloadstrategy']) === true && $_SESSION['user_treeloadstrategy'] === 'full' ? ' selected' : '';?> |
|
| 410 | + <?php echo isset($_SESSION['user_treeloadstrategy']) === true && $_SESSION['user_treeloadstrategy'] === 'full' ? ' selected' : ''; ?> |
|
| 413 | 411 | ><?php echo langHdl('full'); ?></option> |
| 414 | 412 | </select> |
| 415 | 413 | </div> |
@@ -443,7 +441,7 @@ discard block |
||
| 443 | 441 | <button type="button" class="btn btn-warning float-right ml-2" id="profile-avatar-file"><?php echo langHdl('upload_new_avatar'); ?></button> |
| 444 | 442 | <?php |
| 445 | 443 | if (isset($SETTINGS['api']) === true && (int) $SETTINGS['api'] === 1) { |
| 446 | - echo '<button type="button" class="btn btn-warning float-right" id="profile-button-api_token">' . langHdl('generate_api_token') . '</button>'; |
|
| 444 | + echo '<button type="button" class="btn btn-warning float-right" id="profile-button-api_token">'.langHdl('generate_api_token').'</button>'; |
|
| 447 | 445 | } |
| 448 | 446 | ?> |
| 449 | 447 | <div id="profile-avatar-file-container" class="hidden"></div> |
@@ -43,11 +43,11 @@ discard block |
||
| 43 | 43 | } |
| 44 | 44 | |
| 45 | 45 | /* do checks */ |
| 46 | -require_once $SETTINGS['cpassman_dir'] . '/sources/checks.php'; |
|
| 46 | +require_once $SETTINGS['cpassman_dir'].'/sources/checks.php'; |
|
| 47 | 47 | if (checkUser($_SESSION['user_id'], $_SESSION['key'], 'profile', $SETTINGS) === false) { |
| 48 | 48 | $_SESSION['error']['code'] = ERR_NOT_ALLOWED; |
| 49 | 49 | //not allowed page |
| 50 | - include $SETTINGS['cpassman_dir'] . '/error.php'; |
|
| 50 | + include $SETTINGS['cpassman_dir'].'/error.php'; |
|
| 51 | 51 | exit; |
| 52 | 52 | } |
| 53 | 53 | ?> |
@@ -212,7 +212,7 @@ discard block |
||
| 212 | 212 | $('#profile-username').html($('#profile-user-name').val() + ' ' + $('#profile-user-lastname').val()); |
| 213 | 213 | |
| 214 | 214 | // reload page in case of language change |
| 215 | - if ($('#profile-user-language').val().toLowerCase() !== '<?php echo $_SESSION['user_language'];?>') { |
|
| 215 | + if ($('#profile-user-language').val().toLowerCase() !== '<?php echo $_SESSION['user_language']; ?>') { |
|
| 216 | 216 | // prepare reload |
| 217 | 217 | $(this).delay(3000).queue(function() { |
| 218 | 218 | document.location.href = "index.php?page=profile"; |
@@ -223,7 +223,7 @@ discard block |
||
| 223 | 223 | // Inform user |
| 224 | 224 | toastr.remove(); |
| 225 | 225 | toastr.info( |
| 226 | - '<?php echo langHdl('alert_page_will_reload') . ' ... ' . langHdl('please_wait'); ?>', |
|
| 226 | + '<?php echo langHdl('alert_page_will_reload').' ... '.langHdl('please_wait'); ?>', |
|
| 227 | 227 | '', { |
| 228 | 228 | timeOut: 3000, |
| 229 | 229 | progressBar: true |
@@ -72,8 +72,8 @@ discard block |
||
| 72 | 72 | } |
| 73 | 73 | |
| 74 | 74 | // Include files |
| 75 | -require_once $SETTINGS['cpassman_dir'] . '/includes/config/settings.php'; |
|
| 76 | -require_once $SETTINGS['cpassman_dir'] . '/includes/config/include.php'; |
|
| 75 | +require_once $SETTINGS['cpassman_dir'].'/includes/config/settings.php'; |
|
| 76 | +require_once $SETTINGS['cpassman_dir'].'/includes/config/include.php'; |
|
| 77 | 77 | // Quick major version check -> upgrade needed? |
| 78 | 78 | if (isset($SETTINGS['cpassman_version']) === true && version_compare(TP_VERSION, $SETTINGS['cpassman_version']) > 0) { |
| 79 | 79 | // Perform redirection |
@@ -86,7 +86,7 @@ discard block |
||
| 86 | 86 | exit; |
| 87 | 87 | } |
| 88 | 88 | |
| 89 | -require_once $SETTINGS['cpassman_dir'] . '/includes/libraries/protect/SuperGlobal/SuperGlobal.php'; |
|
| 89 | +require_once $SETTINGS['cpassman_dir'].'/includes/libraries/protect/SuperGlobal/SuperGlobal.php'; |
|
| 90 | 90 | $superGlobal = new protect\SuperGlobal\SuperGlobal(); |
| 91 | 91 | |
| 92 | 92 | if (isset($SETTINGS['cpassman_url']) === false || $SETTINGS['cpassman_url'] === '') { |
@@ -94,8 +94,8 @@ discard block |
||
| 94 | 94 | } |
| 95 | 95 | |
| 96 | 96 | // Include files |
| 97 | -require_once $SETTINGS['cpassman_dir'] . '/sources/SplClassLoader.php'; |
|
| 98 | -require_once $SETTINGS['cpassman_dir'] . '/sources/main.functions.php'; |
|
| 97 | +require_once $SETTINGS['cpassman_dir'].'/sources/SplClassLoader.php'; |
|
| 98 | +require_once $SETTINGS['cpassman_dir'].'/sources/main.functions.php'; |
|
| 99 | 99 | // Open MYSQL database connection |
| 100 | 100 | require_once './includes/libraries/Database/Meekrodb/db.class.php'; |
| 101 | 101 | if (defined('DB_PASSWD_CLEAR') === false) { |
@@ -108,7 +108,7 @@ discard block |
||
| 108 | 108 | DB::$port = DB_PORT; |
| 109 | 109 | DB::$encoding = DB_ENCODING; |
| 110 | 110 | // Load Core library |
| 111 | -require_once $SETTINGS['cpassman_dir'] . '/sources/core.php'; |
|
| 111 | +require_once $SETTINGS['cpassman_dir'].'/sources/core.php'; |
|
| 112 | 112 | // Prepare POST variables |
| 113 | 113 | $post_language = filter_input(INPUT_POST, 'language', FILTER_SANITIZE_STRING); |
| 114 | 114 | // Prepare superGlobal variables |
@@ -138,8 +138,8 @@ discard block |
||
| 138 | 138 | //get default language |
| 139 | 139 | $dataLanguage = DB::queryFirstRow( |
| 140 | 140 | 'SELECT m.valeur AS valeur, l.flag AS flag |
| 141 | - FROM ' . prefixTable('misc') . ' AS m |
|
| 142 | - INNER JOIN ' . prefixTable('languages') . ' AS l ON (m.valeur = l.name) |
|
| 141 | + FROM ' . prefixTable('misc').' AS m |
|
| 142 | + INNER JOIN ' . prefixTable('languages').' AS l ON (m.valeur = l.name) |
|
| 143 | 143 | WHERE m.type=%s_type AND m.intitule=%s_intitule', |
| 144 | 144 | [ |
| 145 | 145 | 'type' => 'admin', |
@@ -181,23 +181,23 @@ discard block |
||
| 181 | 181 | |
| 182 | 182 | // Load user languages files |
| 183 | 183 | if (in_array($session_user_language, $languagesList) === true) { |
| 184 | - if (file_exists($SETTINGS['cpassman_dir'] . '/includes/language/' . $session_user_language . '.php') === true) { |
|
| 185 | - $_SESSION['teampass']['lang'] = include $SETTINGS['cpassman_dir'] . '/includes/language/' . $session_user_language . '.php'; |
|
| 184 | + if (file_exists($SETTINGS['cpassman_dir'].'/includes/language/'.$session_user_language.'.php') === true) { |
|
| 185 | + $_SESSION['teampass']['lang'] = include $SETTINGS['cpassman_dir'].'/includes/language/'.$session_user_language.'.php'; |
|
| 186 | 186 | } |
| 187 | 187 | } else { |
| 188 | 188 | $_SESSION['error']['code'] = ERR_NOT_ALLOWED; |
| 189 | 189 | //not allowed page |
| 190 | - include $SETTINGS['cpassman_dir'] . '/error.php'; |
|
| 190 | + include $SETTINGS['cpassman_dir'].'/error.php'; |
|
| 191 | 191 | } |
| 192 | 192 | |
| 193 | 193 | // load 2FA Google |
| 194 | 194 | if (isset($SETTINGS['google_authentication']) === true && $SETTINGS['google_authentication'] === '1') { |
| 195 | - include_once $SETTINGS['cpassman_dir'] . '/includes/libraries/Authentication/TwoFactorAuth/TwoFactorAuth.php'; |
|
| 195 | + include_once $SETTINGS['cpassman_dir'].'/includes/libraries/Authentication/TwoFactorAuth/TwoFactorAuth.php'; |
|
| 196 | 196 | } |
| 197 | 197 | |
| 198 | 198 | // load 2FA Yubico |
| 199 | 199 | if (isset($SETTINGS['yubico_authentication']) === true && $SETTINGS['yubico_authentication'] === '1') { |
| 200 | - include_once $SETTINGS['cpassman_dir'] . '/includes/libraries/Authentication/Yubico/Yubico.php'; |
|
| 200 | + include_once $SETTINGS['cpassman_dir'].'/includes/libraries/Authentication/Yubico/Yubico.php'; |
|
| 201 | 201 | } |
| 202 | 202 | |
| 203 | 203 | // Some template adjust |
@@ -254,7 +254,7 @@ discard block |
||
| 254 | 254 | <!-- Toastr --> |
| 255 | 255 | <link rel="stylesheet" href="plugins/toastr/toastr.min.css" /> |
| 256 | 256 | <!-- favicon --> |
| 257 | - <link rel="shortcut icon" type="image/png" href="<?php echo $SETTINGS['favicon'];?>"/> |
|
| 257 | + <link rel="shortcut icon" type="image/png" href="<?php echo $SETTINGS['favicon']; ?>"/> |
|
| 258 | 258 | </head> |
| 259 | 259 | |
| 260 | 260 | |
@@ -285,7 +285,7 @@ discard block |
||
| 285 | 285 | ), |
| 286 | 286 | 'SESSION' |
| 287 | 287 | ); |
| 288 | - include $SETTINGS['cpassman_dir'] . '/error.php'; |
|
| 288 | + include $SETTINGS['cpassman_dir'].'/error.php'; |
|
| 289 | 289 | } |
| 290 | 290 | } elseif ( |
| 291 | 291 | $session_validite_pw !== null |
@@ -329,7 +329,7 @@ discard block |
||
| 329 | 329 | <div class="dropdown show"> |
| 330 | 330 | <a class="btn btn-primary dropdown-toggle" href="#" data-toggle="dropdown"> |
| 331 | 331 | <?php |
| 332 | - echo $session_name . ' ' . $session_lastname; ?> |
|
| 332 | + echo $session_name.' '.$session_lastname; ?> |
|
| 333 | 333 | </a> |
| 334 | 334 | |
| 335 | 335 | <div class="dropdown-menu dropdown-menu-right"> |
@@ -367,7 +367,7 @@ discard block |
||
| 367 | 367 | <!-- Main Sidebar Container --> |
| 368 | 368 | <aside class="main-sidebar sidebar-dark-primary elevation-4"> |
| 369 | 369 | <!-- Brand Logo --> |
| 370 | - <a href="<?php echo $SETTINGS['cpassman_url'] . '/index.php?page=items'; ?>" class="brand-link"> |
|
| 370 | + <a href="<?php echo $SETTINGS['cpassman_url'].'/index.php?page=items'; ?>" class="brand-link"> |
|
| 371 | 371 | <img src="includes/images/teampass-logo2-home.png" alt="Teampass Logo" class="brand-image"> |
| 372 | 372 | <span class="brand-text font-weight-light"><?php echo TP_TOOL_NAME; ?></span> |
| 373 | 373 | </a> |
@@ -385,7 +385,7 @@ discard block |
||
| 385 | 385 | <a href="#" data-name="items" class="nav-link', $get['page'] === 'items' ? ' active' : '', '"> |
| 386 | 386 | <i class="nav-icon fas fa-key"></i> |
| 387 | 387 | <p> |
| 388 | - ' . langHdl('pw') . ' |
|
| 388 | + ' . langHdl('pw').' |
|
| 389 | 389 | </p> |
| 390 | 390 | </a> |
| 391 | 391 | </li>'; |
@@ -401,7 +401,7 @@ discard block |
||
| 401 | 401 | <a href="#" data-name="import" class="nav-link', $get['page'] === 'import' ? ' active' : '', '"> |
| 402 | 402 | <i class="nav-icon fas fa-file-import"></i> |
| 403 | 403 | <p> |
| 404 | - ' . langHdl('import') . ' |
|
| 404 | + ' . langHdl('import').' |
|
| 405 | 405 | </p> |
| 406 | 406 | </a> |
| 407 | 407 | </li>'; |
@@ -422,7 +422,7 @@ discard block |
||
| 422 | 422 | <a href="#" data-name="export" class="nav-link', $get['page'] === 'export' ? ' active' : '', '"> |
| 423 | 423 | <i class="nav-icon fas fa-file-export"></i> |
| 424 | 424 | <p> |
| 425 | - ' . langHdl('export') . ' |
|
| 425 | + ' . langHdl('export').' |
|
| 426 | 426 | </p> |
| 427 | 427 | </a> |
| 428 | 428 | </li>'; |
@@ -449,7 +449,7 @@ discard block |
||
| 449 | 449 | <a href="#" data-name="search" class="nav-link', $get['page'] === 'search' ? ' active' : '', '"> |
| 450 | 450 | <i class="nav-icon fas fa-search"></i> |
| 451 | 451 | <p> |
| 452 | - ' . langHdl('find') . ' |
|
| 452 | + ' . langHdl('find').' |
|
| 453 | 453 | </p> |
| 454 | 454 | </a> |
| 455 | 455 | </li>'; |
@@ -466,7 +466,7 @@ discard block |
||
| 466 | 466 | <a href="#" data-name="favourites" class="nav-link', $get['page'] === 'admin' ? ' favourites' : '', '"> |
| 467 | 467 | <i class="nav-icon fas fa-star"></i> |
| 468 | 468 | <p> |
| 469 | - ' . langHdl('favorites') . ' |
|
| 469 | + ' . langHdl('favorites').' |
|
| 470 | 470 | </p> |
| 471 | 471 | </a> |
| 472 | 472 | </li>'; |
@@ -496,7 +496,7 @@ discard block |
||
| 496 | 496 | <a href="#" data-name="suggestion" class="nav-link', $get['page'] === 'suggestion' ? ' active' : '', '"> |
| 497 | 497 | <i class="nav-icon fas fa-lightbulb"></i> |
| 498 | 498 | <p> |
| 499 | - ' . langHdl('suggestion_menu') . ' |
|
| 499 | + ' . langHdl('suggestion_menu').' |
|
| 500 | 500 | </p> |
| 501 | 501 | </a> |
| 502 | 502 | </li>'; |
@@ -509,7 +509,7 @@ discard block |
||
| 509 | 509 | <a href="#" data-name="admin" class="nav-link', $get['page'] === 'admin' ? ' active' : '', '"> |
| 510 | 510 | <i class="nav-icon fas fa-info"></i> |
| 511 | 511 | <p> |
| 512 | - ' . langHdl('admin_main') . ' |
|
| 512 | + ' . langHdl('admin_main').' |
|
| 513 | 513 | </p> |
| 514 | 514 | </a> |
| 515 | 515 | </li> |
@@ -517,7 +517,7 @@ discard block |
||
| 517 | 517 | <a href="#" class="nav-link"> |
| 518 | 518 | <i class="nav-icon fas fa-wrench"></i> |
| 519 | 519 | <p> |
| 520 | - ' . langHdl('admin_settings') . ' |
|
| 520 | + ' . langHdl('admin_settings').' |
|
| 521 | 521 | <i class="fas fa-angle-left right"></i> |
| 522 | 522 | </p> |
| 523 | 523 | </a> |
@@ -525,55 +525,55 @@ discard block |
||
| 525 | 525 | <li class="nav-item"> |
| 526 | 526 | <a href="#" data-name="options" class="nav-link', $get['page'] === 'options' ? ' active' : '', '"> |
| 527 | 527 | <i class="fas fa-check-double nav-icon"></i> |
| 528 | - <p>' . langHdl('options') . '</p> |
|
| 528 | + <p>' . langHdl('options').'</p> |
|
| 529 | 529 | </a> |
| 530 | 530 | </li> |
| 531 | 531 | <li class="nav-item"> |
| 532 | 532 | <a href="#" data-name="2fa" class="nav-link', $get['page'] === '2fa' ? ' active' : '', '"> |
| 533 | 533 | <i class="fas fa-qrcode nav-icon"></i> |
| 534 | - <p>' . langHdl('mfa_short') . '</p> |
|
| 534 | + <p>' . langHdl('mfa_short').'</p> |
|
| 535 | 535 | </a> |
| 536 | 536 | </li> |
| 537 | 537 | <li class="nav-item"> |
| 538 | 538 | <a href="#" data-name="api" class="nav-link', $get['page'] === 'api' ? ' active' : '', '"> |
| 539 | 539 | <i class="fas fa-cubes nav-icon"></i> |
| 540 | - <p>' . langHdl('api') . '</p> |
|
| 540 | + <p>' . langHdl('api').'</p> |
|
| 541 | 541 | </a> |
| 542 | 542 | </li> |
| 543 | 543 | <li class="nav-item"> |
| 544 | 544 | <a href="#" data-name="backups" class="nav-link', $get['page'] === 'backups' ? ' active' : '', '"> |
| 545 | 545 | <i class="fas fa-database nav-icon"></i> |
| 546 | - <p>' . langHdl('backups') . '</p> |
|
| 546 | + <p>' . langHdl('backups').'</p> |
|
| 547 | 547 | </a> |
| 548 | 548 | </li> |
| 549 | 549 | <li class="nav-item"> |
| 550 | 550 | <a href="#" data-name="emails" class="nav-link', $get['page'] === 'emails' ? ' active' : '', '"> |
| 551 | 551 | <i class="fas fa-envelope nav-icon"></i> |
| 552 | - <p>' . langHdl('emails') . '</p> |
|
| 552 | + <p>' . langHdl('emails').'</p> |
|
| 553 | 553 | </a> |
| 554 | 554 | </li> |
| 555 | 555 | <li class="nav-item"> |
| 556 | 556 | <a href="#" data-name="fields" class="nav-link', $get['page'] === 'fields' ? ' active' : '', '"> |
| 557 | 557 | <i class="fas fa-keyboard nav-icon"></i> |
| 558 | - <p>' . langHdl('fields') . '</p> |
|
| 558 | + <p>' . langHdl('fields').'</p> |
|
| 559 | 559 | </a> |
| 560 | 560 | </li> |
| 561 | 561 | <li class="nav-item"> |
| 562 | 562 | <a href="#" data-name="ldap" class="nav-link', $get['page'] === 'ldap' ? ' active' : '', '"> |
| 563 | 563 | <i class="fas fa-id-card nav-icon"></i> |
| 564 | - <p>' . langHdl('ldap') . '</p> |
|
| 564 | + <p>' . langHdl('ldap').'</p> |
|
| 565 | 565 | </a> |
| 566 | 566 | </li> |
| 567 | 567 | <li class="nav-item"> |
| 568 | 568 | <a href="#" data-name="uploads" class="nav-link', $get['page'] === 'uploads' ? ' active' : '', '"> |
| 569 | 569 | <i class="fas fa-file-upload nav-icon"></i> |
| 570 | - <p>' . langHdl('uploads') . '</p> |
|
| 570 | + <p>' . langHdl('uploads').'</p> |
|
| 571 | 571 | </a> |
| 572 | 572 | </li> |
| 573 | 573 | <li class="nav-item"> |
| 574 | 574 | <a href="#" data-name="statistics" class="nav-link', $get['page'] === 'statistics' ? ' active' : '', '"> |
| 575 | 575 | <i class="fas fa-chart-bar nav-icon"></i> |
| 576 | - <p>' . langHdl('statistics') . '</p> |
|
| 576 | + <p>' . langHdl('statistics').'</p> |
|
| 577 | 577 | </a> |
| 578 | 578 | </li> |
| 579 | 579 | </ul> |
@@ -582,7 +582,7 @@ discard block |
||
| 582 | 582 | <a href="#" data-name="actions" class="nav-link', $get['page'] === 'actions' ? ' active' : '', '"> |
| 583 | 583 | <i class="nav-icon fas fa-cogs"></i> |
| 584 | 584 | <p> |
| 585 | - ' . langHdl('actions') . ' |
|
| 585 | + ' . langHdl('actions').' |
|
| 586 | 586 | </p> |
| 587 | 587 | </a> |
| 588 | 588 | </li>'; |
@@ -598,7 +598,7 @@ discard block |
||
| 598 | 598 | <a href="#" data-name="folders" class="nav-link', $get['page'] === 'folders' ? ' active' : '', '"> |
| 599 | 599 | <i class="nav-icon fas fa-folder-open"></i> |
| 600 | 600 | <p> |
| 601 | - ' . langHdl('folders') . ' |
|
| 601 | + ' . langHdl('folders').' |
|
| 602 | 602 | </p> |
| 603 | 603 | </a> |
| 604 | 604 | </li> |
@@ -606,7 +606,7 @@ discard block |
||
| 606 | 606 | <a href="#" data-name="roles" class="nav-link', $get['page'] === 'roles' ? ' active' : '', '"> |
| 607 | 607 | <i class="nav-icon fas fa-graduation-cap"></i> |
| 608 | 608 | <p> |
| 609 | - ' . langHdl('roles') . ' |
|
| 609 | + ' . langHdl('roles').' |
|
| 610 | 610 | </p> |
| 611 | 611 | </a> |
| 612 | 612 | </li> |
@@ -614,38 +614,38 @@ discard block |
||
| 614 | 614 | <a href="#" data-name="users" class="nav-link', $get['page'] === 'users' ? ' active' : '', '"> |
| 615 | 615 | <i class="nav-icon fas fa-users"></i> |
| 616 | 616 | <p> |
| 617 | - ' . langHdl('users') . ' |
|
| 617 | + ' . langHdl('users').' |
|
| 618 | 618 | </p> |
| 619 | 619 | </a> |
| 620 | 620 | </li> |
| 621 | 621 | <li class="nav-item has-treeview', $menuUtilities === true ? ' menu-open' : '', '"> |
| 622 | 622 | <a href="#" class="nav-link"> |
| 623 | 623 | <i class="nav-icon fas fa-cubes"></i> |
| 624 | - <p>' . langHdl('admin_views') . '<i class="fas fa-angle-left right"></i></p> |
|
| 624 | + <p>' . langHdl('admin_views').'<i class="fas fa-angle-left right"></i></p> |
|
| 625 | 625 | </a> |
| 626 | 626 | <ul class="nav nav-treeview"> |
| 627 | 627 | <li class="nav-item"> |
| 628 | 628 | <a href="#" data-name="utilities.renewal" class="nav-link', $get['page'] === 'utilities.renewal' ? ' active' : '', '"> |
| 629 | 629 | <i class="far fa-calendar-alt nav-icon"></i> |
| 630 | - <p>' . langHdl('renewal') . '</p> |
|
| 630 | + <p>' . langHdl('renewal').'</p> |
|
| 631 | 631 | </a> |
| 632 | 632 | </li> |
| 633 | 633 | <li class="nav-item"> |
| 634 | 634 | <a href="#" data-name="utilities.deletion" class="nav-link', $get['page'] === 'utilities.deletion' ? ' active' : '', '"> |
| 635 | 635 | <i class="fas fa-trash-alt nav-icon"></i> |
| 636 | - <p>' . langHdl('deletion') . '</p> |
|
| 636 | + <p>' . langHdl('deletion').'</p> |
|
| 637 | 637 | </a> |
| 638 | 638 | </li> |
| 639 | 639 | <li class="nav-item"> |
| 640 | 640 | <a href="#" data-name="utilities.logs" class="nav-link', $get['page'] === 'utilities.logs' ? ' active' : '', '"> |
| 641 | 641 | <i class="fas fa-history nav-icon"></i> |
| 642 | - <p>' . langHdl('logs') . '</p> |
|
| 642 | + <p>' . langHdl('logs').'</p> |
|
| 643 | 643 | </a> |
| 644 | 644 | </li> |
| 645 | 645 | <li class="nav-item"> |
| 646 | 646 | <a href="#" data-name="utilities.database" class="nav-link', $get['page'] === 'utilities.database' ? ' active' : '', '"> |
| 647 | 647 | <i class="fas fa-database nav-icon"></i> |
| 648 | - <p>' . langHdl('database') . '</p> |
|
| 648 | + <p>' . langHdl('database').'</p> |
|
| 649 | 649 | </a> |
| 650 | 650 | </li> |
| 651 | 651 | </ul> |
@@ -656,10 +656,10 @@ discard block |
||
| 656 | 656 | <!-- /.sidebar-menu --> |
| 657 | 657 | <div class="menu-footer"> |
| 658 | 658 | <div class="" id="sidebar-footer"> |
| 659 | - <i class="fas fa-clock-o mr-2 infotip text-info pointer" title="<?php echo langHdl('server_time') . ' ' . |
|
| 660 | - date($SETTINGS['date_format'], (int) $server['request_time']) . ' - ' . |
|
| 659 | + <i class="fas fa-clock-o mr-2 infotip text-info pointer" title="<?php echo langHdl('server_time').' '. |
|
| 660 | + date($SETTINGS['date_format'], (int) $server['request_time']).' - '. |
|
| 661 | 661 | date($SETTINGS['time_format'], (int) $server['request_time']); ?>"></i> |
| 662 | - <i class="fas fa-users mr-2 infotip text-info pointer" title="<?php echo $session_nb_users_online . ' ' . langHdl('users_online'); ?>"></i> |
|
| 662 | + <i class="fas fa-users mr-2 infotip text-info pointer" title="<?php echo $session_nb_users_online.' '.langHdl('users_online'); ?>"></i> |
|
| 663 | 663 | <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> |
| 664 | 664 | <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> |
| 665 | 665 | <i class="fas fa-bug infotip pointer text-info" title="<?php echo langHdl('bugs_page'); ?>" onclick="generateBugReport()"></i> |
@@ -962,18 +962,18 @@ discard block |
||
| 962 | 962 | } elseif ($get['page'] === 'items') { |
| 963 | 963 | // SHow page with Items |
| 964 | 964 | if ((int) $session_user_admin !== 1) { |
| 965 | - include $SETTINGS['cpassman_dir'] . '/pages/items.php'; |
|
| 965 | + include $SETTINGS['cpassman_dir'].'/pages/items.php'; |
|
| 966 | 966 | } elseif ((int) $session_user_admin === 1) { |
| 967 | - include $SETTINGS['cpassman_dir'] . '/pages/admin.php'; |
|
| 967 | + include $SETTINGS['cpassman_dir'].'/pages/admin.php'; |
|
| 968 | 968 | } else { |
| 969 | 969 | $_SESSION['error']['code'] = ERR_NOT_ALLOWED; |
| 970 | 970 | //not allowed page |
| 971 | - include $SETTINGS['cpassman_dir'] . '/error.php'; |
|
| 971 | + include $SETTINGS['cpassman_dir'].'/error.php'; |
|
| 972 | 972 | } |
| 973 | 973 | } elseif (in_array($get['page'], array_keys($mngPages)) === true) { |
| 974 | 974 | // Define if user is allowed to see management pages |
| 975 | 975 | if ($session_user_admin === 1) { |
| 976 | - include $SETTINGS['cpassman_dir'] . '/pages/' . $mngPages[$get['page']]; |
|
| 976 | + include $SETTINGS['cpassman_dir'].'/pages/'.$mngPages[$get['page']]; |
|
| 977 | 977 | } elseif ($session_user_manager === 1 || $session_user_human_resources === 1) { |
| 978 | 978 | if ($get['page'] !== 'manage_main' |
| 979 | 979 | && $get['page'] !== 'manage_settings' |
@@ -982,15 +982,15 @@ discard block |
||
| 982 | 982 | } else { |
| 983 | 983 | $_SESSION['error']['code'] = ERR_NOT_ALLOWED; |
| 984 | 984 | //not allowed page |
| 985 | - include $SETTINGS['cpassman_dir'] . '/error.php'; |
|
| 985 | + include $SETTINGS['cpassman_dir'].'/error.php'; |
|
| 986 | 986 | } |
| 987 | 987 | } else { |
| 988 | 988 | $_SESSION['error']['code'] = ERR_NOT_ALLOWED; |
| 989 | 989 | //not allowed page |
| 990 | - include $SETTINGS['cpassman_dir'] . '/error.php'; |
|
| 990 | + include $SETTINGS['cpassman_dir'].'/error.php'; |
|
| 991 | 991 | } |
| 992 | 992 | } elseif (empty($get['page']) === false) { |
| 993 | - include $SETTINGS['cpassman_dir'] . '/pages/' . $get['page'] . '.php'; |
|
| 993 | + include $SETTINGS['cpassman_dir'].'/pages/'.$get['page'].'.php'; |
|
| 994 | 994 | } else { |
| 995 | 995 | $_SESSION['error']['code'] = ERR_NOT_EXIST; |
| 996 | 996 | //page doesn't exist |
@@ -1080,7 +1080,7 @@ discard block |
||
| 1080 | 1080 | $superGlobal->put('initialUrl', '', 'SESSION'); |
| 1081 | 1081 | |
| 1082 | 1082 | // LOGIN form |
| 1083 | - include $SETTINGS['cpassman_dir'] . '/includes/core/login.php'; |
|
| 1083 | + include $SETTINGS['cpassman_dir'].'/includes/core/login.php'; |
|
| 1084 | 1084 | } |
| 1085 | 1085 | |
| 1086 | 1086 | ?> |
@@ -1270,61 +1270,61 @@ discard block |
||
| 1270 | 1270 | isset($_SESSION['CPM']) === true |
| 1271 | 1271 | && isset($SETTINGS['cpassman_dir']) === true |
| 1272 | 1272 | ) { |
| 1273 | - include_once $SETTINGS['cpassman_dir'] . '/includes/core/load.js.php'; |
|
| 1273 | + include_once $SETTINGS['cpassman_dir'].'/includes/core/load.js.php'; |
|
| 1274 | 1274 | if ($menuAdmin === true) { |
| 1275 | - include_once $SETTINGS['cpassman_dir'] . '/pages/admin.js.php'; |
|
| 1275 | + include_once $SETTINGS['cpassman_dir'].'/pages/admin.js.php'; |
|
| 1276 | 1276 | if ($get['page'] === '2fa') { |
| 1277 | - include_once $SETTINGS['cpassman_dir'] . '/pages/2fa.js.php'; |
|
| 1277 | + include_once $SETTINGS['cpassman_dir'].'/pages/2fa.js.php'; |
|
| 1278 | 1278 | } elseif ($get['page'] === 'api') { |
| 1279 | - include_once $SETTINGS['cpassman_dir'] . '/pages/api.js.php'; |
|
| 1279 | + include_once $SETTINGS['cpassman_dir'].'/pages/api.js.php'; |
|
| 1280 | 1280 | } elseif ($get['page'] === 'backups') { |
| 1281 | - include_once $SETTINGS['cpassman_dir'] . '/pages/backups.js.php'; |
|
| 1281 | + include_once $SETTINGS['cpassman_dir'].'/pages/backups.js.php'; |
|
| 1282 | 1282 | } elseif ($get['page'] === 'emails') { |
| 1283 | - include_once $SETTINGS['cpassman_dir'] . '/pages/emails.js.php'; |
|
| 1283 | + include_once $SETTINGS['cpassman_dir'].'/pages/emails.js.php'; |
|
| 1284 | 1284 | } elseif ($get['page'] === 'ldap') { |
| 1285 | - include_once $SETTINGS['cpassman_dir'] . '/pages/ldap.js.php'; |
|
| 1285 | + include_once $SETTINGS['cpassman_dir'].'/pages/ldap.js.php'; |
|
| 1286 | 1286 | } elseif ($get['page'] === 'uploads') { |
| 1287 | - include_once $SETTINGS['cpassman_dir'] . '/pages/uploads.js.php'; |
|
| 1287 | + include_once $SETTINGS['cpassman_dir'].'/pages/uploads.js.php'; |
|
| 1288 | 1288 | } elseif ($get['page'] === 'actions') { |
| 1289 | - include_once $SETTINGS['cpassman_dir'] . '/pages/actions.js.php'; |
|
| 1289 | + include_once $SETTINGS['cpassman_dir'].'/pages/actions.js.php'; |
|
| 1290 | 1290 | } elseif ($get['page'] === 'fields') { |
| 1291 | - include_once $SETTINGS['cpassman_dir'] . '/pages/fields.js.php'; |
|
| 1291 | + include_once $SETTINGS['cpassman_dir'].'/pages/fields.js.php'; |
|
| 1292 | 1292 | } elseif ($get['page'] === 'options') { |
| 1293 | - include_once $SETTINGS['cpassman_dir'] . '/pages/options.js.php'; |
|
| 1293 | + include_once $SETTINGS['cpassman_dir'].'/pages/options.js.php'; |
|
| 1294 | 1294 | } elseif ($get['page'] === 'statistics') { |
| 1295 | - include_once $SETTINGS['cpassman_dir'] . '/pages/statistics.js.php'; |
|
| 1295 | + include_once $SETTINGS['cpassman_dir'].'/pages/statistics.js.php'; |
|
| 1296 | 1296 | } |
| 1297 | 1297 | } elseif (isset($get['page']) === true && $get['page'] !== '') { |
| 1298 | 1298 | if ($get['page'] === 'items') { |
| 1299 | - include_once $SETTINGS['cpassman_dir'] . '/pages/items.js.php'; |
|
| 1299 | + include_once $SETTINGS['cpassman_dir'].'/pages/items.js.php'; |
|
| 1300 | 1300 | } elseif ($get['page'] === 'import') { |
| 1301 | - include_once $SETTINGS['cpassman_dir'] . '/pages/import.js.php'; |
|
| 1301 | + include_once $SETTINGS['cpassman_dir'].'/pages/import.js.php'; |
|
| 1302 | 1302 | } elseif ($get['page'] === 'export') { |
| 1303 | - include_once $SETTINGS['cpassman_dir'] . '/pages/export.js.php'; |
|
| 1303 | + include_once $SETTINGS['cpassman_dir'].'/pages/export.js.php'; |
|
| 1304 | 1304 | } elseif ($get['page'] === 'offline') { |
| 1305 | - include_once $SETTINGS['cpassman_dir'] . '/pages/offline.js.php'; |
|
| 1305 | + include_once $SETTINGS['cpassman_dir'].'/pages/offline.js.php'; |
|
| 1306 | 1306 | } elseif ($get['page'] === 'search') { |
| 1307 | - include_once $SETTINGS['cpassman_dir'] . '/pages/search.js.php'; |
|
| 1307 | + include_once $SETTINGS['cpassman_dir'].'/pages/search.js.php'; |
|
| 1308 | 1308 | } elseif ($get['page'] === 'profile') { |
| 1309 | - include_once $SETTINGS['cpassman_dir'] . '/pages/profile.js.php'; |
|
| 1309 | + include_once $SETTINGS['cpassman_dir'].'/pages/profile.js.php'; |
|
| 1310 | 1310 | } elseif ($get['page'] === 'favourites') { |
| 1311 | - include_once $SETTINGS['cpassman_dir'] . '/pages/favorites.js.php'; |
|
| 1311 | + include_once $SETTINGS['cpassman_dir'].'/pages/favorites.js.php'; |
|
| 1312 | 1312 | } elseif ($get['page'] === 'folders') { |
| 1313 | - include_once $SETTINGS['cpassman_dir'] . '/pages/folders.js.php'; |
|
| 1313 | + include_once $SETTINGS['cpassman_dir'].'/pages/folders.js.php'; |
|
| 1314 | 1314 | } elseif ($get['page'] === 'users') { |
| 1315 | - include_once $SETTINGS['cpassman_dir'] . '/pages/users.js.php'; |
|
| 1315 | + include_once $SETTINGS['cpassman_dir'].'/pages/users.js.php'; |
|
| 1316 | 1316 | } elseif ($get['page'] === 'roles') { |
| 1317 | - include_once $SETTINGS['cpassman_dir'] . '/pages/roles.js.php'; |
|
| 1317 | + include_once $SETTINGS['cpassman_dir'].'/pages/roles.js.php'; |
|
| 1318 | 1318 | } elseif ($get['page'] === 'utilities.deletion') { |
| 1319 | - include_once $SETTINGS['cpassman_dir'] . '/pages/utilities.deletion.js.php'; |
|
| 1319 | + include_once $SETTINGS['cpassman_dir'].'/pages/utilities.deletion.js.php'; |
|
| 1320 | 1320 | } elseif ($get['page'] === 'utilities.logs') { |
| 1321 | - include_once $SETTINGS['cpassman_dir'] . '/pages/utilities.logs.js.php'; |
|
| 1321 | + include_once $SETTINGS['cpassman_dir'].'/pages/utilities.logs.js.php'; |
|
| 1322 | 1322 | } elseif ($get['page'] === 'utilities.database') { |
| 1323 | - include_once $SETTINGS['cpassman_dir'] . '/pages/utilities.database.js.php'; |
|
| 1323 | + include_once $SETTINGS['cpassman_dir'].'/pages/utilities.database.js.php'; |
|
| 1324 | 1324 | } elseif ($get['page'] === 'utilities.renewal') { |
| 1325 | - include_once $SETTINGS['cpassman_dir'] . '/pages/utilities.renewal.js.php'; |
|
| 1325 | + include_once $SETTINGS['cpassman_dir'].'/pages/utilities.renewal.js.php'; |
|
| 1326 | 1326 | } |
| 1327 | 1327 | } else { |
| 1328 | - include_once $SETTINGS['cpassman_dir'] . '/includes/core/login.js.php'; |
|
| 1328 | + include_once $SETTINGS['cpassman_dir'].'/includes/core/login.js.php'; |
|
| 1329 | 1329 | } |
| 1330 | 1330 | } |
@@ -53,7 +53,7 @@ discard block |
||
| 53 | 53 | require $SETTINGS['cpassman_dir'].'/includes/libraries/Authentication/DuoUniversal/Client.php'; |
| 54 | 54 | |
| 55 | 55 | // Load superGlobals |
| 56 | -include_once $SETTINGS['cpassman_dir'] . '/includes/libraries/protect/SuperGlobal/SuperGlobal.php'; |
|
| 56 | +include_once $SETTINGS['cpassman_dir'].'/includes/libraries/protect/SuperGlobal/SuperGlobal.php'; |
|
| 57 | 57 | $superGlobal = new protect\SuperGlobal\SuperGlobal(); |
| 58 | 58 | |
| 59 | 59 | |
@@ -66,7 +66,7 @@ discard block |
||
| 66 | 66 | $SETTINGS['cpassman_url'].'/duo-callback' |
| 67 | 67 | ); |
| 68 | 68 | } catch (DuoException $e) { |
| 69 | - throw new ErrorException("*** Duo config error. Verify the values in duo.conf are correct ***\n" . $e->getMessage()); |
|
| 69 | + throw new ErrorException("*** Duo config error. Verify the values in duo.conf are correct ***\n".$e->getMessage()); |
|
| 70 | 70 | } |
| 71 | 71 | |
| 72 | 72 | $state = $duo_client->generateState(); |