MasterPassword for Magento Store Developers

MasterPassword offers events that allow Store Developers to interact with the Customer Login Process.

Customer Login Validate

These events are being introduced by MasterPassword during a customer login validation.

Events

Password validation upon attempt to login:

customer_validate_password_before

Validation on creating a new Customer Account:

customer_validate_before
customer_validate_after

Models passed to Observer

customer - Current Customer object


Code Example

To add your own Observer to these Events, you may use the following code examples as guideline:

Your Extensions [config.xml]

<global>
   <events>
      <customer_validate_before>
         <observers>
            <yourobserver_event_login_process_before>
               <type>singleton</type>
               <class>Your_Extension_Model_Observer</class>
               <method>eventLoginProcessBefore</method>
            </yourobserver_event_login_process_before>
	 </observers>
      </customer_validate_before>
   </events>
</global>


Your Extensions [Observer.php]

class Your_Extension_Model_Observer
{
 
  /*
   * Event before processing download
   */
  public function eventLoginProcessBefore($observer)
  {
  	$customer = $observer->getEvent()->getCustomer();
  	$errors = $customer->getErrors();
 
  	// Do your own stuff with it here...
  }
 
}