Skip to content

Commit

Permalink
Merge branch 'development'
Browse files Browse the repository at this point in the history
  • Loading branch information
nilsteampassnet committed Apr 10, 2017
2 parents bc3977a + b318f22 commit 7782b1d
Show file tree
Hide file tree
Showing 36 changed files with 480 additions and 325 deletions.
2 changes: 1 addition & 1 deletion admin.php
Original file line number Diff line number Diff line change
Expand Up @@ -334,7 +334,7 @@
<table border="0">
<tr>
<td>'.$LANG['settings_send_stats'].'&nbsp;</td>
<td width="200px"><div class="toggle toggle-modern" id="send_stats" data-toggle-on="', isset($_SESSION['settings']['send_stats']) && $_SESSION['settings']['send_stats'] == 1 ? 'true' : 'false', '"></div><input type="hidden" id="send_stats_input" name="send_stats_input" value="', isset($_SESSION['settings']['send_stats']) && $_SESSION['settings']['send_stats'] === "1" ? '1' : '0', '" /></td>
<td width="200px"><div class="toggle toggle-modern" id="send_stats" data-toggle-on="', isset($_SESSION['settings']['send_stats']) && $_SESSION['settings']['send_stats'] === "1" ? 'true' : 'false', '"></div><input type="hidden" id="send_stats_input" name="send_stats_input" value="', isset($_SESSION['settings']['send_stats']) && $_SESSION['settings']['send_stats'] === "1" ? '1' : '0', '" /></td>
</tr>
</table>
</div>
Expand Down
55 changes: 40 additions & 15 deletions admin.settings.load.php
Original file line number Diff line number Diff line change
Expand Up @@ -174,7 +174,7 @@ function(data) {
// parse json table and disaply
var json = $.parseJSON(data);
$(json).each(function(i,val){
if (val[0] == 1) {
if (val[0] === "1") {
newList += '<tr id="t_cat_'+val[1]+'"><td colspan="2">'+
'<input type="text" id="catOrd_'+val[1]+'" size="1" class="category_order" value="'+val[3]+'" />&nbsp;'+
'<span class="fa-stack tip" title="<?php echo $LANG['field_add_in_category'];?>" onclick="fieldAdd('+
Expand Down Expand Up @@ -299,14 +299,23 @@ function(data) {
/*
*
*/
function changeMainSaltKey(start)
function confirmChangingSk() {
if (confirm("Please confirm")) {
changeMainSaltKey('starting', '');
}
}

/*
*
*/
function changeMainSaltKey(start, type)
{
var nb = 10; // can be changed - number of items treated in each loop

//console.log("Start value: "+start);

// start change
if (start == "starting") {
if (start === "starting") {
// inform
$("#changeMainSaltKey_message").html("<i class=\"fa fa-cog fa-spin fa\"></i>&nbsp;<?php echo $LANG['starting'];?>");

Expand All @@ -322,33 +331,32 @@ function(data) {
$("#changeMainSaltKey_itemsCount").val(data[0].nbOfItems);
//console.log("Now launch encryption");
// start encrypting items with new saltkey
changeMainSaltKey(0);
changeMainSaltKey(0, "items");
} else {
// error mngt
$("#changeMainSaltKey_message").html("<i class=\"fa fa-alert fa-spin fa\"></i>&nbsp;<?php echo $LANG['error_sent_back'];?> : "+data[0].error);
}
},
"json"
);
}
else if (isFinite(start)) {
//console.log("Step Encrypt - " + newSK+" ; "+start+" ; "+nb+" ; "+$("#changeMainSaltKey_itemsCount").val());
} else if (isFinite(start) && type === "items") {
console.log("Step Encrypt - " +start+" ; "+nb+" ; "+$("#changeMainSaltKey_itemsCount").val());

$("#changeMainSaltKey_message").html("<i class=\"fa fa-cog fa-spin fa\"></i>&nbsp;<?php echo $LANG['treating_items'];?>...&nbsp;"+start+" > "+(parseInt(start)+parseInt(nb))+" (<?php echo $LANG['total_number_of_items'];?> : "+$("#changeMainSaltKey_itemsCount").val()+")");

$.post(
"sources/admin.queries.php",
{
type : "admin_action_change_salt_key___encrypt",
type : "admin_action_change_salt_key___encrypt_files",
start : start,
length : nb,
nbItems : $("#changeMainSaltKey_itemsCount").val()
},
function(data) {
console.log("Next action: "+data[0].nextAction);
if (data[0].nextAction == "encrypting") {
changeMainSaltKey(data[0].nextStart);
} else if (data[0].nextAction == "finishing") {
if (data[0].nextAction === "encrypting") {
changeMainSaltKey(data[0].nextStart, "items");
} else if (data[0].nextAction === "finishing") {
$("#changeMainSaltKey_message").html("<?php echo $LANG['finalizing'];?>...");
changeMainSaltKey("finishing");
} else {
Expand All @@ -358,16 +366,33 @@ function(data) {
},
"json"
);
}
else {
console.log("finishing");
} else if (isFinite(start) && type == "logs") {
$("#changeMainSaltKey_message").html("<i class=\"fa fa-cog fa-spin fa\"></i>&nbsp;<?php echo $LANG['treating_items'];?>...&nbsp;"+start+" > "+(parseInt(start)+parseInt(nb))+" (<?php echo $LANG['total_number_of_items'];?> : "+$("#changeMainSaltKey_itemsCount").val()+")");

changeMainSaltKey(0, "files");

} else if (isFinite(start) && type == "files") {
$("#changeMainSaltKey_message").html("<i class=\"fa fa-cog fa-spin fa\"></i>&nbsp;<?php echo $LANG['treating_items'];?>...&nbsp;"+start+" > "+(parseInt(start)+parseInt(nb))+" (<?php echo $LANG['total_number_of_items'];?> : "+$("#changeMainSaltKey_itemsCount").val()+")");

changeMainSaltKey(0, "categories");

} else if (isFinite(start) && type == "categories") {
$("#changeMainSaltKey_message").html("<i class=\"fa fa-cog fa-spin fa\"></i>&nbsp;<?php echo $LANG['treating_items'];?>...&nbsp;"+start+" > "+(parseInt(start)+parseInt(nb))+" (<?php echo $LANG['total_number_of_items'];?> : "+$("#changeMainSaltKey_itemsCount").val()+")");

changeMainSaltKey(0, "custfields");

} else if (isFinite(start) && type == "custfields") {
$("#changeMainSaltKey_message").html("<i class=\"fa fa-cog fa-spin fa\"></i>&nbsp;<?php echo $LANG['treating_items'];?>...&nbsp;"+start+" > "+(parseInt(start)+parseInt(nb))+" (<?php echo $LANG['total_number_of_items'];?> : "+$("#changeMainSaltKey_itemsCount").val()+")");

changeMainSaltKey("finishing");
} else {
$.post(
"sources/admin.queries.php",
{
type : "admin_action_change_salt_key___end"
},
function(data) {
if (data[0].nextAction == "done") {
if (data[0].nextAction === "done") {
console.log("done");
$("#changeMainSaltKey_message").html("<i class=\"fa fa-info fa-lg\"></i>&nbsp;<?php echo $LANG['alert_message_done']." ".$LANG['number_of_items_treated'];?> : "+$("#changeMainSaltKey_itemsCount").val());
} else {
Expand Down
4 changes: 2 additions & 2 deletions admin.settings.php
Original file line number Diff line number Diff line change
Expand Up @@ -327,7 +327,7 @@
<label for="default_language">'.$LANG['settings_default_language'].'</label>
</td>
<td>
<select id="default_language" name="default_language" class="text ui-widget-content">
<select id="default_language" name="default_language" class="text ui-widget-content" onchange="updateSetting($(this).attr(\'id\'));">
<option value="">-- '.$LANG['select'].' --</option>';
foreach ($languagesList as $lang) {
echo '
Expand Down Expand Up @@ -560,7 +560,7 @@
// Change main SALT key
echo '
<div style="margin-bottom:3px">
<span class="fa-stack tip" title="'.htmlentities(strip_tags($LANG['admin_action_db_backup_start_tip']), ENT_QUOTES).'" onclick="changeMainSaltKey(\'starting\')" style="cursor:pointer;">
<span class="fa-stack tip" title="'.htmlentities(strip_tags($LANG['admin_action_db_backup_start_tip']), ENT_QUOTES).'" onclick="confirmChangingSk()" style="cursor:pointer;">
<i class="fa fa-square fa-stack-2x"></i>
<i class="fa fa-cogs fa-stack-1x fa-inverse"></i>
</span>
Expand Down
19 changes: 19 additions & 0 deletions changelog.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,23 @@
2.1.27
Secure fixes
Session increase time feature is now increasing with the expected user session duration
Default language cannot be changed fix
Fix for "hide not accessible folders" option
#1725 Some fixes
#1723 Fix spin not removed while reseting user saltkey
#1722 SELinux issue leads to upload impossible
#1718 Moving a folder to itself
#1717 After deleting a folder, items are still visible in search page
#1713 Doubleclick on directory shows items twice
#1710 Error on psk change
#1709 Missing field in table on fresh install
#1707 "Restricted To" not working correctly when creating new items
#1706 User can edit & delete items without rights
#1696 Fix for no log for OTV
#1695 Manager can create folder at root from Items pas
#1686 Fix for item History dialogbox
#1685 Fix in Portuguese file
#1684 Estonian language still missing
#1679 Sort by don't work in Utilities/logs
#1676 Pre-auth XSS in index.php
#1674 name and lastname are changed on other user edit
Expand Down
2 changes: 1 addition & 1 deletion favorites.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
/**
* @file favorites.php
* @author Nils Laumaillé
* @version 2.1.27
* @version 2.1.27
* @copyright (c) 2009-2017 Nils Laumaillé
* @licensing GNU AFFERO GPL 3.0
* @link http://www.teampass.net
Expand Down
4 changes: 2 additions & 2 deletions includes/language/english.php
Original file line number Diff line number Diff line change
Expand Up @@ -413,7 +413,7 @@
'email' => 'Email',
'email_altbody_1' => 'Item',
'email_altbody_2' => 'has been created.',
'email_announce' => 'Email a link to all users',
'email_announce' => 'Email a link to users',
'email_change' => 'Change the account\'s email',
'email_changed' => 'Email changed!',
'email_select' => 'Select users to inform',
Expand Down Expand Up @@ -508,7 +508,7 @@
'import_keepass_to_folder' => 'Select the destination folder',
'import_kp_finished' => 'Import from KeePass is now finished ! The required password strength for new folders has been set to Medium. You may wish to modify the password strength requirement.',
'import_to_folder' => 'Select the items you wish to import to folder:',
'index_add_one_hour' => 'Extend session 1 hour',
'index_add_one_hour' => 'Extend session duration',
'index_alarm' => 'ALARM!!!',
'index_bas_pw' => 'Bad password for this account!',
'index_change_pw' => 'Change my password',
Expand Down
2 changes: 1 addition & 1 deletion includes/language/french.php
Original file line number Diff line number Diff line change
Expand Up @@ -508,7 +508,7 @@
'import_keepass_to_folder' => 'Choisir le répertoire de destination',
'import_kp_finished' => 'L\'importation depuis KeePass est maintenant terminée ! Par défaut, le niveau de complexité des nouveaux répertoires a été défini à \'Moyen\'. Vous devriez peut-être le changer en fonction de vos besoins.',
'import_to_folder' => 'Cocher les éléments que vous voulez importer dans le répertoire :',
'index_add_one_hour' => 'Ajouter une heure',
'index_add_one_hour' => 'Augmenter la durée de la session',
'index_alarm' => 'ATTENTION !!!',
'index_bas_pw' => 'Mauvais mot de passe pour ce compte !',
'index_change_pw' => 'Changer votre mot de passe',
Expand Down
2 changes: 1 addition & 1 deletion includes/language/polish.php
Original file line number Diff line number Diff line change
Expand Up @@ -873,7 +873,7 @@
'error_bad_credentials' => 'Poświadczenia logowania nie odpowiadają!',
'reload_page_after_user_account_creation' => 'Twoje konto zostało dodane. Strona zostanie automatycznie przekierowana w ciągu 3 sekund ...',
'settings_ldap_usergroup' => 'Grupa LDAP do przeszukiwania',
'settings_ldap_usergroup_tip' => 'Grupa LDAP której użytkownik musi być członkiem aby się zalogowa?,
'settings_ldap_usergroup_tip' => 'Grupa LDAP której użytkownik musi być członkiem aby się zalogowa?',
'server_password_change_enable' => 'Włącz zmianę hasła na zdalnym serwerze (używając połączenia SSH)',
'error_login_missing' => 'Nie podano loginu!',
'error_pwd_missing' => 'Nie podano hasła!',
Expand Down
6 changes: 3 additions & 3 deletions includes/language/portuguese.php
Original file line number Diff line number Diff line change
Expand Up @@ -489,10 +489,10 @@
'history' => 'Historia ',
'home' => 'Inicio',
'home_personal_menu' => 'Ações pessoais',
'home_personal_saltkey' => 'Sua senha pessoal \'SALT KEY\'',
'home_personal_saltkey' => 'Sua senha pessoal `SALT KEY`',
'home_personal_saltkey_button' => 'Armazená-lo',
'home_personal_saltkey_info' => 'Entre com seu \'SALT KEY\' pessoal. É necessário para administrar suas senhas pessoais',
'home_personal_saltkey_label' => 'Entre com seu \'SALT KEY\' pesso',
'home_personal_saltkey_info' => 'Entre com seu `SALT KEY` pessoal. É necessário para administrar suas senhas pessoais',
'home_personal_saltkey_label' => 'Entre com seu `SALT KEY` pesso',
'importing_details' => 'Lista de detalhes',
'importing_folders' => 'Importar diretórios',
'importing_items' => 'Importar itens',
Expand Down
Loading

0 comments on commit 7782b1d

Please sign in to comment.