Heres my code in controller function edit
(Old password is invalid)
public function action_edit($id = null)
{
$user = Model_User::find($id);
//$val = Model_User::validate('edit');
// if ($val->run())
// {
//simple auth update user
$user = Auth::update_user(
array(
'email' => Input::post('email'),
'password' => Input::post('password'),
'old_password' => Input::post('oldpassword'),
)
);
if ($user)
{
Session::set_flash('success', e('Updated user #' ));
Response::redirect('admin/users');
}
else
{
if (Input::method() == 'POST')
{
$user = Auth::update_user(
array(
'email' => $val->validated('email'),
'password' => $val->validated('password'),
'old_password' => $val->validated('oldpassword'),
)
);
Session::set_flash('error', $val->error());
}
$this->template->set_global('user', $user, false);
}
$this->template->title = "Users";
$this->template->content = View::forge('admin/users/edit');
}
It looks like you're new here. If you want to get involved, click one of these buttons!