Back to SiteApplication class

Method login

public bool
login
(mixed $credentials, mixed $options = array())
Login authentication function
Parameters
  • array $credentials Array('username' => string, 'password' => string)
  • array $options Array('remember' => boolean)
Returns
  • bool True on success.
Since
  • 3.2

Method login - Source code

/**
 * Login authentication function
 *
 * @param   array  $credentials  Array('username' => string, 'password' => string)
 * @param   array  $options      Array('remember' => boolean)
 *
 * @return  boolean  True on success.
 *
 * @since   3.2
 */
public function login($credentials, $options = array())
{
    // Set the application login entry point
    if (!\array_key_exists('entry_url', $options)) {
        $options['entry_url'] = Uri::base() . 'index.php?option=com_users&task=user.login';
    }
    // Set the access control action to check.
    $options['action'] = 'core.login.site';
    return parent::login($credentials, $options);
}