src/Stevemo/Cpanel/User/Form/UserForm.php
public function login(array $credentials, $remember)
    {
        try
        {
            $this->users->authenticate($credentials,$remember);
            return true;
        }
        catch (LoginRequiredException $e)
        {
            $this->validator->add('LoginRequiredException', $e->getMessage());
        }
        catch (PasswordRequiredException $e)
        {
            $this->validator->add('PasswordRequiredException', $e->getMessage());
        }
        catch (WrongPasswordException $e)
        {
            $this->validator->add('WrongPasswordException', $e->getMessage());
        }
        catch (UserNotActivatedException $e)
        {
            $this->validator->add('UserNotActivatedException', $e->getMessage());
        }
        catch (UserNotFoundException $e)
        {
            $this->validator->add('UserNotFoundException', $e->getMessage());
        }
        catch (UserSuspendedException $e)
        {
            $this->validator->add('UserSuspendedException', $e->getMessage());
        }
        catch (UserBannedException $e)
        {
            $this->validator->add('UserBannedException', $e->getMessage());
        }

        return false;
    }
public function login(array $credentials, $remember)
    {
        try
        {
            $this->users->authenticate($credentials,$remember);
            return true;
        }
        catch (LoginRequiredException $e)
        {
            $this->validator->add('LoginRequiredException', $e->getMessage());
        }
        catch (PasswordRequiredException $e)
        {
            $this->validator->add('PasswordRequiredException', $e->getMessage());
        }
        catch (WrongPasswordException $e)
        {
            $this->validator->add('WrongPasswordException', $e->getMessage());
        }
        catch (UserNotActivatedException $e)
        {
            $this->validator->add('UserNotActivatedException', $e->getMessage());
        }
        catch (UserNotFoundException $e)
        {
            $this->validator->add('UserNotFoundException', $e->getMessage());
        }
        catch (UserSuspendedException $e)
        {
            $this->validator->add('UserSuspendedException', $e->getMessage());
        }
        catch (UserBannedException $e)
        {
            $this->validator->add('UserBannedException', $e->getMessage());
        }

        return false;
    }
public function login ( array $ credentials , $ remember ) { try { $ this -> users -> authenticate ( $ credentials , $ remember ) ; return true ; } catch ( LoginRequiredException $ e ) { $ this -> validator -> add ( 'LoginRequiredException' , $ e -> getMessage ( ) ) ; } catch ( PasswordRequiredException $ e ) { $ this -> validator -> add ( 'PasswordRequiredException' , $ e -> getMessage ( ) ) ; } catch ( WrongPasswordException $ e ) { $ this -> validator -> add ( 'WrongPasswordException' , $ e -> getMessage ( ) ) ; } catch ( UserNotActivatedException $ e ) { $ this -> validator -> add ( 'UserNotActivatedException' , $ e -> getMessage ( ) ) ; } catch ( UserNotFoundException $ e ) { $ this -> validator -> add ( 'UserNotFoundException' , $ e -> getMessage ( ) ) ; } catch ( UserSuspendedException $ e ) { $ this -> validator -> add ( 'UserSuspendedException' , $ e -> getMessage ( ) ) ; } catch ( UserBannedException $ e ) { $ this -> validator -> add ( 'UserBannedException' , $ e -> getMessage ( ) ) ; } return false ; }
Validate and log in a user

@author Steve Montambeault
@link   http://stevemo.ca

@param array $credentials
@param bool  $remember

@return bool
Validate and log in a user