Skip to content

Commit

Permalink
2.1.27
Browse files Browse the repository at this point in the history
Fix for #2453, #2455
  • Loading branch information
nilsteampassnet authored and nilsteampassnet committed Oct 30, 2018
1 parent e98ef34 commit 7d8e2e3
Show file tree
Hide file tree
Showing 5 changed files with 72 additions and 57 deletions.
4 changes: 4 additions & 0 deletions changelog.txt
Original file line number Diff line number Diff line change
@@ -1,4 +1,8 @@
2.1.27
26/
#2453 account creation... password sent in email is "undefined"
#2455 Unable to login after upgrade from 2.1.27.23 => 2.1.27.25

25/
#2454 Update from 2.1.27.23 to 2.1.27.24 doesn't work

Expand Down
2 changes: 1 addition & 1 deletion includes/config/include.php
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
global $SETTINGS, $languagesList, $SETTINGS_EXT;

$SETTINGS_EXT['version'] = "2.1.27";
$SETTINGS_EXT['version_full'] = $SETTINGS_EXT['version'].".25";
$SETTINGS_EXT['version_full'] = $SETTINGS_EXT['version'].".26";
$SETTINGS_EXT['tool_name'] = "TeamPass";
$SETTINGS_EXT['one_day_seconds'] = 86400;
$SETTINGS_EXT['one_week_seconds'] = 604800;
Expand Down
6 changes: 5 additions & 1 deletion load.php
Original file line number Diff line number Diff line change
Expand Up @@ -197,7 +197,11 @@ function launchIdentify(isDuo, redirect, psk)
return false;
}
} else {
if ($("#ga_code").val() !== "" || $("#yubiko_key").val() !== "") {
user2FaMethod = true;
} else {
return false;
}
}
// launch identification
Expand Down
8 changes: 6 additions & 2 deletions sources/users.queries.php
Original file line number Diff line number Diff line change
Expand Up @@ -223,13 +223,17 @@
);

// get links url
if (empty($SETTINGS['email_server_url'])) {
if (empty($SETTINGS['email_server_url']) === true) {
$SETTINGS['email_server_url'] = $SETTINGS['cpassman_url'];
}
// Send email to new user
sendEmail(
$LANG['email_subject_new_user'],
str_replace(array('#tp_login#', '#tp_pw#', '#tp_link#'), array(" ".addslashes($login), addslashes($pw), $SETTINGS['email_server_url']), $LANG['email_new_user_mail']),
str_replace(
array('#tp_login#', '#tp_pw#', '#tp_link#'),
array(" ".addslashes($login), addslashes($pw), $SETTINGS['email_server_url']),
$LANG['email_new_user_mail']
),
$dataReceived['email'],
$LANG,
$SETTINGS
Expand Down
109 changes: 56 additions & 53 deletions users.load.php
Original file line number Diff line number Diff line change
Expand Up @@ -247,65 +247,68 @@ function(data) {
forbidFld += $(this).val() + ";";
});

//prepare data
/*var data = '{"login":"'+sanitizeString($('#new_login').val())+'", '+
'"name":"'+sanitizeString($('#new_name').val())+'", '+
'"lastname":"'+sanitizeString($('#new_lastname').val())+'", '+
'"pw":"'+sanitizeString($('#new_pwd').val())+'", '+
'"email":"'+$("#new_email").val()+'", '+
'"admin":"'+$("#new_admin").prop("checked")+'", '+
'"manager":"'+$("#new_manager").prop("checked")+'", '+
'"read_only":"'+$("#new_read_only").prop("checked")+'", '+
'"personal_folder":"'+$("#new_personal_folder").prop("checked")+'", '+
'"new_folder_role_domain":"'+$("#new_folder_role_domain").prop("checked")+'", '+
'"domain":"'+$('#new_domain').val()+'", '+
'"isAdministratedByRole":"'+$("#new_is_admin_by").val()+'", '+
'"groups":"' + groups + '", '+
'"allowed_flds":"' + authFld + '", '+
'"forbidden_flds":"' + forbidFld + '"}';*/

var data = {
login : $('#new_login').val(),
name : $('#new_name').val(),
lastname : $('#new_lastname').val(),
pw : $('#new_pwd').val(),
email : $('#new_email').val(),
admin : $('#new_admin').prop('checked'),
manager : $('#new_manager').prop('checked'),
read_only : $('#new_read_only').prop('checked'),
personal_folder : $('#new_personal_folder').prop('checked'),
new_folder_role_domain : $('#new_folder_role_domain').prop('checked'),
domain : $('#new_domain').val(),
isAdministratedByRole : $('#new_is_admin_by').val(),
groups : groups,
allowed_flds : authFld,
forbidden_flds : forbidFld,
};

$.post(
"sources/users.queries.php",
"sources/main.queries.php",
{
type :"add_new_user",
data : prepareExchangedData(JSON.stringify(data), "encode", "<?php echo $_SESSION['key']; ?>"),
key : "<?php echo $_SESSION['key']; ?>"
type : "generate_a_password",
size : 12,
secure : false,
symbols : false,
capitalize : true,
numerals : true,
lowercase : true
},
function(data) {
$("#add_new_user_info").hide().html("");
if (data[0].error === "no") {
// clear form fields
$("#new_name, #new_lastname, #new_login, #new_pwd, #new_is_admin_by, #new_email, #new_domain").val("");
$("#new_admin, #new_manager, #new_read_only, #new_personal_folder").prop("checked", false);

// refresh table content
tableUsers.api().ajax.reload();

$("#add_new_user").dialog("close");
data = prepareExchangedData(data, "decode", "<?php echo $_SESSION['key']; ?>");
if (data.error == "true") {
$("#add_new_user_error").html(data.error_msg).show(1).delay(1000).fadeOut(1000);
} else {
$("#add_new_user_error").html(data[0].error).show(1).delay(1000).fadeOut(1000);
//prepare data
var data = {
login : $('#new_login').val(),
name : $('#new_name').val(),
lastname : $('#new_lastname').val(),
pw : data.key[0],
email : $('#new_email').val(),
admin : $('#new_admin').prop('checked'),
manager : $('#new_manager').prop('checked'),
read_only : $('#new_read_only').prop('checked'),
personal_folder : $('#new_personal_folder').prop('checked'),
new_folder_role_domain : $('#new_folder_role_domain').prop('checked'),
domain : $('#new_domain').val(),
isAdministratedByRole : $('#new_is_admin_by').val(),
groups : groups,
allowed_flds : authFld,
forbidden_flds : forbidFld,
};

$.post(
"sources/users.queries.php",
{
type :"add_new_user",
data : prepareExchangedData(JSON.stringify(data), "encode", "<?php echo $_SESSION['key']; ?>"),
key : "<?php echo $_SESSION['key']; ?>"
},
function(data) {
$("#add_new_user_info").hide().html("");
if (data[0].error === "no") {
// clear form fields
$("#new_name, #new_lastname, #new_login, #new_pwd, #new_is_admin_by, #new_email, #new_domain").val("");
$("#new_admin, #new_manager, #new_read_only, #new_personal_folder").prop("checked", false);

// refresh table content
tableUsers.api().ajax.reload();

$("#add_new_user").dialog("close");
} else {
$("#add_new_user_error").html(data[0].error).show(1).delay(1000).fadeOut(1000);
}
},
"json"
);
}
},
"json"
)
}
);
}
},
"<?php echo $LANG['cancel_button']; ?>": function() {
Expand Down

0 comments on commit 7d8e2e3

Please sign in to comment.