From e0da32a3bfbb0cd0fe85759aa7264488ab45514f Mon Sep 17 00:00:00 2001 From: nilsteampassnet Date: Wed, 25 May 2016 18:38:57 +0200 Subject: [PATCH 1/7] 2.1.26 Working on #1298, #1299 Added checks at install --- changelog.md | 2 ++ install/install.js | 2 +- install/install.php | 2 ++ sources/export.queries.php | 12 ++++++------ sources/items.queries.php | 6 +++--- 5 files changed, 14 insertions(+), 10 deletions(-) diff --git a/changelog.md b/changelog.md index 5c722d0e6..90cf32614 100644 --- a/changelog.md +++ b/changelog.md @@ -1,5 +1,7 @@ Last changes 2.1.26 + #1299 Export to pdf or csv shows htmlencoded + #1298 Backup-filename on 2.1.26 contains / #1284 fix for can_manage_all_users update during upgrade #1279 SyntaxError: Unexpected token î in JSON at position 0 #1276 MySQL 5.7 query error diff --git a/install/install.js b/install/install.js index 2bf6fa124..c65da66f7 100644 --- a/install/install.js +++ b/install/install.js @@ -55,7 +55,7 @@ function CheckPage() error = "Fields need to be filled in!"; } else { data = '{"root_path":"'+$("#root_path").val()+'", "url_path":"'+$("#url_path").val()+'"}'; - tasks = ["folder*install", "folder*includes", "folder*files", "folder*upload", "extension*mcrypt", "extension*mbstring", "extension*openssl", "extension*bcmath", "extension*iconv", "extension*gd", "function*mysqli_fetch_all", "version*php", "ini*max_execution_time", "folder*includes/avatars", "extension*xml", "folder*includes/libraries/csrfp/libs"]; + tasks = ["folder*install", "folder*includes", "folder*files", "folder*upload", "extension*mcrypt", "extension*mbstring", "extension*openssl", "extension*bcmath", "extension*iconv", "extension*gd", "function*mysqli_fetch_all", "version*php", "ini*max_execution_time", "folder*includes/avatars", "extension*xml", "folder*includes/libraries/csrfp/libs", "folder*includes/libraries/csrfp/js", "folder*includes/libraries/csrfp/log"]; multiple = true; $("#hid_abspath").val($("#root_path").val()); $("#hid_url_path").val($("#url_path").val()); diff --git a/install/install.php b/install/install.php index 73ef7342f..6f01e0330 100644 --- a/install/install.php +++ b/install/install.php @@ -118,6 +118,8 @@
  • Directory "/files/" is writable 
  • Directory "/upload/" is writable 
  • Directory "/includes/libraries/csrfp/libs/" is writable 
  • +
  • Directory "/includes/libraries/csrfp/js/" is writable 
  • +
  • Directory "/includes/libraries/csrfp/log/" is writable 
  • PHP extension "mcrypt" is loaded 
  • PHP extension "mbstring" is loaded 
  • PHP extension "openssl" is loaded 
  • diff --git a/sources/export.queries.php b/sources/export.queries.php index 9332ca675..c26a3c53e 100644 --- a/sources/export.queries.php +++ b/sources/export.queries.php @@ -122,10 +122,10 @@ prefix_table("export"), array( 'id' => $record['id'], - 'description' => addslashes($record['description']), - 'label' => addslashes($record['label']), + 'description' => htmlspecialchars_decode(addslashes($record['description'])), + 'label' => htmlspecialchars_decode(addslashes($record['label'])), 'pw' => stripslashes($pw['string']), - 'login' => $record['login'], + 'login' => htmlspecialchars_decode($record['login']), 'path' => $path ) ); @@ -283,10 +283,10 @@ } $full_listing[$i] = array( 'id' => $record['id'], - 'label' => $record['label'], - 'description' => addslashes(str_replace(array(";", "
    "), array("|", "\n\r"), mysqli_escape_string($link, stripslashes(utf8_decode($record['description']))))), + 'label' => htmlspecialchars_decode($record['label']), + 'description' => htmlspecialchars_decode(addslashes(str_replace(array(";", "
    "), array("|", "\n\r"), mysqli_escape_string($link, stripslashes(utf8_decode($record['description'])))))), 'pw' => addslashes($pw['string']), - 'login' => $record['login'], + 'login' => htmlspecialchars_decode($record['login']), 'restricted_to' => $record['restricted_to'], 'perso' => $record['perso'] ); diff --git a/sources/items.queries.php b/sources/items.queries.php index 0dfdb8c4b..a4694e2c2 100644 --- a/sources/items.queries.php +++ b/sources/items.queries.php @@ -1146,17 +1146,17 @@ $arrData['show_detail_option'] = 2; } - $arrData['label'] = $dataItem['label']; + $arrData['label'] = htmlspecialchars_decode($dataItem['label']); $arrData['pw'] = $pw; $arrData['email'] = $dataItem['email']; - $arrData['url'] = $dataItem['url']; + $arrData['url'] = htmlspecialchars_decode($dataItem['url']); $arrData['folder'] = $dataItem['id_tree']; if (!empty($dataItem['url'])) { $arrData['link'] = "  "; } $arrData['description'] = preg_replace('/(? 0 ? implode(";", $listRestrictionRoles).";" : ""; $arrData['tags'] = $tags; From c5b667a7fa384e018a898d31cfad0d17a3002d05 Mon Sep 17 00:00:00 2001 From: nilsteampassnet Date: Fri, 27 May 2016 17:54:25 +0200 Subject: [PATCH 2/7] 2.1.26 Fix for #1308, #1304, #910 Possible for fix for csrfp.config.php not created --- api/functions.php | 5 +- changelog.md | 2 + install/upgrade_run_2.1.26.php | 26 ++++++ items.load.php | 4 +- sources/folders.queries.php | 18 ++-- sources/import.queries.php | 147 +++++++++++++++++---------------- sources/main.queries.php | 4 +- sources/roles.queries.php | 31 +++++-- sources/users.queries.php | 5 +- 9 files changed, 151 insertions(+), 91 deletions(-) diff --git a/api/functions.php b/api/functions.php index 504392cf5..f2cac0fac 100644 --- a/api/functions.php +++ b/api/functions.php @@ -741,7 +741,7 @@ function rest_get () { } elseif ($GLOBALS['request'][0] == "set") { /* * Expected call format: .../api/index.php/set/////?apikey= - * Example: https://127.0.0.1/teampass/api/index.php/auth/myLogin/myPassword/USER1/test/76?apikey=chahthait5Aidood6johh6Avufieb6ohpaixain + * Example: https://127.0.0.1/teampass/api/index.php/set/newLogin/newPassword/newUrl/myLogin/myPassword?apikey=gu6Eexaewaishooph6iethoh5woh0yoit6ohquo * * NEW ITEM WILL BE STORED IN SPECIFIC FOLDER */ @@ -754,6 +754,9 @@ function rest_get () { "SELECT `id`, `pw`, `groupes_interdits`, `groupes_visibles`, `fonction_id` FROM " . $pre . "users WHERE login = %s", $GLOBALS['request'][4] ); + if (DB::count() == 0) { + rest_error ('AUTH_NO_IDENTIFIER'); + } // load passwordLib library $_SESSION['settings']['cpassman_dir'] = ".."; diff --git a/changelog.md b/changelog.md index 90cf32614..89828c3a9 100644 --- a/changelog.md +++ b/changelog.md @@ -1,5 +1,6 @@ Last changes 2.1.26 + #1308 Teampass hangs when a folder is create with option "New sub-folder inherits rights from parent folder" enabled #1299 Export to pdf or csv shows htmlencoded #1298 Backup-filename on 2.1.26 contains / #1284 fix for can_manage_all_users update during upgrade @@ -27,6 +28,7 @@ Last changes #1178 New user right added for managing all users (super Manager) #1174 Adding LDAP groups support to 'posix-search' LDAP auth #1158 Can't Change admin Password + #910 Backslashes in accounts are not copied to clipboard NEW: Server user password change through SSH connection NEW: Upgrade database handler improved for better upgrades management NEW: New user right added for managing all users (super Manager) diff --git a/install/upgrade_run_2.1.26.php b/install/upgrade_run_2.1.26.php index 80d753434..04c896f6d 100644 --- a/install/upgrade_run_2.1.26.php +++ b/install/upgrade_run_2.1.26.php @@ -143,7 +143,33 @@ function tableExists($tablename, $database = false) exit(); } + // alter table Items mysqli_query($dbTmp, "ALTER TABLE `".$_SESSION['tbl_prefix']."items` MODIFY complexity_level VARCHAR(3)"); + +// ensure CSRFP config file is ready +if (!isset($_SESSION['upgrade']['csrfp_config_file']) || $_SESSION['upgrade']['csrfp_config_file']) != 1) { + $csrfp_file_sample = "../includes/libraries/csrfp/libs/csrfp.config.sample.php"; + $csrfp_file = "../includes/libraries/csrfp/libs/csrfp.config.php"; + if (file_exists($csrfp_file)) { + if (!copy($csrfp_file, $csrfp_file.'.'.date("Y_m_d", mktime(0, 0, 0, date('m'), date('d'), date('y'))))) { + 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."}]'; + break; + } else { + // "The file $csrfp_file already exist. A copy has been created.
    "; + } + } + unlink($csrfp_file); // delete existing csrfp.config file + copy($csrfp_file_sample, $csrfp_file); // make a copy of csrfp.config.sample file + $data = file_get_contents("../includes/libraries/csrfp/libs/csrfp.config.php"); + $newdata = str_replace('"CSRFP_TOKEN" => ""', '"CSRFP_TOKEN" => "'.bin2hex(openssl_random_pseudo_bytes(25)).'"', $data); + $newdata = str_replace('"tokenLength" => "25"', '"tokenLength" => "50"', $newdata); + $jsUrl = $_SESSION['fullurl'].'/includes/libraries/csrfp/js/csrfprotector.js'; + $newdata = str_replace('"jsUrl" => ""', '"jsUrl" => "'.$jsUrl.'"', $newdata); + file_put_contents("../includes/libraries/csrfp/libs/csrfp.config.php", $newdata); + + $_SESSION['upgrade']['csrfp_config_file']) = 1; +} + echo '[{"finish":"1" , "next":"", "error":""}]'; \ No newline at end of file diff --git a/items.load.php b/items.load.php index 3e548b0fc..53be0960a 100644 --- a/items.load.php +++ b/items.load.php @@ -1361,7 +1361,7 @@ function(data) { if (data.pw != "") { var clipboard_pw = new Clipboard("#menu_button_copy_pw, #button_quick_pw_copy", { text: function() { - return unsanitizeString(data.pw); + return (data.pw); } }); clipboard_pw.on('success', function(e) { @@ -1376,7 +1376,7 @@ function(data) { if (data.login != "") { var clipboard_login = new Clipboard("#menu_button_copy_login, #button_quick_login_copy", { text: function() { - return unsanitizeString(data.login); + return (data.login); } }); clipboard_login.on('success', function(e) { diff --git a/sources/folders.queries.php b/sources/folders.queries.php index b032205b5..d604af469 100644 --- a/sources/folders.queries.php +++ b/sources/folders.queries.php @@ -410,14 +410,16 @@ //add access to this new folder foreach (explode(';', $_SESSION['fonction_id']) as $role) { - DB::insert( - prefix_table("roles_values"), - array( - 'role_id' => $role, - 'folder_id' => $newId, - 'type' => "W" - ) - ); + if (!empty($role)) { + DB::insert( + prefix_table("roles_values"), + array( + 'role_id' => $role, + 'folder_id' => $newId, + 'type' => "W" + ) + ); + } } } diff --git a/sources/import.queries.php b/sources/import.queries.php index 579d7356d..b169e4fa6 100644 --- a/sources/import.queries.php +++ b/sources/import.queries.php @@ -828,77 +828,82 @@ function recursiveKeepassXML($xmlRoot, $xmlLevel = 0) "SELECT title FROM ".prefix_table("nested_tree")." WHERE id = %i", intval($folderId) ); - - $results .= " - Inserting\n"; - - // prepare PW - if ($import_perso == true) { - $encrypt = cryption($pw, $_SESSION['my_sk'], "", "encrypt"); - } else { - $encrypt = cryption($pw, SALT, "", "encrypt"); - } - - //ADD item - DB::insert( - prefix_table("items"), - array( - 'label' => stripslashes($item[KP_TITLE]), - 'description' => stripslashes(str_replace($lineEndSeparator, '
    ', $item[KP_NOTES])), - 'pw' => $encrypt['string'], - 'pw_iv' => $encrypt['iv'], - 'url' => stripslashes($item[KP_URL]), - 'id_tree' => $folderId, - 'login' => stripslashes($item[KP_USERNAME]), - 'anyone_can_modify' => $_POST['import_kps_anyone_can_modify'] == "true" ? 1 : 0 - ) - ); - $newId = DB::insertId(); - - //if asked, anyone in role can modify - if (isset($_POST['import_kps_anyone_can_modify_in_role']) && $_POST['import_kps_anyone_can_modify_in_role'] == "true") { - foreach ($_SESSION['arr_roles'] as $role) { - DB::insert( - prefix_table("restriction_to_roles"), - array( - 'role_id' => $role['id'], - 'item_id' => $newId - ) - ); - } - } - - //Add log - DB::insert( - prefix_table("log_items"), - array( - 'id_item' => $newId, - 'date' => time(), - 'id_user' => $_SESSION['user_id'], - 'action' => 'at_creation', - 'raison' => 'at_import' - ) - ); - - //Add entry to cache table - DB::insert( - prefix_table("cache"), - array( - 'id' => $newId, - 'label' => stripslashes($item[KP_TITLE]), - 'description' => stripslashes(str_replace($lineEndSeparator, '
    ', $item[KP_NOTES])), - 'id_tree' => $folderId, - 'perso' => $personalFolder == 0 ? 0 : 1, - 'login' => stripslashes($item[KP_USERNAME]), - 'folder' => $data['title'], - 'author' => $_SESSION['user_id'] - ) - ); - - //show - //$text .= '- '.addslashes($item[2]).'
    '; - - //increment number of imported items - $nbItemsImported++; + + // escape if folderId is empty + if (!empty($folderId)) { + $results .= " - Inserting\n"; + + // prepare PW + if ($import_perso == true) { + $encrypt = cryption($pw, $_SESSION['my_sk'], "", "encrypt"); + } else { + $encrypt = cryption($pw, SALT, "", "encrypt"); + } + + //ADD item + DB::insert( + prefix_table("items"), + array( + 'label' => stripslashes($item[KP_TITLE]), + 'description' => stripslashes(str_replace($lineEndSeparator, '
    ', $item[KP_NOTES])), + 'pw' => $encrypt['string'], + 'pw_iv' => $encrypt['iv'], + 'url' => stripslashes($item[KP_URL]), + 'id_tree' => $folderId, + 'login' => stripslashes($item[KP_USERNAME]), + 'anyone_can_modify' => $_POST['import_kps_anyone_can_modify'] == "true" ? 1 : 0 + ) + ); + $newId = DB::insertId(); + + //if asked, anyone in role can modify + if (isset($_POST['import_kps_anyone_can_modify_in_role']) && $_POST['import_kps_anyone_can_modify_in_role'] == "true") { + foreach ($_SESSION['arr_roles'] as $role) { + DB::insert( + prefix_table("restriction_to_roles"), + array( + 'role_id' => $role['id'], + 'item_id' => $newId + ) + ); + } + } + + //Add log + DB::insert( + prefix_table("log_items"), + array( + 'id_item' => $newId, + 'date' => time(), + 'id_user' => $_SESSION['user_id'], + 'action' => 'at_creation', + 'raison' => 'at_import' + ) + ); + + //Add entry to cache table + DB::insert( + prefix_table("cache"), + array( + 'id' => $newId, + 'label' => stripslashes($item[KP_TITLE]), + 'description' => stripslashes(str_replace($lineEndSeparator, '
    ', $item[KP_NOTES])), + 'id_tree' => $folderId, + 'perso' => $personalFolder == 0 ? 0 : 1, + 'login' => stripslashes($item[KP_USERNAME]), + 'folder' => $data['title'], + 'author' => $_SESSION['user_id'] + ) + ); + + //show + //$text .= '- '.addslashes($item[2]).'
    '; + + //increment number of imported items + $nbItemsImported++; + } else { + $results .= " - ".$item[KP_TITLE]." was not imported\n"; + } } } diff --git a/sources/main.queries.php b/sources/main.queries.php index d4381f1b1..12a6667d8 100644 --- a/sources/main.queries.php +++ b/sources/main.queries.php @@ -18,7 +18,9 @@ require_once 'sessions.php'; session_start(); if (!isset($_SESSION['CPM']) || $_SESSION['CPM'] != 1) { - die('Hacking attempt...'); + $_SESSION['error']['code'] = "1004"; //Hacking attempt + include $_SESSION['settings']['cpassman_dir'].'/error.php'; + exit(); } /* do checks */ diff --git a/sources/roles.queries.php b/sources/roles.queries.php index f844bad34..2bdbe59a5 100644 --- a/sources/roles.queries.php +++ b/sources/roles.queries.php @@ -63,6 +63,7 @@ $tmp = DB::query("SELECT * FROM ".prefix_table("roles_title")." WHERE title = %s", stripslashes($_POST['name'])); $counter = DB::count(); if ($counter == 0) { + db::debugmode(false); DB::insert( prefix_table("roles_title"), array( @@ -81,15 +82,21 @@ $data_tmp = DB::queryfirstrow("SELECT fonction_id FROM ".prefix_table("users")." WHERE id = %s", $_SESSION['user_id']); // add new role to user + $tmp = str_replace(";;", ";", $data_tmp['fonction_id']); + if (substr($tmp, -1) == ";") { + $_SESSION['fonction_id'] = str_replace(";;", ";", $data_tmp['fonction_id'].$role_id); + } else { + $_SESSION['fonction_id'] = str_replace(";;", ";", $data_tmp['fonction_id'].";".$role_id); + } + // store in DB DB::update( prefix_table("users"), array( - 'fonction_id' => $data_tmp['fonction_id'].$role_id.";" + 'fonction_id' => $_SESSION['fonction_id'] ), "id = %i", $_SESSION['user_id'] ); - $_SESSION['fonction_id'] = $data_tmp['fonction_id'].$role_id.";"; $_SESSION['user_roles'] = explode(";", $_SESSION['fonction_id']); @@ -112,10 +119,24 @@ // parse all users to remove this role $rows = DB::query( - "SELECT fonction_id FROM ".prefix_table("users")." + "SELECT id, fonction_id FROM ".prefix_table("users")." ORDER BY id ASC"); foreach ($rows as $record) { - // todo + $tab = explode(";", $record['fonction_id']); + if (($key = array_search($_POST['id'], $tab)) !== false) { + // remove the deleted role id + unset($tab[$key]); + + // store new list of functions + DB::update( + prefix_table("users"), + array( + 'fonction_id' => rtrim(implode(";", $tab), ";") + ), + "id = %i", + $record['id'] + ); + } } echo '[ { "error" : "no" } ]'; @@ -256,7 +277,7 @@ //count nb of roles $arrUserRoles = array_filter($_SESSION['user_roles']); - if (count($arrUserRoles) == 0) $where = ""; + if (count($arrUserRoles) == 0 || $_SESSION['is_admin'] == 1) $where = ""; else $where = " WHERE id IN (".implode(',', $arrUserRoles).")"; DB::query("SELECT * FROM ".prefix_table("roles_title").$where); $roles_count = DB::count(); diff --git a/sources/users.queries.php b/sources/users.queries.php index 4ae85741d..e108f6d2f 100644 --- a/sources/users.queries.php +++ b/sources/users.queries.php @@ -111,9 +111,8 @@ } else { $new_fonctions = $val[1]; } - while (substr_count($new_fonctions, ";;") > 0) { - $new_fonctions = str_replace(";;", ";", $new_fonctions); - } + // ensure no double ; exists + $new_fonctions = str_replace(";;", ";", $new_fonctions); // Store id DB DB::update( prefix_table("users"), From 0ebe000e6811a9e61125b0c29aa8983b7fffba89 Mon Sep 17 00:00:00 2001 From: nilsteampassnet Date: Tue, 31 May 2016 17:42:12 +0200 Subject: [PATCH 3/7] 2.1.26 NEW: After 3 bad login attempts, user needs to wait 10s before new try FIX: QRCode is not visible in Users list FIX: Display inconsistancies in User log results --- changelog.md | 3 +++ includes/language/english.php | 1 + load.php | 6 +++++- sources/identify.php | 28 +++++++++++++++++++++++++--- sources/users.queries.php | 13 +++++++------ users.load.php | 1 + 6 files changed, 42 insertions(+), 10 deletions(-) diff --git a/changelog.md b/changelog.md index 89828c3a9..8ae2d687d 100644 --- a/changelog.md +++ b/changelog.md @@ -32,10 +32,13 @@ Last changes NEW: Server user password change through SSH connection NEW: Upgrade database handler improved for better upgrades management NEW: New user right added for managing all users (super Manager) + NEW: After 3 bad login attempts, user needs to wait 10s before new try FIX: If expiration engaged and password is changed, the warning is still present. FIX: New suggestion folder could remain empty in some specific cases. FIX: By creating a role, this new one is directly visible by creator. FIX: Security issue with downloadFile.php. Now protected by session and htaccess. + FIX: QRCode is not visible in Users list + FIX: Display inconsistancies in User log results 2.1.25 #1169 sending Google Authenticator code through index page diff --git a/includes/language/english.php b/includes/language/english.php index 03b908fa3..a45088066 100644 --- a/includes/language/english.php +++ b/includes/language/english.php @@ -14,6 +14,7 @@ */ global $LANG; $LANG = array ( + 'error_bad_credentials_more_than_3_times' => 'Login credentials do not correspond!
    Please wait 10 seconds before new try', 'user_ga_code' => 'Send GoogleAuthenticator to user by email', 'send_ga_code' => 'Google Authenticator for user', 'error_no_email' => 'This user has no email set!', diff --git a/load.php b/load.php index 31531ddbf..0e916f15b 100644 --- a/load.php +++ b/load.php @@ -257,6 +257,9 @@ function (){ ); } else if (data[0].value == "false_onetimepw") { $("#connection_error").html("'.$LANG['bad_onetime_password'].'").show(); + } else if (data[0].pwd_attempts >=3 ||data[0].error == "bruteforce_wait") { + // now user needs to wait 10 secs before new passwd + $("#connection_error").html("'.$LANG['error_bad_credentials_more_than_3_times'].'").show(); } else if (data[0].error == "bad_credentials") { $("#connection_error").html("'.$LANG['error_bad_credentials'].'").show(); } else if (data[0].error == "ga_code_wrong") { @@ -264,7 +267,8 @@ function (){ } else { $("#connection_error").html("'.$LANG['error_bad_credentials'].'").show(); } - $("#ajax_loader_connexion").hide(); + + $("#ajax_loader_connexion").hide(); }, "json" ); diff --git a/sources/identify.php b/sources/identify.php index e46ee4503..a36648e82 100644 --- a/sources/identify.php +++ b/sources/identify.php @@ -73,8 +73,24 @@ echo '[{"resp" : "'.$resp.'"}]'; } } elseif ($_POST['type'] == "identify_user") { - // identify the user through Teampass process - identifyUser($_POST['data']); + // increment counter of login attempts + if (empty($_SESSION["pwd_attempts"])) $_SESSION["pwd_attempts"] = 1; + else $_SESSION["pwd_attempts"] ++; + + // manage brute force + if ($_SESSION["pwd_attempts"] <= 3) { + // identify the user through Teampass process + identifyUser($_POST['data']); + } elseif (isset($_SESSION["next_possible_pwd_attempts"]) && time() > $_SESSION["next_possible_pwd_attempts"] && $_SESSION["pwd_attempts"] > 3) { + $_SESSION["pwd_attempts"] = 1; + // identify the user through Teampass process + identifyUser($_POST['data']); + } else { + $_SESSION["next_possible_pwd_attempts"] = time() + 10; + echo '[{"error" : "bruteforce_wait"}]'; + return false; + } + } elseif ($_POST['type'] == "store_data_in_cookie") { // not used any more (only development purpose) if ($_POST['key'] != $_SESSION['key']) { @@ -522,6 +538,7 @@ function identifyUser($sentData) ) ) { $_SESSION['autoriser'] = true; + $_SESSION["pwd_attempts"] = 0; // Generate a ramdom ID $key = GenerateCryptKey(50); @@ -801,8 +818,13 @@ function identifyUser($sentData) "Identified : " . $return . "\n\n" ); } + + // manage bruteforce + if ($_SESSION["pwd_attempts"] > 2) { + $_SESSION["next_possible_pwd_attempts"] = time() + 10; + } - echo '[{"value" : "'.$return.'", "user_admin":"', isset($_SESSION['user_admin']) ? $_SESSION['user_admin'] : "", '", "initial_url" : "'.@$_SESSION['initial_url'].'", "error" : "'.$logError.'"}]'; + echo '[{"value" : "'.$return.'", "user_admin":"', isset($_SESSION['user_admin']) ? $_SESSION['user_admin'] : "", '", "initial_url" : "'.@$_SESSION['initial_url'].'", "error" : "'.$logError.'", "pwd_attempts" : "'.$_SESSION["pwd_attempts"].'"}]'; $_SESSION['initial_url'] = ""; if ($_SESSION['settings']['cpassman_dir'] == "..") { diff --git a/sources/users.queries.php b/sources/users.queries.php index e108f6d2f..0808a40a3 100644 --- a/sources/users.queries.php +++ b/sources/users.queries.php @@ -252,7 +252,8 @@ $dataReceived['email'] ); // update LOG - logEvents('user_mngt', 'at_user_added', $_SESSION['user_id'], $_SESSION['login'], $new_user_id); + logEvents('user_mngt', 'at_user_added', $_SESSION['user_id'], $_SESSION['login'], $new_user_id); + echo '[ { "error" : "no" } ]'; } else { echo '[ { "error" : "'.addslashes($LANG['error_user_exists']).'" } ]'; @@ -802,8 +803,8 @@ FROM ".prefix_table("log_items")." as l INNER JOIN ".prefix_table("items")." as i ON (l.id_item=i.id) INNER JOIN ".prefix_table("users")." as u ON (l.id_user=u.id) - WHERE l.id_user = %i", - intval($_POST['id'].$sql_filter) + WHERE l.id_user = %i ".$sql_filter, + intval($_POST['id']) ); $counter = DB::count(); // define query limits @@ -818,10 +819,10 @@ FROM ".prefix_table("log_items")." as l INNER JOIN ".prefix_table("items")." as i ON (l.id_item=i.id) INNER JOIN ".prefix_table("users")." as u ON (l.id_user=u.id) - WHERE l.id_user = %i + WHERE l.id_user = %i ".$sql_filter." ORDER BY date DESC LIMIT ".intval($start).",".intval($_POST['nb_items_by_page']), - intval($_POST['id'].$sql_filter) + intval($_POST['id']) ); } else { // get number of pages @@ -854,7 +855,7 @@ if (isset($counter) && $counter != 0) { $nb_pages = ceil($counter / $_POST['nb_items_by_page']); for ($i = 1; $i <= $nb_pages; $i++) { - $pages .= ''.$i:'\'>'.$i).''; + $pages .= ''.$i:'\'>'.$i).''; } } $pages .= ''; diff --git a/users.load.php b/users.load.php index 75c65101d..deb8b5a0e 100644 --- a/users.load.php +++ b/users.load.php @@ -81,6 +81,7 @@ null, null, null, + null, null ] }) From 2ed8e5e713b72379ea3e52319d3c79f06c7fb332 Mon Sep 17 00:00:00 2001 From: "nils@teampass.net" Date: Tue, 31 May 2016 22:14:41 +0200 Subject: [PATCH 4/7] 2.1.26 In work: Deletion by API Added Estonia language --- api/functions.php | 97 ++++++++++++++++++++++++++++++++ includes/language/arabic.php | 1 + includes/language/bulgarian.php | 1 + includes/language/catalan.php | 1 + includes/language/chinese.php | 1 + includes/language/czech.php | 1 + includes/language/dutch.php | 1 + includes/language/german.php | 1 + includes/language/greek.php | 1 + includes/language/hungarian.php | 1 + includes/language/italian.php | 1 + includes/language/japanese.php | 1 + includes/language/norwegian.php | 1 + includes/language/polish.php | 1 + includes/language/portuguese.php | 1 + includes/language/romanian.php | 3 +- includes/language/russian.php | 3 +- includes/language/spanish.php | 1 + includes/language/swedish.php | 1 + includes/language/turkish.php | 1 + includes/language/ukrainian.php | 1 + includes/language/vietnamese.php | 1 + install/install.queries.php | 3 +- install/upgrade_run_2.1.26.php | 95 ++++++++++++++++--------------- 24 files changed, 171 insertions(+), 49 deletions(-) diff --git a/api/functions.php b/api/functions.php index f2cac0fac..44cf0e21f 100644 --- a/api/functions.php +++ b/api/functions.php @@ -864,6 +864,103 @@ function rest_get () { } else { rest_error ('AUTH_NO_IDENTIFIER'); } + } + /* + * DELETE + * + * Expected call format: .../api/index.php/delete/folder>/?apikey= + * Expected call format: .../api/index.php/delete/item>//?apikey= + */ + elseif ($GLOBALS['request'][0] == "delete") { + if($GLOBALS['request'][1] == "folder") { + $array_category = explode(';',$GLOBALS['request'][2]); + + foreach($array_category as $category) { + if(!preg_match_all("/^([\w\:\'\-\sàáâãäåçèéêëìíîïðòóôõöùúûüýÿ]+)$/i", $category,$result)) { + rest_error('CATEGORY_MALFORMED'); + } + } + + if(count($array_category) > 1 && count($array_category) < 5) { + for ($i = count($array_category); $i > 0; $i--) { + $slot = $i - 1; + if (!$slot) { + $category_query .= "select id from ".prefix_table("nested_tree")." where title LIKE '".$array_category[$slot]."' AND parent_id = 0"; + } else { + $category_query .= "select id from ".prefix_table("nested_tree")." where title LIKE '".$array_category[$slot]."' AND parent_id = ("; + } + } + for ($i = 1; $i < count($array_category); $i++) { $category_query .= ")"; } + } elseif (count($array_category) == 1) { + $category_query = "select id from ".prefix_table("nested_tree")." where title LIKE '".$array_category[0]."' AND parent_id = 0"; + } else { + rest_error ('NO_CATEGORY'); + } + + // Delete items which in category + $response = DB::delete(prefix_table("items"), "id_tree = (".$category_query.")"); + // Delete sub-categories which in category + $response = DB::delete(prefix_table("nested_tree"), "parent_id = (".$category_query.")"); + // Delete category + $response = DB::delete(prefix_table("nested_tree"), "id = (".$category_query.")"); + + $json['type'] = 'category'; + $json['category'] = $GLOBALS['request'][2]; + if($response) { + $json['status'] = 'OK'; + } else { + $json['status'] = 'KO'; + } + + } elseif($GLOBALS['request'][1] == "item") { + $array_category = explode(';',$GLOBALS['request'][2]); + $item = $GLOBALS['request'][3]; + + foreach($array_category as $category) { + if(!preg_match_all("/^([\w\:\'\-\sàáâãäåçèéêëìíîïðòóôõöùúûüýÿ]+)$/i", $category,$result)) { + rest_error('CATEGORY_MALFORMED'); + } + } + + if(!preg_match_all("/^([\w\:\'\-\sàáâãäåçèéêëìíîïðòóôõöùúûüýÿ]+)$/i", $item,$result)) { + rest_error('ITEM_MALFORMED'); + } elseif (empty($item) || count($array_category) == 0) { + rest_error('MALFORMED'); + } + + if(count($array_category) > 1 && count($array_category) < 5) { + for ($i = count($array_category); $i > 0; $i--) { + $slot = $i - 1; + if (!$slot) { + $category_query .= "select id from ".prefix_table("nested_tree")." where title LIKE '".$array_category[$slot]."' AND parent_id = 0"; + } else { + $category_query .= "select id from ".prefix_table("nested_tree")." where title LIKE '".$array_category[$slot]."' AND parent_id = ("; + } + } + for ($i = 1; $i < count($array_category); $i++) { $category_query .= ")"; } + } elseif (count($array_category) == 1) { + $category_query = "select id from ".prefix_table("nested_tree")." where title LIKE '".$array_category[0]."' AND parent_id = 0"; + } else { + rest_error ('NO_CATEGORY'); + } + + // Delete item + $response = DB::delete(prefix_table("items"), "id_tree = (".$category_query.") and label LIKE '".$item."'"); + $json['type'] = 'item'; + $json['item'] = $item; + $json['category'] = $GLOBALS['request'][2]; + if($response) { + $json['status'] = 'OK'; + } else { + $json['status'] = 'KO'; + } + } + + if ($json) { + echo json_encode($json); + } else { + rest_error ('EMPTY'); + } } else { rest_error ('METHOD'); } diff --git a/includes/language/arabic.php b/includes/language/arabic.php index df5ef3699..bc8ab1edd 100644 --- a/includes/language/arabic.php +++ b/includes/language/arabic.php @@ -14,6 +14,7 @@ */ global $LANG; $LANG = array ( + 'error_bad_credentials_more_than_3_times' => 'Login credentials do not correspond!
    Please wait 10 seconds before new try', 'user_ga_code' => 'Send GoogleAuthenticator to user by email', 'send_ga_code' => 'Google Authenticator for user', 'error_no_email' => 'This user has no email set!', diff --git a/includes/language/bulgarian.php b/includes/language/bulgarian.php index 837a5b63e..b3702b209 100644 --- a/includes/language/bulgarian.php +++ b/includes/language/bulgarian.php @@ -14,6 +14,7 @@ */ global $LANG; $LANG = array ( + 'error_bad_credentials_more_than_3_times' => 'Login credentials do not correspond!
    Please wait 10 seconds before new try', 'user_ga_code' => 'Send GoogleAuthenticator to user by email', 'send_ga_code' => 'Google Authenticator за потребител', 'error_no_email' => 'Този потребител няма настроена поща!', diff --git a/includes/language/catalan.php b/includes/language/catalan.php index 6fc82d49c..033c8b48f 100644 --- a/includes/language/catalan.php +++ b/includes/language/catalan.php @@ -14,6 +14,7 @@ */ global $LANG; $LANG = array ( + 'error_bad_credentials_more_than_3_times' => 'Login credentials do not correspond!
    Please wait 10 seconds before new try', 'user_ga_code' => 'Enviar GoogleAuthenticator per email', 'send_ga_code' => 'Google Authenticator per l\'usuari', 'error_no_email' => 'L\'usuari no te email configurat!', diff --git a/includes/language/chinese.php b/includes/language/chinese.php index 1f91df596..4febf65df 100644 --- a/includes/language/chinese.php +++ b/includes/language/chinese.php @@ -14,6 +14,7 @@ */ global $LANG; $LANG = array ( + 'error_bad_credentials_more_than_3_times' => 'Login credentials do not correspond!
    Please wait 10 seconds before new try', 'user_ga_code' => '发送 Google 身份验证器至用户,通过电子邮件', 'send_ga_code' => 'Google 身份验证器,为用户', 'error_no_email' => '此用户未设置电子邮件地址!', diff --git a/includes/language/czech.php b/includes/language/czech.php index 60e8c6ba8..7f54bf4e3 100644 --- a/includes/language/czech.php +++ b/includes/language/czech.php @@ -14,6 +14,7 @@ */ global $LANG; $LANG = array ( + 'error_bad_credentials_more_than_3_times' => 'Login credentials do not correspond!
    Please wait 10 seconds before new try', 'user_ga_code' => 'Zaslat uživateli Google Authenticator emailem', 'send_ga_code' => 'Google Authenticator pro uživatele', 'error_no_email' => 'Tento uživatel nemá nastavenou emailovou adresu!', diff --git a/includes/language/dutch.php b/includes/language/dutch.php index ad4f425fc..a2801f0c1 100644 --- a/includes/language/dutch.php +++ b/includes/language/dutch.php @@ -14,6 +14,7 @@ */ global $LANG; $LANG = array ( + 'error_bad_credentials_more_than_3_times' => 'Login credentials do not correspond!
    Please wait 10 seconds before new try', 'user_ga_code' => 'Stuur GoogleAuthenticator naar gebruiker via e-mail', 'send_ga_code' => 'GoogleAuthenticator voor gebruiker', 'error_no_email' => 'Deze gebruiker heeft geen e-mailadres ingesteld', diff --git a/includes/language/german.php b/includes/language/german.php index 13b68dfa7..fda8bf892 100644 --- a/includes/language/german.php +++ b/includes/language/german.php @@ -14,6 +14,7 @@ */ global $LANG; $LANG = array ( + 'error_bad_credentials_more_than_3_times' => 'Login credentials do not correspond!
    Please wait 10 seconds before new try', 'user_ga_code' => 'Den Google Authenticator per E-Mail an Benutzer senden', 'send_ga_code' => 'Google Authenticator für Benutzer', 'error_no_email' => 'Für diesen Nutzer wurde keine E-Mail Adresse festgelegt.', diff --git a/includes/language/greek.php b/includes/language/greek.php index 6d37846c5..19095e9cc 100644 --- a/includes/language/greek.php +++ b/includes/language/greek.php @@ -14,6 +14,7 @@ */ global $LANG; $LANG = array ( + 'error_bad_credentials_more_than_3_times' => 'Login credentials do not correspond!
    Please wait 10 seconds before new try', 'user_ga_code' => 'Αποστολή GoogleAuthenticator στο χρήστη με ηλεκτρονικό μήνυμα', 'send_ga_code' => 'Google Authenticator for user', 'error_no_email' => 'Αυτός ο χρήστης δεν έχει ορίσει διεύθυνση ηλεκτρονικού ταχυδρομίου!', diff --git a/includes/language/hungarian.php b/includes/language/hungarian.php index c34a99af0..a3566f2e7 100644 --- a/includes/language/hungarian.php +++ b/includes/language/hungarian.php @@ -14,6 +14,7 @@ */ global $LANG; $LANG = array ( + 'error_bad_credentials_more_than_3_times' => 'Login credentials do not correspond!
    Please wait 10 seconds before new try', 'user_ga_code' => 'Google Hitelesítő küldése a felhasználónak email-ben.', 'send_ga_code' => 'Google Hitelesítés a felhasználó számára.', 'error_no_email' => 'Ennek a felhasználónak nincs email beállítva!', diff --git a/includes/language/italian.php b/includes/language/italian.php index 1b05f58d1..de6b700c2 100644 --- a/includes/language/italian.php +++ b/includes/language/italian.php @@ -14,6 +14,7 @@ */ global $LANG; $LANG = array ( + 'error_bad_credentials_more_than_3_times' => 'Login credentials do not correspond!
    Please wait 10 seconds before new try', 'user_ga_code' => 'Invia all\'utente per mail il link GoogleAuthenticator', 'send_ga_code' => 'Google Authenticator per utente', 'error_no_email' => 'Questo utente non ha un indirizzo email!', diff --git a/includes/language/japanese.php b/includes/language/japanese.php index 09b7bfd70..14ca4c9e3 100644 --- a/includes/language/japanese.php +++ b/includes/language/japanese.php @@ -14,6 +14,7 @@ */ global $LANG; $LANG = array ( + 'error_bad_credentials_more_than_3_times' => 'Login credentials do not correspond!
    Please wait 10 seconds before new try', 'user_ga_code' => 'Send GoogleAuthenticator to user by email', 'send_ga_code' => 'Google Authenticator for user', 'error_no_email' => 'This user has no email set!', diff --git a/includes/language/norwegian.php b/includes/language/norwegian.php index 21756d713..8604c7dee 100644 --- a/includes/language/norwegian.php +++ b/includes/language/norwegian.php @@ -14,6 +14,7 @@ */ global $LANG; $LANG = array ( + 'error_bad_credentials_more_than_3_times' => 'Login credentials do not correspond!
    Please wait 10 seconds before new try', 'user_ga_code' => 'Send GoogleAuthenticator til brukeren på epost', 'send_ga_code' => 'Goggle Authenticator for brukeren', 'error_no_email' => 'Denne brukeren har ikke definert epost', diff --git a/includes/language/polish.php b/includes/language/polish.php index 5667e0f6a..419f017ad 100644 --- a/includes/language/polish.php +++ b/includes/language/polish.php @@ -14,6 +14,7 @@ */ global $LANG; $LANG = array ( + 'error_bad_credentials_more_than_3_times' => 'Login credentials do not correspond!
    Please wait 10 seconds before new try', 'user_ga_code' => 'Wyślij do użytkownika Google Authenticator za pośrednictwem e-mail ', 'send_ga_code' => 'Google Authenticator dla użytkownika', 'error_no_email' => 'Ten użytkownik nie ma ustawionego adresu e-mail', diff --git a/includes/language/portuguese.php b/includes/language/portuguese.php index 94c77bf69..3eaeceb1e 100644 --- a/includes/language/portuguese.php +++ b/includes/language/portuguese.php @@ -14,6 +14,7 @@ */ global $LANG; $LANG = array ( + 'error_bad_credentials_more_than_3_times' => 'Login credentials do not correspond!
    Please wait 10 seconds before new try', 'user_ga_code' => 'Send GoogleAuthenticator to user by email', 'send_ga_code' => 'Google Authenticator for user', 'error_no_email' => 'This user has no email set!', diff --git a/includes/language/romanian.php b/includes/language/romanian.php index 788c728ca..1d36de0e5 100644 --- a/includes/language/romanian.php +++ b/includes/language/romanian.php @@ -179,7 +179,7 @@ 'admin_email_result_nok' => 'Emailul nu a fost trimis ... verifica-ti configuratia. Vezi eroarea generata:␣', 'email_subject_item_updated' => 'Parola a fost actualizata', 'email_body_item_updated' => 'Hello,

    Password for \'#item_label#\' has been updated.

    You can check it HERE

    Cheers', - 'email_bodyalt_item_updated' => 'Password for #item_label# has been updated.', + 'email_bodyalt_item_updated' => 'Parola itemului #item_label# a fost actualizata.', 'admin_email_send_backlog' => 'Send emails backlog (actually #nb_emails# emails)', 'admin_email_send_backlog_tip' => 'This script permits to force the emails in the database to be sent.
    This could take some time depending of the number of emails to send.', 'please_wait' => 'Va rugam, asteptati!', @@ -899,5 +899,6 @@ 'server_auto_update_password_enabled_tip' => 'Automatic user password change enabled', 'server_password_change_enable_tip' => 'This option permits to allow users to automatically change the user\'s password of a server located in the url field using SSH connection.
    Notice that the automatic change at specific frequency can be done if the file /files/script.ssh.php is added to the crontab of this server. The advice would be to run it once a day.', 'can_manage_all_users' => 'Human Resources
    Can manage all Users independately of his/hers group.
    Will be also promoted to Manager role.
    Will not be able to change an existing administrator (only an Administrator can remove administrator rights on a user).
    ', + 'error_bad_credentials_more_than_3_times' => 'Login credentials do not correspond!
    Please wait 10 seconds before new try', '' => '' ); \ No newline at end of file diff --git a/includes/language/russian.php b/includes/language/russian.php index 5dd7b8d30..2cdab3ba1 100644 --- a/includes/language/russian.php +++ b/includes/language/russian.php @@ -14,6 +14,7 @@ */ global $LANG; $LANG = array ( + 'error_bad_credentials_more_than_3_times' => 'Login credentials do not correspond!
    Please wait 10 seconds before new try', 'user_ga_code' => 'Отправить приложение Google Authenticator на email пользователю', 'send_ga_code' => 'Код Google Authenticator для пользователя', 'error_no_email' => 'У пользователя не задан email!', @@ -773,7 +774,7 @@ 'duplicate' => 'Дублировать', 'duplicate_title_in_same_folder' => 'Элемент с аналогичным именем существуют в текущей папке! Одинаковые имена элементов запрещены!', 'duplicate_item_in_folder' => 'Разрешить элементы с аналогичными метками в общей папке', - 'find_message' => '<i class="fa fa-info-circle"></i> %X% найдено объекто', + 'find_message' => '<i class="fa fa-info-circle"></i> %X% найдено объекто?, 'settings_roles_allowed_to_print' => 'Определить роли которым разрешено печатать элементы', 'settings_roles_allowed_to_print_tip' => 'Выбранным ролям будет разрешено печатать элементы в файл', 'user_profile_dialogbox_menu' => 'Ваша TeamPass информация', diff --git a/includes/language/spanish.php b/includes/language/spanish.php index 4e90493d6..e349c93c1 100644 --- a/includes/language/spanish.php +++ b/includes/language/spanish.php @@ -14,6 +14,7 @@ */ global $LANG; $LANG = array ( + 'error_bad_credentials_more_than_3_times' => 'Login credentials do not correspond!
    Please wait 10 seconds before new try', 'user_ga_code' => 'Enviar el código de GoogleAuthenticator por correo al usuario', 'send_ga_code' => 'Google Authenticator para el usuario', 'error_no_email' => '¡Este usuario no tiene correo configurado!', diff --git a/includes/language/swedish.php b/includes/language/swedish.php index 874dac060..a7ff3be3b 100644 --- a/includes/language/swedish.php +++ b/includes/language/swedish.php @@ -14,6 +14,7 @@ */ global $LANG; $LANG = array ( + 'error_bad_credentials_more_than_3_times' => 'Login credentials do not correspond!
    Please wait 10 seconds before new try', 'user_ga_code' => 'Send GoogleAuthenticator to user by email', 'send_ga_code' => 'Google Authenticator for user', 'error_no_email' => 'This user has no email set!', diff --git a/includes/language/turkish.php b/includes/language/turkish.php index dd295786f..342974325 100644 --- a/includes/language/turkish.php +++ b/includes/language/turkish.php @@ -14,6 +14,7 @@ */ global $LANG; $LANG = array ( + 'error_bad_credentials_more_than_3_times' => 'Login credentials do not correspond!
    Please wait 10 seconds before new try', 'user_ga_code' => 'Send GoogleAuthenticator to user by email', 'send_ga_code' => 'Google Authenticator for user', 'error_no_email' => 'This user has no email set!', diff --git a/includes/language/ukrainian.php b/includes/language/ukrainian.php index b0315017a..76bba2be9 100644 --- a/includes/language/ukrainian.php +++ b/includes/language/ukrainian.php @@ -14,6 +14,7 @@ */ global $LANG; $LANG = array ( + 'error_bad_credentials_more_than_3_times' => 'Login credentials do not correspond!
    Please wait 10 seconds before new try', 'user_ga_code' => 'Відправити електронною поштою GoogleAuthenticator користувачу', 'send_ga_code' => 'Google Authenticator для користувача', 'error_no_email' => 'У цього користувача не вказано електронну пошту!', diff --git a/includes/language/vietnamese.php b/includes/language/vietnamese.php index 7f9190faa..0d01d4bc7 100644 --- a/includes/language/vietnamese.php +++ b/includes/language/vietnamese.php @@ -14,6 +14,7 @@ */ global $LANG; $LANG = array ( + 'error_bad_credentials_more_than_3_times' => 'Login credentials do not correspond!
    Please wait 10 seconds before new try', 'user_ga_code' => 'Gửi mã xác thực GoogleAuthenticator tới người sử dụng qua Email!', 'send_ga_code' => 'Google Authenticator for user', 'error_no_email' => 'Người sử dụng này chưa khai báo địa chỉ email!', diff --git a/install/install.queries.php b/install/install.queries.php index c102fd6be..d7f4f7964 100644 --- a/install/install.queries.php +++ b/install/install.queries.php @@ -605,7 +605,8 @@ function chmod_r($dir, $dirPermissions, $filePermissions) { ('swedish', 'Swedish' , 'se', 'se.png'), ('dutch', 'Dutch' , 'nl', 'nl.png'), ('catalan', 'Catalan' , 'ct', 'ct.png'), - ('vietnamese', 'Vietnamese' , 'vi', 'vi.png');" + ('vietnamese', 'Vietnamese' , 'vi', 'vi.png'), + ('estonia', 'Estonia' , 'ee', 'ee.png');" ); } } else if ($task == "emails") { diff --git a/install/upgrade_run_2.1.26.php b/install/upgrade_run_2.1.26.php index 04c896f6d..77c0a1c94 100644 --- a/install/upgrade_run_2.1.26.php +++ b/install/upgrade_run_2.1.26.php @@ -95,81 +95,84 @@ function tableExists($tablename, $database = false) //Build tree $tree = new Tree\NestedTree\NestedTree( - $_SESSION['tbl_prefix'].'nested_tree', - 'id', - 'parent_id', - 'title' + $_SESSION['tbl_prefix'].'nested_tree', + 'id', + 'parent_id', + 'title' ); // dataBase $res = ""; mysqli_connect( - $_SESSION['db_host'], - $_SESSION['db_login'], - $_SESSION['db_pw'], - $_SESSION['db_bdd'], - $_SESSION['db_port'] + $_SESSION['db_host'], + $_SESSION['db_login'], + $_SESSION['db_pw'], + $_SESSION['db_bdd'], + $_SESSION['db_port'] ); $dbTmp = mysqli_connect( - $_SESSION['db_host'], - $_SESSION['db_login'], - $_SESSION['db_pw'], - $_SESSION['db_bdd'], - $_SESSION['db_port'] + $_SESSION['db_host'], + $_SESSION['db_login'], + $_SESSION['db_pw'], + $_SESSION['db_bdd'], + $_SESSION['db_port'] ); // add field timestamp to cache table $res = addColumnIfNotExist( - $_SESSION['tbl_prefix']."cache", - "timestamp", - "VARCHAR(50) NOT NULL" + $_SESSION['tbl_prefix']."cache", + "timestamp", + "VARCHAR(50) NOT NULL" ); if ($res === false) { - echo '[{"finish":"1", "msg":"", "error":"An error appears when adding field Timestamp to table Cache! '.mysqli_error($dbTmp).'!"}]'; - mysqli_close($dbTmp); - exit(); + echo '[{"finish":"1", "msg":"", "error":"An error appears when adding field Timestamp to table Cache! '.mysqli_error($dbTmp).'!"}]'; + mysqli_close($dbTmp); + exit(); } // add field can_manage_all_users to users table $res = addColumnIfNotExist( - $_SESSION['tbl_prefix']."users", - "can_manage_all_users", - "BOOLEAN NOT NULL DEFAULT FALSE" + $_SESSION['tbl_prefix']."users", + "can_manage_all_users", + "BOOLEAN NOT NULL DEFAULT FALSE" ); if ($res === false) { - echo '[{"finish":"1", "msg":"", "error":"An error appears when adding field can_manage_all_users to table Users! '.mysqli_error($dbTmp).'!"}]'; - mysqli_close($dbTmp); - exit(); + echo '[{"finish":"1", "msg":"", "error":"An error appears when adding field can_manage_all_users to table Users! '.mysqli_error($dbTmp).'!"}]'; + mysqli_close($dbTmp); + exit(); } // alter table Items mysqli_query($dbTmp, "ALTER TABLE `".$_SESSION['tbl_prefix']."items` MODIFY complexity_level VARCHAR(3)"); +// add Estonia +mysqli_query($dbTmp, "INSERT INTO `".$_SESSION['tbl_prefix']."languages` VALUES (null, 'estonia', 'Estonia', 'ee', 'ee.png')"); + // ensure CSRFP config file is ready if (!isset($_SESSION['upgrade']['csrfp_config_file']) || $_SESSION['upgrade']['csrfp_config_file']) != 1) { - $csrfp_file_sample = "../includes/libraries/csrfp/libs/csrfp.config.sample.php"; - $csrfp_file = "../includes/libraries/csrfp/libs/csrfp.config.php"; - if (file_exists($csrfp_file)) { - if (!copy($csrfp_file, $csrfp_file.'.'.date("Y_m_d", mktime(0, 0, 0, date('m'), date('d'), date('y'))))) { - 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."}]'; - break; - } else { - // "The file $csrfp_file already exist. A copy has been created.
    "; - } - } - unlink($csrfp_file); // delete existing csrfp.config file - copy($csrfp_file_sample, $csrfp_file); // make a copy of csrfp.config.sample file - $data = file_get_contents("../includes/libraries/csrfp/libs/csrfp.config.php"); - $newdata = str_replace('"CSRFP_TOKEN" => ""', '"CSRFP_TOKEN" => "'.bin2hex(openssl_random_pseudo_bytes(25)).'"', $data); - $newdata = str_replace('"tokenLength" => "25"', '"tokenLength" => "50"', $newdata); - $jsUrl = $_SESSION['fullurl'].'/includes/libraries/csrfp/js/csrfprotector.js'; - $newdata = str_replace('"jsUrl" => ""', '"jsUrl" => "'.$jsUrl.'"', $newdata); - file_put_contents("../includes/libraries/csrfp/libs/csrfp.config.php", $newdata); - - $_SESSION['upgrade']['csrfp_config_file']) = 1; + $csrfp_file_sample = "../includes/libraries/csrfp/libs/csrfp.config.sample.php"; + $csrfp_file = "../includes/libraries/csrfp/libs/csrfp.config.php"; + if (file_exists($csrfp_file)) { + if (!copy($csrfp_file, $csrfp_file.'.'.date("Y_m_d", mktime(0, 0, 0, date('m'), date('d'), date('y'))))) { + 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."}]'; + break; + } else { + // "The file $csrfp_file already exist. A copy has been created.
    "; + } + } + unlink($csrfp_file); // delete existing csrfp.config file + copy($csrfp_file_sample, $csrfp_file); // make a copy of csrfp.config.sample file + $data = file_get_contents("../includes/libraries/csrfp/libs/csrfp.config.php"); + $newdata = str_replace('"CSRFP_TOKEN" => ""', '"CSRFP_TOKEN" => "'.bin2hex(openssl_random_pseudo_bytes(25)).'"', $data); + $newdata = str_replace('"tokenLength" => "25"', '"tokenLength" => "50"', $newdata); + $jsUrl = $_SESSION['fullurl'].'/includes/libraries/csrfp/js/csrfprotector.js'; + $newdata = str_replace('"jsUrl" => ""', '"jsUrl" => "'.$jsUrl.'"', $newdata); + file_put_contents("../includes/libraries/csrfp/libs/csrfp.config.php", $newdata); + + $_SESSION['upgrade']['csrfp_config_file']) = 1; } echo '[{"finish":"1" , "next":"", "error":""}]'; \ No newline at end of file From d102c4e3201f7d67bad9064569bb55a927c2fb49 Mon Sep 17 00:00:00 2001 From: nilsteampassnet Date: Wed, 1 Jun 2016 17:03:54 +0200 Subject: [PATCH 5/7] 2.1.26 Fix for API deletion service --- api/functions.php | 184 ++++++++++++++------------ install/install.queries.php | 8 ++ install/upgrade_run_2.1.26.php | 8 ++ sources/datatable/datatable.users.php | 5 +- 4 files changed, 115 insertions(+), 90 deletions(-) diff --git a/api/functions.php b/api/functions.php index 44cf0e21f..0569ae335 100644 --- a/api/functions.php +++ b/api/functions.php @@ -17,6 +17,7 @@ require_once "../includes/include.php"; require_once "../sources/main.functions.php"; + function teampass_api_enabled() { teampass_connect(); $response = DB::queryFirstRow( @@ -99,19 +100,7 @@ function addToCacheTable($id) $tags .= $itemTag['tag']." "; } } - // form id_tree to full foldername - /*$folder = ""; - $arbo = $tree->getPath($data['id_tree'], true); - foreach ($arbo as $elem) { - if ($elem->title == $_SESSION['user_id'] && $elem->nlevel == 1) { - $elem->title = $_SESSION['login']; - } - if (empty($folder)) { - $folder = stripslashes($elem->title); - } else { - $folder .= " » ".stripslashes($elem->title); - } - }*/ + // finaly update DB::insert( prefix_table("cache"), @@ -868,92 +857,111 @@ function rest_get () { /* * DELETE * - * Expected call format: .../api/index.php/delete/folder>/?apikey= - * Expected call format: .../api/index.php/delete/item>//?apikey= + * Expected call format: .../api/index.php/delete/folder/?apikey= + * Expected call format: .../api/index.php/delete/item>/?apikey= */ elseif ($GLOBALS['request'][0] == "delete") { + $_SESSION['settings']['cpassman_dir'] = ".."; if($GLOBALS['request'][1] == "folder") { $array_category = explode(';',$GLOBALS['request'][2]); - foreach($array_category as $category) { - if(!preg_match_all("/^([\w\:\'\-\sàáâãäåçèéêëìíîïðòóôõöùúûüýÿ]+)$/i", $category,$result)) { - rest_error('CATEGORY_MALFORMED'); - } - } - - if(count($array_category) > 1 && count($array_category) < 5) { - for ($i = count($array_category); $i > 0; $i--) { - $slot = $i - 1; - if (!$slot) { - $category_query .= "select id from ".prefix_table("nested_tree")." where title LIKE '".$array_category[$slot]."' AND parent_id = 0"; - } else { - $category_query .= "select id from ".prefix_table("nested_tree")." where title LIKE '".$array_category[$slot]."' AND parent_id = ("; - } - } - for ($i = 1; $i < count($array_category); $i++) { $category_query .= ")"; } - } elseif (count($array_category) == 1) { - $category_query = "select id from ".prefix_table("nested_tree")." where title LIKE '".$array_category[0]."' AND parent_id = 0"; + if(count($array_category) > 0 && count($array_category) < 5) { + // load passwordLib library + require_once '../sources/SplClassLoader.php'; + + // prepare tree + $tree = new SplClassLoader('Tree\NestedTree', '../includes/libraries'); + $tree->register(); + $tree = new Tree\NestedTree\NestedTree(prefix_table("nested_tree"), 'id', 'parent_id', 'title', 'personal_folder'); + + // this will delete all sub folders and items associated + for ($i=0; $i < count($array_category); $i ++) { + // Get through each subfolder + $folders = $tree->getDescendants($array_category[$i], true); + print_r($folders); + if (count($folders) > 0) { + foreach ($folders as $folder) { + if (($folder->parent_id > 0 || $folder->parent_id == 0) && $folder->personal_folder != 1) { + //Store the deleted folder (recycled bin) + DB::insert( + prefix_table("misc"), + array( + 'type' => 'folder_deleted', + 'intitule' => "f".$array_category[$i], + 'valeur' => $folder->id.', '.$folder->parent_id.', '. + $folder->title.', '.$folder->nleft.', '.$folder->nright.', '. $folder->nlevel.', 0, 0, 0, 0' + ) + ); + //delete folder + DB::delete(prefix_table("nested_tree"), "id = %i", $folder->id); + + //delete items & logs + $items = DB::query( + "SELECT id + FROM ".prefix_table("items")." + WHERE id_tree=%i", + $folder->id + ); + foreach ($items as $item) { + DB::update( + prefix_table("items"), + array( + 'inactif' => '1', + ), + "id = %i", + $item['id'] + ); + //log + DB::insert( + prefix_table("log_items"), + array( + 'id_item' => $item['id'], + 'date' => time(), + 'id_user' => "9999999", + 'action' => 'at_delete' + ) + ); + } + //Update CACHE table + updateCacheTable("delete_value", $array_category[$i]); + } + } + } + } } else { rest_error ('NO_CATEGORY'); } - // Delete items which in category - $response = DB::delete(prefix_table("items"), "id_tree = (".$category_query.")"); - // Delete sub-categories which in category - $response = DB::delete(prefix_table("nested_tree"), "parent_id = (".$category_query.")"); - // Delete category - $response = DB::delete(prefix_table("nested_tree"), "id = (".$category_query.")"); - - $json['type'] = 'category'; - $json['category'] = $GLOBALS['request'][2]; - if($response) { - $json['status'] = 'OK'; - } else { - $json['status'] = 'KO'; - } + $json['status'] = 'OK'; } elseif($GLOBALS['request'][1] == "item") { - $array_category = explode(';',$GLOBALS['request'][2]); - $item = $GLOBALS['request'][3]; - - foreach($array_category as $category) { - if(!preg_match_all("/^([\w\:\'\-\sàáâãäåçèéêëìíîïðòóôõöùúûüýÿ]+)$/i", $category,$result)) { - rest_error('CATEGORY_MALFORMED'); - } - } - - if(!preg_match_all("/^([\w\:\'\-\sàáâãäåçèéêëìíîïðòóôõöùúûüýÿ]+)$/i", $item,$result)) { - rest_error('ITEM_MALFORMED'); - } elseif (empty($item) || count($array_category) == 0) { - rest_error('MALFORMED'); - } - - if(count($array_category) > 1 && count($array_category) < 5) { - for ($i = count($array_category); $i > 0; $i--) { - $slot = $i - 1; - if (!$slot) { - $category_query .= "select id from ".prefix_table("nested_tree")." where title LIKE '".$array_category[$slot]."' AND parent_id = 0"; - } else { - $category_query .= "select id from ".prefix_table("nested_tree")." where title LIKE '".$array_category[$slot]."' AND parent_id = ("; - } - } - for ($i = 1; $i < count($array_category); $i++) { $category_query .= ")"; } - } elseif (count($array_category) == 1) { - $category_query = "select id from ".prefix_table("nested_tree")." where title LIKE '".$array_category[0]."' AND parent_id = 0"; - } else { - rest_error ('NO_CATEGORY'); - } - - // Delete item - $response = DB::delete(prefix_table("items"), "id_tree = (".$category_query.") and label LIKE '".$item."'"); - $json['type'] = 'item'; - $json['item'] = $item; - $json['category'] = $GLOBALS['request'][2]; - if($response) { - $json['status'] = 'OK'; - } else { - $json['status'] = 'KO'; - } + $array_items = explode(';',$GLOBALS['request'][2]); + + for ($i=0; $i < count($array_items); $i ++) { + DB::update( + prefix_table("items"), + array( + 'inactif' => '1', + ), + "id = %i", + $array_items[$i] + ); + //log + DB::insert( + prefix_table("log_items"), + array( + 'id_item' => $array_items[$i], + 'date' => time(), + 'id_user' => "9999999", + 'action' => 'at_delete' + ) + ); + + //Update CACHE table + updateCacheTable("delete_value", $array_items[$i]); + } + + $json['status'] = 'OK'; } if ($json) { diff --git a/install/install.queries.php b/install/install.queries.php index d7f4f7964..26401f6a1 100644 --- a/install/install.queries.php +++ b/install/install.queries.php @@ -728,6 +728,14 @@ function chmod_r($dir, $dirPermissions, $filePermissions) { } else { $mysqli_result = mysqli_query($dbTmp, "UPDATE `".$var['tbl_prefix']."users` SET `pw` = '".bCrypt($var['admin_pwd'],'13' )."' WHERE login = 'admin' AND id = '1'"); } + + // check that API doesn't exist + $tmp = mysqli_fetch_row(mysqli_query($dbTmp, "SELECT COUNT(*) FROM `".$var['tbl_prefix']."users` WHERE id = '9999999'")); + if ($tmp[0] == 0 || empty($tmp[0])) { + $mysqli_result = mysqli_query($dbTmp, + "INSERT INTO `".$var['tbl_prefix']."users` (`id`, `login`, `read_only`) VALUES ('9999999', 'API', '1')" + ); + } } } // answer back diff --git a/install/upgrade_run_2.1.26.php b/install/upgrade_run_2.1.26.php index 77c0a1c94..9d9a51fa9 100644 --- a/install/upgrade_run_2.1.26.php +++ b/install/upgrade_run_2.1.26.php @@ -143,6 +143,14 @@ function tableExists($tablename, $database = false) exit(); } +// check that API doesn't exist +$tmp = mysqli_fetch_row(mysqli_query($dbTmp, "SELECT COUNT(*) FROM `".$_SESSION['tbl_prefix']."users` WHERE id = '9999999'")); +if ($tmp[0] == 0 || empty($tmp[0])) { + mysqli_query($dbTmp, + "INSERT INTO `".$_SESSION['tbl_prefix']."users` (`id`, `login`, `read_only`) VALUES ('9999999', 'API', '1')" + ); +} + // alter table Items mysqli_query($dbTmp, "ALTER TABLE `".$_SESSION['tbl_prefix']."items` MODIFY complexity_level VARCHAR(3)"); diff --git a/sources/datatable/datatable.users.php b/sources/datatable/datatable.users.php index 9bd177469..3b226ee93 100644 --- a/sources/datatable/datatable.users.php +++ b/sources/datatable/datatable.users.php @@ -203,8 +203,9 @@ } else { $sOutput .= '"'; } - $sOutput .= '"'; - $sOutput .= ','; + if ($record['id'] != "9999999") + $sOutput .= ''; + $sOutput .= '",'; //col2 $sOutput .= '"'.$record['login'].'"'; From 3836f7c230811ec74a1db5f1513a83638214ae8e Mon Sep 17 00:00:00 2001 From: nilsteampassnet Date: Thu, 2 Jun 2016 18:10:23 +0200 Subject: [PATCH 6/7] 2.1.26 Fix: Inconsistency in Delete & Restore process Fix: Errors in CSV import process --- api/functions.php | 182 +++---- changelog.md | 2 + includes/images/flags/ee.png | Bin 0 -> 429 bytes includes/language/english.php | 4 +- includes/language/estonian.php | 904 +++++++++++++++++++++++++++++++++ items.import.php | 9 + sources/folders.queries.php | 2 +- sources/import.queries.php | 10 +- sources/views.queries.php | 6 +- 9 files changed, 1017 insertions(+), 102 deletions(-) create mode 100644 includes/images/flags/ee.png create mode 100644 includes/language/estonian.php diff --git a/api/functions.php b/api/functions.php index 0569ae335..ed3c39d25 100644 --- a/api/functions.php +++ b/api/functions.php @@ -743,9 +743,9 @@ function rest_get () { "SELECT `id`, `pw`, `groupes_interdits`, `groupes_visibles`, `fonction_id` FROM " . $pre . "users WHERE login = %s", $GLOBALS['request'][4] ); - if (DB::count() == 0) { - rest_error ('AUTH_NO_IDENTIFIER'); - } + if (DB::count() == 0) { + rest_error ('AUTH_NO_IDENTIFIER'); + } // load passwordLib library $_SESSION['settings']['cpassman_dir'] = ".."; @@ -866,102 +866,102 @@ function rest_get () { $array_category = explode(';',$GLOBALS['request'][2]); if(count($array_category) > 0 && count($array_category) < 5) { - // load passwordLib library + // load passwordLib library require_once '../sources/SplClassLoader.php'; - - // prepare tree - $tree = new SplClassLoader('Tree\NestedTree', '../includes/libraries'); - $tree->register(); - $tree = new Tree\NestedTree\NestedTree(prefix_table("nested_tree"), 'id', 'parent_id', 'title', 'personal_folder'); - - // this will delete all sub folders and items associated - for ($i=0; $i < count($array_category); $i ++) { - // Get through each subfolder - $folders = $tree->getDescendants($array_category[$i], true); - print_r($folders); - if (count($folders) > 0) { - foreach ($folders as $folder) { - if (($folder->parent_id > 0 || $folder->parent_id == 0) && $folder->personal_folder != 1) { - //Store the deleted folder (recycled bin) - DB::insert( - prefix_table("misc"), - array( - 'type' => 'folder_deleted', - 'intitule' => "f".$array_category[$i], - 'valeur' => $folder->id.', '.$folder->parent_id.', '. - $folder->title.', '.$folder->nleft.', '.$folder->nright.', '. $folder->nlevel.', 0, 0, 0, 0' - ) - ); - //delete folder - DB::delete(prefix_table("nested_tree"), "id = %i", $folder->id); - - //delete items & logs - $items = DB::query( - "SELECT id - FROM ".prefix_table("items")." - WHERE id_tree=%i", - $folder->id - ); - foreach ($items as $item) { - DB::update( - prefix_table("items"), - array( - 'inactif' => '1', - ), - "id = %i", - $item['id'] - ); - //log - DB::insert( - prefix_table("log_items"), - array( - 'id_item' => $item['id'], - 'date' => time(), - 'id_user' => "9999999", - 'action' => 'at_delete' - ) - ); - } - //Update CACHE table - updateCacheTable("delete_value", $array_category[$i]); - } - } - } - } + + // prepare tree + $tree = new SplClassLoader('Tree\NestedTree', '../includes/libraries'); + $tree->register(); + $tree = new Tree\NestedTree\NestedTree(prefix_table("nested_tree"), 'id', 'parent_id', 'title', 'personal_folder'); + + // this will delete all sub folders and items associated + for ($i=0; $i < count($array_category); $i ++) { + // Get through each subfolder + $folders = $tree->getDescendants($array_category[$i], true); + print_r($folders); + if (count($folders) > 0) { + foreach ($folders as $folder) { + if (($folder->parent_id > 0 || $folder->parent_id == 0) && $folder->personal_folder != 1) { + //Store the deleted folder (recycled bin) + DB::insert( + prefix_table("misc"), + array( + 'type' => 'folder_deleted', + 'intitule' => "f".$array_category[$i], + 'valeur' => $folder->id.', '.$folder->parent_id.', '. + $folder->title.', '.$folder->nleft.', '.$folder->nright.', '. $folder->nlevel.', 0, 0, 0, 0' + ) + ); + //delete folder + DB::delete(prefix_table("nested_tree"), "id = %i", $folder->id); + + //delete items & logs + $items = DB::query( + "SELECT id + FROM ".prefix_table("items")." + WHERE id_tree=%i", + $folder->id + ); + foreach ($items as $item) { + DB::update( + prefix_table("items"), + array( + 'inactif' => '1', + ), + "id = %i", + $item['id'] + ); + //log + DB::insert( + prefix_table("log_items"), + array( + 'id_item' => $item['id'], + 'date' => time(), + 'id_user' => "9999999", + 'action' => 'at_delete' + ) + ); + } + //Update CACHE table + updateCacheTable("delete_value", $array_category[$i]); + } + } + } + } } else { rest_error ('NO_CATEGORY'); } - $json['status'] = 'OK'; + $json['status'] = 'OK'; } elseif($GLOBALS['request'][1] == "item") { $array_items = explode(';',$GLOBALS['request'][2]); - - for ($i=0; $i < count($array_items); $i ++) { - DB::update( - prefix_table("items"), - array( - 'inactif' => '1', - ), - "id = %i", - $array_items[$i] - ); - //log - DB::insert( - prefix_table("log_items"), - array( - 'id_item' => $array_items[$i], - 'date' => time(), - 'id_user' => "9999999", - 'action' => 'at_delete' - ) - ); - - //Update CACHE table - updateCacheTable("delete_value", $array_items[$i]); - } - - $json['status'] = 'OK'; + + for ($i=0; $i < count($array_items); $i ++) { + DB::update( + prefix_table("items"), + array( + 'inactif' => '1', + ), + "id = %i", + $array_items[$i] + ); + //log + DB::insert( + prefix_table("log_items"), + array( + 'id_item' => $array_items[$i], + 'date' => time(), + 'id_user' => "9999999", + 'action' => 'at_delete' + ) + ); + + //Update CACHE table + updateCacheTable("delete_value", $array_items[$i]); + } + + $json['status'] = 'OK'; } if ($json) { diff --git a/changelog.md b/changelog.md index 8ae2d687d..4860a91ee 100644 --- a/changelog.md +++ b/changelog.md @@ -39,6 +39,8 @@ Last changes FIX: Security issue with downloadFile.php. Now protected by session and htaccess. FIX: QRCode is not visible in Users list FIX: Display inconsistancies in User log results + Fix: Inconsistency in Delete & Restore process + Fix: Errors in CSV import process 2.1.25 #1169 sending Google Authenticator code through index page diff --git a/includes/images/flags/ee.png b/includes/images/flags/ee.png new file mode 100644 index 0000000000000000000000000000000000000000..0c82efb7dde983e6ab0f6bebb3b2eb326ce3874a GIT binary patch literal 429 zcmV;e0aE^nP)X?Fbu$UUAQCA3`wxix_2=I& zAouq_SzðCcuS!~%52Kai0?gF&VORsRAR2~rJG2PFT1^!)w@)C_d-AAkU2Vc75Z z*R<@y`9z1vevIh)-p7{p`5C+7f|6l;f1_&?! X)GmJPc-xs)00000NkvXXu0mjfGFPrC literal 0 HcmV?d00001 diff --git a/includes/language/english.php b/includes/language/english.php index a45088066..7bc602862 100644 --- a/includes/language/english.php +++ b/includes/language/english.php @@ -14,6 +14,7 @@ */ global $LANG; $LANG = array ( + 'csv_import_information' => 'The CSV file needs to fullfil next rules:
    • The 1st line must be a header,
    • It must contain 5 columns,
    • The separator character is a comma `,`,
    • The encalupsation character is a double quotes `"`,
    • Expected columns are: `Label` , `Login` , `Password` , `URL` , `Comments`.
    ', 'error_bad_credentials_more_than_3_times' => 'Login credentials do not correspond!
    Please wait 10 seconds before new try', 'user_ga_code' => 'Send GoogleAuthenticator to user by email', 'send_ga_code' => 'Google Authenticator for user', @@ -501,7 +502,6 @@ 'import_button' => 'Import', 'import_csv_anyone_can_modify_in_role_txt' => 'Set "anyone in the same role can modify" right on all imported items.', 'import_csv_anyone_can_modify_txt' => 'Set "anyone can modify" right on all imported items.', - 'import_csv_dialog_info' => 'Information: import must be done using a CSV file. Typically a file exported from KeePass has the expected structure.
    If you use a file generated by another tool, please check that CSV structure is as follows: `Account`,`Login Name`,`Password`,`Web Site`,`Comments`.', 'import_csv_menu_title' => 'Import Items', 'import_error_no_file' => 'You must select a file!', 'import_error_no_read_possible' => 'Can\'t read the file!', @@ -804,7 +804,7 @@ 'edit_user' => 'Edit user', 'pf_change_encryption' => 'The encryption algorithm has changed and your personal passwords have to be re-encoded. You need to run this process to use your passwords. This process may take several minutes depending on the number of items you have.', 'operation_encryption_done' => 'Re-encryption has been performed. You can close this dialogbox.', - 'show_password' => 'Show password', + 'show_password' => 'Click and maintain to show password', 'change_password' => 'Change password', 'pf_sk_set' => 'Your personal Salt Key is correctly set, You can click on button Start', 'pf_sk_not_set' => 'Your personal Salt Key is NOT set! Please enter it.', diff --git a/includes/language/estonian.php b/includes/language/estonian.php new file mode 100644 index 000000000..9bf34346e --- /dev/null +++ b/includes/language/estonian.php @@ -0,0 +1,904 @@ + 'Saada GoogleAuthenticator kasutajale e-mailiga', + 'send_ga_code' => 'Google Authenticator kasutajale', + 'error_no_email' => 'Kasutajal puudub e-posti aadress!', + 'error_no_user' => 'Kasutajat ei leitud!', + 'email_ga_subject' => 'Sinu Google Authenticatori ühekordne kood Teampassi jaoks', + 'email_ga_text' => 'Hello,

    Please click this LINK and flash it with GoogleAuthenticator application to get your OTP credentials for Teampass.

    Cheers', + 'settings_attachments_encryption' => 'Lülita sisse manustatud failide krüpteering', + 'settings_attachments_encryption_tip' => 'THIS OPTION COULD BREAK EXISTING ATTACHMENTS, please read carefully the next. If enabled, Items attachments are stored encrypted on the server. The ecryption uses the SALT defined for Teampass. This requieres more server ressources. WARNING: once you change strategy, it is mandatory to run the script to adapt existing attachments. See tab \'Specific Actions\'.', + 'admin_action_attachments_cryption' => 'Krüpteeri või dekrüpteeri manustatud faile', + 'admin_action_attachments_cryption_tip' => 'WARNING: this action has ONLY to be performed after changing the associated option in Teampass settings. Please make a copy of the folder \'upload\' before doing any action, just in case ...', + 'encrypt' => 'Krüpteeri', + 'decrypt' => 'Dekrüpteeri', + 'admin_ga_website_name' => 'Google Authenticatoris kasutatav nimi Teampassi jaoks', + 'admin_ga_website_name_tip' => 'This name is used for the identification code account in Google Authenticator.', + 'admin_action_pw_prefix_correct' => 'Õige parooli prefiks', + 'admin_action_pw_prefix_correct_tip' => 'Before lauching this script, PLEASE be sure to make a dump of the database. This script will perform an update of passwords prefix. It SHALL only be used if you noticed that passwords are displayed with strange prefix.', + 'items_changed' => 'on muudetud.', + 'ga_not_yet_synchronized' => 'Tuvasta ennast Google Authenticatori kaudu', + 'ga_scan_url' => 'Please scan this flashcode with your mobile Google Authenticator application. Copy from it the identification code.', + 'ga_identification_code' => 'Tunnuskood', + 'ga_enter_credentials' => 'Sa pead sisestama oma kasutajatunnuse ja parooli', + 'ga_bad_code' => 'Sinu Google Authenticatori kood on vale', + 'settings_get_tp_info' => 'Lae automaatselt TeamPassi puudutavat informatsiooni', + 'settings_get_tp_info_tip' => 'This option permits the administration page to load information such as version and libraries usage from Teampass server.', + 'at_field' => 'Väli', + 'category_in_folders_title' => 'Seotud kaustad', + 'category_in_folders' => 'Muuda kaustu antud kategoorias', + 'select_folders_for_category' => 'Vali kaustad, mis siduda antud kategooria väljadega', + 'offline_mode_warning' => 'Off-line mode permits you to export into an HTML file your Items, so that you can access them when not connected to Teampass server. The passwords are encrypted by a Key you are given.', + 'offline_menu_title' => 'Offline režiim', + 'settings_offline_mode' => 'Aktiveeri offline režiim', + 'settings_offline_mode_tip' => 'Off-line mode consists in exporting the Items in an HTML file. The Items in this page are encrypted with a key given by User.', + 'offline_mode_key_level' => 'Offline krüpteerimisvõtme minimaalne turvatase', + 'categories' => 'Kategooriad', + 'new_category_label' => 'Loo uus kategooria - Sisesta pealkiri', + 'no_category_defined' => 'Defineeritud kategooriad puuduvad', + 'confirm_deletion' => 'Sa oled kustutamas... oled ikka kindel?', + 'confirm_rename' => 'Kas kinnitad ümbernimetamist?', + 'new_field_title' => 'Sisesta uue välja pealkiri', + 'confirm_creation' => 'Kas kinnitad uue loomist?', + 'confirm_moveto' => 'Kas kinnitad välja liigutamist?', + 'for_selected_items' => 'Valitud kirjele', + 'move' => 'Liiguta', + 'field_add_in_category' => 'Lisa uus väli antud kategoorias', + 'rename' => 'Nimeta ümber', + 'settings_item_extra_fields' => 'Authorize Items to be completed with more Fields (by Categories)', + 'settings_item_extra_fields_tip' => 'This feature permits to enhance the Item definition with extra fields the administrator can define and organize by Categories. All data is encrypted. Notice that this feature consumes more SQL queries (around 5 more per Field during an Item update) and may require more time for actions to be performed. This is server dependant.', + 'html' => 'html', + 'more' => 'Kuva rohkem', + 'save_categories_position' => 'Salvesta kategooriate järjekord', + 'reload_table' => 'Värskenda tabelit', + 'settings_ldap_type' => 'LDAP serveri tüüp', + 'use_md5_password_as_salt' => 'Kasuta sisselogimise parooli `SALTkey` soolana', + 'server_time' => 'Serveri aeg', + 'settings_tree_counters' => 'Show more counters in folders tree', + 'settings_tree_counters_tip' => 'This will display for each folder 3 counters: number of items in folder; number of items in all subfolders; number of subfolders. This feature needs more SQL queries and may require more time to display the Tree.', + 'settings_encryptClientServer' => 'Kliendi-serveri infovahetus on krüpteeritud', + 'settings_encryptClientServer_tip' => 'AES-256 encryption is by-default enabled. This should be the case if no SSL certificat is used to securize data exchanges between client and server. If you are using an SSL protocol or if you are using Teampass in an Intranet, then you could deactivate this feature in order to speed up the data display in Teampass. /!\\ Remember that the safer and more securized solution is to use an SSL connection between Client and Server.', + 'error_group_noparent' => 'Ülemkausta pole valitud!', + 'channel_encryption_no_iconv' => 'Extension ICONV is not loaded! Encryption can\'t be initiated!', + 'channel_encryption_no_bcmath' => 'Extension BCMATH is not loaded! Encryption can\'t be initiated!', + 'admin_action_check_pf' => 'Actualize Personal Folders for all users (creates them if not existing)', + 'admin_actions_title' => 'Konkreetsed tegevused', + 'enable_personal_folder_feature_tip' => 'Once activated, you need to manually run a script that will create the personal folders for the existing users. Notice that this will only create personal folders for Users that do not have such a folder. The script \'".$txt[\'admin_action_check_pf\']."\' is available in tab \'".$txt[\'admin_actions_title\']."\'', + 'is_administrated_by_role' => 'Kasutajat haldab', + 'administrators_only' => 'Ainult administraatorid', + 'managers_of' => 'Rolli haldajad', + 'managed_by' => 'Haldab', + 'admin_small' => 'Admin', + 'setting_can_create_root_folder' => 'Luba juurkausta sisse uue kausta loomine', + 'settings_enable_sts' => 'Enforce HTTPS Strict Transport Security -- Warning: Read ToolTip.', + 'settings_enable_sts_tip' => 'This will enforce HTTPS STS. STS helps stop SSL Man-in-the-Middle attacks. You MUST have a valid SSL certificate in order to use this option. If you have a self-signed certificate and enable this option it will break teampass!! You must have \'SSLOptions +ExportCertData\' in the Apache SSL configuration.', + 'channel_encryption_no_gmp' => 'Extension GMP is not loaded! Encryption can\'t be initiated!', + 'channel_encryption_no_openssl' => 'OPENSSL moodul ei ole serveris laetud! Krüpteerimist ei saa algatada!', + 'channel_encryption_no_file' => 'No encryption keys file was found!
    Please launch upgrade process.', + 'admin_action_generate_encrypt_keys' => 'Genereeri uus krüptovõtmete komplekt', + 'admin_action_generate_encrypt_keys_tip' => 'Encryption keys set is a very important aspect in the security of your TeamPass installation. Indeed those keys are used in order to encrypt the channel between Server and Client. Even if this file is securized outside the WWW zone of your server, it is recommanded to regenerate the keys time to time. Notice that this operation can take up to 1 minute.', + 'settings_anyone_can_modify_bydefault' => 'Aktiveeri \'igaüks saab muuta\' valik vaikimisi', + 'channel_encryption_in_progress' => 'Kanali krüptimine...', + 'channel_encryption_failed' => 'Autentimine ebaõnnestus!', + 'purge_log' => 'Puhasta logid alates', + 'to' => 'kellele', + 'purge_now' => 'Puhasta kohe!', + 'purge_done' => 'Puhastus tehtud! Kirjeid kustutati: ', + 'settings_upload_maxfilesize_tip' => 'Maksimaalne lubatud faili suurus. See peab olema kooskõlas serveri seadetega.', + 'settings_upload_docext_tip' => 'Dokumentide tüübid. Määra lubatud faililaiendid eraldades need komaga (,)', + 'settings_upload_imagesext_tip' => 'Piltide tüübid. Määra lubatud faililaiendid eraldades need komaga (,)', + 'settings_upload_pkgext_tip' => 'Pakitud failide tüübid. Määra lubatud faililaiendid eraldades need komaga (,)', + 'settings_upload_otherext_tip' => 'Muud failitüübid. Määra lubatud faililaiendid eraldades need komaga (,)', + 'settings_upload_imageresize_options_tip' => 'When activated, this option resizes the Images to the format indicated just below.', + 'settings_upload_maxfilesize' => 'Maksimaalne faili suurus (Mb)', + 'settings_upload_docext' => 'Lubatud dokumendiformaadid', + 'settings_upload_imagesext' => 'Lubatud pildiformaadid', + 'settings_upload_pkgext' => 'Lubatud pakkeformaadid', + 'settings_upload_otherext' => 'Luba teisi failiformaate', + 'settings_upload_imageresize_options' => 'Kas piltide suurust tuleks muuta', + 'settings_upload_imageresize_options_w' => 'Uute piltide laius (pikslites)', + 'settings_upload_imageresize_options_h' => 'Uute piltide kõrgus (pikslites)', + 'settings_upload_imageresize_options_q' => 'Uute piltide kvaliteet', + 'admin_upload_title' => 'Manused', + 'settings_importing' => 'Luba andmete import CVS/KeyPass failidest', + 'admin_proxy_ip' => 'Proxy IP', + 'admin_proxy_ip_tip' => 'If your Internet connection goes through a proxy. Indicate here its IP.
    Leave empty if no Proxy.
    ', + 'admin_proxy_port' => 'Proxy port', + 'admin_proxy_port_tip' => 'If you have set an IP for the Proxy, now indicate its PORT. Could be 8080.
    Leave empty if no Proxy.
    ', + 'settings_ldap_elusers' => ' Ainult TeamPassi kohalikud kasutajad ', + 'settings_ldap_elusers_tip' => ' This feature allows users in the database to authenticate via LDAP. Disable this if you want to browse any LDAP directory. ', + 'error_role_complex_not_set' => 'The Role must have a minimum required passwords complexity level!', + 'item_updated_text' => 'Seda kirjet ei saa muuta. Sa pead seda esmalt uuendama.', + 'database_menu' => 'Andmebaas', + 'db_items_edited' => 'Tegelit muudetud kirjete arv', + 'item_edition_start_hour' => 'Muutmine algas', + 'settings_delay_for_item_edition' => 'After how long an Item edition is considered as failed (in minutes)', + 'settings_delay_for_item_edition_tip' => 'When editing an Item, the Item is locked so that no other parallel edition can be performed. A kind of token is reserved.
    This setting permits to delete the token. If the value is set to 0 then the token will never be deleted (unless by Administrator)
    ', + 'db_users_logged' => 'Tegelik logitud kasutajate arv', + 'action' => 'Tegevus', + 'login_time' => 'Sisseloginud alates', + 'lastname' => 'Perekonnanimi', + 'user_login' => 'Kasutajatunnus', + 'at_user_new_lastname' => 'Kasutaja #user_login# perekonnanimi muudetud', + 'at_user_new_name' => 'Kasutaja #user_login# nimi muudetud', + 'info_list_of_connected_users_approximation' => 'Note: This list may show more connected users than it is really the case.', + 'disconnect_all_users' => 'Logi kõik kasutajad välja (peale administraatorite)', + 'role' => 'Roll', + 'admin_2factors_authentication_setting' => 'Aktiveeri Google 2-faktoriline autentimine', + 'admin_2factors_authentication_setting_tip' => 'Google 2-Factors autentication permits to add one more security level for user autentication. When user wants to login TeamPass, a QR code is generated. This QR code needs to be scanned by the user to get a one-time password.
    WARNING: this extra needs an Internet connection and a scanner such as a smartphone.
    ', + '2factors_tile' => '2-faktoriline autentimine', + '2factors_image_text' => 'Palun skanneeri QR kood', + '2factors_confirm_text' => 'Sisesta ühekordne OTP parool', + 'bad_onetime_password' => 'Vale ühekordne OTP parool!', + 'error_string_not_utf8' => 'Viga tekkis, kuna tekst ei olnud UTF8 formaadis!', + 'error_role_exist' => 'Selline roll juba eksisteerib!', + 'error_no_edition_possible_locked' => 'Edition not possible. This Item is presently edited!', + 'error_mcrypt_not_loaded' => 'Extension \'mcrypt\' is actually not loaded in PHP module. This module is required for TeamPass to work. Please inform your administrator if you see this message.', + 'at_user_added' => 'Kasutaja #user_login# on lisatud', + 'at_user_deleted' => 'Kasutaja #user_login# on kustutatud', + 'at_user_locked' => 'Kasutaja #user_login# on lukustatud', + 'at_user_unlocked' => 'Kasutaja #user_login# on avatud', + 'at_user_email_changed' => 'Kasutaja #user_login# e-posti aadress muudetud', + 'at_user_pwd_changed' => 'Kasutaja #user_login# parool muudetud', + 'at_user_initial_pwd_changed' => 'Kasutaja #user_login# esmakordne paroolivahetus', + 'user_mngt' => 'Kasutajate haldus', + 'select' => 'vali', + 'user_activity' => 'Kasutaja tegevused', + 'items' => 'Kirjed', + 'enable_personal_saltkey_cookie' => 'Enable personal SALTKey to be stored in a cookie', + 'personal_saltkey_cookie_duration' => 'Personal SALTKey cookie DAYS life time before expiration', + 'admin_emails' => 'E-mailid', + 'admin_emails_configuration' => 'E-posti seadistus', + 'admin_emails_configuration_testing' => 'Seadistuste katsetamine', + 'admin_email_smtp_server' => 'SMTP server', + 'admin_email_auth' => 'SMTP server vajab autentimist', + 'admin_email_auth_username' => 'Kasutajanimi autentimiseks', + 'admin_email_auth_pwd' => 'Parool autentimiseks', + 'admin_email_port' => 'Serveri port', + 'admin_email_from' => 'Saatja e-mail (kellelt)', + 'admin_email_from_name' => 'Saatja nimi (kellelt)', + 'admin_email_test_configuration' => 'Katseta e-posti seadistuste tööd', + 'admin_email_test_configuration_tip' => 'This test should send an email to the address indicated. If you don\'t receive it, please check your credentials.', + 'admin_email_test_subject' => '[Teampass] Test e-mail', + 'admin_email_test_body' => 'Tere,

    E-mail on edukalt saadetud.

    Kõike head.', + 'admin_email_result_ok' => 'E-mail on saadetud #email# aadressile... Kontrolli oma postkasti.', + 'admin_email_result_nok' => 'Email not sent ... check your configuration. See associated error: ', + 'email_subject_item_updated' => 'Parool on muudetud', + 'email_body_item_updated' => 'Hello,

    Password for \'#item_label#\' has been updated.

    You can check it HERE

    Cheers', + 'email_bodyalt_item_updated' => 'Objekti #item_label# parool on uuendatud.', + 'admin_email_send_backlog' => 'Send emails backlog (actually #nb_emails# emails)', + 'admin_email_send_backlog_tip' => 'This script permits to force the emails in the database to be sent.
    This could take some time depending of the number of emails to send.', + 'please_wait' => 'Palun oota!', + 'admin_url_to_files_folder' => 'Manuste kausta URL aadress', + 'admin_path_to_files_folder' => 'Manuste kausta absoluutne tee', + 'admin_path_to_files_folder_tip' => 'Files folder is used to store all generated files by TeamPass and also some uploaded files.
    IMPORTANT: for security reason, this folder should not be in the WWW folder of your website. It should be set in a protected area with a specific redirection rule in your Server configuration.
    IMPORTANT 2:It could be good to set a CRON task in order to clean up periodically this folder.
    ', + 'admin_path_to_upload_folder_tip' => 'Upload folder is used to store all uploaded files associated to Items.
    IMPORTANT: for security reason, this folder should not be in the WWW folder of your website. It should be set in a protected area with a specific redirection rule in your Server configuration.
    IMPORTANT 2:This folder should never be clean up! Those files are associated to the Items.
    ', + 'pdf_export' => 'PDF eksport', + 'pdf_password' => 'PDF krüpteerimisparool', + 'pdf_password_warning' => 'Sa pead määrama krüpteerimisparooli!', + 'admin_pwd_maximum_length' => 'Maksimaalne paroolide pikkus', + 'admin_pwd_maximum_length_tip' => 'The default value for passwords length is set to 40. It is important to know that setting a high value length will have impact on performances. Indeed more long is this value, more time the server needs to encrypt and decrypt, and to display passwords.', + 'settings_insert_manual_entry_item_history' => 'Enable permitting manual insertions in Items History log', + 'settings_insert_manual_entry_item_history_tip' => 'For any reason you may need to add manually an entry in the history of the Item. By activating this feature, it is possible.', + 'add_history_entry' => 'Sisesta kirje ajaloo logisse', + 'at_manual' => 'Manuaalne tegevus', + 'at_manual_add' => 'Lisatud käsitsi', + 'admin_path_to_upload_folder' => 'Upload kausta absoluutne teekond', + 'admin_url_to_upload_folder' => 'Upload kausta URL', + 'automatic_del_after_date_text' => 'või peale kuupäeva', + 'at_automatically_deleted' => 'Automaatselt kustutatud', + 'admin_setting_enable_delete_after_consultation' => 'Item consulted can be automatically deleted', + 'admin_setting_enable_delete_after_consultation_tip' => 'When enabled, the Item creator can decide that Item will be automatically deleted after being seen X times.', + 'enable_delete_after_consultation' => 'Kui kirje on nähtud, siis see kustutatakse automaatselt', + 'times' => 'korda.', + 'automatic_deletion_activated' => 'Automaatne kustutamine aktiveeritud', + 'at_automatic_del' => 'automaatne kustutamine', + 'error_times_before_deletion' => 'Number of consultation before deletion needs to be more than 0!', + 'enable_notify' => 'Aktiveeri teavitused', + 'disable_notify' => 'Keela teavitused', + 'notify_activated' => 'Teavitused aktiveeritud', + 'at_email' => 'e-mail', + 'enable_email_notification_on_item_shown' => 'Saada e-postiga teavitus, kui seda kirjet kuvatakse', + 'bad_email_format' => 'Email address doesn\'t have the expected format!', + 'item_share_text' => 'In order to share this item by mail, enter the email address and press SEND button.', + 'share' => 'Jaga antud objekti', + 'share_sent_ok' => 'E-mail on saadetud', + 'email_share_item_subject' => '[TeamPass] Sinuga jagati kirjet', + 'email_share_item_mail' => 'Hello,

    #tp_user# has shared with you the item #tp_item#
    Click the LINK to access.

    Best regards.', + 'see_item_title' => 'Objekti detailid', + 'email_on_open_notification_subject' => '[TeamPass] Teavitus kirje avamisest', + 'email_on_open_notification_mail' => 'Hello,

    #tp_user# has opened and watched the Item \'#tp_item#\'.
    Click the LINK to access.

    Best regards.', + 'pdf' => 'PDF', + 'csv' => 'CSV', + 'user_admin_migrate_pw' => 'Migrate personal Items to a user account', + 'migrate_pf_select_to' => 'Migrate personal Items to user', + 'migrate_pf_user_salt' => 'Sisesta valitud kasutaja parooli sool', + 'migrate_pf_no_sk' => 'Sa ei ole sisestanud enda parooli soola', + 'migrate_pf_no_sk_user' => 'Sa pead sisestama enda parooli soola', + 'migrate_pf_no_user_id' => 'Sa pead valima kasutaja";', + 'email_subject_new_user' => '[TeamPass] Sinu konto loomine', + 'email_new_user_mail' => 'Hello,

    An administrator has created your account for Teampass.
    You can use the next credentials for being logged:
    - Login: #tp_login#
    - Password: #tp_pw#

    Click the LINK to access.

    Best regards.', + 'error_empty_data' => 'Viga, andmed puuduvad!', + 'error_not_allowed_to' => 'Sul ei ole lubatud seda toimingut teostada!', + 'personal_saltkey_lost' => 'Algseadista minu personaalne parooli sool', + 'new_saltkey_warning_lost' => 'You have lost your saltkey? What a pitty, this one can\'t be recovered, so please be sure before continuing.
    By reseting your saltkey, all your previous personal items will be deleted!', + 'previous_pw' => 'Eelnevalt kasutatud parool:', + 'no_previous_pw' => 'Eelnevat parooli pole', + 'request_access_ot_item' => 'Taotle autorilt juurdepääsu', + 'email_request_access_subject' => '[TeamPass] Kirjele juurdepääsu taotlus', + 'email_request_access_mail' => 'Hello #tp_item_author#,

    User #tp_user# has required an access to \'#tp_item#\'.

    Be sure of the rights of this user before changing the restriction to the Item.

    Regards.', + 'admin_action_change_salt_key' => 'Change the main SALT Key', + 'admin_action_change_salt_key_tip' => 'Before changing the SALT key, please be sure to do a full backup of the database, and to put the tool in maintenance in order to avoid any users being logged.', + 'block_admin_info' => 'Administraatori info', + 'admin_new1' => '14FEB2012:
    Administrator profile is no more allowed to see items. This profile is now only an Administrative account.
    See TeamPass.net page concerning the way to handle this change.', + 'nb_items_by_query' => 'Number of items to get at each query iterration', + 'nb_items_by_query_tip' => 'More items means more time to display the list.
    Set to \'auto\' to let the tool to adapt this number depending on the size screen of the user.
    Set to \'max\' to force to display the complet list in one time.
    Set a number corresding to the number of items to get at each query iterration.
    ', + 'error_no_selected_folder' => 'Sa pead valima kausta', + 'open_url_link' => 'Ava uuel lehel', + 'error_pw_too_long' => 'Parool on liiga pikk! On lubatud kuni 40 tähemärki.', + 'at_restriction' => 'Piirang', + 'pw_encryption_error' => 'Error encryption of the password!', + 'enable_send_email_on_user_login' => 'Send an email to Admins on User log in', + 'email_subject_on_user_login' => '[TeamPass] Kasutaja logis sisse', + 'email_body_on_user_login' => 'Hello,

    User #tp_user# has connected to TeamPass the #tp_date# at #tp_time#.

    Regards.', + 'account_is_locked' => 'See konto on lukustatud', + 'activity' => 'Tegevus', + 'add_button' => 'Lisa', + 'add_new_group' => 'Lisa uus kaust', + 'add_role_tip' => 'Lisa uus roll.', + 'admin' => 'Haldamine', + 'admin_action' => 'Palun valideeri oma tegevus', + 'admin_action_db_backup' => 'Loo andmebaasist varukoopia', + 'admin_action_db_backup_key_tip' => 'Please enter the encryption key. Save it somewhere, it will be asked when restoring. (leave empty to not encrypt)', + 'admin_action_db_backup_start_tip' => 'Alusta', + 'admin_action_db_backup_tip' => 'It is a good practice to create a backup that could be used to restore your database.', + 'admin_action_db_clean_items' => 'Remove orphan items from database', + 'admin_action_db_clean_items_result' => 'kirjed on kustutatud', + 'admin_action_db_clean_items_tip' => 'This will only delete those items and associated logs that have not been deleted after the associated folder has been deleted. It is suggested to create a backup before.', + 'admin_action_db_optimize' => 'Optimeeri andmebaasi', + 'admin_action_db_restore' => 'Taasta andmebaas', + 'admin_action_db_restore_key' => 'Palun sisesta krüpteerimisparool.', + 'admin_action_db_restore_tip' => 'It has to be done using an SQL backup file created by the backup functionality.', + 'admin_action_purge_old_files' => 'Puhasta vanad failid', + 'admin_action_purge_old_files_result' => 'failid on kustutatud.', + 'admin_action_purge_old_files_tip' => 'This will delete all temporary files older than 7 days.', + 'admin_action_reload_cache_table' => 'Värskenda vahemälu tabelit', + 'admin_action_reload_cache_table_tip' => 'This permits to reload the full content of table Cache. Can be usefull to be done sometimes.', + 'admin_backups' => 'Varukoopiad', + 'admin_error_no_complexity' => '(Define?)', + 'admin_error_no_visibility' => 'No one can see this item. (Customize roles)', + 'admin_functions' => 'Rollide haldus', + 'admin_groups' => 'Kaustade haldus', + 'admin_help' => 'Abi', + 'admin_info' => 'Tooteinfo', + 'admin_info_loading' => 'Laen andmeid... palun oota', + 'admin_ldap_configuration' => 'LDAP seadistus', + 'admin_ldap_menu' => 'LDAP valikud', + 'admin_main' => 'Informatsioon', + 'admin_misc_cpassman_dir' => 'TeamPassi absoluutne failisüsteemi asukoht', + 'admin_misc_cpassman_url' => 'TeamPassi terviklik URL', + 'admin_misc_custom_login_text' => 'Enda valitud sisselogimise tekst', + 'admin_misc_custom_logo' => 'Enda valitud sisselogmise logo URL', + 'admin_misc_favicon' => 'Favicon pildi URL', + 'admin_misc_title' => 'Kohanda', + 'admin_one_shot_backup' => 'Ühe klikiga varundamine ja taastamine', + 'admin_script_backups' => 'Varukoopia skriptide sätted', + 'admin_script_backups_tip' => 'For more security, it is recommended to parameter a scheduled backup of the database.
    Use your server to schedule a daily cron task by calling the file \'script.backup.php\' in \'backups\' folder.
    You first need to set the 2 first paramteres and SAVE them.', + 'admin_script_backup_decrypt' => 'Faili nimi, mida lahti krüpteerida', + 'admin_script_backup_decrypt_tip' => 'In order to decrypt a backup file, just indicate the name of the backup file (no extension and no path).
    The file will be decrypted in the same folder as the backup files are.', + 'admin_script_backup_encryption' => 'Krüpteerimisparool (vabatahtlik)', + 'admin_script_backup_encryption_tip' => 'If set, this key will be used to encrypted your file', + 'admin_script_backup_filename' => 'Varukoopia faili nimi', + 'admin_script_backup_filename_tip' => 'Varukoopia faili nimi', + 'admin_script_backup_path' => 'Varukoopiate asukoht failisüsteemis', + 'admin_script_backup_path_tip' => 'Varukoopiate kaust', + 'admin_settings' => 'Sätted', + 'admin_settings_title' => 'TeamPassi sätted', + 'admin_setting_activate_expiration' => 'Aktiveeri paroolide aegumine', + 'admin_setting_activate_expiration_tip' => 'When enabled, items expired will not be displayed to users.', + 'admin_users' => 'Kasutajate haldus', + 'admin_views' => 'Vaated', + 'alert_message_done' => 'Valmis!', + 'alert_message_personal_sk_missing' => 'You must enter your personal saltkey!', + 'all' => 'kõik', + 'anyone_can_modify' => 'Allow this item to be modified by anyone that can access it', + 'associated_role' => 'What role to associate this folder to :', + 'associate_kb_to_items' => 'Select the items to associate to this KB', + 'assoc_authorized_groups' => 'Allowed Associated Folders', + 'assoc_forbidden_groups' => 'Forbidden Associated Folders', + 'at' => '@', + 'at_add_file' => 'Fail lisatud', + 'at_category' => 'Kaust', + 'at_copy' => 'Kopeerimine valmis', + 'at_creation' => 'Loomine', + 'at_delete' => 'Kustutamine', + 'at_del_file' => 'Fail kustutatud', + 'at_description' => 'Kirjeldus.', + 'at_file' => 'Fail', + 'at_import' => 'Imporditud', + 'at_label' => 'Silt', + 'at_login' => 'Sisenemine', + 'at_modification' => 'Muutmine', + 'at_moved' => 'Liigutatud', + 'at_personnel' => 'Personal', + 'at_pw' => 'Parool muudetud.', + 'at_restored' => 'Taastatud', + 'at_shown' => 'Kuvatud', + 'at_url' => 'URL', + 'auteur' => 'Autor', + 'author' => 'Autor', + 'authorized_groups' => 'Lubatud kaustad', + 'auth_creation_without_complexity' => 'Allow creating an item without respecting the required password complexity', + 'auth_modification_without_complexity' => 'Allow modifying an item without respecting the required password complexity', + 'auto_create_folder_role' => 'Loo kaust ja roll kasutajale ', + 'block_last_created' => 'Viimati loodud', + 'bugs_page' => 'If you discover a bug, you can directly post it in Bugs Forum.', + 'by' => 'poolt', + 'cancel' => 'Katkesta', + 'cancel_button' => 'Katkesta', + 'can_create_root_folder' => 'Saab luua uut kausta juurkausta tasemele', + 'changelog' => 'Viimased uudised', + 'change_authorized_groups' => 'Muuda volitatud kaustu', + 'change_forbidden_groups' => 'Muuda keelatud kaustu', + 'change_function' => 'Muuda rolle', + 'change_group_autgroups_info' => 'Select the authorized folders this Role can see and use', + 'change_group_autgroups_title' => 'Seadista volitatud kaustu', + 'change_group_forgroups_info' => 'Select the forbidden folders this Role can\'t see and use', + 'change_group_forgroups_title' => 'Seadista keelatud kaustu', + 'change_user_autgroups_info' => 'Select the authorized folders this account can see and use', + 'change_user_autgroups_title' => 'Seadista volitatud kaustu', + 'change_user_forgroups_info' => 'Select the forbidden folders this account can\'t see nor use', + 'change_user_forgroups_title' => 'Seadista keelatud kaustu', + 'change_user_functions_info' => 'Select the functions associated to this account', + 'change_user_functions_title' => 'Seadista seotud funktsioone', + 'check_all_text' => 'Vali kõik', + 'close' => 'Sulge', + 'complexity' => 'Keerukus', + 'complex_asked' => 'Nõutud keerukus', + 'complex_level0' => 'Väga nõrk', + 'complex_level1' => 'Nõrk', + 'complex_level2' => 'Keskmine', + 'complex_level3' => 'Tugev', + 'complex_level4' => 'Väga tugev', + 'complex_level5' => 'Turvaline', + 'complex_level6' => 'Väga turvaline', + 'confirm' => 'Kinnita', + 'confirm_delete_group' => 'You have decided to delete this Folder and all included Items ... are you sure?', + 'confirm_del_account' => 'Soovid kustutatada seda kontot. Oled kindel?', + 'confirm_del_from_fav' => 'Palun kinnita lemmikute alt kustutamist', + 'confirm_del_role' => 'Please confirm the deletion of the next role:', + 'confirm_edit_role' => 'Please enter the name of the next role:', + 'confirm_lock_account' => 'You have decided to LOCK this Account. Are you sure?', + 'connection' => 'Ühendus', + 'connections' => 'ühendused', + 'copy' => 'Kopeeri', + 'copy_to_clipboard_small_icons' => 'Enable copy to clipboard small icons in items page', + 'copy_to_clipboard_small_icons_tip' => 'This could help preventing memory usage if users have no recent computer.
    Indeed, the clipboard is not loaded with items informations. But no quick copy of password and login is possible. 'Loomise aeg', + 'csv_import_button_text' => 'Sirvi CSV faili', + 'date' => 'Kuupäev', + 'date_format' => 'Kuupäeva formaat', + 'days' => 'päevi', + 'definition' => 'Definitsioon', + 'delete' => 'Kustuta', + 'deletion' => 'Kustutamised', + 'deletion_title' => 'Nimekiri kustutatud kirjetest', + 'del_button' => 'Kustuta', + 'del_function' => 'Kustuta rolle', + 'del_group' => 'Kustuta kaust', + 'description' => 'Kirjeldus', + 'disconnect' => 'Välju', + 'disconnection' => 'Välju', + 'div_dialog_message_title' => 'Informatsioon', + 'done' => 'Valmis', + 'drag_drop_helper' => 'Drag and drop item', + 'duplicate_folder' => 'Luba kasutada mitut samanimelist kausta.', + 'duplicate_item' => 'Luba kasutada mitut samanimelist kirjet.', + 'email' => 'E-mail', + 'email_altbody_1' => 'Objekt', + 'email_altbody_2' => 'on loodud.', + 'email_announce' => 'Teavita antud kirjest e-postiga', + 'email_body1' => 'Tere!

    Kirje \'', + 'email_body2' => 'on loodud.

    Sa saad seda vaadata, vajutades '>SIIA

    Tervitades.', + 'email_change' => 'Muuda konto e-posti aadressi', + 'email_changed' => 'E-post muudetud!', + 'email_select' => 'Vali isikud, keda teavitada', + 'email_subject' => 'Paroolihaldurisse uue kirje loomine', + 'email_text_new_user' => 'Tere!

    Sinu konto on loodud TeamPassi.
    Sa saad nüüd aadressile $TeamPass_url oma kasutaja ja parooliga siseneda:
    ', + 'enable_favourites' => 'Luba kasutajatel lemmikute salvestamine', + 'enable_personal_folder' => 'Aktiveeri personaalne kaust', + 'enable_personal_folder_feature' => 'Aktiveeri personaalse kausta funktsioon', + 'enable_user_can_create_folders' => 'Users are allowed to manage folders in allowed parent folders', + 'encrypt_key' => 'Krüpteerimisparool', + 'errors' => 'vead', + 'error_complex_not_enought' => 'Parooli keerukus on täitmata!', + 'error_confirm' => 'Parooli kinnitus ei ole korrektne!', + 'error_cpassman_dir' => 'No path for TeamPass is set. Please select \'TeamPass settings\' tab in Admin Settings page.', + 'error_cpassman_url' => 'No URL for TeamPass is set. Please select \'TeamPass settings\' tab in Admin Settings page.', + 'error_fields_2' => 'Need 2 välja on kohustuslikud!', + 'error_group' => 'Kausta valimine on kohustuslik!', + 'error_group_complex' => 'The Folder must have a minimum required passwords complexity level!', + 'error_group_exist' => 'Selline kaust on juba olemas!', + 'error_group_label' => 'Kaustale tuleb anda nimi!', + 'error_html_codes' => 'Osa tekstist sisaldab HTML koodi! See ei ole lubatud.', + 'error_item_exists' => 'Selline kirje on juba olemas!', + 'error_label' => 'Silt on kohustuslik!', + 'error_must_enter_all_fields' => 'Sa pead täitma kõik väljad!', + 'error_mysql' => 'MySQL viga!', + 'error_not_authorized' => 'Sul ei ole õigust seda lehte näha.', + 'error_not_exists' => 'Sellist lehte ei eksisteeri.', + 'error_no_folders' => 'Alusta esmalt uue kausta loomisega.', + 'error_no_password' => 'Sa pead sisestama parooli!', + 'error_no_roles' => 'You should also create some roles and associate them to folders.', + 'error_password_confirmation' => 'Paroolid peavad kattuma', + 'error_pw' => 'Parool on kohustuslik!', + 'error_renawal_period_not_integer' => 'Uuendamise periood tuleks märkida kuudes!', + 'error_salt' => 'The SALT KEY is too long! Please don\'t use the tool until an Admin has modified the salt key. In settings.php file, SALT should not be longer than 32 characters.', + 'error_tags' => 'Lubamatu kirjavahemärk märksõna sees! Ainult tühik on lubatud.', + 'error_user_exists' => 'Selline kasutaja on juba olemas', + 'expiration_date' => 'Aegumine', + 'expir_one_month' => '1 kuu', + 'expir_one_year' => '1 aasta', + 'expir_six_months' => '6 kuud', + 'expir_today' => 'täna', + 'files_&_images' => 'Failid & Pildid', + 'find' => 'Otsi', + 'find_text' => 'Sinu otsing', + 'folders' => 'Kaustad', + 'forbidden_groups' => 'Keelatud kaustad', + 'forgot_my_pw' => 'Unustasid parooli?', + 'forgot_my_pw_email_sent' => 'E-post on saadetud', + 'forgot_my_pw_error_email_not_exist' => 'Sellist e-posti aadressi ei eksisteeri!', + 'forgot_my_pw_text' => 'Sinu parool on saadetud Sinu kontos määratud e-posti aadressile.', + 'forgot_pw_email_altbody_1' => 'Tere

    Sinu kasutaja andmed TeamPassi jaoks on:', + 'forgot_pw_email_body' => 'Tere

    Sinu uus parool TeamPassi jaoks on:', + 'forgot_pw_email_body_1' => 'Tere!

    Sinu konto andmed TeamPassi jaoks on:

    ', + 'forgot_pw_email_subject' => 'TeamPass - Sinu parool', + 'forgot_pw_email_subject_confirm' => '[TeamPass] Sinu parooli samm 2', + 'functions' => 'Rollid', + 'function_alarm_no_group' => 'Antud roll ei ole seotud ühegi kaustaga!', + 'generate_pdf' => 'Genereeri PDF fail', + 'generation_options' => 'Genereerimise valikud', + 'gestionnaire' => 'Haldaja', + 'give_function_tip' => 'Lisa uus roll', + 'give_function_title' => 'Lisa uus roll', + 'give_new_email' => 'Palun sisesta uus e-posti aadress', + 'give_new_login' => 'Palun vali konto', + 'give_new_pw' => 'Palun määra uus parool', + 'god' => 'Administraator', + 'group' => 'Kaust', + 'group_parent' => 'Ülemkaust', + 'group_pw_duration' => 'Uuendamise periood', + 'group_pw_duration_tip' => 'Kuudes. Keelamiseks sisesta 0.', + 'group_select' => 'Vali kaust', + 'group_title' => 'Kausta silt', + 'history' => 'Ajalugu', + 'home' => 'Esileht', + 'home_personal_menu' => 'Isiklik tegevus', + 'home_personal_saltkey' => 'Sinu parooli sool', + 'home_personal_saltkey_button' => 'Määra parooli sool', + 'home_personal_saltkey_info' => 'You should enter your personal saltkey if you need to use your personal items.', + 'home_personal_saltkey_label' => 'Sisesta oma personaalne parooli sool', + 'importing_details' => 'Detailide nimekiri', + 'importing_folders' => 'Kaustade importimine', + 'importing_items' => 'Kirjete importimine', + 'import_button' => 'Import', + 'import_csv_anyone_can_modify_in_role_txt' => 'Set "anyone in the same role can modify" right on all imported items.', + 'import_csv_anyone_can_modify_txt' => 'Set "anyone can modify" right on all imported items.', + 'import_csv_dialog_info' => 'Information: import must be done using a CSV file. Typically a file exported from KeePass has the expected structure.
    If you use a file generated by another tool, please check that CSV structure is as follows: `Account`,`Login Name`,`Password`,`Web Site`,`Comments`.', + 'import_csv_menu_title' => 'Impordi kirjed', + 'import_error_no_file' => 'Sa pead valima faili!', + 'import_error_no_read_possible' => 'Faili ei saa lugeda!', + 'import_error_no_read_possible_kp' => 'Can\'t read the file! It must be a KeePass file.', + 'import_keepass_dialog_info' => 'Please use this to select an XML file generated by KeePass export functionality. Will only work with KeePass file! Notice that the import script will not import folders or elements that already exist at the same level of the tree structure.', + 'import_keepass_to_folder' => 'Vali sihtkaust', + 'import_kp_finished' => 'Import from KeePass is now finished !
    By default, the complexity level for new folders have been set to `Medium`. Perhaps will you need to change it.', + 'import_to_folder' => 'Märgi kirjed, mida soovid kausta importida:', + 'index_add_one_hour' => 'Pikenda sessiooni 1 tunni võrra', + 'index_alarm' => 'HÄIRE!!!', + 'index_bas_pw' => 'Vale parool!', + 'index_change_pw' => 'Muuda parooli', + 'index_change_pw_button' => 'Muuda', + 'index_change_pw_confirmation' => 'Kinnita', + 'index_expiration_in' => 'sessioon aegub', + 'index_get_identified' => 'Palun tuvasta ennast', + 'index_identify_button' => 'Sisene', + 'index_identify_you' => 'Palun tuvasta ennast', + 'index_last_pw_change' => 'Parool muudetud', + 'index_last_seen' => 'Viimane ühendus', + 'index_login' => 'Konto', + 'index_maintenance_mode' => 'Vabandame, toimub hooldus! Ainult administraatorid saavad siseneda.', + 'index_maintenance_mode_admin' => 'Maintenance mode is activated. Users currently can not access TeamPass.', + 'index_new_pw' => 'Uus parool', + 'index_password' => 'Parool', + 'index_pw_error_identical' => 'Paroolid peavad olema identsed!', + 'index_pw_expiration' => 'Tegelik parooli aegumine toimub', + 'index_pw_level_txt' => 'Keerukus', + 'index_refresh_page' => 'Värskenda lehte', + 'index_session_duration' => 'Sessiooni kestvus', + 'index_session_ending' => 'Sinu sessioon aegub 1 minuti pärast.', + 'index_session_expired' => 'Sinu sessioon on aegunud või Sa ei ole korrektselt tuvastatud!', + 'index_welcome' => 'Teretulemast', + 'info' => 'Informatsioon', + 'info_click_to_edit' => 'Vajuta välja peal, et muuta selle sisu', + 'is_admin' => 'On admin', + 'is_manager' => 'On haldaja', + 'is_read_only' => 'On vaataja', + 'items_browser_title' => 'Kaustad', + 'item_copy_to_folder' => 'Please select a folder in which the item has to be copied.', + 'item_menu_add_elem' => 'Lisa objekt', + 'item_menu_add_rep' => 'Lisa kaust', + 'item_menu_add_to_fav' => 'Lisa lemmikutesse', + 'item_menu_collab_disable' => 'Edition is not allowed', + 'item_menu_collab_enable' => 'Edition is allowed', + 'item_menu_copy_elem' => 'Kopeeri kirje', + 'item_menu_copy_login' => 'Kopeeri kasutajanimi', + 'item_menu_copy_pw' => 'Kopeeri parool', + 'item_menu_del_elem' => 'Kustuta kirje', + 'item_menu_del_from_fav' => 'Kustuta lemmikutest', + 'item_menu_del_rep' => 'Kustuta kaust', + 'item_menu_edi_elem' => 'Muuda kirjet', + 'item_menu_edi_rep' => 'Muuda kausta', + 'item_menu_find' => 'Otsi', + 'item_menu_mask_pw' => 'Varja parool', + 'item_menu_refresh' => 'Värskenda lehte', + 'kbs' => 'KBs', + 'kb_menu' => 'Teadmiste baas', + 'keepass_import_button_text' => 'Sirvi XML faile ja importe', + 'label' => 'Silt', + 'last_items_icon_title' => 'Näita/Peida viimati nähtud kirjed', + 'last_items_title' => 'Viimati nähtud kirjed', + 'ldap_extension_not_loaded' => 'LDAP moodul ei ole serveris aktiveeritud.', + 'level' => 'Tase', + 'link_copy' => 'Loo link antud kirjele', + 'link_is_copied' => 'The link to this Item has been copied to clipboard.', + 'login' => 'Kasutajatunnus (kui on vaja)', + 'login_attempts_on' => ' sisselogimise katset ', + 'login_copied_clipboard' => 'Kasutajanimi kopeeritud lõikelauale', + 'login_copy' => 'Kopeeri konto lõikelauale', + 'logs' => 'Logid', + 'logs_1' => 'Generate the log file for the passwords renewal done the', + 'logs_passwords' => 'Genereeri paroolide logi', + 'maj' => 'Suurtähed', + 'mask_pw' => 'Varja/Kuva parool', + 'max_last_items' => 'Maksimaalne viimati nähtud kirjete arv kasutaja kohta (vaikimisi on 10)', + 'menu_title_new_personal_saltkey' => 'Muuda minu personaalset parooli soola', + 'minutes' => 'minutit', + 'modify_button' => 'Muuda', + 'my_favourites' => 'Minu lemmikud', + 'name' => 'Nimi', + 'nb_false_login_attempts' => 'Number of false login attempts before account is disabled (0 to disable)', + 'nb_folders' => 'Kaustade arv', + 'nb_items' => 'Kirjete arv', + 'nb_items_by_page' => 'Kirjete arv lehe kohta', + 'new_label' => 'Uus silt', + 'new_role_title' => 'Uus rolli nimetus', + 'new_saltkey' => 'Uus parooli sool', + 'new_saltkey_warning' => 'Please be sure to use the original SaltKey, otherwize the new encryption will be corrupted. Before doing any change, please test your actual SaltKey!', + 'new_user_title' => 'Lisa uus kasutaja', + 'no' => 'Ei', + 'nom' => 'Nimi', + 'none' => 'Puudub', + 'none_selected_text' => 'Pole midagi valitud', + 'not_allowed_to_see_pw' => 'Sul ei ole õigusi seda kirjet näha!', + 'not_allowed_to_see_pw_is_expired' => 'Antud kirje on aegunud!', + 'not_defined' => 'Pole defineeritud', + 'no_last_items' => 'Pole kirjeid näinud', + 'no_restriction' => 'Piirangud puuduvad', + 'numbers' => 'Numbrid', + 'number_of_used_pw' => 'Number of new passwords a user has to enter before reusing an old one.', + 'ok' => 'OK', + 'pages' => 'Leheküljed', + 'pdf_del_date' => 'PDF genereeritud', + 'pdf_del_title' => 'Parooli uuendamise järeltegevus', + 'pdf_download' => 'Lae fail alla', + 'personal_folder' => 'Isiklik kaust', + 'personal_saltkey_change_button' => 'Muuda!', + 'personal_salt_key' => 'Sinu personaalne parooli sool', + 'personal_salt_key_empty' => 'Personaalne parooli sool ei ole määratud!', + 'personal_salt_key_info' => 'This salt key will be used to encrypt and decrypt your passwords.
    It is not stored in database, you are the only person who knows it.
    So don\'t loose it!', + 'please_update' => 'Palun uuenda tarkvara!', + 'print' => 'Prindi', + 'print_out_menu_title' => 'Ekspordi kirjed', + 'print_out_pdf_title' => 'TeamPass - Eksporditud kirjete nimekiri', + 'print_out_warning' => 'By writing the file containing unencrypted items/passwords, you are accepting the full responsibility for further protection of this list! Your PDF export will be logged.', + 'pw' => 'Parool', + 'pw_change' => 'Muuda konto parooli', + 'pw_changed' => 'Parool muudetud!', + 'pw_copied_clipboard' => 'Parool kopeeritud lõikelauale', + 'pw_copy_clipboard' => 'Kopeeri parool lõikelauale', + 'pw_generate' => 'Genereeri', + 'pw_is_expired_-_update_it' => 'See kirje on aegunud! Sa pead muutma selle parooli.', + 'pw_life_duration' => 'Users\' password life duration before expiration (in days, 0 to disable)', + 'pw_recovery_asked' => 'Sa palusid parooli taastamist', + 'pw_recovery_button' => 'Saada mulle mu uus parool', + 'pw_recovery_info' => 'By clicking on the next button, you will receive an email that contains the new password for your account.', + 'pw_used' => 'Sellist parooli on juba varem kasutatud!', + 'readme_open' => 'Ava terve readme fail', + 'read_only_account' => 'Ainult vaatamiseks', + 'refresh_matrix' => 'Värskenda maatriksit', + 'renewal_menu' => 'Uuendamise järeltegevus', + 'renewal_needed_pdf_title' => 'Kuva kirjed, mis vajavad uuendamist', + 'renewal_selection_text' => 'Kuva kõik kirjed, mis aeguvad:', + 'restore' => 'Taasta', + 'restricted_to' => 'Piiratud ainult', + 'restricted_to_roles' => 'Luba kirjete piiramine kasutajatele ja rollidele', + 'rights_matrix' => 'Kasutajaõiguste maatriks', + 'roles' => 'Rollid', + 'role_cannot_modify_all_seen_items' => 'Set this role not allowed to modify all accessible items (normal setting)', + 'role_can_modify_all_seen_items' => 'Set this role allowed to modify all accessible items (not secure setting)', + 'root' => 'Juurkaust', + 'save_button' => 'Salvesta', + 'secure' => 'Turvaline', + 'see_logs' => 'Vaata logisid', + 'select_folders' => 'Vali kaustad', + 'select_language' => 'Vali oma keel', + 'send' => 'Saada', + 'settings_anyone_can_modify' => 'Activate an option for each item that allows anyone to modify it', + 'settings_anyone_can_modify_tip' => 'When activated, this will add a checkbox in the item form that permits the creator to allow the modification of this item by anyone.', + 'settings_default_language' => 'Määra vaikimisi keel', + 'settings_kb' => 'Aktiveeri teadmiste baas (beta)', + 'settings_kb_tip' => 'When activated, this will add a page where you can build your knowledge base.', + 'settings_ldap_domain' => 'LDAP domeeni konto suffiks', + 'settings_ldap_domain_controler' => 'LDAP domeenikontrollerite nimekiri', + 'settings_ldap_domain_controler_tip' => 'Specifiy multiple controllers if you would like the class to balance the LDAP queries amongst multiple servers.
    You must delimit the domains by a comma (,)!
    By example: domain_1,domain_2,domain_3
    ', + 'settings_ldap_domain_dn' => 'LDAP domeeni baas DN', + 'settings_ldap_mode' => 'Aktiveeri kasutajate autentimine läbi LDAP serveri', + 'settings_ldap_mode_tip' => 'Enable only if you have an LDAP server and if you want to use it to authentify TeamPass users through it.', + 'settings_ldap_ssl' => 'Kasuta LDAPi üle SSLi (LDAPS)', + 'settings_ldap_tls' => 'Kasuta LDAPi üle TLSi', + 'settings_log_accessed' => 'Aktiveeri kirjete vaatamise logimine', + 'settings_log_connections' => 'Aktiveeri kõigi kasutaja ühenduste logimine andmebaasi.', + 'settings_maintenance_mode' => 'Aktiveeri TeamPassi hooldusrežiim', + 'settings_maintenance_mode_tip' => 'This mode will refuse any user connection except for Administrators.', + 'settings_manager_edit' => 'Haldajad saavad muuta ja kustutada kirjeid, mida nad näevad', + 'settings_printing' => 'Aktiveeri kirjete printimine PDF faili', + 'settings_printing_tip' => 'When enabled, a button will be added to user\'s home page that will permit him/her to write a listing of items to a PDF file he/she can view. Notice that the listed passwords will be uncrypted.', + 'settings_restricted_to' => 'Aktiveeri kirjetel piiratud kasutaja funktsionaalsus', + 'settings_richtext' => 'Luba kirjete kirjelduse lahtris vormindatud teksti kasutamist', + 'settings_richtext_tip' => 'This will activate a richtext with BBCodes in description field.', + 'settings_send_stats' => 'Saada TeamPassi autorile enda paigaldusest igakuiset kasutusstatistikat', + 'settings_send_stats_tip' => 'These statistics are entirely anonymous!
    Your IP is not sent, just the following data are transmitted: amount of Items, Folders, Users, TeamPass version, personal folders enabled, ldap enabled.
    Many thanks if you enable those statistics. By this you help me further develop TeamPass.
    ', + 'settings_show_description' => 'Kuva kirjete nimekirjas ka kirjeldusi', + 'show' => 'Näita', + 'show_help' => 'Näita abi', + 'show_last_items' => 'Kuva viimaste kirjete moodulit avalehel', + 'size' => 'Suurus', + 'start_upload' => 'Alusta failide üleslaadimist', + 'sub_group_of' => 'Sõltub', + 'support_page' => 'For any support, please use the Forum.', + 'symbols' => 'Sümbolid', + 'tags' => 'Märksõnad', + 'thku' => 'Tänan, et kasutad TeamPassi!', + 'timezone_selection' => 'Ajatsooni valimine', + 'time_format' => 'Ajaformaat', + 'uncheck_all_text' => 'Eemalda kõik linnukesed', + 'unlock_user' => 'Kasutaja on lukus. Kas soovid seda kontot avada?', + 'update_needed_mode_admin' => 'It is recommended to update your TeamPass installation. Click HERE', + 'uploaded_files' => 'Olemasolevad failid', + 'upload_button_text' => 'Sirvi', + 'upload_files' => 'Lae üles uusi faile', + 'url' => 'URL', + 'url_copied' => 'URL on kopeeritud!', + 'used_pw' => 'Kasutatud parool', + 'user' => 'Kasutaja', + 'users' => 'Kasutajad', + 'users_online' => 'kasutajat onlines', + 'user_action' => 'Tegevus kasutajaga', + 'user_alarm_no_function' => 'Kasutajal puuduvad rollid!', + 'user_del' => 'Kustuta konto', + 'user_lock' => 'Lukusta kasutaja', + 'version' => 'Praegune versioon', + 'views_confirm_items_deletion' => 'Kas soovid kindlasti valitud kirjed kustutada andmebaasist?', + 'views_confirm_restoration' => 'Palun kinnita valitud kirje taastamist', + 'visibility' => 'Nähtavus', + 'warning_screen_height' => 'Hoiatus: ekraani kõrgus ei ole piisav, et kuvada kirjete nimekirja!', + 'yes' => 'Jah', + 'your_version' => 'Sinu versioon', + 'disconnect_all_users_sure' => 'Kas soovid kindlasti kõik kasutajad välja logida?', + 'Test the Email configuration' => 'Testi e-posti sätete toimivust', + 'url_copied_clipboard' => 'URL kopeeritud lõikelauale', + 'url_copy' => 'Kopeeri URL lõikelauale', + 'one_time_item_view' => 'Ühekordne link vaatamiseks', + 'one_time_view_item_url_box' => 'Jaga ühekordset URL linki usaldusväärse inimesega

    #URL#

    Pea meeles, et see link on nähtav ainult ühe korra kuni #DAY#', + 'admin_api' => 'API', + 'settings_api' => 'Luba juurdepääs kirjetele läbi TeamPassi API', + 'settings_api_tip' => 'API access permits to do access the Items from a third party application in JSON format.', + 'settings_api_keys_list' => 'Võtmete nimekiri', + 'settings_api_keys_list_tip' => 'This is the keys that are allowed to access to Teampass. Without a valid Key, the access is not possible. You should share those Keys carrefuly!', + 'settings_api_generate_key' => 'Genereeri võti', + 'settings_api_delete_key' => 'Kustuta võti', + 'settings_api_add_key' => 'Lisa uus võti', + 'settings_api_key' => 'Võti', + 'settings_api_key_label' => 'Silt', + 'settings_api_ip_whitelist' => 'Lubatud IP-aadressite nimekiri', + 'settings_api_ip_whitelist_tip' => 'Kui ühtegi IP-aadressi ei ole nimekirjas, on kõik lubatud.', + 'settings_api_add_ip' => 'Lisa uus IP', + 'settings_api_db_intro' => 'Give a label for this new Key (not mandatory but recommended)', + 'error_too_long' => 'Viga - sisestasid liiga pika teksti!', + 'settings_api_ip' => 'IP', + 'settings_api_db_intro_ip' => 'Määra uuele IP-aadressile silt', + 'settings_api_world_open' => 'No IP defined. The feature is totally open from any location (maybe unsecure).', + 'subfolder_rights_as_parent' => 'New sub-folder inherits rights from parent folder', + 'subfolder_rights_as_parent_tip' => 'When this feature is disabled, each new sub-folder inherits the rights associated to the Creator roles. If enabled, then each new sub-folder inherits the rights of the parent folder.', + 'show_only_accessible_folders_tip' => 'By default, the user see the complete path of the tree even if he doesn\'t have access to all of the folders. You may simplify this removing from the tree the folders he has no access to.', + 'show_only_accessible_folders' => 'Simplify the Items Tree by removing the Folders the user has no access to', + 'suggestion' => 'Kirjete soovitused', + 'suggestion_add' => 'Lisa kirje soovitus', + 'comment' => 'Kommentaar', + 'suggestion_error_duplicate' => 'Sarnane soovitus on juba olemas!', + 'suggestion_delete_confirm' => 'Palun kinnita soovituse kustutamist', + 'suggestion_validate_confirm' => 'Palun kinnita soovitust', + 'suggestion_validate' => 'Sa soovid lisada soovitust kirjete nimekirja... palun kinnita.', + 'suggestion_error_cannot_add' => 'Viga - seda soovitust ei saanud lisada kui kirjet!', + 'suggestion_is_duplicate' => 'CAUTION: this suggestion has a similar Item (with equal Label and Folder). If you click on ADD button, this Item will be updated with data from this Suggestion.', + 'suggestion_menu' => 'Soovitused', + 'settings_suggestion' => 'Luba kirjete soovitamist kasutajatele vaataja õigustes', + 'settings_suggestion_tip' => 'Item suggestion permits the Read-Only users to propose new items or items modification. Those suggestions will be validated by Administrator or Manager users.', + 'imported_via_api' => 'API', + 'settings_ldap_bind_dn' => 'LDAP Bind DN', + 'settings_ldap_bind_passwd' => 'LDAP Bind parool', + 'settings_ldap_search_base' => 'LDAP otsingu juurasukoht', + 'settings_ldap_bind_dn_tip' => 'A Bind DN which can bind and search users in the tree', + 'settings_ldap_bind_passwd_tip' => 'Password for the bind DN which can bind and search users in the tree', + 'settings_ldap_search_base_tip' => 'Search root DN for searches on the tree', + 'old_saltkey' => 'Parooli vana sool', + 'define_old_saltkey' => 'I want to specify the old SALT Key to use (optional)', + 'admin_email_server_url_tip' => 'Customize the URL to be used in links present in emails if you don\'t want the by-default one used.', + 'admin_email_server_url' => 'Serveri URL e-mailides olevate linkide jaoks', + 'generated_pw' => 'Genereeritud parool', + 'enable_email_notification_on_user_pw_change' => 'Saada kasutajale e-mail, kui tema parool muutub', + 'settings_otv_expiration_period' => 'Delay before expiration of one time view (OTV) shared items (in days)', + 'change_right_access' => 'Määra juurdepääsuõigused', + 'write' => 'Kirjuta', + 'read' => 'Loe', + 'no_access' => 'Juurdepääs puudub', + 'right_types_label' => 'Select the type of access on this folder for the selected group of users', + 'groups' => 'Kaustad', + 'duplicate' => 'Duplikeeri', + 'duplicate_title_in_same_folder' => 'A similar Item name exists in current Folder! Duplicates are not allowed!', + 'duplicate_item_in_folder' => 'Allow items with similar label in a common folder', + 'find_message' => ' %X% objekti leitud', + 'settings_roles_allowed_to_print' => 'Määra rollid, kellel on lubatud kirjeid printida', + 'settings_roles_allowed_to_print_tip' => 'Valitud rollidel lubatakse failist kirjete printimist.', + 'user_profile_dialogbox_menu' => 'Sinu TeamPassi informatsioon', + 'admin_email_security' => 'SMTP turvalisus', + 'alert_page_will_reload' => 'Antud leht laetakse uuesti', + 'csv_import_items_selection' => 'Vali kirjed, mida importida', + 'csv_import_options' => 'Määra importimise valikud', + 'file_protection_password' => 'Määra faili parool', + 'button_export_file' => 'Ekspordi kirjed', + 'error_export_format_not_selected' => 'Eksporditava faili formaadi määramine on kohustuslik', + 'select_file_format' => 'Vali failiformaat', + 'button_offline_generate' => 'Genereeri offline fail', + 'upload_new_avatar' => 'Vali profiilipildi PNG fail', + 'expand' => 'Laienda', + 'collapse' => 'Sulge', + 'error_file_is_missing' => 'Viga: fail on puudu!', + 'click_to_change' => 'Vajuta et muuta', + 'settings_ldap_user_attribute' => 'Kasutaja parameeter, mida otsida', + 'settings_ldap_user_attribute_tip' => 'LDAP parameeter, millest kasutajanime otsida', + 'user_ga_code_sent_by_email' => 'Sinu uus GoogleAuthenticatori kood on saadetud e-postiga.', + 'log_user_initial_pwd_changed' => 'Esmakordne parool defineeritud', + 'log_user_email_changed' => 'Kasutaja e-posti aadress muudetud ', + 'log_user_created' => 'Kasutajakonto loodud', + 'log_user_locked' => 'Kasutaja lukustatud', + 'log_user_unlocked' => 'Kasutaja lukust avatud', + 'log_user_pwd_changed' => 'Kasutaja parool on muudetud', + 'edit_user' => 'Muuda kasutajat', + 'pf_change_encryption' => 'The encryption algorithm has changed and your personal passwords have to be re-encoded. You need to run this process to use your passwords. This process may take several minutes depending on the number of items you have.', + 'operation_encryption_done' => 'Re-encryption has been performed. You can close this dialogbox.', + 'show_password' => 'Kuva parool', + 'change_password' => 'Muuda parooli', + 'pf_sk_set' => 'Your personal Salt Key is correctly set, You can click on button Start', + 'pf_sk_not_set' => 'Your personal Salt Key is NOT set! Please enter it.', + 'upgrade_needed' => 'Uuendus on vajalik', + 'item_menu_mov_rep' => 'Liiguta kausta', + 'settings_default_session_expiration_time' => 'By default delay for session expiration', + 'duo_message' => 'DUO Security checks are now done. Sending your credentials to Teampass.
    Please wait ... the page will be reloaded once authentication process will be done.', + 'duo_loading_iframe' => 'DUOSecurity authentication frame is currently being loaded. Please wait.', + 'settings_duo' => 'Aktiveeri DUO Security kahefaktorilise autentimise lahendusena', + 'settings_duo_tip' => 'User 2-Factor authentication can be ensured using DUOSecurity.com. This library guarantees a high level of security related to user authentication.', + 'admin_duo_akey' => 'AKEY', + 'admin_duo_ikey' => 'IKEY', + 'admin_duo_skey' => 'SKEY', + 'admin_duo_host' => 'HOST', + 'generate_random_key' => 'Genereeri püsiv juhuslik võti', + 'duo_save_sk_file' => 'Salvesta andmed sk.php faili', + 'settings_duo_explanation' => 'Those credentials are issued from the web application you specially created for Teampass from the DUOSecurity administration page.
    By clicking the save button they will stored in the sk.php file.', + 'admin_duo_intro' => 'Fill in the next fields with expected data', + 'admin_duo_stored' => 'Credentials stored successfully!', + 'user_not_exists' => 'Sellist kasutajat ei ole olemas!', + 'dialog_admin_user_edit_title' => 'User account edition', + 'user_info_delete' => 'Please reclick to confirm the DELETION of this account.', + 'user_info_delete_warning' => 'By clicking the Save button, you will delete this account from Teampass.
    No return is possible.', + 'edit' => 'Muuda', + 'user_info_locked' => 'User is currently LOCKED.', + 'user_info_unlock_question' => 'Võta konto lukust lahti?', + 'user_info_lock_question' => 'Lukusta konto?', + 'user_info_delete_question' => 'Kustuta konto?', + 'user_info_active' => 'User is currently ENABLED.', + 'settings_ldap_domain_posix' => 'LDAP konto domeeni suffiks ', + 'refresh' => 'Värskenda', + 'loading' => 'Laen', + 'at_password_shown' => 'Parooli näitamine', + 'at_password_copied' => 'Parooli kopeerimine', + 'search_results' => 'Otsingu tulemused', + 'searching' => 'Otsin...', + 'search_tag_results' => 'Search results for tag', + 'searching_tag' => 'Searching for tag', + 'list_items_with_tag' => 'List items with this tag', + 'no_item_to_display' => 'Pole kirjeid, mida kuvada', + 'opening_folder' => 'Loen kausta...', + 'please_confirm' => 'Palun kinnita', + 'suggestion_notify_subject' => '[Teampass] A new suggestion has been done.', + 'suggestion_notify_body' => 'Hello,

    A new suggestion has been done. You need to validate it before it can be used by other users.
    Some information about it:
    - Label: #tp_label#
    - Folder: #tp_folder#
    - User: #tp_user#

    Notice that this email has been sent to all Managers.

    Best regards.', + 'error_unknown' => 'Juhtus ootamatu viga!', + 'no_edit_no_delete' => 'Write but no edition and no deletion', + 'no_edit' => 'Write but no edition', + 'role_cannot_edit_item' => 'Kirjeid ei saa muuta', + 'no_delete' => 'Write but no delete', + 'role_cannot_delete_item' => 'Kirjeid ei saa kustutada', + 'text_without_symbols' => 'Only numbers, letters and symbols # & % * $ @ ( ) are allowed. Other characters are not possible.', + 'my_profile' => 'Minu profiil', + 'at_suggestion' => 'Soovitus vastuvõetud', + 'character_not_allowed' => 'Sümbol ei ole lubatud!', + 'error_saltkey_length' => 'SaltKey must be a 16 characters string!', + 'starting' => 'Alustan...', + 'total_number_of_items' => 'Kirjete koguarv', + 'finalizing' => 'Lõpetan', + 'treating_items' => 'Kirjete ravimine', + 'number_of_items_treated' => 'Ravitud kirjete arv', + 'error_sent_back' => 'Järgmine tekkinud viga', + 'full' => 'Täis', + 'sequential' => 'Järjestikune', + 'tree_load_strategy' => 'Puu kuvamise strateegia', + 'syslog_enable' => 'Aktiveeri syslogi saatmine', + 'syslog_host' => 'Syslogi server', + 'syslog_port' => 'Syslogi port', + 'error_bad_credentials' => 'Kasutajanimi või parool on vale!', + 'reload_page_after_user_account_creation' => 'Sinu konto on loodud. See leht laetakse uuesti 3 sekundi pärast...', + 'settings_ldap_usergroup' => 'LDAP otsitav grupp', + 'settings_ldap_usergroup_tip' => 'LDAP group a user has to be member of in order to log in. Example: cn=sysadmins,ou=groups,dc=example,dc=com', + 'server_password_change_enable' => 'Luba eemalt parooli muutmine (ssh ühendusega)', + 'error_login_missing' => 'Kasutajanimi puudub!', + 'error_pwd_missing' => 'Parool puudub!', + 'error_url_missing' => 'URL puudub!', + 'error_ssh_credentials_missing' => 'SSH sisselogimisandmed puuduvad!', + 'error_url_must_be_ssh' => 'URL peab algama SSH protokolliga!', + 'auto_update_server_password_info' => 'Clicking START button will automatically perform next steps:
    • Connect through SSH to Linux server using login credentials and field `URL`,
    • Change user password on Linux server
    • Save the new password in Teampass
    • Close SSH connection

    Please ensure that user has root privileges on the server (if not, indicate the root login and password) before starting.', + 'update_server_password' => 'Uuenda serveri parooli', + 'error_personal_sk_expected' => 'You shall first enter your personal saltkey!', + 'click_to_generate' => 'Vajuta et genereerida', + 'error_new_pwd_missing' => 'Uus parool on puudu!', + 'ssh_pwd' => 'SSH parool', + 'ssh_user' => 'SSH kasutaja', + 'ssh_action_performed_with_error' => 'Action was performed with error.
    Check answer from server and made correction.', + 'ssh_action_performed' => 'Password updated for this Item.

    You can now close this popup.', + 'ssh_answer_from_server' => 'Vastus serverist', + 'ssh_password_frequency_change_info' => 'You may want the change to be done automatically at a special frequency. For this, you need to select the frequency at which the server user passwords shall be changed (selecting 0 will disable task).
    Notice that this will only work if your administrator has enabled the task in the server cron schedule.', + 'ssh_password_frequency_change' => 'Parooli vahetamise sagedus (kuudes)', + 'ssh_scheduled_change' => 'Scheduled change', + 'ssh_one_shot_change' => 'Ühekorraga muutmine', + 'month' => 'kuu', + 'server_auto_update_password_enabled_tip' => 'Automatic user password change enabled', + 'server_password_change_enable_tip' => 'This option permits to allow users to automatically change the user\'s password of a server located in the url field using SSH connection.
    Notice that the automatic change at specific frequency can be done if the file /files/script.ssh.php is added to the crontab of this server. The advice would be to run it once a day.', + 'can_manage_all_users' => 'Human Resources
    Can manage all Users independately of his/hers group.
    Will be also promoted to Manager role.
    Will not be able to change an existing administrator (only an Administrator can remove administrator rights on a user).
    ', + 'error_bad_credentials_more_than_3_times' => 'Login credentials do not correspond!
    Please wait 10 seconds before new try', + '' => '' +); \ No newline at end of file diff --git a/items.import.php b/items.import.php index e19cf29d4..fc5f947b6 100644 --- a/items.import.php +++ b/items.import.php @@ -65,6 +65,15 @@
    + +
    + + + + + +
     '.$LANG['csv_import_information'].'
    +

    diff --git a/sources/folders.queries.php b/sources/folders.queries.php index d604af469..d70644970 100644 --- a/sources/folders.queries.php +++ b/sources/folders.queries.php @@ -183,7 +183,7 @@ prefix_table("misc"), array( 'type' => 'folder_deleted', - 'intitule' => "f".$_POST['id'], + 'intitule' => "f".$folder->id, 'valeur' => $folder->id.', '.$folder->parent_id.', '. $folder->title.', '.$folder->nleft.', '.$folder->nright.', '. $folder->nlevel.', 0, 0, 0, 0' diff --git a/sources/import.queries.php b/sources/import.queries.php index b169e4fa6..a1517feea 100644 --- a/sources/import.queries.php +++ b/sources/import.queries.php @@ -91,14 +91,14 @@ function sanitiseString($str, $crLFReplacement) { case "import_file_format_csv": //load full tree $tree->rebuild(); - $tst = $tree->getDescendants(); + $tree = $tree->getDescendants(); // do some initializations $file = $_SESSION['settings']['path_to_files_folder']."/".$_POST['file']; $size = 4096; $separator = ","; $enclosure = '"'; - $fields_expected = array("Account","Login Name","Password","Web Site","Comments"); //requiered fields from CSV + $fields_expected = array("Label","Login","Password","URL","Comments"); //requiered fields from CSV $importation_possible = true; $display = ""; $line_number = $prev_level = 0; @@ -156,7 +156,7 @@ function sanitiseString($str, $crLFReplacement) { $comment .= addslashes($row['Label']); } else { // Store in variable values from previous line - if (!empty($row['Label']) && !empty($row['Password']) && !empty($account)) { + if (!empty($account)) { if ($continue_on_next_line == false) { // Prepare listing that will be shown to user $display .= ''; @@ -195,11 +195,11 @@ function sanitiseString($str, $crLFReplacement) { $display .= ''; // Add a checkbox for select/unselect all others - $display .= ''; + $display .= ''; // Prepare a list of all folders that the user can choose $display .= '
    '.$account.'
    '.$account.'
    '.$LANG['all'].'

     '.$LANG['all'].'
      '.$record['label'].''.date($_SESSION['settings']['date_format'], $record['date']).''.$record['login'].''.$thisFolder.''; } - echo '[{"text":"'.$texte.'"}]'; + echo '[{"text":"'.$texte.'"}]'; break; /** From ae6296648fb89e857924b24e415661e7d1216a6c Mon Sep 17 00:00:00 2001 From: "nils@teampass.net" Date: Sat, 4 Jun 2016 08:00:54 +0200 Subject: [PATCH 7/7] 2.1.26 Fix for #1300, #1310 Adapted DB structure for errors related to MySQL 5.7.x SQL error shown when error fires at server level (through usage of a Developer Console) --- changelog.md | 3 +- .../libraries/Database/Meekrodb/db.class.php | 8 +- install/install.queries.php | 12 +- install/upgrade_run_2.1.26.php | 9 +- sources/import.queries.php | 153 +++++++++--------- 5 files changed, 98 insertions(+), 87 deletions(-) diff --git a/changelog.md b/changelog.md index 4860a91ee..a8d8c841c 100644 --- a/changelog.md +++ b/changelog.md @@ -1,6 +1,8 @@ Last changes 2.1.26 + #1310 Addes Estonian language #1308 Teampass hangs when a folder is create with option "New sub-folder inherits rights from parent folder" enabled + #1300 After 3 bad login attempts, user needs to wait 10s before new try #1299 Export to pdf or csv shows htmlencoded #1298 Backup-filename on 2.1.26 contains / #1284 fix for can_manage_all_users update during upgrade @@ -32,7 +34,6 @@ Last changes NEW: Server user password change through SSH connection NEW: Upgrade database handler improved for better upgrades management NEW: New user right added for managing all users (super Manager) - NEW: After 3 bad login attempts, user needs to wait 10s before new try FIX: If expiration engaged and password is changed, the warning is still present. FIX: New suggestion folder could remain empty in some specific cases. FIX: By creating a role, this new one is directly visible by creator. diff --git a/includes/libraries/Database/Meekrodb/db.class.php b/includes/libraries/Database/Meekrodb/db.class.php index 445c0020c..e0f695feb 100644 --- a/includes/libraries/Database/Meekrodb/db.class.php +++ b/includes/libraries/Database/Meekrodb/db.class.php @@ -609,11 +609,13 @@ protected function queryHelper() { // ----- BEGIN ERROR HANDLING if (!$sql || $db->error) { if ($this->error_handler) { + $db_error = $db->error; + $db_errno = $db->errno; $db->query( "INSERT INTO ".$GLOBALS['pre']."log_system SET date=".time().", qui=".$_SESSION['user_id'].", - label='".addslashes($sql)."
    ".addslashes($db->error)."@".$_SERVER['REQUEST_URI']."', + label='Query: ".addslashes($sql)."
    Error: ".addslashes($db_error)."
    @ ".$_SERVER['REQUEST_URI']."', type='error'", MYSQLI_USE_RESULT ); @@ -623,8 +625,8 @@ protected function queryHelper() { call_user_func($error_handler, array( 'type' => 'sql', 'query' => $sql, - 'error' => $db->error, - 'code' => $db->errno + 'error' => $db_error, + 'code' => $db_errno )); } diff --git a/install/install.queries.php b/install/install.queries.php index 26401f6a1..85ac06f26 100644 --- a/install/install.queries.php +++ b/install/install.queries.php @@ -231,17 +231,17 @@ function chmod_r($dir, $dirPermissions, $filePermissions) { $mysqli_result = mysqli_query($dbTmp, "CREATE TABLE IF NOT EXISTS `".$var['tbl_prefix']."items` ( `id` int(12) NOT null AUTO_INCREMENT, - `label` varchar(100) NOT NULL, + `label` varchar(250) NOT NULL, `description` text NOT NULL, `pw` text NOT NULL, `pw_iv` text NOT NULL, `pw_len` int(5) NOT NULL DEFAULT '0', - `url` varchar(250) DEFAULT NULL, + `url` varchar(500) DEFAULT NULL, `id_tree` varchar(10) DEFAULT NULL, `perso` tinyint(1) NOT null DEFAULT '0', `login` varchar(200) DEFAULT NULL, `inactif` tinyint(1) NOT null DEFAULT '0', - `restricted_to` varchar(200) NOT NULL, + `restricted_to` varchar(200) DEFAULT NULL, `anyone_can_modify` tinyint(1) NOT null DEFAULT '0', `email` varchar(100) DEFAULT NULL, `notification` varchar(250) DEFAULT NULL, @@ -506,12 +506,12 @@ function chmod_r($dir, $dirPermissions, $filePermissions) { $mysqli_result = mysqli_query($dbTmp, "CREATE TABLE IF NOT EXISTS `".$var['tbl_prefix']."cache` ( `id` int(12) NOT NULL, - `label` varchar(50) NOT NULL, + `label` varchar(250) NOT NULL, `description` text NOT NULL, - `tags` text NOT NULL, + `tags` text DEFAULT NULL, `id_tree` int(12) NOT NULL, `perso` tinyint(1) NOT NULL, - `restricted_to` varchar(200) NOT NULL, + `restricted_to` varchar(200) DEFAULT NULL, `login` varchar(200) DEFAULT NULL, `folder` varchar(300) NOT NULL, `author` varchar(50) NOT NULL, diff --git a/install/upgrade_run_2.1.26.php b/install/upgrade_run_2.1.26.php index 9d9a51fa9..5b60813f1 100644 --- a/install/upgrade_run_2.1.26.php +++ b/install/upgrade_run_2.1.26.php @@ -154,11 +154,18 @@ function tableExists($tablename, $database = false) // alter table Items mysqli_query($dbTmp, "ALTER TABLE `".$_SESSION['tbl_prefix']."items` MODIFY complexity_level VARCHAR(3)"); +mysqli_query($dbTmp, "ALTER TABLE `".$_SESSION['tbl_prefix']."items` MODIFY label VARCHAR(100)"); +mysqli_query($dbTmp, "ALTER TABLE `".$_SESSION['tbl_prefix']."items` MODIFY url VARCHAR(500)"); +mysqli_query($dbTmp, "ALTER TABLE `".$_SESSION['tbl_prefix']."items` MODIFY restricted_to DEFAULT NULL"); + +// alter table cache +mysqli_query($dbTmp, "ALTER TABLE `".$_SESSION['tbl_prefix']."cache` MODIFY label VARCHAR(100)"); +mysqli_query($dbTmp, "ALTER TABLE `".$_SESSION['tbl_prefix']."cache` MODIFY restricted_to DEFAULT NULL"); +mysqli_query($dbTmp, "ALTER TABLE `".$_SESSION['tbl_prefix']."cache` MODIFY tags DEFAULT NULL"); // add Estonia mysqli_query($dbTmp, "INSERT INTO `".$_SESSION['tbl_prefix']."languages` VALUES (null, 'estonia', 'Estonia', 'ee', 'ee.png')"); - // ensure CSRFP config file is ready if (!isset($_SESSION['upgrade']['csrfp_config_file']) || $_SESSION['upgrade']['csrfp_config_file']) != 1) { $csrfp_file_sample = "../includes/libraries/csrfp/libs/csrfp.config.sample.php"; diff --git a/sources/import.queries.php b/sources/import.queries.php index a1517feea..7ced928c8 100644 --- a/sources/import.queries.php +++ b/sources/import.queries.php @@ -828,82 +828,83 @@ function recursiveKeepassXML($xmlRoot, $xmlLevel = 0) "SELECT title FROM ".prefix_table("nested_tree")." WHERE id = %i", intval($folderId) ); - - // escape if folderId is empty - if (!empty($folderId)) { - $results .= " - Inserting\n"; - - // prepare PW - if ($import_perso == true) { - $encrypt = cryption($pw, $_SESSION['my_sk'], "", "encrypt"); - } else { - $encrypt = cryption($pw, SALT, "", "encrypt"); - } - - //ADD item - DB::insert( - prefix_table("items"), - array( - 'label' => stripslashes($item[KP_TITLE]), - 'description' => stripslashes(str_replace($lineEndSeparator, '
    ', $item[KP_NOTES])), - 'pw' => $encrypt['string'], - 'pw_iv' => $encrypt['iv'], - 'url' => stripslashes($item[KP_URL]), - 'id_tree' => $folderId, - 'login' => stripslashes($item[KP_USERNAME]), - 'anyone_can_modify' => $_POST['import_kps_anyone_can_modify'] == "true" ? 1 : 0 - ) - ); - $newId = DB::insertId(); - - //if asked, anyone in role can modify - if (isset($_POST['import_kps_anyone_can_modify_in_role']) && $_POST['import_kps_anyone_can_modify_in_role'] == "true") { - foreach ($_SESSION['arr_roles'] as $role) { - DB::insert( - prefix_table("restriction_to_roles"), - array( - 'role_id' => $role['id'], - 'item_id' => $newId - ) - ); - } - } - - //Add log - DB::insert( - prefix_table("log_items"), - array( - 'id_item' => $newId, - 'date' => time(), - 'id_user' => $_SESSION['user_id'], - 'action' => 'at_creation', - 'raison' => 'at_import' - ) - ); - - //Add entry to cache table - DB::insert( - prefix_table("cache"), - array( - 'id' => $newId, - 'label' => stripslashes($item[KP_TITLE]), - 'description' => stripslashes(str_replace($lineEndSeparator, '
    ', $item[KP_NOTES])), - 'id_tree' => $folderId, - 'perso' => $personalFolder == 0 ? 0 : 1, - 'login' => stripslashes($item[KP_USERNAME]), - 'folder' => $data['title'], - 'author' => $_SESSION['user_id'] - ) - ); - - //show - //$text .= '- '.addslashes($item[2]).'
    '; - - //increment number of imported items - $nbItemsImported++; - } else { - $results .= " - ".$item[KP_TITLE]." was not imported\n"; - } + + // escape if folderId is empty + if (!empty($folderId)) { + $results .= " - Inserting\n"; + + // prepare PW + if ($import_perso == true) { + $encrypt = cryption($pw, $_SESSION['my_sk'], "", "encrypt"); + } else { + $encrypt = cryption($pw, SALT, "", "encrypt"); + } + + //ADD item + DB::insert( + prefix_table("items"), + array( + 'label' => stripslashes($item[KP_TITLE]), + 'description' => stripslashes(str_replace($lineEndSeparator, '
    ', $item[KP_NOTES])), + 'pw' => $encrypt['string'], + 'pw_iv' => $encrypt['iv'], + 'url' => stripslashes($item[KP_URL]), + 'id_tree' => $folderId, + 'login' => stripslashes($item[KP_USERNAME]), + 'anyone_can_modify' => $_POST['import_kps_anyone_can_modify'] == "true" ? 1 : 0 + ) + ); + $newId = DB::insertId(); + + //if asked, anyone in role can modify + if (isset($_POST['import_kps_anyone_can_modify_in_role']) && $_POST['import_kps_anyone_can_modify_in_role'] == "true") { + foreach ($_SESSION['arr_roles'] as $role) { + DB::insert( + prefix_table("restriction_to_roles"), + array( + 'role_id' => $role['id'], + 'item_id' => $newId + ) + ); + } + } + + //Add log + DB::insert( + prefix_table("log_items"), + array( + 'id_item' => $newId, + 'date' => time(), + 'id_user' => $_SESSION['user_id'], + 'action' => 'at_creation', + 'raison' => 'at_import' + ) + ); + + //Add entry to cache table + DB::insert( + prefix_table("cache"), + array( + 'id' => $newId, + 'label' => stripslashes($item[KP_TITLE]), + 'description' => stripslashes(str_replace($lineEndSeparator, '
    ', $item[KP_NOTES])), + 'id_tree' => $folderId, + 'perso' => $personalFolder == 0 ? 0 : 1, + 'login' => stripslashes($item[KP_USERNAME]), + 'folder' => $data['title'], + 'author' => $_SESSION['user_id'], + 'timestamp' => time() + ) + ); + + //show + //$text .= '- '.addslashes($item[2]).'
    '; + + //increment number of imported items + $nbItemsImported++; + } else { + $results .= " - ".$item[KP_TITLE]." was not imported\n"; + } } }