Browse files

Disable reset password for administrators

Signed-off-by: dimkalinux <dimka.linux@gmail.com>
  • Loading branch information...
1 parent cf1e322 commit 22e47502ce8235fee825bb592a4438ce33f5fc68 @Shutnik Shutnik committed with dimkalinux Jan 19, 2012
Showing with 5 additions and 1 deletion.
  1. +1 −0 lang/English/login.php
  2. +4 −1 login.php
View
1 lang/English/login.php
@@ -21,6 +21,7 @@
'Obtain pass' => 'new password',
'register' => 'register',
'Submit password request' => 'Submit request',
+'Email important' => 'Contact the forum administrator at %s to change password on specified email address.',
'Email flood' => 'This account has already requested a new password in the past %s seconds. Please wait a while before requesting a new password again.',
'New password request' => 'New password request',
'New password errors' => '<strong>Warning!</strong> The following errors must be corrected before a new password can be sent:',
View
5 login.php
@@ -205,7 +205,7 @@
// Fetch user matching $email
$query = array(
- 'SELECT' => 'u.id, u.username, u.salt, u.last_email_sent',
+ 'SELECT' => 'u.id, u.group_id, u.username, u.salt, u.last_email_sent',
'FROM' => 'users AS u',
'WHERE' => 'u.email=\''.$forum_db->escape($email).'\''
);
@@ -243,6 +243,9 @@
($hook = get_hook('li_forgot_pass_pre_flood_check')) ? eval($hook) : null;
+ if ($cur_hit['group_id'] == FORUM_ADMIN)
+ message(sprintf($lang_login['Email important'], '<a href="mailto:'.forum_htmlencode($forum_config['o_admin_email']).'">'.forum_htmlencode($forum_config['o_admin_email']).'</a>'));
+
if ($cur_hit['last_email_sent'] != '' && (time() - $cur_hit['last_email_sent']) < $forgot_pass_timeout && (time() - $cur_hit['last_email_sent']) >= 0)
message(sprintf($lang_login['Email flood'], $forgot_pass_timeout));

0 comments on commit 22e4750

Please sign in to comment.