diff --git a/data/template/lcube6/object_coordination/adminuser/changeuseradmin.mxt b/data/template/lcube6/object_coordination/adminuser/changeuseradmin.mxt index 6d1210b..c42abaf 100755 --- a/data/template/lcube6/object_coordination/adminuser/changeuseradmin.mxt +++ b/data/template/lcube6/object_coordination/adminuser/changeuseradmin.mxt @@ -1,151 +1,151 @@
- - -
-
-

-
-
- " data-offstyle="danger font-weight-bold" data-off="" type="checkbox"> -
-
-
-
-
-
- -
- + + +
+
+

-
-
- -
- -
-
-
- -
- -
-
-
- -
- +
+ " data-offstyle="danger font-weight-bold" data-off="" data-size="mini" type="checkbox" name="user_account_active">
-
-
-
- +
+
+
+
+ +
+ +
+
+
+ +
+ +
+
+
+ +
+ +
+
+
+ +
+
-
-
-
- +
+
+
+ +
+
- -
-
-
- +
+
+ +
+
- -
-
-
- +
+
+ +
+ +
+
+
+ +
+
-
-
-
-

-
-
-
-
-
- +
+

+
+
+
+
+
+ +
+ +
+
+
+ +
+ +
+
+
+ +
+ +
+
+
+ +
+
-
-
-
- +
+
+
+ +
+
- -
-
-
- +
+
+ +
+
- -
-
-
- -
-
-
-
-
- +
+

+
+
+
+
+
+ +
+
- -
-
-
- +
+
+ +
+ +
+
+
+ +
+ +
+
+
+ +
+
-
-
-
-

