@@ -91,35 +91,35 @@ discard block |
||
| 91 | 91 | require_once $SETTINGS['cpassman_dir'].'/sources/core.php'; |
| 92 | 92 | |
| 93 | 93 | // Prepare POST variables |
| 94 | -$post_language = filter_input(INPUT_POST, 'language', FILTER_SANITIZE_STRING); |
|
| 95 | -$post_sig_response = filter_input(INPUT_POST, 'sig_response', FILTER_SANITIZE_STRING); |
|
| 96 | -$post_duo_login = filter_input(INPUT_POST, 'duo_login', FILTER_SANITIZE_STRING); |
|
| 97 | -$post_duo_pwd = filter_input(INPUT_POST, 'duo_pwd', FILTER_SANITIZE_STRING); |
|
| 98 | -$post_duo_data = filter_input(INPUT_POST, 'duo_data', FILTER_SANITIZE_STRING); |
|
| 99 | -$post_login = filter_input(INPUT_POST, 'login', FILTER_SANITIZE_STRING); |
|
| 100 | -$post_pw = filter_input(INPUT_POST, 'pw', FILTER_SANITIZE_STRING); |
|
| 94 | +$post_language = filter_input(INPUT_POST, 'language', FILTER_SANITIZE_STRING); |
|
| 95 | +$post_sig_response = filter_input(INPUT_POST, 'sig_response', FILTER_SANITIZE_STRING); |
|
| 96 | +$post_duo_login = filter_input(INPUT_POST, 'duo_login', FILTER_SANITIZE_STRING); |
|
| 97 | +$post_duo_pwd = filter_input(INPUT_POST, 'duo_pwd', FILTER_SANITIZE_STRING); |
|
| 98 | +$post_duo_data = filter_input(INPUT_POST, 'duo_data', FILTER_SANITIZE_STRING); |
|
| 99 | +$post_login = filter_input(INPUT_POST, 'login', FILTER_SANITIZE_STRING); |
|
| 100 | +$post_pw = filter_input(INPUT_POST, 'pw', FILTER_SANITIZE_STRING); |
|
| 101 | 101 | |
| 102 | 102 | // Prepare superGlobal variables |
| 103 | -$session_user_language = $superGlobal->get("user_language", "SESSION"); |
|
| 104 | -$session_user_id = $superGlobal->get("user_id", "SESSION"); |
|
| 105 | -$session_user_flag = $superGlobal->get("user_language_flag", "SESSION"); |
|
| 106 | -$session_user_admin = $superGlobal->get("user_admin", "SESSION"); |
|
| 103 | +$session_user_language = $superGlobal->get("user_language", "SESSION"); |
|
| 104 | +$session_user_id = $superGlobal->get("user_id", "SESSION"); |
|
| 105 | +$session_user_flag = $superGlobal->get("user_language_flag", "SESSION"); |
|
| 106 | +$session_user_admin = $superGlobal->get("user_admin", "SESSION"); |
|
| 107 | 107 | $session_user_human_resources = $superGlobal->get("user_can_manage_all_users", "SESSION"); |
| 108 | -$session_user_avatar_thumb = $superGlobal->get("user_avatar_thumb", "SESSION"); |
|
| 109 | -$session_name = $superGlobal->get("name", "SESSION"); |
|
| 110 | -$session_lastname = $superGlobal->get("lastname", "SESSION"); |
|
| 111 | -$session_user_manager = $superGlobal->get("user_manager", "SESSION"); |
|
| 112 | -$session_user_read_only = $superGlobal->get("user_read_only", "SESSION"); |
|
| 113 | -$session_is_admin = $superGlobal->get("is_admin", "SESSION"); |
|
| 114 | -$session_login = $superGlobal->get("login", "SESSION"); |
|
| 115 | -$session_validite_pw = $superGlobal->get("validite_pw", "SESSION"); |
|
| 116 | -$session_nb_folders = $superGlobal->get("nb_folders", "SESSION"); |
|
| 117 | -$session_nb_roles = $superGlobal->get("nb_roles", "SESSION"); |
|
| 118 | -$session_autoriser = $superGlobal->get("autoriser", "SESSION"); |
|
| 119 | -$session_hide_maintenance = $superGlobal->get("hide_maintenance", "SESSION"); |
|
| 120 | -$session_initial_url = $superGlobal->get("initial_url", "SESSION"); |
|
| 121 | -$server_request_uri = $superGlobal->get("REQUEST_URI", "SERVER"); |
|
| 122 | -$session_nb_users_online = $superGlobal->get("nb_users_online", "SESSION"); |
|
| 108 | +$session_user_avatar_thumb = $superGlobal->get("user_avatar_thumb", "SESSION"); |
|
| 109 | +$session_name = $superGlobal->get("name", "SESSION"); |
|
| 110 | +$session_lastname = $superGlobal->get("lastname", "SESSION"); |
|
| 111 | +$session_user_manager = $superGlobal->get("user_manager", "SESSION"); |
|
| 112 | +$session_user_read_only = $superGlobal->get("user_read_only", "SESSION"); |
|
| 113 | +$session_is_admin = $superGlobal->get("is_admin", "SESSION"); |
|
| 114 | +$session_login = $superGlobal->get("login", "SESSION"); |
|
| 115 | +$session_validite_pw = $superGlobal->get("validite_pw", "SESSION"); |
|
| 116 | +$session_nb_folders = $superGlobal->get("nb_folders", "SESSION"); |
|
| 117 | +$session_nb_roles = $superGlobal->get("nb_roles", "SESSION"); |
|
| 118 | +$session_autoriser = $superGlobal->get("autoriser", "SESSION"); |
|
| 119 | +$session_hide_maintenance = $superGlobal->get("hide_maintenance", "SESSION"); |
|
| 120 | +$session_initial_url = $superGlobal->get("initial_url", "SESSION"); |
|
| 121 | +$server_request_uri = $superGlobal->get("REQUEST_URI", "SERVER"); |
|
| 122 | +$session_nb_users_online = $superGlobal->get("nb_users_online", "SESSION"); |
|
| 123 | 123 | |
| 124 | 124 | /* DEFINE WHAT LANGUAGE TO USE */ |
| 125 | 125 | if (isset($_GET['language']) === true) { |
@@ -244,12 +244,9 @@ discard block |
||
| 244 | 244 | <div style="float:right; margin:-10px 5px 0 0; color:#FFF;">' |
| 245 | 245 | .$LANG['index_welcome'].' <b>'.$session_name.' '.$session_lastname |
| 246 | 246 | .' ['.$session_login.']</b> - ' |
| 247 | - , $session_user_admin === '1' ? $LANG['god'] : |
|
| 248 | - ( |
|
| 249 | - $session_user_manager === '1' ? $LANG['gestionnaire'] : |
|
| 250 | - ( |
|
| 251 | - $session_user_read_only === '1' ? $LANG['read_only_account'] : |
|
| 252 | - ($session_user_human_resources === '1' ? $LANG['human_resources'] :$LANG['user']) |
|
| 247 | + , $session_user_admin === '1' ? $LANG['god'] : ( |
|
| 248 | + $session_user_manager === '1' ? $LANG['gestionnaire'] : ( |
|
| 249 | + $session_user_read_only === '1' ? $LANG['read_only_account'] : ($session_user_human_resources === '1' ? $LANG['human_resources'] : $LANG['user']) |
|
| 253 | 250 | ) |
| 254 | 251 | ), ' '.strtolower($LANG['index_login']).'</div>'; |
| 255 | 252 | |
@@ -716,7 +713,7 @@ discard block |
||
| 716 | 713 | echo ' |
| 717 | 714 | <div style="margin-bottom:3px;"> |
| 718 | 715 | <label for="login" class="form_label">', isset($SETTINGS['custom_login_text']) && !empty($SETTINGS['custom_login_text']) ? (string) $SETTINGS['custom_login_text'] : $LANG['index_login'], '</label> |
| 719 | - <input type="text" size="10" id="login" name="login" class="input_text text ui-widget-content ui-corner-all" value="' , $username , '" readonly /> |
|
| 716 | + <input type="text" size="10" id="login" name="login" class="input_text text ui-widget-content ui-corner-all" value="' , $username, '" readonly /> |
|
| 720 | 717 | <span id="login_check_wait" style="display:none; float:right;"><i class="fa fa-cog fa-spin fa-1x"></i></span> |
| 721 | 718 | </div>'; |
| 722 | 719 | } else { |
@@ -740,7 +737,7 @@ discard block |
||
| 740 | 737 | </div>'; |
| 741 | 738 | } |
| 742 | 739 | |
| 743 | - if (!(isset($SETTINGS['enable_http_request_login']) === true && $SETTINGS['enable_http_request_login'] === '1' && isset($_SERVER['PHP_AUTH_USER']) === true && !(isset($SETTINGS['maintenance_mode']) === true && $SETTINGS['maintenance_mode'] === '1'))) { |
|
| 740 | + if (!(isset($SETTINGS['enable_http_request_login']) === true && $SETTINGS['enable_http_request_login'] === '1' && isset($_SERVER['PHP_AUTH_USER']) === true && !(isset($SETTINGS['maintenance_mode']) === true && $SETTINGS['maintenance_mode'] === '1'))) { |
|
| 744 | 741 | echo ' |
| 745 | 742 | <div id="connect_pw" style="margin-bottom:3px;"> |
| 746 | 743 | <label for="pw" class="form_label" id="user_pwd">'.$LANG['index_password'].'</label> |
@@ -796,7 +793,7 @@ discard block |
||
| 796 | 793 | <script> |
| 797 | 794 | var seconds = 1; |
| 798 | 795 | function updateLogonButton(timeToGo){ |
| 799 | - document.getElementById("but_identify_user").value = "' . $LANG['duration_login_attempt'] . ' " + timeToGo; |
|
| 796 | + document.getElementById("but_identify_user").value = "' . $LANG['duration_login_attempt'].' " + timeToGo; |
|
| 800 | 797 | } |
| 801 | 798 | $( window ).on( "load", function() { |
| 802 | 799 | updateLogonButton(seconds); |
@@ -878,7 +875,7 @@ discard block |
||
| 878 | 875 | <a href="https://www.reddit.com/r/TeamPass/" target="_blank" style="color:#F0F0F0;" class="tip" title="'.addslashes($LANG['admin_help']).'"><i class="fa fa-reddit-alien"></i></a> |
| 879 | 876 | |
| 880 | 877 | ', ($session_user_id !== null && empty($session_user_id) === false) ? ' |
| 881 | - <a href="#" style="color:#F0F0F0;" class="tip" title="'.addslashes($LANG['bugs_page']).'" onclick="generateBugReport()"><i class="fa fa-bug"></i></a>' : '' ,' |
|
| 878 | + <a href="#" style="color:#F0F0F0;" class="tip" title="'.addslashes($LANG['bugs_page']).'" onclick="generateBugReport()"><i class="fa fa-bug"></i></a>' : '', ' |
|
| 882 | 879 | </div> |
| 883 | 880 | <div style="float:left;width:32%;text-align:center;"> |
| 884 | 881 | ', ($session_user_id !== null && empty($session_user_id) === false) ? '<i class="fa fa-users"></i> '.$session_nb_users_online.' '.$LANG['users_online'].' | <i class="fa fa-hourglass-end"></i> '.$LANG['index_expiration_in'].' <div style="display:inline;" id="countdown"></div>' : '', ' |
@@ -358,7 +358,7 @@ |
||
| 358 | 358 | } |
| 359 | 359 | } |
| 360 | 360 | |
| 361 | - $pdfFile = "renewal_pdf_".date("Y-m-d", mktime(0, 0, 0, (int)date('m'), (int)date('d'), (int)date('y'))).".pdf"; |
|
| 361 | + $pdfFile = "renewal_pdf_".date("Y-m-d", mktime(0, 0, 0, (int) date('m'), (int) date('d'), (int) date('y'))).".pdf"; |
|
| 362 | 362 | //send the file |
| 363 | 363 | $pdf->Output($SETTINGS['path_to_files_folder']."/".$pdfFile); |
| 364 | 364 | |
@@ -180,7 +180,7 @@ discard block |
||
| 180 | 180 | |
| 181 | 181 | // update sessions |
| 182 | 182 | $_SESSION['last_pw'] = $oldPw; |
| 183 | - $_SESSION['last_pw_change'] = mktime(0, 0, 0, (int)date('m'), (int)date('d'), (int)date('y')); |
|
| 183 | + $_SESSION['last_pw_change'] = mktime(0, 0, 0, (int) date('m'), (int) date('d'), (int) date('y')); |
|
| 184 | 184 | $_SESSION['validite_pw'] = true; |
| 185 | 185 | |
| 186 | 186 | // BEfore updating, check that the pwd is correct |
@@ -190,7 +190,7 @@ discard block |
||
| 190 | 190 | prefix_table("users"), |
| 191 | 191 | array( |
| 192 | 192 | 'pw' => $newPw, |
| 193 | - 'last_pw_change' => mktime(0, 0, 0, (int)date('m'), (int)date('d'), (int)date('y')), |
|
| 193 | + 'last_pw_change' => mktime(0, 0, 0, (int) date('m'), (int) date('d'), (int) date('y')), |
|
| 194 | 194 | 'last_pw' => $oldPw |
| 195 | 195 | ), |
| 196 | 196 | "id = %i", |
@@ -208,7 +208,7 @@ discard block |
||
| 208 | 208 | } elseif (null !== filter_input(INPUT_POST, 'change_pw_origine', FILTER_SANITIZE_STRING) |
| 209 | 209 | && ((filter_input(INPUT_POST, 'change_pw_origine', FILTER_SANITIZE_STRING) === "admin_change" |
| 210 | 210 | || filter_input(INPUT_POST, 'change_pw_origine', FILTER_SANITIZE_STRING) === "user_change" |
| 211 | - ) && ($_SESSION['user_admin'] === "1"|| $_SESSION['user_manager'] === "1" |
|
| 211 | + ) && ($_SESSION['user_admin'] === "1" || $_SESSION['user_manager'] === "1" |
|
| 212 | 212 | || $_SESSION['user_can_manage_all_users'] === "1") |
| 213 | 213 | ) |
| 214 | 214 | ) { |
@@ -236,7 +236,7 @@ discard block |
||
| 236 | 236 | prefix_table("users"), |
| 237 | 237 | array( |
| 238 | 238 | 'pw' => $newPw, |
| 239 | - 'last_pw_change' => mktime(0, 0, 0, (int)date('m'), (int)date('d'), (int)date('y')) |
|
| 239 | + 'last_pw_change' => mktime(0, 0, 0, (int) date('m'), (int) date('d'), (int) date('y')) |
|
| 240 | 240 | ), |
| 241 | 241 | "id = %i", |
| 242 | 242 | $dataReceived['user_id'] |
@@ -279,7 +279,7 @@ discard block |
||
| 279 | 279 | prefix_table("users"), |
| 280 | 280 | array( |
| 281 | 281 | 'pw' => $newPw, |
| 282 | - 'last_pw_change' => mktime(0, 0, 0, (int)date('m'), (int)date('d'), (int)date('y')) |
|
| 282 | + 'last_pw_change' => mktime(0, 0, 0, (int) date('m'), (int) date('d'), (int) date('y')) |
|
| 283 | 283 | ), |
| 284 | 284 | "id = %i", |
| 285 | 285 | $_SESSION['user_id'] |
@@ -287,7 +287,7 @@ discard block |
||
| 287 | 287 | |
| 288 | 288 | // update sessions |
| 289 | 289 | $_SESSION['last_pw'] = ""; |
| 290 | - $_SESSION['last_pw_change'] = mktime(0, 0, 0, (int)date('m'), (int)date('d'), (int)date('y')); |
|
| 290 | + $_SESSION['last_pw_change'] = mktime(0, 0, 0, (int) date('m'), (int) date('d'), (int) date('y')); |
|
| 291 | 291 | $_SESSION['validite_pw'] = true; |
| 292 | 292 | |
| 293 | 293 | // update LOG |
@@ -1338,8 +1338,8 @@ discard block |
||
| 1338 | 1338 | if (strpos($line, 'cpassman_url') > 0 && empty($url_found) === true) { |
| 1339 | 1339 | $url_found = substr($line, 19, strlen($line) - 22); |
| 1340 | 1340 | $tmp = parse_url($url_found); |
| 1341 | - $anonym_url = $tmp['scheme'] . '://<anonym_url>' . $tmp['path']; |
|
| 1342 | - $line = "'cpassman_url' => '" . $anonym_url . "\n"; |
|
| 1341 | + $anonym_url = $tmp['scheme'].'://<anonym_url>'.$tmp['path']; |
|
| 1342 | + $line = "'cpassman_url' => '".$anonym_url."\n"; |
|
| 1343 | 1343 | } |
| 1344 | 1344 | |
| 1345 | 1345 | // Anonymize all urls |
@@ -1406,7 +1406,7 @@ discard block |
||
| 1406 | 1406 | |
| 1407 | 1407 | **Teampass configuration file:** |
| 1408 | 1408 | ``` |
| 1409 | -" . $list_of_options . " |
|
| 1409 | +" . $list_of_options." |
|
| 1410 | 1410 | ``` |
| 1411 | 1411 | |
| 1412 | 1412 | **Updated from an older Teampass or fresh install:** |
@@ -1421,12 +1421,12 @@ discard block |
||
| 1421 | 1421 | |
| 1422 | 1422 | #### Web server error log |
| 1423 | 1423 | ``` |
| 1424 | -" . $err['message']." - ".$err['file']." (".$err['line'] .") |
|
| 1424 | +" . $err['message']." - ".$err['file']." (".$err['line'].") |
|
| 1425 | 1425 | ``` |
| 1426 | 1426 | |
| 1427 | 1427 | #### Teampass 10 last system errors |
| 1428 | 1428 | ``` |
| 1429 | -" . $teampass_errors ." |
|
| 1429 | +" . $teampass_errors." |
|
| 1430 | 1430 | ``` |
| 1431 | 1431 | |
| 1432 | 1432 | #### Log from the web-browser developer console (CTRL + SHIFT + i) |
@@ -813,7 +813,7 @@ discard block |
||
| 813 | 813 | } |
| 814 | 814 | // Get IDs of personal folders |
| 815 | 815 | if (isset($SETTINGS['enable_pf_feature']) === true && $SETTINGS['enable_pf_feature'] === '1' |
| 816 | - && isset($_SESSION['personal_folder']) === true && $_SESSION['personal_folder'] === '1' |
|
| 816 | + && isset($_SESSION['personal_folder']) === true && $_SESSION['personal_folder'] === '1' |
|
| 817 | 817 | ) { |
| 818 | 818 | $persoFld = DB::queryfirstrow( |
| 819 | 819 | "SELECT id |
@@ -2089,7 +2089,7 @@ discard block |
||
| 2089 | 2089 | $antiXss = new protect\AntiXSS\AntiXSS(); |
| 2090 | 2090 | |
| 2091 | 2091 | // Protect against bad inputs |
| 2092 | - if (is_array($source_file) ||is_array($target_file)) { |
|
| 2092 | + if (is_array($source_file) || is_array($target_file)) { |
|
| 2093 | 2093 | return 'error_cannot_be_array'; |
| 2094 | 2094 | } |
| 2095 | 2095 | |
@@ -2249,7 +2249,7 @@ discard block |
||
| 2249 | 2249 | $newArr = array(); |
| 2250 | 2250 | |
| 2251 | 2251 | foreach ($arr as $key => $value) { |
| 2252 | - $newArr[ $key ] = (is_array($value) ? array_map_r($func, $value) : (is_array($func) ? call_user_func_array($func, $value) : $func($value))); |
|
| 2252 | + $newArr[$key] = (is_array($value) ? array_map_r($func, $value) : (is_array($func) ? call_user_func_array($func, $value) : $func($value))); |
|
| 2253 | 2253 | } |
| 2254 | 2254 | |
| 2255 | 2255 | return $newArr; |
@@ -2385,16 +2385,16 @@ discard block |
||
| 2385 | 2385 | $mailname = str_replace($domain, '', $email); |
| 2386 | 2386 | $name_l = strlen($mailname); |
| 2387 | 2387 | $domain_l = strlen($domain); |
| 2388 | - for ($i = 0; $i <= $name_l/$prop-1; $i++) { |
|
| 2388 | + for ($i = 0; $i <= $name_l / $prop - 1; $i++) { |
|
| 2389 | 2389 | $start .= 'x'; |
| 2390 | 2390 | } |
| 2391 | 2391 | |
| 2392 | - for ($i = 0; $i <= $domain_l/$prop-1; $i++) { |
|
| 2392 | + for ($i = 0; $i <= $domain_l / $prop - 1; $i++) { |
|
| 2393 | 2393 | $end .= 'x'; |
| 2394 | 2394 | } |
| 2395 | 2395 | |
| 2396 | - return substr_replace($mailname, $start, 2, $name_l/$prop) |
|
| 2397 | - .substr_replace($domain, $end, 2, $domain_l/$prop); |
|
| 2396 | + return substr_replace($mailname, $start, 2, $name_l / $prop) |
|
| 2397 | + .substr_replace($domain, $end, 2, $domain_l / $prop); |
|
| 2398 | 2398 | } |
| 2399 | 2399 | |
| 2400 | 2400 | /** |
@@ -2479,9 +2479,9 @@ discard block |
||
| 2479 | 2479 | |
| 2480 | 2480 | if ($entries['count'] > 0) { |
| 2481 | 2481 | // Now check if group fits |
| 2482 | - for ($i=0; $i<$entries['count']; $i++) { |
|
| 2483 | - $parsr=ldap_explode_dn($entries[$i]['dn'], 0); |
|
| 2484 | - if (str_replace(array('CN=','cn='), '', $parsr[0]) === $SETTINGS['ldap_usergroup']) { |
|
| 2482 | + for ($i = 0; $i < $entries['count']; $i++) { |
|
| 2483 | + $parsr = ldap_explode_dn($entries[$i]['dn'], 0); |
|
| 2484 | + if (str_replace(array('CN=', 'cn='), '', $parsr[0]) === $SETTINGS['ldap_usergroup']) { |
|
| 2485 | 2485 | $GroupRestrictionEnabled = true; |
| 2486 | 2486 | break; |
| 2487 | 2487 | } |
@@ -299,7 +299,7 @@ |
||
| 299 | 299 | $pdf->Ln($h); |
| 300 | 300 | } |
| 301 | 301 | |
| 302 | - $pdf_file = "print_out_pdf_".date("Y-m-d", mktime(0, 0, 0, (int)date('m'), (int)date('d'), (int)date('y')))."_".generateKey().".pdf"; |
|
| 302 | + $pdf_file = "print_out_pdf_".date("Y-m-d", mktime(0, 0, 0, (int) date('m'), (int) date('d'), (int) date('y')))."_".generateKey().".pdf"; |
|
| 303 | 303 | |
| 304 | 304 | //send the file |
| 305 | 305 | $pdf->Output($SETTINGS['path_to_files_folder']."/".$pdf_file); |
@@ -547,7 +547,7 @@ discard block |
||
| 547 | 547 | |
| 548 | 548 | copy( |
| 549 | 549 | SECUREPATH."/teampass-seckey.txt", |
| 550 | - SECUREPATH."/teampass-seckey.txt".'.'.date("Y_m_d", mktime(0, 0, 0, (int)date('m'), (int)date('d'), (int)date('y'))).".".time() |
|
| 550 | + SECUREPATH."/teampass-seckey.txt".'.'.date("Y_m_d", mktime(0, 0, 0, (int) date('m'), (int) date('d'), (int) date('y'))).".".time() |
|
| 551 | 551 | ); |
| 552 | 552 | $superGlobal->put("tp_defuse_new_key", true, "SESSION"); |
| 553 | 553 | $new_salt = defuse_generate_key(); |
@@ -560,7 +560,7 @@ discard block |
||
| 560 | 560 | // update sk.php file |
| 561 | 561 | copy( |
| 562 | 562 | $session_sk_file, |
| 563 | - $session_sk_file.'.'.date("Y_m_d", mktime(0, 0, 0, (int)date('m'), (int)date('d'), (int)date('y'))).".".time() |
|
| 563 | + $session_sk_file.'.'.date("Y_m_d", mktime(0, 0, 0, (int) date('m'), (int) date('d'), (int) date('y'))).".".time() |
|
| 564 | 564 | ); |
| 565 | 565 | $data = file($session_sk_file); // reads an array of lines |
| 566 | 566 | function replace_a_line($data) |
@@ -1102,7 +1102,7 @@ discard block |
||
| 1102 | 1102 | */ |
| 1103 | 1103 | $tp_config_file = "../includes/config/tp.config.php"; |
| 1104 | 1104 | if (file_exists($tp_config_file)) { |
| 1105 | - if (!copy($tp_config_file, $tp_config_file.'.'.date("Y_m_d", mktime(0, 0, 0, (int)date('m'), (int)date('d'), (int)date('y'))))) { |
|
| 1105 | + if (!copy($tp_config_file, $tp_config_file.'.'.date("Y_m_d", mktime(0, 0, 0, (int) date('m'), (int) date('d'), (int) date('y'))))) { |
|
| 1106 | 1106 | echo '[{"error" : "includes/config/tp.config.php file already exists and cannot be renamed. Please do it by yourself and click on button Launch.", "result":"", "index" : "'.$post_index.'", "multiple" : "'.$post_multiple.'"}]'; |
| 1107 | 1107 | return false; |
| 1108 | 1108 | } else { |
@@ -1131,7 +1131,7 @@ discard block |
||
| 1131 | 1131 | utf8_encode( |
| 1132 | 1132 | "<?php |
| 1133 | 1133 | global \$SETTINGS; |
| 1134 | -\$SETTINGS = array (" . $config_text . " |
|
| 1134 | +\$SETTINGS = array (" . $config_text." |
|
| 1135 | 1135 | );" |
| 1136 | 1136 | ) |
| 1137 | 1137 | ); |
@@ -205,7 +205,7 @@ discard block |
||
| 205 | 205 | */ |
| 206 | 206 | $tp_config_file = "../includes/config/tp.config.php"; |
| 207 | 207 | if (file_exists($tp_config_file)) { |
| 208 | - if (!copy($tp_config_file, $tp_config_file.'.'.date("Y_m_d", mktime(0, 0, 0, (int)date('m'), (int)date('d'), (int)date('y'))))) { |
|
| 208 | + if (!copy($tp_config_file, $tp_config_file.'.'.date("Y_m_d", mktime(0, 0, 0, (int) date('m'), (int) date('d'), (int) date('y'))))) { |
|
| 209 | 209 | echo '[{"error" : "includes/config/tp.config.php file already exists and cannot be renamed. Please do it by yourself and click on button Launch.", "result":"", "index" : "'.$post_index.'", "multiple" : "'.$post_multiple.'"}]'; |
| 210 | 210 | return false; |
| 211 | 211 | } else { |
@@ -234,7 +234,7 @@ discard block |
||
| 234 | 234 | utf8_encode( |
| 235 | 235 | "<?php |
| 236 | 236 | global \$SETTINGS; |
| 237 | -\$SETTINGS = array (" . $config_text . " |
|
| 237 | +\$SETTINGS = array (" . $config_text." |
|
| 238 | 238 | );" |
| 239 | 239 | ) |
| 240 | 240 | ); |
@@ -228,15 +228,15 @@ discard block |
||
| 228 | 228 | } |
| 229 | 229 | $tmp = mysqli_num_rows(mysqli_query($dbTmp, "SELECT * FROM `_install` WHERE `key` = 'url_path'")); |
| 230 | 230 | if (intval($tmp) === 0) { |
| 231 | - mysqli_query($dbTmp, "INSERT INTO `_install` (`key`, `value`) VALUES ('url_path', '". empty($session_url_path) ? $db['url_path'] : $session_url_path. "');"); |
|
| 231 | + mysqli_query($dbTmp, "INSERT INTO `_install` (`key`, `value`) VALUES ('url_path', '".empty($session_url_path) ? $db['url_path'] : $session_url_path."');"); |
|
| 232 | 232 | } else { |
| 233 | 233 | mysqli_query($dbTmp, "UPDATE `_install` SET `value` = '", empty($session_url_path) ? $db['url_path'] : $session_url_path, "' WHERE `key` = 'url_path';"); |
| 234 | 234 | } |
| 235 | 235 | $tmp = mysqli_num_rows(mysqli_query($dbTmp, "SELECT * FROM `_install` WHERE `key` = 'abspath'")); |
| 236 | 236 | if (intval($tmp) === 0) { |
| 237 | - mysqli_query($dbTmp, "INSERT INTO `_install` (`key`, `value`) VALUES ('abspath', '". empty($session_abspath) ? $db['abspath'] : $session_abspath. "');"); |
|
| 237 | + mysqli_query($dbTmp, "INSERT INTO `_install` (`key`, `value`) VALUES ('abspath', '".empty($session_abspath) ? $db['abspath'] : $session_abspath."');"); |
|
| 238 | 238 | } else { |
| 239 | - mysqli_query($dbTmp, "UPDATE `_install` SET `value` = '". empty($session_abspath) ? $db['abspath'] : $session_abspath. "' WHERE `key` = 'abspath';"); |
|
| 239 | + mysqli_query($dbTmp, "UPDATE `_install` SET `value` = '".empty($session_abspath) ? $db['abspath'] : $session_abspath."' WHERE `key` = 'abspath';"); |
|
| 240 | 240 | } |
| 241 | 241 | |
| 242 | 242 | echo '[{"error" : "", "result" : "Connection is successful", "multiple" : ""}]'; |
@@ -382,7 +382,7 @@ discard block |
||
| 382 | 382 | // prepare config file |
| 383 | 383 | $tp_config_file = "../includes/config/tp.config.php"; |
| 384 | 384 | if (file_exists($tp_config_file)) { |
| 385 | - if (!copy($tp_config_file, $tp_config_file.'.'.date("Y_m_d", mktime(0, 0, 0, (int)date('m'), (int)date('d'), (int)date('y'))))) { |
|
| 385 | + if (!copy($tp_config_file, $tp_config_file.'.'.date("Y_m_d", mktime(0, 0, 0, (int) date('m'), (int) date('d'), (int) date('y'))))) { |
|
| 386 | 386 | echo '[{"error" : "includes/config/tp.config.php file already exists and cannot be renamed. Please do it by yourself and click on button Launch.", "result":"", "index" : "'.$post_index.'", "multiple" : "'.$post_multiple.'"}]'; |
| 387 | 387 | break; |
| 388 | 388 | } else { |
@@ -1066,7 +1066,7 @@ discard block |
||
| 1066 | 1066 | $filename_seckey = $securePath."/teampass-seckey.txt"; |
| 1067 | 1067 | |
| 1068 | 1068 | if (file_exists($filename_seckey)) { |
| 1069 | - if (!copy($filename_seckey, $filename_seckey.'.'.date("Y_m_d", mktime(0, 0, 0, (int)date('m'), (int)date('d'), (int)date('y'))))) { |
|
| 1069 | + if (!copy($filename_seckey, $filename_seckey.'.'.date("Y_m_d", mktime(0, 0, 0, (int) date('m'), (int) date('d'), (int) date('y'))))) { |
|
| 1070 | 1070 | echo '[{"error" : "File `$filename_seckey` already exists and cannot be renamed. Please do it by yourself and click on button Launch.", "result":"", "index" : "'.$post_index.'", "multiple" : "'.$post_multiple.'"}]'; |
| 1071 | 1071 | break; |
| 1072 | 1072 | } else { |
@@ -1098,7 +1098,7 @@ discard block |
||
| 1098 | 1098 | $filename = "../includes/config/settings.php"; |
| 1099 | 1099 | |
| 1100 | 1100 | if (file_exists($filename)) { |
| 1101 | - if (!copy($filename, $filename.'.'.date("Y_m_d", mktime(0, 0, 0, (int)date('m'), (int)date('d'), (int)date('y'))))) { |
|
| 1101 | + if (!copy($filename, $filename.'.'.date("Y_m_d", mktime(0, 0, 0, (int) date('m'), (int) date('d'), (int) date('y'))))) { |
|
| 1102 | 1102 | echo '[{"error" : "Setting.php file already exists and cannot be renamed. Please do it by yourself and click on button Launch.", "result":"", "index" : "'.$post_index.'", "multiple" : "'.$post_multiple.'"}]'; |
| 1103 | 1103 | break; |
| 1104 | 1104 | } else { |
@@ -1147,7 +1147,7 @@ discard block |
||
| 1147 | 1147 | } elseif ($task === "sk.php") { |
| 1148 | 1148 | //Create sk.php file |
| 1149 | 1149 | if (file_exists($skFile)) { |
| 1150 | - if (!copy($skFile, $skFile.'.'.date("Y_m_d", mktime(0, 0, 0, (int)date('m'), (int)date('d'), (int)date('y'))))) { |
|
| 1150 | + if (!copy($skFile, $skFile.'.'.date("Y_m_d", mktime(0, 0, 0, (int) date('m'), (int) date('d'), (int) date('y'))))) { |
|
| 1151 | 1151 | echo '[{"error" : "sk.php file already exists and cannot be renamed. Please do it by yourself and click on button Launch.", "result":"", "index" : "'.$post_index.'", "multiple" : "'.$post_multiple.'"}]'; |
| 1152 | 1152 | break; |
| 1153 | 1153 | } else { |
@@ -1201,7 +1201,7 @@ discard block |
||
| 1201 | 1201 | $csrfp_file_sample = "../includes/libraries/csrfp/libs/csrfp.config.sample.php"; |
| 1202 | 1202 | $csrfp_file = "../includes/libraries/csrfp/libs/csrfp.config.php"; |
| 1203 | 1203 | if (file_exists($csrfp_file)) { |
| 1204 | - if (!copy($csrfp_file, $csrfp_file.'.'.date("Y_m_d", mktime(0, 0, 0, (int)date('m'), (int)date('d'), (int)date('y'))))) { |
|
| 1204 | + if (!copy($csrfp_file, $csrfp_file.'.'.date("Y_m_d", mktime(0, 0, 0, (int) date('m'), (int) date('d'), (int) date('y'))))) { |
|
| 1205 | 1205 | echo '[{"error" : "csrfp.config.php file already exists and cannot be renamed. Please do it by yourself and click on button Launch.", "result":"", "index" : "'.$post_index.'", "multiple" : "'.$post_multiple.'"}]'; |
| 1206 | 1206 | break; |
| 1207 | 1207 | } else { |
@@ -274,7 +274,7 @@ |
||
| 274 | 274 | $csrfp_file_sample = "../includes/libraries/csrfp/libs/csrfp.config.sample.php"; |
| 275 | 275 | $csrfp_file = "../includes/libraries/csrfp/libs/csrfp.config.php"; |
| 276 | 276 | if (file_exists($csrfp_file)) { |
| 277 | - if (!copy($csrfp_file, $csrfp_file.'.'.date("Y_m_d", mktime(0, 0, 0, (int)date('m'), (int)date('d'), (int)date('y'))))) { |
|
| 277 | + if (!copy($csrfp_file, $csrfp_file.'.'.date("Y_m_d", mktime(0, 0, 0, (int) date('m'), (int) date('d'), (int) date('y'))))) { |
|
| 278 | 278 | echo '[{"finish":"1" , "next":"", "error" : "csrfp.config.php file already exists and cannot be renamed. Please do it by yourself and click on button Launch."}]'; |
| 279 | 279 | return false; |
| 280 | 280 | } else { |