Love Fuel?    Donate

FuelPHP Forums

Ask your question about FuelPHP in the appropriate forum, or help others by answering their questions.
Class 'SimpleUserWrongPassword' not found
  • Hi Guys! How can i handle this ErrorException and display a nice error message to the user?
    ErrorException [ Error ]: Class 'SimpleUserWrongPassword' not found
    
    PKGPATH/auth/classes/auth/login/simpleauth.php @ line 194
    
    189        }
    190        if (array_key_exists('password', $values))
    191        {
    192            if ($current_values->get('password') != $this->hash_password(@$values['old_password']))
    193            {
    194                throw new \SimpleUserWrongPassword('Old password is invalid');
    195            }
    196
    197            if ( ! empty($values['password']))
    198            {
    199                $update['password'] = $this->hash_password($values['password']);
    
    
    
  • I think I have found the answer.. need to call the change_password method with try catch block. Edit* Try catch did not help.
  • Still looks like a bug, the exception class thrown should exist. I'll look into it.
  • Jelmer Schreuder wrote on Saturday 16th of July 2011:
    Still looks like a bug, the exception class thrown should exist. I'll look into it.

    Thanks Jelmer. In the simpleauth class at the top the SimpleUserWrongPassword class defined as below, not sure if it's complete or not. class SimpleUserWrongPassword extends \Fuel_Exception {}
  • Wouldn't you have to
    throw new Auth\SimpleUserWrongPassword()
    

    Since it's defined inside of the Auth namespace?
  • It's already fixed in develop, I forgot to add it to the bootstrap. When it's in the bootstrap it can be requested from the global namespace because the Auth namespace is a "core" namespace (= aliased to global when requested) which allows easy extension from the app.
  • Thanks jelmer

Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

In this Discussion