Fixed issue #75.

This commit is contained in:
Rooty 2021-04-21 03:55:55 +02:00
parent 265c3ec422
commit 0ed1dbd8e2

View File

@ -715,15 +715,12 @@ function exportAdmin()
*/
function execChangeUserAdmin()
{
global $SERVER_NAME, $SCRIPT_NAME, $CONF_PERSISTANT_SECURE,$CONF_DATA_PATH;
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;
/* 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();
$defaultCode=$GLOBALS["SYSTEM_DEFAULT_LANGUAGE_CODE"];
@ -751,7 +748,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_postal_address" && $cle !="user_postal_code" && $cle !="user_city" && $cle !="user_tel" && $cle !="user_country" && $cle !="user_id" && $cle !="user_birthdate" && $cle !="user_mastodon" && $cle !="user_jabber" && $cle !="user_facebook" && $cle !="user_website" ))
if($val=="" && ($cle !="user_comment" && $cle !="user_fax" && $cle !="user_organisation" && $cle !="user_postal_address" && $cle !="user_postal_code" && $cle !="user_city" && $cle !="user_tel" && $cle !="user_state" && $cle !="user_country" && $cle !="user_id" && $cle !="user_birthdate" && $cle !="user_mastodon" && $cle !="user_jabber" && $cle !="user_facebook" && $cle !="user_website" ))
{
$chaine .= getMessage($cle).", ";
}
@ -800,33 +797,33 @@ function exportAdmin()
else
{
//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']);
$MyUser->setAccountActive( isset($_POST["user_account_active"])?$_POST["user_account_active"]:"off" );
$MyUser->setTitle( isset($_POST['user_title'])?$_POST["user_title"]:"" );
$MyUser->setFirstName( isset($_POST['user_first_name'])?$_POST["user_first_name"]:"" );
$MyUser->setLastName( isset($_POST['user_last_name'])?$_POST["user_last_name"]:"" );
$MyUser->setLogin( isset($_POST['user_login'])?$_POST["user_login"]:"" );
$MyUser->setPassword( isset($_POST['user_password'])?$_POST["user_password"]:"" );
$MyUser->setMail( isset($_POST['user_mail'])?$_POST["user_mail"]:"" );
$MyUser->setBirthDate(DateTime::createFromFormat('d/m/Y', $_POST['user_birthdate'])->getTimestamp());
$MyUser->setPostalAddress($_POST['user_postal_address']);
$MyUser->setPostalCode($_POST['user_postal_code']);
$MyUser->setCity($_POST['user_city']);
$MyUser->setState($_POST['user_state']);
$MyUser->setCountry($_POST['user_country']);
$MyUser->setOrganisation($_POST['user_organisation']);
$MyUser->setTel($_POST['user_tel']);
$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']));
$MyUser->setPostalAddress( isset($_POST['user_postal_address'])?$_POST["user_postal_address"]:"" );
$MyUser->setPostalCode( isset($_POST['user_postal_code'])?$_POST["user_postal_code"]:"" );
$MyUser->setCity( isset($_POST['user_city'])?$_POST["user_city"]:"" );
$MyUser->setState( isset($_POST['user_state'])?$_POST['user_state']:"" );
$MyUser->setCountry( isset($_POST['user_country'])?$_POST["user_country"]:"" );
$MyUser->setOrganisation( isset($_POST['user_organisation'])?$_POST['user_organisation']:"" );
$MyUser->setTel( isset($_POST['user_tel'])?$_POST["user_tel"]:"" );
$MyUser->setMastodon( isset($_POST['user_mastodon'])?$_POST["user_mastodon"]:"" );
$MyUser->setFacebook( isset($_POST['user_facebook'])?$_POST["user_facebook"]:"" );
$MyUser->setJabber( isset($_POST['user_jabber'])?$_POST["user_jabber"]:"" );
$MyUser->setTel( isset($_POST['user_tel'])?$_POST["user_tel"]:"" );
$MyUser->setWebsite( isset($_POST['user_website'])?$_POST["user_website"]:"" );
$MyUser->setComment( isset($_POST['user_comment'])?array($_POST['user_comment']):null);
//On enregistre les paramètres
$ObjUsersave = $GLOBALS["SYSTEM_MANAGER"]["USER"]->saveInstance($MyUser);
# Redirection vers le formulaire
systemRedirect(formatUrl($this->getId(),"AdminUser","actionAdmin","datamodified").$localisation);
systemRedirect(formatUrl($this->getId(),"AdminUser","actionAdmin","datamodified"));
}
}
return "";