Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions public_html/lists/admin/css/app.css
Original file line number Diff line number Diff line change
Expand Up @@ -287,3 +287,7 @@ div.plugindetails > div.detail > span.value {
font-weight: bold;
height: 150px;
}

form#forgotpassword-form input[type="submit"] {
margin-top: 10px;
}
18 changes: 14 additions & 4 deletions public_html/lists/admin/index.php
Original file line number Diff line number Diff line change
Expand Up @@ -344,12 +344,22 @@ function mb_strtolower($string)
}
}
//If passwords are encrypted and a password recovery request was made, send mail to the admin of the given email address.
} elseif (isset($_REQUEST['forgotpassword'])) {
$adminId = $GLOBALS['admin_auth']->adminIdForEmail($_REQUEST['forgotpassword']);
} elseif (isset($_REQUEST['forgotpassword']) || isset($_REQUEST['forgotusername'])) {
$addressReminderType = '';
$addressReminder = '';
if (isset($_REQUEST['forgotpassword']) && !empty($_REQUEST['forgotpassword'])) {
$addressReminderType = 'password';
$addressReminder = $_REQUEST['forgotpassword'];
} elseif (isset($_REQUEST['forgotusername']) && !empty($_REQUEST['forgotusername'])) {
$addressReminderType = 'username';
$addressReminder = $_REQUEST['forgotusername'];
}
$adminId = $GLOBALS['admin_auth']->adminIdForEmail($addressReminder);
if ($adminId) {
$msg = sendAdminPasswordToken($adminId);
$msg = ($addressReminderType == 'password') ? sendAdminPasswordToken($adminId) : sendAdminUsernameReminder($adminId);
} else {
$msg = $GLOBALS['I18N']->get('Failed sending a change password token');
if (empty($addressReminderType)) $addressReminderType = 'password';
$msg = $GLOBALS['I18N']->get('Failed sending a ' . (($addressReminderType == 'password') ? 'change password token' : 'username reminder'));
}
$page = 'login';
} elseif (!empty($_GET['secret'])
Expand Down
25 changes: 24 additions & 1 deletion public_html/lists/admin/lib.php
Original file line number Diff line number Diff line change
Expand Up @@ -417,6 +417,29 @@ function sendAdminPasswordToken($adminId)
}
}

//Send an email with a username reminder the specified adminId.
function sendAdminUsernameReminder($adminId)
{
//Retrieve the admin login name and email address
$SQLquery = sprintf('select loginname,email from %s where id=%d;', $GLOBALS['tables']['admin'], $adminId);
$row = Sql_Fetch_Row_Query($SQLquery);
$adminName = $row[0];
$email = $row[1];

$urlroot = getConfig('website').$GLOBALS['adminpages'];
//Build the email body to be sent, and finally send it.
$emailBody = $GLOBALS['I18N']->get('Hello')."\n\n";
$emailBody .= $GLOBALS['I18N']->get('You have requested a username reminder for phpList.')."\n\n";
$emailBody .= $GLOBALS['I18N']->get('Your username is:')."\n\n";
$emailBody .= $adminName;

if (sendMail($email, $GLOBALS['I18N']->get('Username reminder'), "\n\n".$emailBody, '', '', true)) {
return $GLOBALS['I18N']->get('A username reminder has been sent to the corresponding email address.');
} else {
return $GLOBALS['I18N']->get('Error sending user reminder');
}
}

function getTopSmtpServer($domain)
{
$mx = getmxrr($domain, $mxhosts, $weight);
Expand Down Expand Up @@ -2522,4 +2545,4 @@ function notifyNewIPLogin($adminId) {
sendMail($main_admin_mail, $GLOBALS['installation_name'].' '.s('login from new location'), $msg, system_messageheaders($admin_mail));
}

}
}
6 changes: 5 additions & 1 deletion public_html/lists/admin/login.php
Original file line number Diff line number Diff line change
Expand Up @@ -40,8 +40,12 @@ function footer()
echo '<form method="post" id="forgotpassword-form" action="">';
echo '<div class="login"><p>';
echo $GLOBALS['I18N']->get('Forgot password').' ';
echo $GLOBALS['I18N']->get('Enter your email address').': </p><input type="text" name="forgotpassword" value="" size="30" />';
echo $GLOBALS['I18N']->get('Enter your email address').': </p><input type="email" name="forgotpassword" value="" size="30" />';
echo ' <input class="submit" type="submit" name="process" value="'.$GLOBALS['I18N']->get('Send password').'" />';
echo ' <p>';
echo $GLOBALS['I18N']->get('Forgot username').' ';
echo $GLOBALS['I18N']->get('Enter your email address').': </p><input type="email" name="forgotusername" value="" size="30" />';
echo ' <input class="submit" type="submit" name="process" value="'.$GLOBALS['I18N']->get('Send username').'" />';
echo ' <div class="clear"></div>';
echo '</div></form>';
}
Expand Down
Loading