The authentication hook allows checking for a username and password pair in an external system, for example, LDAP. To do this, you need to extend the class pm_Hook_Auth. The class must be located in the directory plib/hooks/.

Example

Below is an example of such a hook, using the method

Use the following code:

class Modules_MyExtension_Auth extends pm_Hook_Auth
{
    public function auth($login, $password)
    {
        // TODO: add your implementation here
    }
}

The method must return a boolean value. If a username and password pair is valid, it should return true.

You can control the operation of the extension during run-time by implementing the method isEnabled().