Fixed issue #61.

This commit is contained in:
Rooty 2021-04-06 18:59:13 +02:00
parent edc6f86723
commit a70877b16e
4 changed files with 135 additions and 133 deletions

View File

@ -8,7 +8,7 @@
<span class="text-center"><h3><mx:text id="formUser1"/></h3></span> <span class="text-center"><h3><mx:text id="formUser1"/></h3></span>
</div> </div>
<div class="input-group col-xs-12 col-sm-3 col-lg-2 justify-content-center"> <div class="input-group col-xs-12 col-sm-3 col-lg-2 justify-content-center">
<span class="float-right"><input data-toggle="toggle" data-onstyle="success font-weight-bold" data-on="<mx:text id="user_account_sEnabled"/>" data-offstyle="danger font-weight-bold" data-off="<mx:text id="user_account_sDisabled"/>" type="checkbox"<mx:text id="accountState"/>></span> <input data-toggle="toggle" data-style="float-right" data-onstyle="success font-weight-bold" data-on="<mx:text id="user_account_sEnabled"/>" data-offstyle="danger font-weight-bold" data-off="<mx:text id="user_account_sDisabled"/>" data-size="mini" type="checkbox"<mx:text id="accountState"/> name="user_account_active">
</div> </div>
</div> </div>
<div class="card-body center-block"> <div class="card-body center-block">

View File

@ -83,7 +83,7 @@ CREATE TABLE `{_PREFIX_}object_user_temp` (
`user_comment` text NOT NULL, `user_comment` text NOT NULL,
`user_info` text NOT NULL, `user_info` text NOT NULL,
`user_charte_status` tinyint(4) NOT NULL DEFAULT 0, `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; ) ENGINE=MyISAM DEFAULT CHARSET=utf8 PACK_KEYS=0;
#-- -------------------------------------------------------- #-- --------------------------------------------------------
#-- #--
@ -339,7 +339,7 @@ CREATE TABLE `{_PREFIX_}user` (
`user_comment` text NOT NULL DEFAULT '', `user_comment` text NOT NULL DEFAULT '',
`user_info` text NOT NULL DEFAULT '', `user_info` text NOT NULL DEFAULT '',
`user_charte_status` tinyint(4) NOT NULL DEFAULT 0, `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; ) ENGINE=MyISAM DEFAULT CHARSET=utf8 PACK_KEYS=0;
#-- -------------------------------------------------------- #-- --------------------------------------------------------
#-- #--

View File

@ -163,8 +163,8 @@ INSERT INTO `{_PREFIX_}right` VALUES (17, 'Community', 'actionLecture', 2, 2, 0,
#-- #--
#-- Contenu de la table `user` #-- Contenu de la table `user`
#-- #--
INSERT INTO `{_PREFIX_}user` VALUES (1, '0', 'Anonyme', '', 'Guest', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', 0, 1); INSERT INTO `{_PREFIX_}user` VALUES (1, '0', 'Anonyme', '', 'Guest', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', 0, 'on');
INSERT INTO `{_PREFIX_}user` VALUES (2, '0', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', 0, 0); INSERT INTO `{_PREFIX_}user` VALUES (2, '0', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', 0, 'on');
#----------------------------------------------------------- #-----------------------------------------------------------
#-- #--
#-- Contenu de la table `user_preference` #-- Contenu de la table `user_preference`

View File

@ -210,9 +210,8 @@ Class AdminUser extends CoordinationObj
$GLOBALS["SYSTEM_TEMPLATE"]->MxText("ligne.vuser_login", htmlentitiesconv($currentUser->getLogin())); $GLOBALS["SYSTEM_TEMPLATE"]->MxText("ligne.vuser_login", htmlentitiesconv($currentUser->getLogin()));
$GLOBALS["SYSTEM_TEMPLATE"]->MxText("ligne.vuser_mail", htmlentitiesconv($currentUser->getMail())); $GLOBALS["SYSTEM_TEMPLATE"]->MxText("ligne.vuser_mail", htmlentitiesconv($currentUser->getMail()));
$GLOBALS["SYSTEM_TEMPLATE"]->MxAttribut("ligne.vmailto", "mailto:".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"]->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()); $GLOBALS["SYSTEM_TEMPLATE"]->MxAttribut("ligne.vuser_id", "user".$currentUser->getId());
/* Pour récuperer les libellés */ /* Pour récuperer les libellés */
@ -669,7 +668,7 @@ function exportAdmin()
$MyUser = $GLOBALS["SYSTEM_MANAGER"]["USER"]->createInstance($param); $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")); $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)."\""); $GLOBALS["SYSTEM_TEMPLATE"]->MxSelect("user_title", "user_title", $MyUser->getTitle(), $titre, "", "", "", "class=\"form\" title=\"".htmlspecialchars(getMessage("tipSelectTitle"), ENT_QUOTES)."\"");
@ -766,6 +765,9 @@ function exportAdmin()
$groupId=($this->getData("groupId")!="")?$this->getData("groupId"):1; $groupId=($this->getData("groupId")!="")?$this->getData("groupId"):1;
$group_id=(isset($_POST["group_id"]) && is_numeric($_POST["group_id"]))?$_POST["group_id"]:$groupId; $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 */ /* gestion du lib en fonction de la langue courante */
$currentCode=$GLOBALS["SYSTEM_USER_SESSION"]->langue->getCode(); $currentCode=$GLOBALS["SYSTEM_USER_SESSION"]->langue->getCode();
$defaultCode=$GLOBALS["SYSTEM_DEFAULT_LANGUAGE_CODE"]; $defaultCode=$GLOBALS["SYSTEM_DEFAULT_LANGUAGE_CODE"];
@ -843,15 +845,15 @@ function exportAdmin()
else else
{ {
$d = DateTime::createFromFormat('d/m/Y', $_POST['user_birthdate']); $d = DateTime::createFromFormat('d/m/Y', $_POST['user_birthdate']);
var_dump($_POST);
//On enregistre les modifications de l'objet User //On enregistre les modifications de l'objet User
$MyUser->setAccountActive($user_account_active);
$MyUser->setTitle($_POST['user_title']); $MyUser->setTitle($_POST['user_title']);
$MyUser->setFirstName($_POST['user_first_name']); $MyUser->setFirstName($_POST['user_first_name']);
$MyUser->setLastName($_POST['user_last_name']); $MyUser->setLastName($_POST['user_last_name']);
$MyUser->setLogin($_POST['user_login']); $MyUser->setLogin($_POST['user_login']);
$MyUser->setPassword($_POST['user_password']); $MyUser->setPassword($_POST['user_password']);
$MyUser->setMail($_POST['user_mail']); $MyUser->setMail($_POST['user_mail']);
var_dump($d->getTimestamp());
$MyUser->setBirthDate($d->getTimestamp()); $MyUser->setBirthDate($d->getTimestamp());
$MyUser->setPostalAddress($_POST['user_postal_address']); $MyUser->setPostalAddress($_POST['user_postal_address']);
$MyUser->setPostalCode($_POST['user_postal_code']); $MyUser->setPostalCode($_POST['user_postal_code']);