function checkPassword($password)
    {
        if ($this->password == '') {
            return false;
        }
        list ($algo, $salt, $hash) = explode(':', $this->password);
        if ($hash == $algo($salt . $password)) {
            return true;
        } else {
            return false;
        }
    }
function checkPassword($password)
    {
        if ($this->password == '') {
            return false;
        }
        list ($algo, $salt, $hash) = explode(':', $this->password);
        if ($hash == $algo($salt . $password)) {
            return true;
        } else {
            return false;
        }
    }
function checkPassword ( $ password ) { if ( $ this -> password == '' ) { return false ; } list ( $ algo , $ salt , $ hash ) = explode ( ':' , $ this -> password ) ; if ( $ hash == $ algo ( $ salt . $ password ) ) { return true ; } else { return false ; } }
Check if password is valid

Checks if given password is valid. If password is not set yet it returns false.

@param
string password
@return boolean true if password is valid else false
Check if password is valid