Closed (fixed)
Project:
Login Disable
Version:
7.x-1.1
Component:
Code
Priority:
Normal
Category:
Bug report
Assigned:
Unassigned
Reporter:
Created:
14 Nov 2014 at 03:39 UTC
Updated:
1 Jul 2017 at 11:19 UTC
Jump to comment: Most recent
In login_disable_form_user_login_alter(), drupal_set_message() is called to display the login disabled message) even when the user is allowed to login:
function login_disable_form_user_login_alter(&$form, &$form_state) {
if (variable_get('login_disable_is_active', FALSE)) {
$key = variable_get('login_disable_key', 'admin');
// If the key is set, block people from logging in if it was not passed as
// an argument in the URL.
if (!empty($key) && !array_key_exists($key, $_GET)) {
$form['name']['#disabled'] = 'disabled';
$form['pass']['#disabled'] = 'disabled';
unset($form['#validate']);
unset($form['#submit']);
unset($form['action']);
}
drupal_set_message(variable_get('login_disable_message', t('Member access has been temporarily disabled. Please try again later.')), 'warning', FALSE);
}
}
A patch is attached to move drupal_set_message() to the appropriate block so it is only displayed when login is blocked.
| Comment | File | Size | Author |
|---|---|---|---|
| login-disable-move-message-1087226.patch | 1.05 KB | wonder95 |
Comments
Comment #1
interdruper commentedPatch works fine for me.
Comment #2
nehajyoti commentedPatch applied cleanly and works fine. Applying patch to dev release.
Comment #4
nehajyoti commentedComment #6
gsquirrelDid this fix get lost - I have same issue with current version and it appears the drupal_Set_message is back in the wrong place?