Пример #1
0
 public function restoreNewPassword($email, $password, $token)
 {
     $dataBaseServices = new DbConnection();
     $checkEmailStatus = $dataBaseServices->checkUserEmail($email);
     if ($checkEmailStatus === 0) {
         $chekTokenStatus = $dataBaseServices->checkValidToken($email, $token);
         if ($chekTokenStatus === 0) {
             $signedPassword = $this->signNewPassword($password);
             $changePasswordStatus = $dataBaseServices->changeUserPassword($email, $signedPassword);
             if ($changePasswordStatus === 0) {
                 return 0;
             } else {
                 return 1;
             }
         } else {
             return 1;
         }
     } else {
         return 1;
     }
 }