protected virtual XVar assignCookieParams() { if ((XVar)(!(XVar)(MVCFunctions.strlen((XVar)(MVCFunctions.GetCookie("paramsLogger"))))) && (XVar)(!(XVar)(this.userID))) { MVCFunctions.SetCookie(new XVar("paramsLogger"), (XVar)(CommonFunctions.generatePassword(new XVar(24))), (XVar)(MVCFunctions.time() + (5 * 365) * 86400)); } this.cookie = XVar.Clone(MVCFunctions.GetCookie("paramsLogger")); return(null); }
public static XVar tryRelogin() { dynamic loginPageObject = null, password = null, username = null; username = XVar.Clone(MVCFunctions.GetCookie("username")); password = XVar.Clone(MVCFunctions.GetCookie("password")); if ((XVar)(username == XVar.Pack("")) || (XVar)(password == XVar.Pack(""))) { return(false); } loginPageObject = XVar.Clone(createLoginPageObject()); if (XVar.Pack(loginPageObject.twoFactAuth)) { return(false); } return(loginPageObject.LogIn((XVar)(username), (XVar)(password))); }
public virtual XVar doCommonAssignments() { dynamic rememberPassword = null, rememberbox_checked = null; this.xt.assign(new XVar("id"), (XVar)(this.id)); this.xt.assign(new XVar("loginlink_attrs"), (XVar)(MVCFunctions.Concat("id=\"submitLogin", this.id, "\""))); if ((XVar)((XVar)((XVar)(this.loggedByCredentials) && (XVar)(this.mode == Constants.LOGIN_EMBEDED)) && (XVar)(this.twoFactAuth)) && (XVar)(this.skipSecondStep)) { return(null); } setLangParams(); rememberbox_checked = new XVar(""); if ((XVar)((XVar)(rememberPassword) || (XVar)(MVCFunctions.GetCookie("username"))) || (XVar)(MVCFunctions.GetCookie("password"))) { rememberbox_checked = new XVar(" checked"); } this.xt.assign(new XVar("rememberbox_attrs"), (XVar)(MVCFunctions.Concat((XVar.Pack(this.is508) ? XVar.Pack("id=\"remember_password\" ") : XVar.Pack("")), "name=\"remember_password\" value=\"1\"", rememberbox_checked))); this.xt.assign(new XVar("guestlink_block"), (XVar)((XVar)((XVar)(this.mode == Constants.LOGIN_SIMPLE) && (XVar)(CommonFunctions.guestHasPermissions())) && (XVar)(CommonFunctions.isGuestLoginAvailable()))); this.xt.assign(new XVar("username_label"), new XVar(true)); this.xt.assign(new XVar("password_label"), new XVar(true)); this.xt.assign(new XVar("remember_password_label"), new XVar(true)); if ((XVar)(this.is508) && (XVar)(getLayoutVersion() != Constants.BOOTSTRAP_LAYOUT)) { this.xt.assign_section(new XVar("username_label"), new XVar("<label for=\"username\">"), new XVar("</label>")); this.xt.assign_section(new XVar("password_label"), new XVar("<label for=\"password\">"), new XVar("</label>")); this.xt.assign_section(new XVar("remember_password_label"), new XVar("<label for=\"remember_password\">"), new XVar("</label>")); } if ((XVar)((XVar)(this.message) || (XVar)(this.mode == Constants.LOGIN_POPUP)) || (XVar)(this.twoFactAuth)) { this.xt.assign(new XVar("message_block"), new XVar(true)); if (getLayoutVersion() == Constants.BOOTSTRAP_LAYOUT) { this.xt.assign(new XVar("message"), (XVar)(this.message)); } else { this.xt.assign(new XVar("message"), (XVar)(MVCFunctions.Concat("<div id='login_message' class='message rnr-error'>", this.message, "</div>"))); } if (getLayoutVersion() == Constants.BOOTSTRAP_LAYOUT) { this.xt.assign(new XVar("message_class"), (XVar)((XVar.Pack(this.messageType == Constants.MESSAGE_INFO) ? XVar.Pack("alert-success") : XVar.Pack("alert-danger")))); } if (XVar.Pack(!(XVar)(this.message))) { this.xt.displayBrickHidden(new XVar("message")); } } if (XVar.Pack(MVCFunctions.strlen((XVar)(this.var_pUsername)))) { this.xt.assign(new XVar("username_attrs"), (XVar)(MVCFunctions.Concat((XVar.Pack(this.is508) ? XVar.Pack("id=\"username\" ") : XVar.Pack("")), "value=\"", MVCFunctions.runner_htmlspecialchars((XVar)(this.var_pUsername)), "\""))); } else { if (XVar.Pack(!(XVar)(this.twoFactAuth))) { this.xt.assign(new XVar("username_attrs"), (XVar)(MVCFunctions.Concat((XVar.Pack(this.is508) ? XVar.Pack("id=\"username\" ") : XVar.Pack("")), "value=\"", MVCFunctions.runner_htmlspecialchars((XVar)(MVCFunctions.GetCookie("username"))), "\""))); } } if (XVar.Pack(MVCFunctions.strlen((XVar)(this.var_pPassword)))) { this.xt.assign(new XVar("password_attrs"), (XVar)(MVCFunctions.Concat((XVar.Pack(this.is508) ? XVar.Pack(" id=\"password\"") : XVar.Pack("")), " value=\"", MVCFunctions.runner_htmlspecialchars((XVar)(this.var_pPassword)), "\""))); } else { if (XVar.Pack(!(XVar)(this.twoFactAuth))) { this.xt.assign(new XVar("password_attrs"), (XVar)(MVCFunctions.Concat((XVar.Pack(this.is508) ? XVar.Pack(" id=\"password\"") : XVar.Pack("")), " value=\"", MVCFunctions.runner_htmlspecialchars((XVar)(MVCFunctions.GetCookie("password"))), "\""))); } } if ((XVar)(this.myurl) && (XVar)(XSession.Session["MyUrlAccess"])) { this.xt.assign(new XVar("guestlink_attrs"), (XVar)(MVCFunctions.Concat("href=\"", this.myurl, "\""))); } else { this.xt.assign(new XVar("guestlink_attrs"), (XVar)(MVCFunctions.Concat("href=\"", MVCFunctions.GetTableLink(new XVar("menu")), "\""))); } if ((XVar)((XVar)(this.loggedByCredentials) && (XVar)(this.mode == Constants.LOGIN_EMBEDED)) && (XVar)(this.twoFactAuth)) { doAssignForSecondAuthStep((XVar)(!(XVar)(this.pnoneNotInQuery))); this.xt.displayBrickHidden(new XVar("bsloginregister")); this.xt.displayBrickHidden(new XVar("mesreg")); this.xt.displayBrickHidden(new XVar("mesforgot")); } else { this.xt.assign(new XVar("main_loginfields"), new XVar(true)); this.xt.assign(new XVar("signin_button"), new XVar(true)); } if ((XVar)(this.mode == Constants.LOGIN_POPUP) || (XVar)((XVar)(this.mode == Constants.LOGIN_EMBEDED) && (XVar)(this.twoFactAuth))) { if (XVar.Pack(this.notRedirect)) { this.body["begin"] = MVCFunctions.Concat(this.body["begin"], "<input type=hidden id='notRedirect' value=1>"); this.xt.assign(new XVar("continuebutton_attrs"), new XVar("href=\"#\" style=\"display:none\" id=\"continueButton\"")); this.xt.assign(new XVar("continue_button"), new XVar(true)); } this.xt.assign(new XVar("footer"), new XVar(false)); this.xt.assign(new XVar("header"), new XVar(false)); this.xt.assign(new XVar("body"), (XVar)(this.body)); this.xt.assign(new XVar("registerlink_attrs"), (XVar)(MVCFunctions.Concat("name=\"RegisterPage\" data-table=\"", MVCFunctions.runner_htmlspecialchars((XVar)(GlobalVars.cLoginTable)), "\""))); this.xt.assign(new XVar("forgotpasswordlink_attrs"), new XVar("name=\"ForgotPasswordPage\"")); } return(null); }