This is the API docs for LemonStand V1, which has been discontinued. LemonStand is now a cloud based platform, available at lemonstand.com.

LemonStand API

shop:onAuthenticateCustomer event

Triggered by Shop_Customer
Author LemonStand eCommerce Inc.

Event handler signature

public mixed event_onAuthenticateCustomer(string $email, string $string)
$email string specifies the customer email address.
$string string specifies the customer password.
{return} mixed returns the customer object, NULL or FALSE.
Allows to implement custom customer authentication scenarios. By default when a customer submits the Login form, LemonStand checks the specified email and password values against the content of the shop_customers database table. In the event handler you can use submitted data for custom record search. The handler method should return the customer object (Shop_Customer), NULL or FALSE. The FALSE value is considered as a failed authentication. If the NULL value is returned, the standard authentication code runs. Usage 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();
}