Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

What is the purpose of isFirstPageAfterLogin method in admin/session model?

Tags:

magento

I see where this method is being used, but I'm wondering who has an authoritative answer on the matter?

like image 678
benmarks Avatar asked Dec 28 '22 08:12

benmarks


1 Answers

I know you said you know where, but I'm going to mention it here for completeness since you didn't... hope you don't mind! :)

The flag that isFirstPageAfterLogin() checks is set in the login() method that's called during the admin login process.

It is used in the following places:

  • Mage_Adminhtml_IndexController to store the value in the admin session so that it's still available on the first page load after the login form is submitted.
  • Mage_Adminhtml_Block_Notification_Window to determine whether or not to show the notices "window" that often shows after login.
  • A few actions on Mage_Adminhtml_Report_StatisticsController in order to redirect the user to the page they should be if their login routes them to one of the report refresh actions.
  • Mage_Core_Controller_Front_Action uses it to redirect a user back to the dashboard if their login routes them to an action that would send a download response, which frequently can rely on filter data that may or may not be available to the controller if it come from the login.

So to recap, it's a very important flag that is used to control some behind the scenes behavior. The most important being redirecting to the correct login page and allowing for one-time notices to show upon login.

like image 87
davidalger Avatar answered May 12 '23 05:05

davidalger