if (Input::method() == 'POST')
{
//Put your validation rule
$val->add('oldpassword', 'Old Password')
->add_rule('required');
$val->add('newpassword', 'New Password')
->add_rule('required')
->add_rule('min_length', 3)
->add_rule('max_length', 10);
if ($val->run())
{
try
{
// change password
if(Auth::instance()->change_password(Input::param('oldpassword'), Input::param('newpassword')))
{
$this->template->set_global('change_password_error', 'Password change');
}
else
{
$this->template->set_global('change_password_error', 'Old password was incorrect');
}
}
// catch exceptions from the change_password call
catch (SimpleUserUpdateException $e)
{
$this->template->set_global('change_password_error', $e->getMessage());
}
}
}
It looks like you're new here. If you want to get involved, click one of these buttons!