Fixed issue #60.

This commit is contained in:
Rooty 2021-04-06 17:06:09 +02:00
parent e8767e82b5
commit edc6f86723

View File

@ -675,11 +675,12 @@ function exportAdmin()
$GLOBALS["SYSTEM_TEMPLATE"]->MxSelect("user_title", "user_title", $MyUser->getTitle(), $titre, "", "", "", "class=\"form\" title=\"".htmlspecialchars(getMessage("tipSelectTitle"), ENT_QUOTES)."\"");
$GLOBALS["SYSTEM_TEMPLATE"]->MxFormField("user_first_name", "text", "user_first_name", $MyUser->getFirstName(), "class=\"form\" required=\"true\" title=\"".htmlspecialchars(getMessage("tipFirstName"), ENT_QUOTES)."\"", getMessage("user_first_name"));
$GLOBALS["SYSTEM_TEMPLATE"]->MxFormField("user_last_name", "text", "user_last_name", $MyUser->getLastName(), "class=\"form\" required=\"true\" title=\"".htmlspecialchars(getMessage("tipLastName"), ENT_QUOTES)."\"", getMessage("user_last_name"));
$GLOBALS["SYSTEM_TEMPLATE"]->MxFormField("user_login", "text", "user_login", $MyUser->getLogin(), "class=\"form\" disabled", getMessage("user_login"));
$GLOBALS["SYSTEM_TEMPLATE"]->MxFormField("user_login", "text", "user_login", $MyUser->getLogin(), "class=\"form\"", getMessage("user_login"));
$GLOBALS["SYSTEM_TEMPLATE"]->MxFormField("user_password", "password", "user_password", $MyUser->getPassword(), "class=\"form\" required=\"true\" title=\"".htmlspecialchars(getMessage("tipPassword"), ENT_QUOTES)."\"", getMessage("user_password"));
$GLOBALS["SYSTEM_TEMPLATE"]->MxFormField("re_user_password", "password", "re_user_password", $MyUser->getPassword(), "class=\"form\" required=\"true\" title=\"".htmlspecialchars(getMessage("tipPassword2"), ENT_QUOTES)."\"", getMessage("user_password"));
$GLOBALS["SYSTEM_TEMPLATE"]->MxFormField("user_mail", "text", "user_mail", $MyUser->getMail(), "class=\"form\" required=\"true\" title=\"".htmlspecialchars(getMessage("tipCourriel"), ENT_QUOTES)."\"", getMessage("user_mail"));
$GLOBALS["SYSTEM_TEMPLATE"]->MxFormField("user_birthdate", "text", "user_birthdate", $MyUser->getBirthDate(), "class=\"form\" required=\"true\" title=\"".htmlspecialchars(getMessage("tipBirthDate"), ENT_QUOTES)."\"", getMessage("user_birthdate"));
$d = DateTime::createFromFormat('U', $MyUser->getBirthDate());
$GLOBALS["SYSTEM_TEMPLATE"]->MxFormField("user_birthdate", "text", "user_birthdate", $d->format('d/m/Y'), "class=\"form\" required=\"true\" title=\"".htmlspecialchars(getMessage("tipBirthDate"), ENT_QUOTES)."\"", getMessage("user_birthdate"));
$GLOBALS["SYSTEM_TEMPLATE"]->MxFormField("user_postal_code", "text", "user_postal_code", $MyUser->getPostalCode(), "class=\"form\" title=\"".htmlspecialchars(getMessage("tipPostalCode"), ENT_QUOTES)."\"", getMessage("user_postal_code"));
$GLOBALS["SYSTEM_TEMPLATE"]->MxFormField("user_postal_address", "text", "user_postal_address", $MyUser->getPostalAddress(), "class=\"form\" title=\"".htmlspecialchars(getMessage("tipPostalAddress"), ENT_QUOTES)."\"", getMessage("user_postal_address"));
$GLOBALS["SYSTEM_TEMPLATE"]->MxFormField("user_organisation", "text", "user_organisation", $MyUser->getOrganisation(), "class=\"form\" title=\"".htmlspecialchars(getMessage("tipOrganisation"), ENT_QUOTES)."\"", getMessage("user_ogarnisation"));
@ -759,11 +760,8 @@ function exportAdmin()
*/
function execChangeUserAdmin()
{
/* Inclusion du package */
// includePackage("pagingmanager.php");
global $SERVER_NAME, $SCRIPT_NAME, $CONF_PERSISTANT_SECURE,$CONF_DATA_PATH;
/* 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;
@ -772,10 +770,7 @@ function exportAdmin()
$currentCode=$GLOBALS["SYSTEM_USER_SESSION"]->langue->getCode();
$defaultCode=$GLOBALS["SYSTEM_DEFAULT_LANGUAGE_CODE"];
/* fin récupération des codes par defaut */
// $PagingManager = new PagingManager(0);
// $localisation = $PagingManager->getCurrentLocalisation();
/* Creation du Tree d'admin */
$myTreeGroup =$GLOBALS["SYSTEM_MANAGER"]["TREE_GROUP"]->createInstance($groupId);
/* Verification de l'existance du Tree */
@ -798,7 +793,7 @@ function exportAdmin()
foreach($_POST as $cle=>$val)
{
// echo "cle = ".$cle." val =".$val."<br>";
if($val=="" && ($cle !="user_comment" && $cle !="user_fax" && $cle !="user_organisation" && $cle !="user_country" && $cle !="user_id" && $cle !="user_birthdate"))
if($val=="" && ($cle !="user_comment" && $cle !="user_fax" && $cle !="user_organisation" && $cle !="user_country" && $cle !="user_id" && $cle !="user_birthdate" && $cle !="user_mastodon" && $cle !="user_jabber" && $cle !="user_facebook" && $cle !="user_website" ))
{
$chaine .= getMessage($cle).", ";
}
@ -831,6 +826,7 @@ function exportAdmin()
}
else
{
// var_dump($_POST);
$MyUser = $GLOBALS["SYSTEM_MANAGER"]["USER"]->createInstance($_GET["param"]);
# Teste si il y a des enregistrements sur la table des comptes
$result=$GLOBALS['SYSTEM_MANAGER']['USER']->checkValid($_POST["user_login"], $_POST["user_password"]);
@ -847,13 +843,15 @@ function exportAdmin()
else
{
$d = DateTime::createFromFormat('d/m/Y', $_POST['user_birthdate']);
//On enregistre les modifications de l'objet User ???????????????????????????????????????
var_dump($_POST);
//On enregistre les modifications de l'objet User
$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']);
@ -862,7 +860,11 @@ function exportAdmin()
$MyUser->setCountry($_POST['user_country']);
$MyUser->setOrganisation($_POST['user_organisation']);
$MyUser->setTel($_POST['user_tel']);
$MyUser->setFax($_POST['user_fax']);
$MyUser->setMastodon($_POST['user_mastodon']);
$MyUser->setFacebook($_POST['user_facebook']);
$MyUser->setJabber($_POST['user_jabber']);
$MyUser->setTel($_POST['user_tel']);
$MyUser->setWebsite($_POST['user_website']);
$MyUser->setComment(array($_POST['user_comment']));
//On enregistre les paramètres