i have changed the user module as follows

$_SESSION['loginerror']='';// to store the login error

// change the following function

function user_login_final_validate($form, &$form_state) {
global $user;
if (!$user->uid) {
//form_set_error('name', t('Sorry,...); // comment this line
$_SESSION['loginerror']='error of pw wrong';
}
}

then create the block and add the following code

echo  $_SESSION['loginerror']; 
return drupal_get_form('user_login_block');

When i submit without password and username is show the $_SESSION['loginerror'] value "error of pw wrong" , when i enter the wrong user and wrong pass it does not show the value of session variable. can anybody help in this.

I want to overtake the drupal error and right my own with different format.

Comments

mxh’s picture

Issue summary: View changes
Status: Active » Closed (outdated)

This namespace is taken for a new project, see https://www.drupal.org/node/2833026.