|
|
@@ -130,6 +130,7 @@ class user {
|
|
|
}
|
|
|
|
|
|
public static function maj_user(array $_input){
|
|
|
+
|
|
|
if($_input["password"] != ""){
|
|
|
db::query("UPDATE " . DB_T_USER . " SET password = :password WHERE id = :id");
|
|
|
db::bind(':password', md5($_input["password"]));
|
|
|
@@ -137,7 +138,20 @@ class user {
|
|
|
try {
|
|
|
db::execute();
|
|
|
} catch (Exception $ex) {
|
|
|
- alert::recError("Erreur lors de la modification de l'utilisateur");
|
|
|
+ alert::recError("Erreur lors de la modification du mot de passe");
|
|
|
+ header("Location: /user-" . $_input["id"] .".html");
|
|
|
+ exit();
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+ if(self::getMyGoogleAuthenticator($_input["id"]) == NULL){
|
|
|
+ db::query("UPDATE " . DB_T_USER . " SET googleAuthenticatorSecret = :googleAuthenticatorSecret WHERE id = :id");
|
|
|
+ db::bind(':googleAuthenticatorSecret', googleAuthenticator::createSecret());
|
|
|
+ db::bind(':id', $_input["id"]);
|
|
|
+ try {
|
|
|
+ db::execute();
|
|
|
+ } catch (Exception $ex) {
|
|
|
+ alert::recError("Erreur lors de la création du token de Google Authenticator");
|
|
|
header("Location: /user-" . $_input["id"] .".html");
|
|
|
exit();
|
|
|
}
|