change password

This commit is contained in:
2019-05-07 21:41:49 +02:00
parent 2738f8aa78
commit b3e8eecca6
5 changed files with 105 additions and 12 deletions
@@ -82,6 +82,17 @@ class usersController extends MY_Controller {
$this->json( ['success' => TRUE, 'userID' => $userID] );
}
public function savePassword()
{
$password = $this->clean_input( 'password' );
$user = User::find( USERID );
$saltedPassword = User::getSaltedPassword( $password, $user->salt );
User::whereId( USERID )->update( ['password' => $saltedPassword] );
}
public function archiveUser( $userID, $status )
{
User::whereId( $userID )->update( ['archive' => $status] );