Fixed issue #66
This commit is contained in:
parent
579091374d
commit
48cf0370c6
@ -115,34 +115,16 @@ Class AdminUser extends CoordinationObj
|
||||
$tabId=array_merge(array($groupId), $tabTreeGroup[0]->getSonArray());
|
||||
$tabId=array_unique($tabId);
|
||||
|
||||
/* BEGIN NEW USER FORM */
|
||||
$MyUser = $GLOBALS["SYSTEM_MANAGER"]["USER"]->createNewInstance();
|
||||
$MyUser->setFirstName("");
|
||||
$MyUser->setLastName("");
|
||||
$MyUser->setLogin("");
|
||||
$MyUser->setPassword("");
|
||||
$MyUser->setMail("");
|
||||
|
||||
$titre = array(getMessage("mr"),getMessage("mrs"), getMessage("miss"));
|
||||
$GLOBALS["SYSTEM_TEMPLATE"]->MxSelect("user_title", "user_title", $MyUser->getTitle(), $titre, getMessage("user_title"), "", "", "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\" required=\"true\" title=\"".htmlspecialchars(getMessage("tipLogin"), ENT_QUOTES)."\"", 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("user_password2", "password", "user_password2", $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\" 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", "textarea", "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\"");
|
||||
$tabcom = $MyUser->getComment();
|
||||
$GLOBALS["SYSTEM_TEMPLATE"]->MxFormField("user_coment", "text", "user_coment", (isset($tabcom[0])?$tabcom[0]:""), "class=\"form\"");
|
||||
$GLOBALS["SYSTEM_TEMPLATE"]->MxFormField("user_city", "text", "user_city", $MyUser->getCity(), "class=\"form\" title=\"".htmlspecialchars(getMessage("tipCity"), ENT_QUOTES)."\"", getMessage("user_city"));
|
||||
$GLOBALS["SYSTEM_TEMPLATE"]->MxFormField("user_state", "text", "user_state", $MyUser->getState(), "class=\"form\" title=\"".htmlspecialchars(getMessage("tipState"), ENT_QUOTES)."\"", getMessage("user_state"));
|
||||
$GLOBALS["SYSTEM_TEMPLATE"]->MxFormField("user_country", "text", "user_country", $MyUser->getCountry(), "class=\"form\" required=\"true\" title=\"".htmlspecialchars(getMessage("tipCountry"), ENT_QUOTES)."\"", getMessage("user_country"));
|
||||
$GLOBALS["SYSTEM_TEMPLATE"]->MxFormField("user_tel", "text", "user_tel", $MyUser->getTel(), "class=\"form\" title=\"".htmlspecialchars(getMessage("tipTel"), ENT_QUOTES)."\"", getMessage("user_tel"));
|
||||
$GLOBALS["SYSTEM_TEMPLATE"]->MxFormField("user_fax", "text", "user_fax", $MyUser->getFax(), "class=\"form\" title=\"".htmlspecialchars(getMessage("tipFax"), ENT_QUOTES)."\"", getMessage("user_fax"));
|
||||
$GLOBALS["SYSTEM_TEMPLATE"]->MxAttribut("user_id", $MyUser->getId());
|
||||
$GLOBALS["SYSTEM_TEMPLATE"]->MxSelect("user_title", "user_title", "", $titre, getMessage("user_title"), "", "", "class=\"form\" title=\"".htmlspecialchars(getMessage("tipSelectTitle"), ENT_QUOTES)."\"");
|
||||
$GLOBALS["SYSTEM_TEMPLATE"]->MxFormField("user_first_name", "text", "user_first_name", "", "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", "", "class=\"form\" required=\"true\" title=\"".htmlspecialchars(getMessage("tipLastName"), ENT_QUOTES)."\"", getMessage("user_last_name"));
|
||||
$GLOBALS["SYSTEM_TEMPLATE"]->MxFormField("user_login", "text", "user_login", "", "class=\"form\" required=\"true\" title=\"".htmlspecialchars(getMessage("tipLogin"), ENT_QUOTES)."\"", getMessage("user_login"));
|
||||
$GLOBALS["SYSTEM_TEMPLATE"]->MxFormField("user_password", "password", "user_password", "", "class=\"form\" required=\"true\" title=\"".htmlspecialchars(getMessage("tipPassword"), ENT_QUOTES)."\"", getMessage("user_password"));
|
||||
$GLOBALS["SYSTEM_TEMPLATE"]->MxFormField("user_password2", "password", "user_password2", "", "class=\"form\" required=\"true\" title=\"".htmlspecialchars(getMessage("tipPassword2"), ENT_QUOTES)."\"", getMessage("user_password"));
|
||||
$GLOBALS["SYSTEM_TEMPLATE"]->MxFormField("user_mail", "text", "user_mail", "", "class=\"form\" required=\"true\" title=\"".htmlspecialchars(getMessage("tipCourriel"), ENT_QUOTES)."\"", getMessage("user_mail"));
|
||||
$GLOBALS["SYSTEM_TEMPLATE"]->MxFormField("user_birthdate", "text", "user_birthdate", "", "class=\"form\" title=\"".htmlspecialchars(getMessage("tipBirthDate"), ENT_QUOTES)."\"", getMessage("user_birthdate"));
|
||||
// $GLOBALS["SYSTEM_TEMPLATE"]->MxAttribut("user_id", $MyUser->getId());
|
||||
# Récupération des étiquettes du formulaire
|
||||
$GLOBALS["SYSTEM_TEMPLATE"]->MxAttribut("urlActionAdd", formatUrl($this->getId(),"AdminUser","execAddUserAdmin",""));
|
||||
$GLOBALS["SYSTEM_TEMPLATE"]->MxText("urlReturnAdd", formatUrl($this->GetId(),"AdminUser","actionAdmin"));
|
||||
@ -478,7 +460,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" && $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_country" && $cle !="user_id" && $cle !="user_mastodon" && $cle !="user_jabber" && $cle !="user_facebook" && $cle !="user_website" ))
|
||||
{
|
||||
$chaine .= getMessage($cle).", ";
|
||||
}
|
||||
@ -516,7 +498,7 @@ function exportAdmin()
|
||||
}
|
||||
else
|
||||
{
|
||||
$d = DateTime::createFromFormat('d/m/Y', $_POST['user_birthdate']);
|
||||
// $d = DateTime::createFromFormat('d/m/Y', $_POST['user_birthdate']);
|
||||
|
||||
//On enregistre les modifications de l'objet User
|
||||
$MyUser->setAccountActive($user_account_active);
|
||||
@ -526,7 +508,7 @@ function exportAdmin()
|
||||
$MyUser->setLogin($_POST['user_login']);
|
||||
$MyUser->setPassword($_POST['user_password']);
|
||||
$MyUser->setMail($_POST['user_mail']);
|
||||
$MyUser->setBirthDate($d->getTimestamp());
|
||||
$MyUser->setBirthDate(DateTime::createFromFormat('d/m/Y', $_POST['user_birthdate'])->getTimestamp());
|
||||
|
||||
//On enregistre les paramà res
|
||||
$ObjUsersave = $GLOBALS["SYSTEM_MANAGER"]["USER"]->saveInstance($MyUser);
|
||||
@ -645,7 +627,7 @@ function exportAdmin()
|
||||
$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"));
|
||||
$GLOBALS["SYSTEM_TEMPLATE"]->MxFormField("user_birthdate", "text", "user_birthdate", DateTime::createFromFormat('U', $MyUser->getBirthDate())->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"));
|
||||
@ -817,8 +799,7 @@ function exportAdmin()
|
||||
$MyUser->setLogin($_POST['user_login']);
|
||||
$MyUser->setPassword($_POST['user_password']);
|
||||
$MyUser->setMail($_POST['user_mail']);
|
||||
$d = DateTime::createFromFormat('d/m/Y', $_POST['user_birthdate']);
|
||||
$MyUser->setBirthDate($d->getTimestamp());
|
||||
$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']);
|
||||
@ -1113,7 +1094,8 @@ function exportAdmin()
|
||||
$GLOBALS["SYSTEM_MANAGER"]["TREE_NODE_CACHE"]->emptyCache();
|
||||
$GLOBALS["SYSTEM_MANAGER"]["LIST_USER_GROUP_CACHE"]->emptyCache();
|
||||
$GLOBALS["SYSTEM_MANAGER"]["LIST_USER_NODE_CACHE"]->emptyCache();
|
||||
$GLOBALS["SYSTEM_MANAGER"]["PERMISSION_CACHE"]->emptyCache();
|
||||
if( DATA_ACCES_CACHE_PERMISSION )
|
||||
$GLOBALS["SYSTEM_MANAGER"]["PERMISSION_CACHE"]->emptyCache();
|
||||
|
||||
if (!$verif_delete)
|
||||
{
|
||||
@ -1169,7 +1151,8 @@ function exportAdmin()
|
||||
$GLOBALS["SYSTEM_MANAGER"]["TREE_NODE_CACHE"]->emptyCache();
|
||||
$GLOBALS["SYSTEM_MANAGER"]["LIST_USER_GROUP_CACHE"]->emptyCache();
|
||||
$GLOBALS["SYSTEM_MANAGER"]["LIST_USER_NODE_CACHE"]->emptyCache();
|
||||
$GLOBALS["SYSTEM_MANAGER"]["PERMISSION_CACHE"]->emptyCache();
|
||||
if( DATA_ACCES_CACHE_PERMISSION )
|
||||
$GLOBALS["SYSTEM_MANAGER"]["PERMISSION_CACHE"]->emptyCache();
|
||||
systemRedirect(formatUrl($this->getId(),"AdminUser","ChangeUserAdmin","msgSave",$user_id).$localisation);
|
||||
return "";
|
||||
}else{
|
||||
|
Loading…
x
Reference in New Issue
Block a user