-
-
-
-
-
- -
- -
-
-
- -
- -
-
-
- -
- -
-
-
- -
- -
+ -
-
diff --git a/install/db_scripts/mysql/7_create_structure.sql b/install/db_scripts/mysql/7_create_structure.sql index 895fe56..03e7c2b 100755 --- a/install/db_scripts/mysql/7_create_structure.sql +++ b/install/db_scripts/mysql/7_create_structure.sql @@ -83,7 +83,7 @@ CREATE TABLE `{_PREFIX_}object_user_temp` ( `user_comment` text NOT NULL, `user_info` text NOT NULL, `user_charte_status` tinyint(4) NOT NULL DEFAULT 0, - `user_account_active` tinyint(4) NOT NULL DEFAULT 1 + `user_account_active` enum('on','off') CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NOT NULL DEFAULT 'off' ) ENGINE=MyISAM DEFAULT CHARSET=utf8 PACK_KEYS=0; #-- -------------------------------------------------------- #-- @@ -339,7 +339,7 @@ CREATE TABLE `{_PREFIX_}user` ( `user_comment` text NOT NULL DEFAULT '', `user_info` text NOT NULL DEFAULT '', `user_charte_status` tinyint(4) NOT NULL DEFAULT 0, - `user_account_active` tinyint(4) NOT NULL DEFAULT 1 + `user_account_active` enum('on','off') CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NOT NULL DEFAULT 'off' ) ENGINE=MyISAM DEFAULT CHARSET=utf8 PACK_KEYS=0; #-- -------------------------------------------------------- #-- diff --git a/install/db_scripts/mysql/7_insert_datas.sql b/install/db_scripts/mysql/7_insert_datas.sql index 05ba350..7e669ee 100755 --- a/install/db_scripts/mysql/7_insert_datas.sql +++ b/install/db_scripts/mysql/7_insert_datas.sql @@ -163,8 +163,8 @@ INSERT INTO `{_PREFIX_}right` VALUES (17, 'Community', 'actionLecture', 2, 2, 0, #-- #-- Contenu de la table `user` #-- -INSERT INTO `{_PREFIX_}user` VALUES (1, '0', 'Anonyme', '', 'Guest', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', 0, 1); -INSERT INTO `{_PREFIX_}user` VALUES (2, '0', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', 0, 0); +INSERT INTO `{_PREFIX_}user` VALUES (1, '0', 'Anonyme', '', 'Guest', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', 0, 'on'); +INSERT INTO `{_PREFIX_}user` VALUES (2, '0', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', 0, 'on'); #----------------------------------------------------------- #-- #-- Contenu de la table `user_preference` diff --git a/lib/object_coordination/adminuser/adminuser.php b/lib/object_coordination/adminuser/adminuser.php index c15d19d..244c0fe 100755 --- a/lib/object_coordination/adminuser/adminuser.php +++ b/lib/object_coordination/adminuser/adminuser.php @@ -210,9 +210,8 @@ Class AdminUser extends CoordinationObj $GLOBALS["SYSTEM_TEMPLATE"]->MxText("ligne.vuser_login", htmlentitiesconv($currentUser->getLogin())); $GLOBALS["SYSTEM_TEMPLATE"]->MxText("ligne.vuser_mail", htmlentitiesconv($currentUser->getMail())); $GLOBALS["SYSTEM_TEMPLATE"]->MxAttribut("ligne.vmailto", "mailto:".htmlentitiesconv($currentUser->getMail())); - // var_dump($currentUser->getAccountActive()); $GLOBALS["SYSTEM_TEMPLATE"]->MxAttribut("ligne.url_account_active",formatUrl($this->getId(),"AdminUser","ChangeAccountActive","",$currentUser->getId())); - $GLOBALS["SYSTEM_TEMPLATE"]->MxText("ligne.vuser_account_active", ($currentUser->getAccountActive())?"toggle-on text-success":"toggle-off text-danger" ); + $GLOBALS["SYSTEM_TEMPLATE"]->MxText("ligne.vuser_account_active", ($currentUser->getAccountActive()=="on")?"toggle-on text-success":"toggle-off text-danger" ); $GLOBALS["SYSTEM_TEMPLATE"]->MxAttribut("ligne.vuser_id", "user".$currentUser->getId()); /* Pour récuperer les libellés */ @@ -669,7 +668,7 @@ function exportAdmin() $MyUser = $GLOBALS["SYSTEM_MANAGER"]["USER"]->createInstance($param); - $GLOBALS["SYSTEM_TEMPLATE"]->MxText("accountState", ($MyUser->getAccountActive())?" checked=\"checked\"":""); + $GLOBALS["SYSTEM_TEMPLATE"]->MxText("accountState", ($MyUser->getAccountActive()=="on")?" checked=\"checked\"":""); $titre = array(getMessage("mr"),getMessage("mrs"), getMessage("miss")); $GLOBALS["SYSTEM_TEMPLATE"]->MxSelect("user_title", "user_title", $MyUser->getTitle(), $titre, "", "", "", "class=\"form\" title=\"".htmlspecialchars(getMessage("tipSelectTitle"), ENT_QUOTES)."\""); @@ -765,6 +764,9 @@ function exportAdmin() /* Récupération du noeud à administrer sinon noeud d'entrée de l'admin */ $groupId=($this->getData("groupId")!="")?$this->getData("groupId"):1; $group_id=(isset($_POST["group_id"]) && is_numeric($_POST["group_id"]))?$_POST["group_id"]:$groupId; + + /* Vérification du statut du compte */ + $user_account_active=(isset($_POST["user_account_active"]))?$_POST["user_account_active"]:"off"; /* gestion du lib en fonction de la langue courante */ $currentCode=$GLOBALS["SYSTEM_USER_SESSION"]->langue->getCode(); @@ -843,15 +845,15 @@ function exportAdmin() else { $d = DateTime::createFromFormat('d/m/Y', $_POST['user_birthdate']); - var_dump($_POST); + //On enregistre les modifications de l'objet User + $MyUser->setAccountActive($user_account_active); $MyUser->setTitle($_POST['user_title']); $MyUser->setFirstName($_POST['user_first_name']); $MyUser->setLastName($_POST['user_last_name']); $MyUser->setLogin($_POST['user_login']); $MyUser->setPassword($_POST['user_password']); $MyUser->setMail($_POST['user_mail']); - var_dump($d->getTimestamp()); $MyUser->setBirthDate($d->getTimestamp()); $MyUser->setPostalAddress($_POST['user_postal_address']); $MyUser->setPostalCode($_POST['user_postal_code']);