From 72a025bbb67097ebaed5b1cfa3ab5397948f0d43 Mon Sep 17 00:00:00 2001 From: "tristan.champomier" Date: Tue, 8 Dec 2020 03:34:06 +0100 Subject: [PATCH] Fixed issues #7. --- lib/object_coordination/addcom/addcom.php | 50 +++++++++++++---------- 1 file changed, 29 insertions(+), 21 deletions(-) diff --git a/lib/object_coordination/addcom/addcom.php b/lib/object_coordination/addcom/addcom.php index 2039336..6979481 100755 --- a/lib/object_coordination/addcom/addcom.php +++ b/lib/object_coordination/addcom/addcom.php @@ -105,26 +105,27 @@ var $tabForbidden=array("adminentrynode", "admingroup", "adminnode", "home", "ad } else // On raffiche les données saisies par l'utilisateur { - /*MxSelect(string $path, string $name, string | array $selectedValue, array $Value, [string $defaultValue], [int $multipleSize], [string $javascriptAttribut]);*/ $titre = array(getMessage("mr"),getMessage("mrs"), getMessage("miss")); - $GLOBALS["SYSTEM_TEMPLATE"]->MxSelect("user_title", "user_title", $_POST['user_title'], $titre, "", "", "", "class=\"form\""); - - /*MxFormField(string $path, string $type, $string name, string $value, [string $attribut]); */ - $GLOBALS["SYSTEM_TEMPLATE"]->MxFormField("user_first_name", "text", "user_first_name", $_POST['user_first_name'], "class=\"form\""); - $GLOBALS["SYSTEM_TEMPLATE"]->MxFormField("user_last_name", "text", "user_last_name", $_POST['user_last_name'], "class=\"form\""); - $GLOBALS["SYSTEM_TEMPLATE"]->MxFormField("user_login", "text", "user_login", "", "class=\"form\""); - $GLOBALS["SYSTEM_TEMPLATE"]->MxFormField("user_password", "password", "user_password", "", "class=\"form\""); - $GLOBALS["SYSTEM_TEMPLATE"]->MxFormField("user_password2", "password", "user_password2", "", "class=\"form\""); - $GLOBALS["SYSTEM_TEMPLATE"]->MxFormField("user_mail", "text", "user_mail", $_POST['user_mail'], "class=\"form\""); - $GLOBALS["SYSTEM_TEMPLATE"]->MxFormField("user_postal_code", "text", "user_postal_code", $_POST['user_postal_code'], "class=\"form\""); - $GLOBALS["SYSTEM_TEMPLATE"]->MxFormField("user_postal_address", "textarea", "user_postal_address", $_POST['user_postal_address'], "class=\"form\""); - // $GLOBALS["SYSTEM_TEMPLATE"]->MxFormField("user_organisation", "text", "user_organisation", $_POST['user_organisation'], "class=\"form\""); - // $GLOBALS["SYSTEM_TEMPLATE"]->MxFormField("user_comment", "textarea", "user_comment", $_POST['user_comment'], "class=\"form\""); - $GLOBALS["SYSTEM_TEMPLATE"]->MxFormField("user_city", "text", "user_city", $_POST['user_city'], "class=\"form\""); - $GLOBALS["SYSTEM_TEMPLATE"]->MxFormField("user_state", "text", "user_state", $_POST['user_state'], "class=\"form\""); - $GLOBALS["SYSTEM_TEMPLATE"]->MxFormField("user_country", "text", "user_country", $_POST['user_country'], "class=\"form\""); - $GLOBALS["SYSTEM_TEMPLATE"]->MxFormField("user_tel", "text", "user_tel", $_POST['user_tel'], "class=\"form\""); - $GLOBALS["SYSTEM_TEMPLATE"]->MxFormField("user_fax", "text", "user_fax", $_POST['user_fax'], "class=\"form\""); + $GLOBALS["SYSTEM_TEMPLATE"]->MxSelect("user_title", "user_title", $_POST['user_title'], $titre, getMessage("user_title"), "", "", "class=\"form\" required=\"true\" title=\"".htmlspecialchars(getMessage("tipSelectTitle"), ENT_QUOTES)."\""); + $GLOBALS["SYSTEM_TEMPLATE"]->MxFormField("user_first_name", "text", "user_first_name", $_POST['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", $_POST['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", $_POST['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", $_POST['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"]->MxFormField("user_postal_code", "text", "user_postal_code", $_POST['user_postal_code'], "class=\"form\" required=\"true\" title=\"".htmlspecialchars(getMessage("tipPostalCode"), ENT_QUOTES)."\"", getMessage("user_postal_code")); + $GLOBALS["SYSTEM_TEMPLATE"]->MxFormField("user_postal_address", "text", "user_postal_address", $_POST['user_postal_address'], "class=\"form\" required=\"true\" title=\"".htmlspecialchars(getMessage("tipPostalAddress"), ENT_QUOTES)."\"", getMessage("user_postal_address")); + $GLOBALS["SYSTEM_TEMPLATE"]->MxFormField("user_city", "text", "user_city", $_POST['user_city'], "class=\"form\" title=\"".htmlspecialchars(getMessage("tipCity"), ENT_QUOTES)."\"", getMessage("user_city")); + $GLOBALS["SYSTEM_TEMPLATE"]->MxFormField("user_state", "text", "user_state", $_POST['user_state'], "class=\"form\" title=\"".htmlspecialchars(getMessage("tipState"), ENT_QUOTES)."\"", getMessage("user_state")); + $GLOBALS["SYSTEM_TEMPLATE"]->MxFormField("user_country", "text", "user_country", $_POST['user_country'], "class=\"form\" required=\"true\" title=\"".htmlspecialchars(getMessage("tipCountry"), ENT_QUOTES)."\"", getMessage("user_country")); + $GLOBALS["SYSTEM_TEMPLATE"]->MxFormField("user_tel", "text", "user_tel", $_POST['user_tel'], "class=\"form\" title=\"".htmlspecialchars(getMessage("tipTel"), ENT_QUOTES)."\"", getMessage("user_tel")); + $GLOBALS["SYSTEM_TEMPLATE"]->MxFormField("user_fax", "text", "user_fax", $_POST['user_fax'], "class=\"form\" title=\"".htmlspecialchars(getMessage("tipFax"), ENT_QUOTES)."\"", getMessage("user_fax")); + $GLOBALS["SYSTEM_TEMPLATE"]->MxFormField("user_website", "text", "user_website", $_POST['user_website'], "class=\"form\" title=\"".htmlspecialchars(getMessage("tipWebsite"), ENT_QUOTES)."\"", getMessage("user_website")); + $GLOBALS["SYSTEM_TEMPLATE"]->MxFormField("user_msn", "text", "user_msn", $_POST['user_msn'], "class=\"form\" title=\"".htmlspecialchars(getMessage("tipMsn"), ENT_QUOTES)."\"", getMessage("user_msn")); + $GLOBALS["SYSTEM_TEMPLATE"]->MxFormField("user_jabber", "text", "user_jabber", $_POST['user_jabber'], "class=\"form\" title=\"".htmlspecialchars(getMessage("tipJabber"), ENT_QUOTES)."\"", getMessage("user_jabber")); + $GLOBALS["SYSTEM_TEMPLATE"]->MxFormField("user_facebook", "text", "user_facebook", $_POST['user_facebook'], "class=\"form\" title=\"".htmlspecialchars(getMessage("tipFacebook"), ENT_QUOTES)."\"", getMessage("user_facebook")); + $GLOBALS["SYSTEM_TEMPLATE"]->MxFormField("user_mastodon", "text", "user_mastodon", $_POST['user_mastodon'], "class=\"form\" title=\"".htmlspecialchars(getMessage("tipMastodon"), ENT_QUOTES)."\"", getMessage("user_mastodon")); } /* Récupération de toutes les langues actives */ @@ -246,7 +247,7 @@ function execAdmin() { // echo "cle = ".$cle." val =".$val."
"; // if($val=="" && ($cle !="user_comment" && $cle !="user_fax" && $cle !="user_organisation" && $cle !="user_country")) - if($val=="" && ($cle !="NodeEntry_type" && $cle !="NodeEntry_typereg" && $cle !="NodeEntry_domain" && $cle !="user_fax" && $cle !="user_country")) + if($val=="" && ($cle !="NodeEntry_type" && $cle !="NodeEntry_typereg" && $cle !="NodeEntry_domain" && $cle !="user_fax" && $cle !="user_mastodon" && $cle !="user_jabber" && $cle !="user_facebook" && $cle !="user_msn" && $cle !="user_website")) { $chaine .= getMessage($cle).", "; // var_dump(getMessage($cle)); @@ -299,6 +300,7 @@ function execAdmin() $MyUser->setLastName($_POST['user_last_name']); $MyUser->setLogin($_POST['user_login']); $MyUser->setPassword($_POST['user_password']); + $MyUser->setBirthDate($_POST['user_birthdate']); $MyUser->setMail($_POST['user_mail']); $MyUser->setPostalAddress($_POST['user_postal_address']); $MyUser->setPostalCode($_POST['user_postal_code']); @@ -309,6 +311,12 @@ function execAdmin() $MyUser->setTel($_POST['user_tel']); $MyUser->setFax($_POST['user_fax']); // $MyUser->setComment(array($_POST['user_comment'])); + $MyUser->setWebSite($_POST['user_website']); +// $MyUser->setMsn($_POST['user_msn']); + $MyUser->setJabber($_POST['user_jabber']); + $MyUser->setFacebook($_POST['user_facebook']); + $MyUser->setMastodon($_POST['user_mastodon']); + $MyUser->SetAccountActive(1); //On enregistre les paramètres $MyUser = $GLOBALS["SYSTEM_MANAGER"]["USER"]->saveInstance($MyUser); @@ -329,7 +337,7 @@ function execAdmin() } // $Node->SetIcone( ((isset($_POST["iconeN"]))?(htmlentitiesconv($_POST["iconeN"])):"") ); - $Node->setCType( ((isset($_POST["NodeEntry_type"]))?($_POST["NodeEntry_type"]):"default") ); + $Node->setCType( ((isset($_POST["NodeEntry_type"])&&$_POST["NodeEntry_type"]!="#")?($_POST["NodeEntry_type"]):"default") ); $Node->setCTypereg( ((isset($_POST["NodeEntry_typereg"]))?($_POST["NodeEntry_typereg"]):"") ); $Node->setDomain( ((isset($_POST["NodeEntry_domain"]))?($_POST["NodeEntry_domain"]):"") ); $Node->SetHasLanding( ((isset($_POST["haslanding"]))?($_POST["haslanding"]):0) );