$this->html .= $this->basicInputField("user_new_password2", $locale['u135'], "64", $passRequired, "password", FALSE, "user_password");
$this->html .= $this->basicInputField("generated_password", $locale['u135b'], "100", false, $locale['u126']);
$this->html .= "<tr>\n";
$this->html .= "<td width='150'></td>\n";
$this->html .= "<td width='150'><input type='button' class='btn btn-primary' value='".$locale['u135a']."' onClick='randomPassword(8);'></td></tr>\n";
$this->html .= "<script>";
$this->html .= "function randomPassword(length) {";
$this->html.= "var chars = 'abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOP1234567890';";
$this->html .= "var pass = '';";
$this->html .= "for (var x = 0; x < length; x++) {";
$this->html.= "var i = Math.floor(Math.random() * chars.length);";
$this->html .= "pass += chars.charAt(i);";
$this->html .= "}";
$this->html .= "inputform.user_new_password.value = pass;";
$this->html .= "inputform.user_new_password2.value = pass;";
$this->html .= "inputform.generated_password.value = pass;";
$this->html .= "}";
$this->html .= "</script>";
$locale['u135'] = "Confirm password";
$locale['u135a'] = "Generate password";
$locale['u135b'] = "Generated password";
private $_themeChanged = FALSE;
private $_passwordchange = FALSE;
$this->_setCustomUserFieldsData();
if ($this->_passwordchange == TRUE) {
require_once LOCALE.LOCALESET."admin/members_email.php";
require_once INCLUDES."sendmail_include.php";
$subject = $locale['email_passwordupd_subject'].$settings['sitename'];
$replace_this = ["[USER_NAME]", "[PASSWORD]", "[SITENAME]", "[SITEUSERNAME]"];
$replace_with = [$this->_userName, $this->_newUserPassword, $settings['sitename'], $settings['siteusername']];
$message = str_replace($replace_this, $replace_with, $locale['email_passwordupd_message']);
sendemail($this->_userName, $this->_userEmail, $settings['siteusername'], $settings['siteemail'], $subject, $message);
$this->_passwordchange = FALSE;
}
if ($_isValidNewPassword === 0) {
// New password is valid
$this->_passwordchange = TRUE;
$locale['email_create_subject'] = "Account created at ";
$locale['email_create_message'] = "Hello [USER_NAME],<br/>\r\n
Your account at [SITENAME] has been created.<br/>\r\nYou can now login using the following details:<br/>\r\n
Username: [USER_NAME]<br/>\r\nPassword: [PASSWORD]<br/>\r\nRegards,<br/>\r\n[SITEUSERNAME]";
$locale['email_passwordupd_subject'] = "Password changed at ";
$locale['email_passwordupd_message'] = "Hello [USER_NAME],\n
Your password has been succesfully updated<br>Y\r\nYou can now login using the following details:<br/>\r\n
Username: [USER_NAME]<br/>\r\nPassword: [PASSWORD]<br/>\r\nRegards,<br/>\r\n[SITEUSERNAME]";
Category Forum
Code Snippet and functions - 8Labels
None yet
Statistics
4 participants
Notifications
You are not receiving notifications from this thread.
Related Questions