Model_Auth_User::change_password PHP Method

change_password() public method

Validates an array for a matching password and password_confirm field, and optionally redirects after a successful save.
public change_password ( array &$array, $redirect = FALSE ) : boolean
$array array
return boolean
    public function change_password(array &$array, $redirect = FALSE)
    {
        $array = Validate::factory($array)->label('password', $this->_labels['password'])->label('password_confirm', $this->_labels['password_confirm'])->filter(TRUE, 'trim')->rules('password', $this->_rules['password'])->rules('password_confirm', $this->_rules['password_confirm']);
        if ($status = $array->check()) {
            // Change the password
            $this->password = $array['password'];
            if ($status = $this->save() and is_string($redirect)) {
                // Redirect to the success page
                Request::instance()->redirect($redirect);
            }
        }
        return $status;
    }