shop:onAuthenticateCustomer event
The event allows to implement custom authentication scenarios. By default when customer submits the Login form, LemonStand checks the specified email and password values against the database. In the event handler you can use submitted data for custom customer record search.
The event handler should have 2 parameters - user name and password (which correspond the email and password fields on the customer login form). The handler method should return the customer object (Shop_Customer) or null. Handler example:
public function subscribeEvents()
{
Backend::$events->addEvent('shop:onAuthenticateCustomer', $this, 'find_customer');
}
public function find_customer($login, $password)
{
return Shop_Customer::create()
->where('x_customer_profile_id=?', $login)
->where('password=?', Phpr_SecurityFramework::create()->salted_hash($password))
->find();
}Next: shop:onAutomatedBillingSupported event
Previous: shop:onGetProductExtraPrice
Return to Handling LemonStand events

