- Patch by Robert: fixed problem with username blocking.

4.7.x
Dries Buytaert 2005-06-23 19:26:51 +00:00
parent e7cc200eeb
commit 5365db7e07
2 changed files with 58 additions and 54 deletions

View File

@ -812,6 +812,7 @@ function user_login($edit = array(), $msg = '') {
drupal_goto('user');
}
if (isset($edit['name'])) {
if (user_is_blocked($edit['name'])) {
// blocked in user administration
$error = t('The username %name has been blocked.', array('%name' => theme('placeholder', $edit['name'])));
@ -820,7 +821,7 @@ function user_login($edit = array(), $msg = '') {
// denied by access controls
$error = t('The name %name is a reserved username.', array('%name' => theme('placeholder', $edit['name'])));
}
else if ($edit['name'] && $edit['pass']) {
else if ($edit['pass']) {
if (!$user->uid) {
$user = user_authenticate($edit['name'], trim($edit['pass']));
@ -844,6 +845,7 @@ function user_login($edit = array(), $msg = '') {
watchdog('user', t('Login attempt failed for %user: %error.', array('%user' => theme('placeholder', $edit['name']), '%error' => theme('placeholder', $error))));
}
}
}
// Display error message (if any):
if ($error) {

View File

@ -812,6 +812,7 @@ function user_login($edit = array(), $msg = '') {
drupal_goto('user');
}
if (isset($edit['name'])) {
if (user_is_blocked($edit['name'])) {
// blocked in user administration
$error = t('The username %name has been blocked.', array('%name' => theme('placeholder', $edit['name'])));
@ -820,7 +821,7 @@ function user_login($edit = array(), $msg = '') {
// denied by access controls
$error = t('The name %name is a reserved username.', array('%name' => theme('placeholder', $edit['name'])));
}
else if ($edit['name'] && $edit['pass']) {
else if ($edit['pass']) {
if (!$user->uid) {
$user = user_authenticate($edit['name'], trim($edit['pass']));
@ -844,6 +845,7 @@ function user_login($edit = array(), $msg = '') {
watchdog('user', t('Login attempt failed for %user: %error.', array('%user' => theme('placeholder', $edit['name']), '%error' => theme('placeholder', $error))));
}
}
}
// Display error message (if any):
if ($error) {