@@ -2226,7 +2226,7 @@ |
||
| 2226 | 2226 | * <tt>exec("find ".$path." -type d -exec chmod 755 {} \;");</tt> |
| 2227 | 2227 | * |
| 2228 | 2228 | * @author Jeppe Toustrup (tenzer at tenzer dot dk) |
| 2229 | - * |
|
| 2229 | + * |
|
| 2230 | 2230 | * @param string $path An either relative or absolute path to a file or directory which should be processed. |
| 2231 | 2231 | * @param int $filePerm The permissions any found files should get. |
| 2232 | 2232 | * @param int $dirPerm The permissions any found folder should get. |
@@ -34,7 +34,7 @@ discard block |
||
| 34 | 34 | $ret = []; |
| 35 | 35 | |
| 36 | 36 | foreach ($rows as $row) { |
| 37 | - $isVisible = in_array((int) $row['id'], $foldersId); |
|
| 37 | + $isVisible = in_array((int) $row['id'], $foldersId); |
|
| 38 | 38 | $childrens = $this->getFoldersChildren($row['id'], $foldersId); |
| 39 | 39 | |
| 40 | 40 | if ($isVisible || count($childrens) > 0) { |
@@ -43,7 +43,7 @@ discard block |
||
| 43 | 43 | [ |
| 44 | 44 | 'id' => (int) $row['id'], |
| 45 | 45 | 'title' => $row['title'], |
| 46 | - 'isVisible' => $isVisible, |
|
| 46 | + 'isVisible' => $isVisible, |
|
| 47 | 47 | 'childrens' => $childrens |
| 48 | 48 | ] |
| 49 | 49 | ); |
@@ -63,7 +63,7 @@ discard block |
||
| 63 | 63 | |
| 64 | 64 | if ( count($childrens) > 0) { |
| 65 | 65 | foreach ($childrens as $children) { |
| 66 | - $isVisible = in_array((int) $children['id'], $foldersId); |
|
| 66 | + $isVisible = in_array((int) $children['id'], $foldersId); |
|
| 67 | 67 | $childs = $this->getFoldersChildren($children['id'], $foldersId); |
| 68 | 68 | |
| 69 | 69 | if (in_array((int) $children['id'], $foldersId) || count($childs) > 0) { |
@@ -72,7 +72,7 @@ discard block |
||
| 72 | 72 | [ |
| 73 | 73 | 'id' => (int) $children['id'], |
| 74 | 74 | 'title' => $children['title'], |
| 75 | - 'isVisible' => $isVisible, |
|
| 75 | + 'isVisible' => $isVisible, |
|
| 76 | 76 | 'childrens' => $childs |
| 77 | 77 | ] |
| 78 | 78 | ); |
@@ -37,45 +37,45 @@ discard block |
||
| 37 | 37 | * @return boolean |
| 38 | 38 | */ |
| 39 | 39 | function is_jwt_valid($jwt) { |
| 40 | - try { |
|
| 41 | - $decoded = (array) JWT::decode($jwt, new Key(DB_PASSWD, 'HS256')); |
|
| 40 | + try { |
|
| 41 | + $decoded = (array) JWT::decode($jwt, new Key(DB_PASSWD, 'HS256')); |
|
| 42 | 42 | |
| 43 | - // Check if expiration is reached |
|
| 44 | - if ($decoded['exp'] - time() < 0) { |
|
| 45 | - return false; |
|
| 46 | - } |
|
| 43 | + // Check if expiration is reached |
|
| 44 | + if ($decoded['exp'] - time() < 0) { |
|
| 45 | + return false; |
|
| 46 | + } |
|
| 47 | 47 | /* |
| 48 | 48 | $decoded1 = JWT::decode($jwt, new Key(DB_PASSWD, 'HS256'), $headers = new stdClass()); |
| 49 | 49 | print_r($headers); |
| 50 | 50 | */ |
| 51 | 51 | |
| 52 | - return true; |
|
| 53 | - } catch (InvalidArgumentException $e) { |
|
| 54 | - // provided key/key-array is empty or malformed. |
|
| 55 | - return false; |
|
| 56 | - } catch (DomainException $e) { |
|
| 57 | - // provided algorithm is unsupported OR |
|
| 58 | - // provided key is invalid OR |
|
| 59 | - // unknown error thrown in openSSL or libsodium OR |
|
| 60 | - // libsodium is required but not available. |
|
| 61 | - return false; |
|
| 62 | - } catch (SignatureInvalidException $e) { |
|
| 63 | - // provided JWT signature verification failed. |
|
| 64 | - return false; |
|
| 65 | - } catch (BeforeValidException $e) { |
|
| 66 | - // provided JWT is trying to be used before "nbf" claim OR |
|
| 67 | - // provided JWT is trying to be used before "iat" claim. |
|
| 68 | - return false; |
|
| 69 | - } catch (ExpiredException $e) { |
|
| 70 | - // provided JWT is trying to be used after "exp" claim. |
|
| 71 | - return false; |
|
| 72 | - } catch (UnexpectedValueException $e) { |
|
| 73 | - // provided JWT is malformed OR |
|
| 74 | - // provided JWT is missing an algorithm / using an unsupported algorithm OR |
|
| 75 | - // provided JWT algorithm does not match provided key OR |
|
| 76 | - // provided key ID in key/key-array is empty or invalid. |
|
| 77 | - return false; |
|
| 78 | - } |
|
| 52 | + return true; |
|
| 53 | + } catch (InvalidArgumentException $e) { |
|
| 54 | + // provided key/key-array is empty or malformed. |
|
| 55 | + return false; |
|
| 56 | + } catch (DomainException $e) { |
|
| 57 | + // provided algorithm is unsupported OR |
|
| 58 | + // provided key is invalid OR |
|
| 59 | + // unknown error thrown in openSSL or libsodium OR |
|
| 60 | + // libsodium is required but not available. |
|
| 61 | + return false; |
|
| 62 | + } catch (SignatureInvalidException $e) { |
|
| 63 | + // provided JWT signature verification failed. |
|
| 64 | + return false; |
|
| 65 | + } catch (BeforeValidException $e) { |
|
| 66 | + // provided JWT is trying to be used before "nbf" claim OR |
|
| 67 | + // provided JWT is trying to be used before "iat" claim. |
|
| 68 | + return false; |
|
| 69 | + } catch (ExpiredException $e) { |
|
| 70 | + // provided JWT is trying to be used after "exp" claim. |
|
| 71 | + return false; |
|
| 72 | + } catch (UnexpectedValueException $e) { |
|
| 73 | + // provided JWT is malformed OR |
|
| 74 | + // provided JWT is missing an algorithm / using an unsupported algorithm OR |
|
| 75 | + // provided JWT algorithm does not match provided key OR |
|
| 76 | + // provided key ID in key/key-array is empty or invalid. |
|
| 77 | + return false; |
|
| 78 | + } |
|
| 79 | 79 | } |
| 80 | 80 | |
| 81 | 81 | function base64url_encode($data) { |
@@ -83,24 +83,24 @@ discard block |
||
| 83 | 83 | } |
| 84 | 84 | |
| 85 | 85 | function get_authorization_header(){ |
| 86 | - $superGlobal = new SuperGlobal(); |
|
| 87 | - $headers = null; |
|
| 86 | + $superGlobal = new SuperGlobal(); |
|
| 87 | + $headers = null; |
|
| 88 | 88 | |
| 89 | - if (null !== $superGlobal->get('Authorization', 'SERVER')) { |
|
| 90 | - $headers = trim($superGlobal->get('Authorization', 'SERVER')); |
|
| 91 | - } else if (null !== $superGlobal->get('HTTP_AUTHORIZATION', 'SERVER')) { //Nginx or fast CGI |
|
| 92 | - $headers = trim($superGlobal->get('HTTP_AUTHORIZATION', 'SERVER')); |
|
| 93 | - } else if (function_exists('apache_request_headers') === true) { |
|
| 94 | - $requestHeaders = (array) apache_request_headers(); |
|
| 95 | - // Server-side fix for bug in old Android versions (a nice side-effect of this fix means we don't care about capitalization for Authorization) |
|
| 96 | - $requestHeaders = array_combine(array_map('ucwords', array_keys($requestHeaders)), array_values($requestHeaders)); |
|
| 97 | - //print_r($requestHeaders); |
|
| 98 | - if (isset($requestHeaders['Authorization']) === true) { |
|
| 99 | - $headers = trim($requestHeaders['Authorization']); |
|
| 100 | - } |
|
| 101 | - } |
|
| 89 | + if (null !== $superGlobal->get('Authorization', 'SERVER')) { |
|
| 90 | + $headers = trim($superGlobal->get('Authorization', 'SERVER')); |
|
| 91 | + } else if (null !== $superGlobal->get('HTTP_AUTHORIZATION', 'SERVER')) { //Nginx or fast CGI |
|
| 92 | + $headers = trim($superGlobal->get('HTTP_AUTHORIZATION', 'SERVER')); |
|
| 93 | + } else if (function_exists('apache_request_headers') === true) { |
|
| 94 | + $requestHeaders = (array) apache_request_headers(); |
|
| 95 | + // Server-side fix for bug in old Android versions (a nice side-effect of this fix means we don't care about capitalization for Authorization) |
|
| 96 | + $requestHeaders = array_combine(array_map('ucwords', array_keys($requestHeaders)), array_values($requestHeaders)); |
|
| 97 | + //print_r($requestHeaders); |
|
| 98 | + if (isset($requestHeaders['Authorization']) === true) { |
|
| 99 | + $headers = trim($requestHeaders['Authorization']); |
|
| 100 | + } |
|
| 101 | + } |
|
| 102 | 102 | |
| 103 | - return $headers; |
|
| 103 | + return $headers; |
|
| 104 | 104 | } |
| 105 | 105 | |
| 106 | 106 | function get_bearer_token() { |
@@ -117,8 +117,8 @@ discard block |
||
| 117 | 117 | |
| 118 | 118 | function get_bearer_data($jwt) { |
| 119 | 119 | // split the jwt |
| 120 | - $tokenParts = explode('.', $jwt); |
|
| 121 | - $payload = base64_decode($tokenParts[1]); |
|
| 120 | + $tokenParts = explode('.', $jwt); |
|
| 121 | + $payload = base64_decode($tokenParts[1]); |
|
| 122 | 122 | |
| 123 | 123 | // HEADER: Get the access token from the header |
| 124 | 124 | if (empty($payload) === false) { |
@@ -133,7 +133,7 @@ |
||
| 133 | 133 | { |
| 134 | 134 | include API_ROOT_PATH . '/../includes/config/tp.config.php'; |
| 135 | 135 | |
| 136 | - $payload = [ |
|
| 136 | + $payload = [ |
|
| 137 | 137 | 'username' => $login, |
| 138 | 138 | 'id' => $id, |
| 139 | 139 | 'exp' => (time() + $SETTINGS['api_token_duration'] + 600), |
@@ -78,7 +78,7 @@ |
||
| 78 | 78 | $database, |
| 79 | 79 | $port |
| 80 | 80 | ); |
| 81 | - $db_link->set_charset(DB_ENCODING); |
|
| 81 | + $db_link->set_charset(DB_ENCODING); |
|
| 82 | 82 | } else { |
| 83 | 83 | $res = 'Impossible to get connected to server. Error is: '.addslashes(mysqli_connect_error()); |
| 84 | 84 | echo '[{"finish":"1", "error":"Impossible to get connected to server. Error is: '.addslashes(mysqli_connect_error()).'!"}]'; |
@@ -66,7 +66,7 @@ discard block |
||
| 66 | 66 | |
| 67 | 67 | // Do we need to rewrite the settings.php file? |
| 68 | 68 | if (defined("DB_PASSWD") === false) { |
| 69 | - $settingsFile = '../includes/config/settings.php'; |
|
| 69 | + $settingsFile = '../includes/config/settings.php'; |
|
| 70 | 70 | if (null !== SECUREPATH) { //3.0.0.23 |
| 71 | 71 | //Do a copy of the existing file |
| 72 | 72 | if (!copy( |
@@ -191,17 +191,17 @@ discard block |
||
| 191 | 191 | define("SECUREPATH", "' . str_replace('\\', '\\\\', SECUREPATH) . '");'; |
| 192 | 192 | define("SECUREFILE", "' . SECUREFILE. '"); |
| 193 | 193 | |
| 194 | - if (defined('IKEY') === true) $settingsTxt .= ' |
|
| 194 | + if (defined('IKEY') === true) $settingsTxt .= ' |
|
| 195 | 195 | define("IKEY", "' . IKEY . '");'; |
| 196 | - else $settingsTxt .= ' |
|
| 196 | + else $settingsTxt .= ' |
|
| 197 | 197 | define("IKEY", "");'; |
| 198 | - if (defined('SKEY') === true) $settingsTxt .= ' |
|
| 198 | + if (defined('SKEY') === true) $settingsTxt .= ' |
|
| 199 | 199 | define("SKEY", "' . SKEY . '");'; |
| 200 | - else $settingsTxt .= ' |
|
| 200 | + else $settingsTxt .= ' |
|
| 201 | 201 | define("SKEY", "");'; |
| 202 | - if (defined('HOST') === true) $settingsTxt .= ' |
|
| 202 | + if (defined('HOST') === true) $settingsTxt .= ' |
|
| 203 | 203 | define("HOST", "' . HOST . '");'; |
| 204 | - else $settingsTxt .= ' |
|
| 204 | + else $settingsTxt .= ' |
|
| 205 | 205 | define("HOST", "");'; |
| 206 | 206 | |
| 207 | 207 | |
@@ -39,68 +39,68 @@ discard block |
||
| 39 | 39 | |
| 40 | 40 | <body> |
| 41 | 41 | <?php |
| 42 | - // define root path |
|
| 43 | - $abs_path = rtrim( |
|
| 44 | - filter_var($_SERVER['DOCUMENT_ROOT'], FILTER_SANITIZE_FULL_SPECIAL_CHARS), |
|
| 45 | - '/' |
|
| 46 | - ) . substr( |
|
| 47 | - filter_var($_SERVER['PHP_SELF'], FILTER_SANITIZE_FULL_SPECIAL_CHARS), |
|
| 48 | - 0, |
|
| 49 | - strlen(filter_var($_SERVER['PHP_SELF'], FILTER_SANITIZE_FULL_SPECIAL_CHARS)) - 20 |
|
| 50 | - ); |
|
| 51 | - if (isset($_SERVER['HTTPS'])) { |
|
| 52 | - $protocol = 'https://'; |
|
| 53 | - } else { |
|
| 54 | - $protocol = 'http://'; |
|
| 55 | - } |
|
| 42 | + // define root path |
|
| 43 | + $abs_path = rtrim( |
|
| 44 | + filter_var($_SERVER['DOCUMENT_ROOT'], FILTER_SANITIZE_FULL_SPECIAL_CHARS), |
|
| 45 | + '/' |
|
| 46 | + ) . substr( |
|
| 47 | + filter_var($_SERVER['PHP_SELF'], FILTER_SANITIZE_FULL_SPECIAL_CHARS), |
|
| 48 | + 0, |
|
| 49 | + strlen(filter_var($_SERVER['PHP_SELF'], FILTER_SANITIZE_FULL_SPECIAL_CHARS)) - 20 |
|
| 50 | + ); |
|
| 51 | + if (isset($_SERVER['HTTPS'])) { |
|
| 52 | + $protocol = 'https://'; |
|
| 53 | + } else { |
|
| 54 | + $protocol = 'http://'; |
|
| 55 | + } |
|
| 56 | 56 | |
| 57 | 57 | |
| 58 | - $post_step = filter_input(INPUT_POST, 'step', FILTER_SANITIZE_NUMBER_INT); |
|
| 59 | - $post_db_host = filter_input(INPUT_POST, 'db_host', FILTER_SANITIZE_FULL_SPECIAL_CHARS); |
|
| 60 | - if (empty($post_db_host) === true) { |
|
| 61 | - $post_db_host = filter_input(INPUT_POST, 'hid_db_host', FILTER_SANITIZE_FULL_SPECIAL_CHARS); |
|
| 62 | - } |
|
| 63 | - $post_db_login = filter_input(INPUT_POST, 'db_login', FILTER_SANITIZE_FULL_SPECIAL_CHARS); |
|
| 64 | - if (empty($post_db_login) === true) { |
|
| 65 | - $post_db_login = filter_input(INPUT_POST, 'hid_db_login', FILTER_SANITIZE_FULL_SPECIAL_CHARS); |
|
| 66 | - } |
|
| 67 | - $post_db_pwd = filter_input(INPUT_POST, 'db_pwd', FILTER_SANITIZE_FULL_SPECIAL_CHARS); |
|
| 68 | - if (empty($post_db_pwd) === true) { |
|
| 69 | - $post_db_pwd = filter_input(INPUT_POST, 'hid_db_pwd', FILTER_SANITIZE_FULL_SPECIAL_CHARS); |
|
| 70 | - } |
|
| 71 | - $post_db_port = filter_input(INPUT_POST, 'db_port', FILTER_SANITIZE_FULL_SPECIAL_CHARS); |
|
| 72 | - if (empty($post_db_port) === true) { |
|
| 73 | - $post_db_port = filter_input(INPUT_POST, 'hid_db_port', FILTER_SANITIZE_FULL_SPECIAL_CHARS); |
|
| 74 | - } |
|
| 75 | - $post_db_bdd = filter_input(INPUT_POST, 'db_bdd', FILTER_SANITIZE_FULL_SPECIAL_CHARS); |
|
| 76 | - if (empty($post_db_bdd) === true) { |
|
| 77 | - $post_db_bdd = filter_input(INPUT_POST, 'hid_db_bdd', FILTER_SANITIZE_FULL_SPECIAL_CHARS); |
|
| 78 | - } |
|
| 79 | - $post_db_pre = filter_input(INPUT_POST, 'db_pre', FILTER_SANITIZE_FULL_SPECIAL_CHARS); |
|
| 80 | - if (empty($post_db_pre) === true) { |
|
| 81 | - $post_db_pre = filter_input(INPUT_POST, 'hid_db_pre', FILTER_SANITIZE_FULL_SPECIAL_CHARS); |
|
| 82 | - } |
|
| 83 | - $post_absolute_path = filter_input(INPUT_POST, 'absolute_path', FILTER_SANITIZE_FULL_SPECIAL_CHARS); |
|
| 84 | - if (empty($post_absolute_path) === true) { |
|
| 85 | - $post_absolute_path = filter_input(INPUT_POST, 'hid_absolute_path', FILTER_SANITIZE_FULL_SPECIAL_CHARS); |
|
| 86 | - } |
|
| 87 | - $post_url_path = filter_input(INPUT_POST, 'url_path', FILTER_SANITIZE_FULL_SPECIAL_CHARS); |
|
| 88 | - if (empty($post_url_path) === true) { |
|
| 89 | - $post_url_path = filter_input(INPUT_POST, 'hid_url_path', FILTER_SANITIZE_FULL_SPECIAL_CHARS); |
|
| 90 | - } |
|
| 91 | - $post_sk_path = filter_input(INPUT_POST, 'sk_path', FILTER_SANITIZE_FULL_SPECIAL_CHARS); |
|
| 92 | - if (empty($post_sk_path) === true) { |
|
| 93 | - $post_sk_path = filter_input(INPUT_POST, 'hid_sk_path', FILTER_SANITIZE_FULL_SPECIAL_CHARS); |
|
| 94 | - } |
|
| 58 | + $post_step = filter_input(INPUT_POST, 'step', FILTER_SANITIZE_NUMBER_INT); |
|
| 59 | + $post_db_host = filter_input(INPUT_POST, 'db_host', FILTER_SANITIZE_FULL_SPECIAL_CHARS); |
|
| 60 | + if (empty($post_db_host) === true) { |
|
| 61 | + $post_db_host = filter_input(INPUT_POST, 'hid_db_host', FILTER_SANITIZE_FULL_SPECIAL_CHARS); |
|
| 62 | + } |
|
| 63 | + $post_db_login = filter_input(INPUT_POST, 'db_login', FILTER_SANITIZE_FULL_SPECIAL_CHARS); |
|
| 64 | + if (empty($post_db_login) === true) { |
|
| 65 | + $post_db_login = filter_input(INPUT_POST, 'hid_db_login', FILTER_SANITIZE_FULL_SPECIAL_CHARS); |
|
| 66 | + } |
|
| 67 | + $post_db_pwd = filter_input(INPUT_POST, 'db_pwd', FILTER_SANITIZE_FULL_SPECIAL_CHARS); |
|
| 68 | + if (empty($post_db_pwd) === true) { |
|
| 69 | + $post_db_pwd = filter_input(INPUT_POST, 'hid_db_pwd', FILTER_SANITIZE_FULL_SPECIAL_CHARS); |
|
| 70 | + } |
|
| 71 | + $post_db_port = filter_input(INPUT_POST, 'db_port', FILTER_SANITIZE_FULL_SPECIAL_CHARS); |
|
| 72 | + if (empty($post_db_port) === true) { |
|
| 73 | + $post_db_port = filter_input(INPUT_POST, 'hid_db_port', FILTER_SANITIZE_FULL_SPECIAL_CHARS); |
|
| 74 | + } |
|
| 75 | + $post_db_bdd = filter_input(INPUT_POST, 'db_bdd', FILTER_SANITIZE_FULL_SPECIAL_CHARS); |
|
| 76 | + if (empty($post_db_bdd) === true) { |
|
| 77 | + $post_db_bdd = filter_input(INPUT_POST, 'hid_db_bdd', FILTER_SANITIZE_FULL_SPECIAL_CHARS); |
|
| 78 | + } |
|
| 79 | + $post_db_pre = filter_input(INPUT_POST, 'db_pre', FILTER_SANITIZE_FULL_SPECIAL_CHARS); |
|
| 80 | + if (empty($post_db_pre) === true) { |
|
| 81 | + $post_db_pre = filter_input(INPUT_POST, 'hid_db_pre', FILTER_SANITIZE_FULL_SPECIAL_CHARS); |
|
| 82 | + } |
|
| 83 | + $post_absolute_path = filter_input(INPUT_POST, 'absolute_path', FILTER_SANITIZE_FULL_SPECIAL_CHARS); |
|
| 84 | + if (empty($post_absolute_path) === true) { |
|
| 85 | + $post_absolute_path = filter_input(INPUT_POST, 'hid_absolute_path', FILTER_SANITIZE_FULL_SPECIAL_CHARS); |
|
| 86 | + } |
|
| 87 | + $post_url_path = filter_input(INPUT_POST, 'url_path', FILTER_SANITIZE_FULL_SPECIAL_CHARS); |
|
| 88 | + if (empty($post_url_path) === true) { |
|
| 89 | + $post_url_path = filter_input(INPUT_POST, 'hid_url_path', FILTER_SANITIZE_FULL_SPECIAL_CHARS); |
|
| 90 | + } |
|
| 91 | + $post_sk_path = filter_input(INPUT_POST, 'sk_path', FILTER_SANITIZE_FULL_SPECIAL_CHARS); |
|
| 92 | + if (empty($post_sk_path) === true) { |
|
| 93 | + $post_sk_path = filter_input(INPUT_POST, 'hid_sk_path', FILTER_SANITIZE_FULL_SPECIAL_CHARS); |
|
| 94 | + } |
|
| 95 | 95 | |
| 96 | - // Get some data |
|
| 97 | - include "../includes/config/include.php"; |
|
| 96 | + // Get some data |
|
| 97 | + include "../includes/config/include.php"; |
|
| 98 | 98 | |
| 99 | - // # LOADER |
|
| 100 | - echo ' |
|
| 99 | + // # LOADER |
|
| 100 | + echo ' |
|
| 101 | 101 | <div style="position:absolute;top:49%;left:49%;display:none;z-index:9999999;" id="loader"><img src="images/76.gif" /></div>'; |
| 102 | - // # HEADER ## |
|
| 103 | - echo ' |
|
| 102 | + // # HEADER ## |
|
| 103 | + echo ' |
|
| 104 | 104 | <div id="top"> |
| 105 | 105 | <div id="logo" class="lcol"><img src="../includes/images/teampass-logo2-home.png" /></div> |
| 106 | 106 | <div class="lcol"> |
@@ -131,9 +131,9 @@ discard block |
||
| 131 | 131 | </h3> |
| 132 | 132 | </div> |
| 133 | 133 | <div class="card-body">'; |
| 134 | - if (!isset($_GET['step']) && !isset($post_step)) { |
|
| 135 | - //ETAPE O |
|
| 136 | - echo ' |
|
| 134 | + if (!isset($_GET['step']) && !isset($post_step)) { |
|
| 135 | + //ETAPE O |
|
| 136 | + echo ' |
|
| 137 | 137 | <div class="row"> |
| 138 | 138 | <div class="callout callout-warning col-12"> |
| 139 | 139 | <h5><i class="fas fa-info-circle text-warning mr-2"></i>Welcome to Teampass installation</h5> |
@@ -159,13 +159,13 @@ discard block |
||
| 159 | 159 | <p><a class="text-primary" target="_blank" href="https://spdx.org/licenses/GPL-3.0-only.html#licenseText">Read complete license</a> |
| 160 | 160 | </div> |
| 161 | 161 | </div>'; |
| 162 | - // STEP1 |
|
| 163 | - } elseif ((isset($post_step) && $post_step == 2) |
|
| 164 | - || (isset($_GET['step']) && $_GET['step'] == 2) |
|
| 165 | - && $post_user_granted === '1' |
|
| 166 | - ) { |
|
| 167 | - //ETAPE 1 |
|
| 168 | - echo ' |
|
| 162 | + // STEP1 |
|
| 163 | + } elseif ((isset($post_step) && $post_step == 2) |
|
| 164 | + || (isset($_GET['step']) && $_GET['step'] == 2) |
|
| 165 | + && $post_user_granted === '1' |
|
| 166 | + ) { |
|
| 167 | + //ETAPE 1 |
|
| 168 | + echo ' |
|
| 169 | 169 | <div class="row"> |
| 170 | 170 | <div class="col-12"> |
| 171 | 171 | <div class="card card-primary"> |
@@ -186,7 +186,7 @@ discard block |
||
| 186 | 186 | </div> |
| 187 | 187 | </div>'; |
| 188 | 188 | |
| 189 | - echo ' |
|
| 189 | + echo ' |
|
| 190 | 190 | <div class="row"> |
| 191 | 191 | <div class="col-12"> |
| 192 | 192 | <div class="card card-primary"> |
@@ -225,13 +225,13 @@ discard block |
||
| 225 | 225 | </div> |
| 226 | 226 | </div> |
| 227 | 227 | </div>'; |
| 228 | - // STEP2 |
|
| 229 | - } elseif ((isset($post_step) && $post_step == 3) |
|
| 230 | - || (isset($_GET['step']) && $_GET['step'] == 3) |
|
| 231 | - && $post_user_granted === '1' |
|
| 232 | - ) { |
|
| 233 | - //ETAPE 2 |
|
| 234 | - echo ' |
|
| 228 | + // STEP2 |
|
| 229 | + } elseif ((isset($post_step) && $post_step == 3) |
|
| 230 | + || (isset($_GET['step']) && $_GET['step'] == 3) |
|
| 231 | + && $post_user_granted === '1' |
|
| 232 | + ) { |
|
| 233 | + //ETAPE 2 |
|
| 234 | + echo ' |
|
| 235 | 235 | <div class="row"> |
| 236 | 236 | <div class="col-12"> |
| 237 | 237 | <div class="card card-primary"> |
@@ -268,13 +268,13 @@ discard block |
||
| 268 | 268 | </div> |
| 269 | 269 | </div>'; |
| 270 | 270 | |
| 271 | - // STEP3 |
|
| 272 | - } elseif ((isset($post_step) && $post_step == 4) |
|
| 273 | - || (isset($_GET['step']) && $_GET['step'] == 4) |
|
| 274 | - && $post_user_granted === '1' |
|
| 275 | - ) { |
|
| 276 | - //ETAPE 3 |
|
| 277 | - echo ' |
|
| 271 | + // STEP3 |
|
| 272 | + } elseif ((isset($post_step) && $post_step == 4) |
|
| 273 | + || (isset($_GET['step']) && $_GET['step'] == 4) |
|
| 274 | + && $post_user_granted === '1' |
|
| 275 | + ) { |
|
| 276 | + //ETAPE 3 |
|
| 277 | + echo ' |
|
| 278 | 278 | <div class="row"> |
| 279 | 279 | <div class="col-12"> |
| 280 | 280 | <div class="card card-primary"> |
@@ -310,13 +310,13 @@ discard block |
||
| 310 | 310 | </div>'; |
| 311 | 311 | |
| 312 | 312 | |
| 313 | - // STEP4 |
|
| 314 | - } elseif ((isset($post_step) && $post_step == 5) |
|
| 315 | - || (isset($_GET['step']) && $_GET['step'] == 5) |
|
| 316 | - && $post_user_granted === '1' |
|
| 317 | - ) { |
|
| 318 | - //ETAPE 4 |
|
| 319 | - echo ' |
|
| 313 | + // STEP4 |
|
| 314 | + } elseif ((isset($post_step) && $post_step == 5) |
|
| 315 | + || (isset($_GET['step']) && $_GET['step'] == 5) |
|
| 316 | + && $post_user_granted === '1' |
|
| 317 | + ) { |
|
| 318 | + //ETAPE 4 |
|
| 319 | + echo ' |
|
| 320 | 320 | <div class="row"> |
| 321 | 321 | <div class="col-12"> |
| 322 | 322 | <div class="card card-primary"> |
@@ -330,13 +330,13 @@ discard block |
||
| 330 | 330 | </div> |
| 331 | 331 | </div>'; |
| 332 | 332 | |
| 333 | - // STEP5 |
|
| 334 | - } elseif ((isset($post_step) && $post_step == 6) |
|
| 335 | - || (isset($_GET['step']) && $_GET['step'] == 6) |
|
| 336 | - && $post_user_granted === '1' |
|
| 337 | - ) { |
|
| 338 | - //ETAPE 5 |
|
| 339 | - echo ' |
|
| 333 | + // STEP5 |
|
| 334 | + } elseif ((isset($post_step) && $post_step == 6) |
|
| 335 | + || (isset($_GET['step']) && $_GET['step'] == 6) |
|
| 336 | + && $post_user_granted === '1' |
|
| 337 | + ) { |
|
| 338 | + //ETAPE 5 |
|
| 339 | + echo ' |
|
| 340 | 340 | <div class="row"> |
| 341 | 341 | <div class="col-12"> |
| 342 | 342 | <div class="card card-primary"> |
@@ -357,13 +357,13 @@ discard block |
||
| 357 | 357 | </div> |
| 358 | 358 | </div>'; |
| 359 | 359 | |
| 360 | - // STEP6 |
|
| 361 | - } elseif ((isset($post_step) && $post_step == 7) |
|
| 362 | - || (isset($_GET['step']) && $_GET['step'] == 7) |
|
| 363 | - && $post_user_granted === '1' |
|
| 364 | - ) { |
|
| 365 | - //ETAPE 6 |
|
| 366 | - echo ' |
|
| 360 | + // STEP6 |
|
| 361 | + } elseif ((isset($post_step) && $post_step == 7) |
|
| 362 | + || (isset($_GET['step']) && $_GET['step'] == 7) |
|
| 363 | + && $post_user_granted === '1' |
|
| 364 | + ) { |
|
| 365 | + //ETAPE 6 |
|
| 366 | + echo ' |
|
| 367 | 367 | <div class="row"> |
| 368 | 368 | <div class="callout callout-primary col-12"> |
| 369 | 369 | <h4>Thank you for installing <b>Teampass</b>.</h4> |
@@ -391,32 +391,32 @@ discard block |
||
| 391 | 391 | </div> |
| 392 | 392 | </div> |
| 393 | 393 | </div>'; |
| 394 | - } |
|
| 394 | + } |
|
| 395 | 395 | |
| 396 | - echo ' |
|
| 396 | + echo ' |
|
| 397 | 397 | </div> |
| 398 | 398 | <div class="card-footer">'; |
| 399 | - //buttons |
|
| 400 | - if (!isset($post_step)) { |
|
| 401 | - echo ' |
|
| 399 | + //buttons |
|
| 400 | + if (!isset($post_step)) { |
|
| 401 | + echo ' |
|
| 402 | 402 | <input type="button" class="btn btn-primary" id="but_next" target_id="2" class="button" value="START" /> |
| 403 | 403 | <input type="button" class="btn btn-primary" id="but_start" onclick="document.location = \'' . $protocol . $_SERVER['HTTP_HOST'] . substr($_SERVER['PHP_SELF'], 0, strrpos($_SERVER['PHP_SELF'], '/') - 8) . '\'" class="button" style="display: none;" value="Start" />'; |
| 404 | - } elseif ($post_step == 7) { |
|
| 405 | - // Nothong to do |
|
| 406 | - } else { |
|
| 407 | - echo ' |
|
| 404 | + } elseif ($post_step == 7) { |
|
| 405 | + // Nothong to do |
|
| 406 | + } else { |
|
| 407 | + echo ' |
|
| 408 | 408 | <input type="button" id="but_launch" onclick="checkPage(\'step' . $post_step . '\')" class="btn btn-primary" value="START" /> |
| 409 | 409 | <input type="button" id="but_next" target_id="' . (intval($post_step) + 1) . '" class="btn btn-primary" value="NEXT" disabled="disabled"> |
| 410 | 410 | <input type="button" class="btn btn-primary" id="but_restart" onclick="document.location = \'install.php\'" class="button" value="RESTART" />'; |
| 411 | - } |
|
| 411 | + } |
|
| 412 | 412 | |
| 413 | - echo ' |
|
| 413 | + echo ' |
|
| 414 | 414 | </div> |
| 415 | 415 | </form> |
| 416 | 416 | </div>'; |
| 417 | 417 | |
| 418 | - //FOOTER |
|
| 419 | - echo ' |
|
| 418 | + //FOOTER |
|
| 419 | + echo ' |
|
| 420 | 420 | <div id="footer"> |
| 421 | 421 | <div style="width:500px; font-size:16px;"> |
| 422 | 422 | ' . TP_TOOL_NAME . ' ' . TP_VERSION . ' <i class="far fa-copyright"></i> copyright 2009-2019 |
@@ -424,7 +424,7 @@ discard block |
||
| 424 | 424 | <div style="float:right;margin-top:-15px;"> |
| 425 | 425 | </div> |
| 426 | 426 | </div>'; |
| 427 | - ?> |
|
| 427 | + ?> |
|
| 428 | 428 | </body> |
| 429 | 429 | |
| 430 | 430 | </html> |
@@ -79,7 +79,7 @@ |
||
| 79 | 79 | $database, |
| 80 | 80 | $port |
| 81 | 81 | ); |
| 82 | - $db_link->set_charset(DB_ENCODING); |
|
| 82 | + $db_link->set_charset(DB_ENCODING); |
|
| 83 | 83 | } else { |
| 84 | 84 | $res = "Impossible to get connected to server. Error is: ".addslashes(mysqli_connect_error()); |
| 85 | 85 | echo '[{"finish":"1", "error":"Impossible to get connected to server. Error is: '.addslashes(mysqli_connect_error()).'!"}]'; |
@@ -2,28 +2,28 @@ |
||
| 2 | 2 | |
| 3 | 3 | declare(strict_types=1); |
| 4 | 4 | |
| 5 | - /** |
|
| 6 | - * Teampass - a collaborative passwords manager. |
|
| 7 | - * --- |
|
| 8 | - * This library is distributed in the hope that it will be useful, |
|
| 9 | - * but WITHOUT ANY WARRANTY; without even the implied warranty of |
|
| 10 | - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. |
|
| 11 | - * --- |
|
| 12 | - * |
|
| 13 | - * @project Teampass |
|
| 14 | - * |
|
| 15 | - * @file search.js.php |
|
| 16 | - * --- |
|
| 17 | - * |
|
| 18 | - * @author Nils Laumaillé ([email protected]) |
|
| 19 | - * |
|
| 20 | - * @copyright 2009-2023 Teampass.net |
|
| 21 | - * |
|
| 22 | - * @license https://spdx.org/licenses/GPL-3.0-only.html#licenseText GPL-3.0 |
|
| 23 | - * --- |
|
| 24 | - * |
|
| 25 | - * @see https://www.teampass.net |
|
| 26 | - */ |
|
| 5 | + /** |
|
| 6 | + * Teampass - a collaborative passwords manager. |
|
| 7 | + * --- |
|
| 8 | + * This library is distributed in the hope that it will be useful, |
|
| 9 | + * but WITHOUT ANY WARRANTY; without even the implied warranty of |
|
| 10 | + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. |
|
| 11 | + * --- |
|
| 12 | + * |
|
| 13 | + * @project Teampass |
|
| 14 | + * |
|
| 15 | + * @file search.js.php |
|
| 16 | + * --- |
|
| 17 | + * |
|
| 18 | + * @author Nils Laumaillé ([email protected]) |
|
| 19 | + * |
|
| 20 | + * @copyright 2009-2023 Teampass.net |
|
| 21 | + * |
|
| 22 | + * @license https://spdx.org/licenses/GPL-3.0-only.html#licenseText GPL-3.0 |
|
| 23 | + * --- |
|
| 24 | + * |
|
| 25 | + * @see https://www.teampass.net |
|
| 26 | + */ |
|
| 27 | 27 | |
| 28 | 28 | use TeampassClasses\PerformChecks\PerformChecks; |
| 29 | 29 | use TeampassClasses\SessionManager\SessionManager; |