0

I have the login form displayed in the CTools modal dialog. When users log in, they see the confirmation message and a Rules action redirect them to the home page. How can I remove the confirmation message without using the disable_messages module?

0

You can add a custom module hook to alter the login process and unset the messages. If you look at core's user.module you can see the various points where you can hook into the login functions.

This is one option (I think there are several and you may need to adjust based on your site's settings) You should be able to do something along these lines:

function YOURMODULE_user_login(&$edit, $account) {
  if ($account->uid) {
     if (isset($_SESSION['messages']['status'])) {
       unset($_SESSION['messages']['status']);
     }
  }
}

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.