Welcome Guest, Not a member yet? Register   Sign In
SOLVED: Error loading model
#1

[eluser]Bramme[/eluser]
Fatal error: Call to undefined method password_hash::_assign_libraries() in /var/www/vhosts/bramme.net/subdomains/mickm/httpdocs/systeem/libraries/Loader.php on line 178

I needed to use a class in my CI app, so I figured, since it's a class, I can just use it as a model... I took care off the variables that needed to be set etc etc, but I can't make anything off this error.

Anybody got a clue?

The error happened in a custom validation callback

Code:
function phpbbmatch($str) {
    
    $this->validation->set_message('phpbbmatch', 'The password you entered does not match with the entered username');
    $this->load->model('password_hash');
    
    if(empty($str) || !isset($str)) {
        return true;
    }
    
    $username = $this->input->post('name');        

    if($username == false) {
        return false;
    } else {
        //connect to phpbb db and get username password
        $dsn = 'mysql://';
        $phpbb = $this->load->database($dsn, true);
        $phpbb->where('username', $username);
        $query = $phpbb->get('phpbb3_users');
        $row = $query->row();
        $hash = $row->user_password;
        $check = $this->password_hash->CheckPassword($str, $hash);
        
        if($check) {
            return true;
        } else {
            return false;    
        }
    }    
}
#2

[eluser]Bramme[/eluser]
nvm: didn't extend Model or declare parent::Model()




Theme © iAndrew 2016 - Forum software by © MyBB