<%@ Page Language="C#" Buffer="true" CodeFile="login.aspx.cs" Inherits="_login" CodePage="65001" UICulture="fr" Culture="fr-FR" ValidateRequest="false" %> <%@ Import Namespace="ItlRuntime" %> <%@ Import Namespace="System.Collections.Generic" %> <%@ Import Namespace="System.Linq" %> <% EC.linkableClassMap = (Map) EC.newMap(new Map() , "ocsNewsEvent:news", new ClassLink("./page00013329.aspx?card=object", "linkTable.aspx?GID=00013329&card=object", "Actualité")); %><% string userLogin = (string) ((string)EC.itl.getParameterValue("string", "userLogin")); string userPwd = (string) ((string)EC.itl.getParameterValue("string", "userPwd")); string action = (string) ((string)EC.itl.getParameterValue("string", "action")); string urlRedirect = (string) ((string)EC.itl.getParameterValue("string", "urlRedirect")); %> " /> Accès à l'administration
Trémentines

Accès à l'administration

<% string autoLogin = (string) (EC.itl.getAutoLogin()); string action__1 = (string) (EC.itl.getRequestVar("action", null)); string _t0 = EC.itl.getRequestVar("userLogin", null); string userLogin__1 = (string) (((ITL.b(_t0)) ? _t0 : autoLogin)); string userPwd__1 = (string) (EC.itl.getRequestVar("userPwd", null)); string action__2 = (string) (EC.itl.getRequestVar("action", null)); string returnURL = (string) (EC.itl.getRequestVar("returnURL", "")); string usrc = (string) (EC.itl.getRequestVar("usrc", "0")); string _t1 = EC.itl.getRequestVar("userMem", null); string userMem = (string) (((ITL.b(_t1)) ? _t1 : (autoLogin != ""?"true":"false"))); returnProcess = (string)(ITL.gv["returnProcess"] = "false"); newUserLogin = (string)(ITL.gv["newUserLogin"] = ""); string mailAddress = (string) ((string)EC.itl.getParameterValue("string", "mailAddress")); string mailingLists = (string) ((string)EC.itl.getParameterValue("string", "mailingLists")); string key = (string) ((string)EC.itl.getParameterValue("string", "key")); string unsubType = (string) ((string)EC.itl.getParameterValue("string", "unsubType")); string fullAccountKey = (string) ((string)EC.itl.getParameterValue("string", "fullAccountKey")); string fullOid = (string) ((string)EC.itl.getParameterValue("string", "fullOid")); if(usrc != "0") { if(usrc == "1") { %>

Vous devez vous identifier pour accéder à ce document.

<% } else if(usrc == "2") { %>

Vous n'avez pas accès à cette page.

<% } else if(usrc == "3") { %>

Vous devez vous identifier pour accéder à cette page.

<% } else {%>

Une erreur est survenue.

<% } } if(action__2 == "login") { string authResultMsg = (string) (userLogin__1); if(returnURL == "useAttribute") { bool processLogin = (bool) (ItlRuntime.XRM.MembershipUtils.SignInAndRedirectTo(userLogin__1, userPwd__1, (ITL.b(userMem) && false), false, "./boAdminHome00010010.aspx", out authResultMsg)); if(ITL.S(processLogin) != "") { %> <% ITL.show(EC.itl.translate(authResultMsg), "string", "html", "string"); %> <% } } else { bool processLogin__1 = (bool) (ItlRuntime.XRM.MembershipUtils.signIn(userLogin__1, userPwd__1, (ITL.b(userMem) && false), out authResultMsg)); if(ITL.S(processLogin__1) != "") { %> <% ITL.show(EC.itl.translate(authResultMsg), "string", "html", "string"); %> <% } } } else if(action__2 == "logout") { string redirectURL = (string) (returnURL != ""?returnURL:"./index.aspx"); bool processLogout = (bool) (ItlRuntime.XRM.MembershipUtils.signOutUser(redirectURL)); } else if(action__2 == "relog") { bool processLogout__1 = (bool) (ItlRuntime.XRM.MembershipUtils.signOutUser("")); } else if(action__2 == "fullaccount") { string shaKey = (string) (EC.sha1((ITL.S(mailAddress) + EC.siteUid))); if(fullAccountKey == shaKey) { SqlObject userFrom = (SqlObject) (new SqlObject("dm:user", @"SELECT this.`_oid` AS this, this_z_s_country.`_oid` AS this_z_s_country, this_z.`password` AS this_z_p_password, this_z.firstname AS this_z_p_firstname, this_z.lastname AS this_z_p_lastname, this_z.phone AS this_z_p_phone, this_z.mobile AS this_z_p_mobile, this_z.fax AS this_z_p_fax, this_z.address AS this_z_p_address, this_z.zipCode AS this_z_p_zipCode, this_z.city AS this_z_p_city, this_z.tempLogin AS this_z_p_tempLogin, this_z.disabled AS this_z_p_disabled, this_z.creationDate AS this_z_p_creationDate, this_z.comments AS this_z_p_comments FROM dm_user AS this INNER JOIN (usr_user AS this_z LEFT JOIN omc_stringItem AS this_z_s_country On ((this_z.country = this_z_s_country.`_oid`) AND (this_z_s_country.iso_sid <> ''))) On ((this.`_oid` = this_z.`_oid`) AND (this_z.iso_sid <> '')) WHERE (this.iso_sid <> '') AND (this_z.email = #V_0&;) AND this_z.isTempAccount AND (CAST(this.`_oid` AS CHAR) = #V_1&;)", new Map("#V_0&;|string", mailAddress, "#V_1&;|string", fullOid),false)); SqlObject userTo = (SqlObject) (new SqlObject("dm:user", @"SELECT this.`_oid` AS this FROM dm_user AS this INNER JOIN usr_user AS this_z On ((this.`_oid` = this_z.`_oid`) AND (this_z.iso_sid <> '')) WHERE (this.iso_sid <> '') AND (this_z.email = #V_0&;) AND NOT(this_z.isTempAccount)", new Map("#V_0&;|string", mailAddress),false)); if(ITL.isNotNull((int?)userFrom.get("this"))) { ItlUpdateObject c9 = new ItlUpdateObject("dm:user", null, userTo); ; c9.setField("login", (string)userFrom.get("this_z_p_tempLogin"), "string", "usr:user", 64); c9.setField("password", (string)userFrom.get("this_z_p_password"), "string", "usr:user", 255); c9.setField("firstname", (string)userFrom.get("this_z_p_firstname"), "string", "usr:user", 128); c9.setField("lastname", (string)userFrom.get("this_z_p_lastname"), "string", "usr:user", 128); c9.setField("phone", (string)userFrom.get("this_z_p_phone"), "string", "usr:user", 32); c9.setField("mobile", (string)userFrom.get("this_z_p_mobile"), "string", "usr:user", 32); c9.setField("fax", (string)userFrom.get("this_z_p_fax"), "string", "usr:user", 32); c9.setField("address", (string)userFrom.get("this_z_p_address"), "string", "usr:user", 255); c9.setField("zipCode", (string)userFrom.get("this_z_p_zipCode"), "string", "usr:user", 32); c9.setField("city", (string)userFrom.get("this_z_p_city"), "string", "usr:user", 128); c9.setAssociation("country", userFrom.getObject("this_z_s_country", "omc:stringItem"), "object:omc:stringItem", "usr:user", true, false); c9.setField("disabled", (bool?)userFrom.get("this_z_p_disabled"), "boolean", "usr:user"); c9.setField("creationDate", (DateTime?)userFrom.get("this_z_p_creationDate"), "date", "usr:user"); c9.setField("modificationDate", EC.itl.now(), "date", "usr:user"); c9.setField("comments", (string)userFrom.get("this_z_p_comments"), "string", "usr:user", 1024); c9.setField("emailValidated", true, "boolean", "usr:user"); c9.setField("isTempAccount", false, "boolean", "usr:user"); if(c9.exec()) { %> Activation réussie. <% ItlDelete c10 = new ItlDelete("dm:user", userFrom); ; c10.exec();; ItlDelete c12 = new ItlDelete("dm:user", new SqlCollection("dm:user", @"SELECT this.`_oid` AS this, this_z.`login` AS this_z_p_login, this_z.firstname AS this_z_p_firstname, this_z.lastname AS this_z_p_lastname FROM dm_user AS this INNER JOIN usr_user AS this_z On ((this.`_oid` = this_z.`_oid`) AND (this_z.iso_sid <> '')) WHERE (this.iso_sid <> '') AND this_z.isTempAccount AND (DATEDIFF(#V_0&;,this_z.creationDate) > 3)", new Map("#V_0&;|date", EC.itl.now()), (List) EC.newList(new List(), "this_z_p_login", "this_z_p_firstname", "this_z_p_lastname"))); ; c12.exec();; } else { %> L'activation a échoué. <% } } else {%> Votre compte a déjà été validé ou a expiré, veuillez vous authentifier ou créer un nouveau compte. <% } userFrom.close(); userTo.close(); } else {%>

Echec lors de l'activation du compte.

<% } } else if(action__2 == "newPasswordProcess") { string userEmail = (string) (EC.itl.getRequestVar("userEmail", null)); SqlObject user = (SqlObject) (new SqlObject("dm:user", @"SELECT this.`_oid` AS this, this_z_s_civility.`_oid` AS this_z_s_civility, this_z.`login` AS this_z_p_login, this_z.email AS this_z_p_email, this_z.firstname AS this_z_p_firstname, this_z.lastname AS this_z_p_lastname, this_z_s_civility.abbrev_fr AS this_z_s_civility_p_abbrev_fr FROM dm_user AS this INNER JOIN (usr_user AS this_z LEFT JOIN omc_stringItem AS this_z_s_civility On ((this_z.civility = this_z_s_civility.`_oid`) AND (this_z_s_civility.iso_sid <> ''))) On ((this.`_oid` = this_z.`_oid`) AND (this_z.iso_sid <> '')) WHERE (this.iso_sid <> '') AND (this_z.email = #V_0&;)", new Map("#V_0&;|string", userEmail),false)); if(ITL.isNotNull((int?)user.get("this"))) { string newPassword = (string) (EC.itl.generatePassword(8)); newUserLogin = (string)(ITL.gv["newUserLogin"] = (string)user.get("this_z_p_login")); string newShaPassword = (string) (EC.sha1(newPassword)); ItlUpdateObject c14 = new ItlUpdateObject("dm:user", null, user); ; c14.setField("password", newShaPassword, "string", "usr:user", 255); if(c14.exec()) { bool? fireOnPasswordChangeEvent = (bool?) (ItlRuntime.XRM.MembershipUtils.onPasswordChange((int)(int?)user.get("this"), (string)user.get("this_z_p_login"), newPassword)); ItlMail mail15 = new ItlMail(); mail15.setProperty("to", (string)user.get("this_z_p_email")); mail15.setProperty("from", "ogerbeatrice@orange.fr"); mail15.setProperty("subject", "Votre nouveau mot de passe"); mail15.addToBody( @"

"); ITL.show(EC.itl.stringReplace(EC.itl.stringReplace(EC.itl.stringReplace("Vous avez déclaré sur notre site avoir perdu votre mot de passe.

Voici donc votre nouveau mot de passe d'identification sur notre site :
Login = [login]
Password = [password]", "[login]", (string)user.get("this_z_p_login")), "[fullname]", ((((ITL.S((string)user.get("this_z_s_civility_p_abbrev_fr")) + " ") + ITL.S((string)user.get("this_z_p_firstname"))) + " ") + ITL.S((string)user.get("this_z_p_lastname")))), "[password]", newPassword), "string", "raw", "string"); mail15.addToBody( @"

"); if(mail15.exec()) { %>

Un nouveau mot de passe vous a été envoyé par e-mail.

<% } else { %>

Erreur lors de l'envoi du mot de passe par e-mail.

<% } } else { %>

Echec de génération d'un nouveau mot de passe.

<% } } else {%>

L'e-mail ne correspond à aucun compte utilisateur enregistré. <% %>

<% returnProcess = (string)(ITL.gv["returnProcess"] = "true"); } user.close(); } if(action__2 == "forgottenPasswordForm" || action__2 == "newPasswordProcess" && (string)ITL.gv["returnProcess"] == "true") { ItlForm form16 = new ItlForm("form16", EC.itl.getId(), "./login.aspx#I00006aa3", "G00011589_17"); form16.setProperty("name", "forgottenPassForm"); form16.setProperty("class", "forgottenPassForm"); form16.setProperty("hasProcessing", false); form16.addParameter("returnURL", EC.itl.makeParameter(returnURL, "string")); form16.addParameter("action", "newPasswordProcess"); form16.show(); %>

En cas de perte de votre mot de passe, veuillez saisir l'adresse e-mail associée à votre compte. <% %>

<%OdfControl input19 = OdfControlFactory.create("generic", EC.itl.getId(), "userEmail", null); input19.setForm(form16); input19.setProperty("class", "usrForgotField"); input19.setProperty("width", "200"); input19.show(); %>
<% string cancelLink = (string) (EC.itl.addURLparameters("./login.aspx#I00006aa3", "action=''")); %>
style="width:;"> <% string buttonClass = (string) ("sdsSubmitButton"); %> type="submit" value="Envoyer" style="width:"/> style="width:"> target="" title="" alt="Annuler" onclick="" style=""> Annuler <% %>
<%form16.close(); } else if(EC.itl.isLogged()) { string currentUserLogin = (string) (EC.itl.login()); %>

Vous êtes identifié en tant que <% ITL.show(currentUserLogin, "string", "html", "string"); %>.

Déconnexion

<% } else {%>

Formulaire d'identification

<% ItlForm form25 = new ItlForm("form25", EC.itl.getId(), "./login.aspx#I00006aa3", "G00011589_26"); form25.setProperty("method", "post"); form25.setProperty("enctype", "application/x-www-form-urlencoded"); form25.setProperty("hasProcessing", false); form25.addParameter("returnURL", EC.itl.makeParameter((returnURL != ""?returnURL:"./boAdminHome00010010.aspx"), "string")); form25.addParameter("action", "login"); form25.show(); %> <% %>
<%OdfControl input27 = OdfControlFactory.create("generic", "c_userLogin", "userLogin", null); input27.setForm(form25); input27.setProperty("kind", "required"); input27.setProperty("missingreason", "Veuillez saisir votre identifiant"); input27.setProperty("value", EC.itl.makeParameter(((ITL.b(userLogin__1)) ? userLogin__1 : (string)ITL.gv["newUserLogin"]), "string")); input27.show(); %>
<%OdfControl input28 = OdfControlFactory.create("password", "c_userPwd", "userPwd", null); input28.setForm(form25); input28.setProperty("kind", "required"); input28.setProperty("missingreason", "Veuillez saisir votre mot de passe"); input28.show(); %>
<% ItlLink link31 = new ItlLink("./login.aspx#I00006aa3"); link31.setProperty("class", " usrForgotLink"); link31.setParameter("action", "forgottenPasswordForm"); link31.show(); %> Mot de passe perdu ? <% link31.close(); %>
style="width:;"> <% string buttonClass__1 = (string) ("sdsSubmitButton"); %> type="submit" value="Connexion" style="width:"/>
<%form25.close(); } %>