@@ -56,7 +56,7 @@ |
||
| 56 | 56 | } elseif (substr_count($val, '$pre = ') > 0) { |
| 57 | 57 | $_SESSION['pre'] = getSettingValue($val); |
| 58 | 58 | } elseif (substr_count($val, "define('SECUREPATH',") > 0) { |
| 59 | - $_SESSION['sk_file'] = substr($val, 23, strpos($val, ');')-24)."/sk.php"; |
|
| 59 | + $_SESSION['sk_file'] = substr($val, 23, strpos($val, ');') - 24)."/sk.php"; |
|
| 60 | 60 | } |
| 61 | 61 | } |
| 62 | 62 | } |
@@ -137,7 +137,7 @@ discard block |
||
| 137 | 137 | $config->setIgnoreHeaderLine("true"); |
| 138 | 138 | // extract data from CSV file |
| 139 | 139 | $interpreter = new Interpreter(); |
| 140 | - $interpreter->addObserver(function (array $row) use (&$valuesToImport) { |
|
| 140 | + $interpreter->addObserver(function(array $row) use (&$valuesToImport) { |
|
| 141 | 141 | $valuesToImport[] = array( |
| 142 | 142 | 'Label' => $row[0], |
| 143 | 143 | 'Login' => $row[1], |
@@ -966,7 +966,7 @@ discard block |
||
| 966 | 966 | break; |
| 967 | 967 | } |
| 968 | 968 | |
| 969 | -spl_autoload_register(function ($class) { |
|
| 969 | +spl_autoload_register(function($class) { |
|
| 970 | 970 | $prefix = 'League\\Csv\\'; |
| 971 | 971 | $base_dir = __DIR__.'/src/'; |
| 972 | 972 | $len = strlen($prefix); |
@@ -105,7 +105,7 @@ discard block |
||
| 105 | 105 | //load full tree |
| 106 | 106 | $tree->rebuild(); |
| 107 | 107 | $tree = $tree->getDescendants(); |
| 108 | - // Init post variable |
|
| 108 | + // Init post variable |
|
| 109 | 109 | $post_operation_id = filter_input(INPUT_POST, 'file', FILTER_SANITIZE_NUMBER_INT); |
| 110 | 110 | |
| 111 | 111 | // Get filename from database |
@@ -436,7 +436,7 @@ discard block |
||
| 436 | 436 | } |
| 437 | 437 | |
| 438 | 438 | /** |
| 439 | - ** Recursive function that will permit to read each level of XML nodes |
|
| 439 | + ** Recursive function that will permit to read each level of XML nodes |
|
| 440 | 440 | */ |
| 441 | 441 | function recursiveKeepassXML($xmlRoot, $xmlLevel = 0) |
| 442 | 442 | { |
@@ -586,7 +586,7 @@ discard block |
||
| 586 | 586 | |
| 587 | 587 | //recursive call |
| 588 | 588 | if ($history !== true) { |
| 589 | - recursiveKeepassXML($xmlChildren, $xmlLevel + 1); |
|
| 589 | + recursiveKeepassXML($xmlChildren, $xmlLevel + 1); |
|
| 590 | 590 | } |
| 591 | 591 | |
| 592 | 592 | // Force History to false |
@@ -85,8 +85,8 @@ |
||
| 85 | 85 | ); |
| 86 | 86 | if ($row['valeur'] === "true") { |
| 87 | 87 | /** |
| 88 | - * Permits to delete files and folders recursively |
|
| 89 | - */ |
|
| 88 | + * Permits to delete files and folders recursively |
|
| 89 | + */ |
|
| 90 | 90 | function delTree($dir) |
| 91 | 91 | { |
| 92 | 92 | $files = array_diff(scandir($dir), array('.', '..')); |
@@ -492,7 +492,7 @@ |
||
| 492 | 492 | $_SESSION['validite_pw'] = true; |
| 493 | 493 | } else { |
| 494 | 494 | $_SESSION['numDaysBeforePwExpiration'] = $SETTINGS['pw_life_duration'] - round( |
| 495 | - (mktime(0, 0, 0, (int)date('m'), (int)date('d'), (int)date('y')) - $_SESSION['last_pw_change']) / (24 * 60 * 60) |
|
| 495 | + (mktime(0, 0, 0, (int) date('m'), (int) date('d'), (int) date('y')) - $_SESSION['last_pw_change']) / (24 * 60 * 60) |
|
| 496 | 496 | ); |
| 497 | 497 | if ($_SESSION['numDaysBeforePwExpiration'] <= 0) { |
| 498 | 498 | $_SESSION['validite_pw'] = false; |
@@ -309,7 +309,7 @@ |
||
| 309 | 309 | BeforeUpload: function (up, file) { |
| 310 | 310 | $("#import_status_ajax_loader").show(); |
| 311 | 311 | up.settings.multipart_params = { |
| 312 | - "PHPSESSID":"<?php echo $_SESSION['user_id'];?>", |
|
| 312 | + "PHPSESSID":"<?php echo $_SESSION['user_id']; ?>", |
|
| 313 | 313 | "type_upload":"import_items_from_keypass", |
| 314 | 314 | "user_token": $("#import_user_token").val() |
| 315 | 315 | }; |
@@ -309,7 +309,7 @@ |
||
| 309 | 309 | BeforeUpload: function (up, file) { |
| 310 | 310 | $("#import_status_ajax_loader").show(); |
| 311 | 311 | up.settings.multipart_params = { |
| 312 | - "PHPSESSID":"<?php echo $_SESSION['user_id'];?>", |
|
| 312 | + "PHPSESSID":"<?php echo $_SESSION['user_id']; ?>", |
|
| 313 | 313 | "type_upload":"import_items_from_keypass", |
| 314 | 314 | "user_token": $("#import_user_token").val() |
| 315 | 315 | }; |
@@ -130,16 +130,16 @@ discard block |
||
| 130 | 130 | $superGlobal = new protect\SuperGlobal\SuperGlobal(); |
| 131 | 131 | |
| 132 | 132 | // Prepare superGlobal variables |
| 133 | - $session_forbiden_pfs = $superGlobal->get("forbiden_pfs", "SESSION"); |
|
| 134 | - $session_groupes_visibles = $superGlobal->get("groupes_visibles", "SESSION"); |
|
| 135 | - $session_list_restricted_folders_for_items = $superGlobal->get("list_restricted_folders_for_items", "SESSION"); |
|
| 136 | - $session_user_id = $superGlobal->get("user_id", "SESSION"); |
|
| 137 | - $session_login = $superGlobal->get("login", "SESSION"); |
|
| 138 | - $session_no_access_folders = $superGlobal->get("no_access_folders", "SESSION"); |
|
| 139 | - $session_list_folders_limited = $superGlobal->get("list_folders_limited", "SESSION"); |
|
| 140 | - $session_read_only_folders = $superGlobal->get("read_only_folders", "SESSION"); |
|
| 141 | - $session_personal_folders = $superGlobal->get("personal_folders", "SESSION"); |
|
| 142 | - $session_personal_visible_groups = $superGlobal->get("personal_visible_groups", "SESSION"); |
|
| 133 | + $session_forbiden_pfs = $superGlobal->get("forbiden_pfs", "SESSION"); |
|
| 134 | + $session_groupes_visibles = $superGlobal->get("groupes_visibles", "SESSION"); |
|
| 135 | + $session_list_restricted_folders_for_items = $superGlobal->get("list_restricted_folders_for_items", "SESSION"); |
|
| 136 | + $session_user_id = $superGlobal->get("user_id", "SESSION"); |
|
| 137 | + $session_login = $superGlobal->get("login", "SESSION"); |
|
| 138 | + $session_no_access_folders = $superGlobal->get("no_access_folders", "SESSION"); |
|
| 139 | + $session_list_folders_limited = $superGlobal->get("list_folders_limited", "SESSION"); |
|
| 140 | + $session_read_only_folders = $superGlobal->get("read_only_folders", "SESSION"); |
|
| 141 | + $session_personal_folders = $superGlobal->get("personal_folders", "SESSION"); |
|
| 142 | + $session_personal_visible_groups = $superGlobal->get("personal_visible_groups", "SESSION"); |
|
| 143 | 143 | |
| 144 | 144 | // Be sure that user can only see folders he/she is allowed to |
| 145 | 145 | if (in_array($nodeId, $session_forbiden_pfs) === false |
@@ -304,15 +304,15 @@ discard block |
||
| 304 | 304 | $superGlobal = new protect\SuperGlobal\SuperGlobal(); |
| 305 | 305 | |
| 306 | 306 | // Prepare superGlobal variables |
| 307 | - $session_forbiden_pfs = $superGlobal->get("forbiden_pfs", "SESSION"); |
|
| 308 | - $session_groupes_visibles = $superGlobal->get("groupes_visibles", "SESSION"); |
|
| 309 | - $session_list_restricted_folders_for_items = $superGlobal->get("list_restricted_folders_for_items", "SESSION"); |
|
| 310 | - $session_user_id = $superGlobal->get("user_id", "SESSION"); |
|
| 311 | - $session_login = $superGlobal->get("login", "SESSION"); |
|
| 312 | - $session_user_read_only = $superGlobal->get("user_read_only", "SESSION"); |
|
| 313 | - $session_no_access_folders = $superGlobal->get("no_access_folders", "SESSION"); |
|
| 314 | - $session_list_folders_limited = $superGlobal->get("list_folders_limited", "SESSION"); |
|
| 315 | - $session_read_only_folders = $superGlobal->get("read_only_folders", "SESSION"); |
|
| 307 | + $session_forbiden_pfs = $superGlobal->get("forbiden_pfs", "SESSION"); |
|
| 308 | + $session_groupes_visibles = $superGlobal->get("groupes_visibles", "SESSION"); |
|
| 309 | + $session_list_restricted_folders_for_items = $superGlobal->get("list_restricted_folders_for_items", "SESSION"); |
|
| 310 | + $session_user_id = $superGlobal->get("user_id", "SESSION"); |
|
| 311 | + $session_login = $superGlobal->get("login", "SESSION"); |
|
| 312 | + $session_user_read_only = $superGlobal->get("user_read_only", "SESSION"); |
|
| 313 | + $session_no_access_folders = $superGlobal->get("no_access_folders", "SESSION"); |
|
| 314 | + $session_list_folders_limited = $superGlobal->get("list_folders_limited", "SESSION"); |
|
| 315 | + $session_read_only_folders = $superGlobal->get("read_only_folders", "SESSION"); |
|
| 316 | 316 | |
| 317 | 317 | // Be sure that user can only see folders he/she is allowed to |
| 318 | 318 | if (in_array($completTree[$nodeId]->id, $session_forbiden_pfs) === false |
@@ -341,8 +341,8 @@ |
||
| 341 | 341 | if ($getItemInList === true) { |
| 342 | 342 | $sOutputConst .= $sOutputItem; |
| 343 | 343 | } else { |
| 344 | - $iFilteredTotal --; |
|
| 345 | - $iTotal --; |
|
| 344 | + $iFilteredTotal--; |
|
| 345 | + $iTotal--; |
|
| 346 | 346 | } |
| 347 | 347 | } |
| 348 | 348 | if (!empty($sOutputConst)) { |
@@ -633,7 +633,7 @@ discard block |
||
| 633 | 633 | $json[$inc]['nlevel'] = mb_convert_encoding($folder->nlevel, mb_detect_encoding($folder->nlevel), 'UTF-8'); |
| 634 | 634 | $json[$inc]['personal'] = mb_convert_encoding($folder->personal_folder, mb_detect_encoding($folder->personal_folder), 'UTF-8'); |
| 635 | 635 | |
| 636 | - $inc ++; |
|
| 636 | + $inc++; |
|
| 637 | 637 | } |
| 638 | 638 | } |
| 639 | 639 | } |
@@ -2099,7 +2099,7 @@ discard block |
||
| 2099 | 2099 | $tree = new Tree\NestedTree\NestedTree(prefix_table("nested_tree"), 'id', 'parent_id', 'title'); |
| 2100 | 2100 | $tree->rebuild(); |
| 2101 | 2101 | |
| 2102 | - echo json_encode(array('new_id' => $newID , 'err' => '')); |
|
| 2102 | + echo json_encode(array('new_id' => $newID, 'err' => '')); |
|
| 2103 | 2103 | } elseif ($GLOBALS['request'][1] === "edit") { |
| 2104 | 2104 | // Is this folder a personal one? |
| 2105 | 2105 | $fldData = DB::queryFirstRow( |
@@ -2166,7 +2166,7 @@ discard block |
||
| 2166 | 2166 | $item_definition['item_id'] |
| 2167 | 2167 | ); |
| 2168 | 2168 | |
| 2169 | - echo json_encode(array('new_id' => '' , 'err' => '')); |
|
| 2169 | + echo json_encode(array('new_id' => '', 'err' => '')); |
|
| 2170 | 2170 | } |
| 2171 | 2171 | } else { |
| 2172 | 2172 | rest_error('AUTH_NOT_GRANTED'); |
@@ -1635,7 +1635,7 @@ |
||
| 1635 | 1635 | rest_error('AUTH_NO_URL'); |
| 1636 | 1636 | } |
| 1637 | 1637 | } else { |
| 1638 | - rest_error('AUTH_NO_IDENTIFIER'); |
|
| 1638 | + rest_error('AUTH_NO_IDENTIFIER'); |
|
| 1639 | 1639 | } |
| 1640 | 1640 | } else { |
| 1641 | 1641 | rest_error('AUTH_NO_IDENTIFIER'); |
@@ -2085,7 +2085,7 @@ discard block |
||
| 2085 | 2085 | $debug_ldap .= "LDAP connection : ".($ldapconn ? "Connected" : "Failed")."<br/>"; |
| 2086 | 2086 | |
| 2087 | 2087 | if ($ldapconn) { |
| 2088 | - $debug_ldap .= "DN : ".$dataReceived[0]['ldap_bind_dn']." -- ".$dataReceived[0]['ldap_bind_passwd']."<br/>"; |
|
| 2088 | + $debug_ldap .= "DN : ".$dataReceived[0]['ldap_bind_dn']." -- ".$dataReceived[0]['ldap_bind_passwd']."<br/>"; |
|
| 2089 | 2089 | ldap_set_option($ldapconn, LDAP_OPT_PROTOCOL_VERSION, 3); |
| 2090 | 2090 | ldap_set_option($ldapconn, LDAP_OPT_REFERRALS, 0); |
| 2091 | 2091 | $ldapbind = ldap_bind($ldapconn, $dataReceived[0]['ldap_bind_dn'], $dataReceived[0]['ldap_bind_passwd']); |
@@ -2112,7 +2112,7 @@ discard block |
||
| 2112 | 2112 | ); |
| 2113 | 2113 | |
| 2114 | 2114 | $debug_ldap .= 'Search filter (group): '.$filter_group."<br/>". |
| 2115 | - 'Results : '.str_replace("\n","<br>", print_r(ldap_get_entries($ldapconn, $result_group), true))."<br/>"; |
|
| 2115 | + 'Results : '.str_replace("\n","<br>", print_r(ldap_get_entries($ldapconn, $result_group), true))."<br/>"; |
|
| 2116 | 2116 | |
| 2117 | 2117 | if ($result_group) { |
| 2118 | 2118 | $entries = ldap_get_entries($ldapconn, $result_group); |
@@ -2120,11 +2120,11 @@ discard block |
||
| 2120 | 2120 | if ($entries['count'] > 0) { |
| 2121 | 2121 | // Now check if group fits |
| 2122 | 2122 | for ($i=0; $i<$entries['count']; $i++) { |
| 2123 | - $parsr=ldap_explode_dn($entries[$i]['dn'], 0); |
|
| 2124 | - if (str_replace(array('CN=','cn='), '', $parsr[0]) === $SETTINGS['ldap_usergroup']) { |
|
| 2123 | + $parsr=ldap_explode_dn($entries[$i]['dn'], 0); |
|
| 2124 | + if (str_replace(array('CN=','cn='), '', $parsr[0]) === $SETTINGS['ldap_usergroup']) { |
|
| 2125 | 2125 | $GroupRestrictionEnabled = true; |
| 2126 | 2126 | break; |
| 2127 | - } |
|
| 2127 | + } |
|
| 2128 | 2128 | } |
| 2129 | 2129 | |
| 2130 | 2130 | } |
@@ -107,7 +107,7 @@ discard block |
||
| 107 | 107 | array( |
| 108 | 108 | 'http' => array( |
| 109 | 109 | 'ignore_errors' => true, |
| 110 | - 'proxy' => $SETTINGS['proxy_ip'] . ':' . $SETTINGS['proxy_port'] |
|
| 110 | + 'proxy' => $SETTINGS['proxy_ip'].':'.$SETTINGS['proxy_port'] |
|
| 111 | 111 | ) |
| 112 | 112 | ) |
| 113 | 113 | ); |
@@ -665,7 +665,7 @@ discard block |
||
| 665 | 665 | |
| 666 | 666 | |
| 667 | 667 | // generate new saltkey |
| 668 | - $old_sk_filename = SECUREPATH."/teampass-seckey.txt".'.'.date("Y_m_d", mktime(0, 0, 0, (int)date('m'), (int)date('d'), (int)date('y'))).'.'.time(); |
|
| 668 | + $old_sk_filename = SECUREPATH."/teampass-seckey.txt".'.'.date("Y_m_d", mktime(0, 0, 0, (int) date('m'), (int) date('d'), (int) date('y'))).'.'.time(); |
|
| 669 | 669 | copy( |
| 670 | 670 | SECUREPATH."/teampass-seckey.txt", |
| 671 | 671 | $old_sk_filename |
@@ -769,7 +769,7 @@ discard block |
||
| 769 | 769 | $objects = explode(",", $post_object); |
| 770 | 770 | |
| 771 | 771 | // Allowed values for $_POST['object'] : "items,logs,files,categories" |
| 772 | - if (in_array($objects[0], array("items","logs","files","categories")) === false) { |
|
| 772 | + if (in_array($objects[0], array("items", "logs", "files", "categories")) === false) { |
|
| 773 | 773 | echo '[{"nextAction":"" , "error":"Input `'.$objects[0].'` is not allowed" , "nbOfItems":""}]'; |
| 774 | 774 | break; |
| 775 | 775 | } |
@@ -1259,7 +1259,7 @@ discard block |
||
| 1259 | 1259 | foreach ($rows as $record) { |
| 1260 | 1260 | if (is_file($SETTINGS['path_to_upload_folder'].'/'.$record['file'])) { |
| 1261 | 1261 | $addFile = 0; |
| 1262 | - if ($post_option== "decrypt" && $record['status'] === 'encrypted') { |
|
| 1262 | + if ($post_option == "decrypt" && $record['status'] === 'encrypted') { |
|
| 1263 | 1263 | $addFile = 1; |
| 1264 | 1264 | } elseif ($post_option == "encrypt" && $record['status'] === 'clear') { |
| 1265 | 1265 | $addFile = 1; |
@@ -1551,7 +1551,7 @@ discard block |
||
| 1551 | 1551 | $tmp_skfile, |
| 1552 | 1552 | $tmp_skfile.'.'.date( |
| 1553 | 1553 | "Y_m_d", |
| 1554 | - mktime(0, 0, 0, (int)date('m'), (int)date('d'), (int)date('y')) |
|
| 1554 | + mktime(0, 0, 0, (int) date('m'), (int) date('d'), (int) date('y')) |
|
| 1555 | 1555 | ) |
| 1556 | 1556 | )) { |
| 1557 | 1557 | echo '[{"result" : "" , "error" : "Could NOT perform a copy of file: '.$tmp_skfile.'"}]'; |
@@ -2067,16 +2067,16 @@ discard block |
||
| 2067 | 2067 | ); |
| 2068 | 2068 | |
| 2069 | 2069 | $debug_ldap .= 'Search filter (group): '.$filter_group."<br/>". |
| 2070 | - 'Results : '.str_replace("\n","<br>", print_r(ldap_get_entries($ldapconn, $result_group), true))."<br/>"; |
|
| 2070 | + 'Results : '.str_replace("\n", "<br>", print_r(ldap_get_entries($ldapconn, $result_group), true))."<br/>"; |
|
| 2071 | 2071 | |
| 2072 | 2072 | if ($result_group) { |
| 2073 | 2073 | $entries = ldap_get_entries($ldapconn, $result_group); |
| 2074 | 2074 | |
| 2075 | 2075 | if ($entries['count'] > 0) { |
| 2076 | 2076 | // Now check if group fits |
| 2077 | - for ($i=0; $i<$entries['count']; $i++) { |
|
| 2078 | - $parsr=ldap_explode_dn($entries[$i]['dn'], 0); |
|
| 2079 | - if (str_replace(array('CN=','cn='), '', $parsr[0]) === $SETTINGS['ldap_usergroup']) { |
|
| 2077 | + for ($i = 0; $i < $entries['count']; $i++) { |
|
| 2078 | + $parsr = ldap_explode_dn($entries[$i]['dn'], 0); |
|
| 2079 | + if (str_replace(array('CN=', 'cn='), '', $parsr[0]) === $SETTINGS['ldap_usergroup']) { |
|
| 2080 | 2080 | $GroupRestrictionEnabled = true; |
| 2081 | 2081 | break; |
| 2082 | 2082 | } |
@@ -2089,7 +2089,7 @@ discard block |
||
| 2089 | 2089 | } |
| 2090 | 2090 | |
| 2091 | 2091 | $debug_ldap .= 'Search filter : '.$filter."<br/>". |
| 2092 | - 'Results : '.str_replace("\n","<br>", print_r(ldap_get_entries($ldapconn, $result), true))."<br/>"; |
|
| 2092 | + 'Results : '.str_replace("\n", "<br>", print_r(ldap_get_entries($ldapconn, $result), true))."<br/>"; |
|
| 2093 | 2093 | |
| 2094 | 2094 | if (ldap_count_entries($ldapconn, $result)) { |
| 2095 | 2095 | // try auth |