- Patch by Robert: fixed problem with username blocking.
parent
e7cc200eeb
commit
5365db7e07
|
@ -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) {
|
||||
|
|
|
@ -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) {
|
||||
|
|
Loading…
Reference in New Issue