private void Page_PreRender(object sender, System.EventArgs e) { try { switch (m_strPageAction) { case "addusergroup": m_editgroups = (editgroups)(LoadControl("controls/user/editgroups.ascx")); m_editgroups.ID = "user"; jsUniqueId.Text = "user_"; DataHolder.Controls.Add(m_editgroups); m_editgroups.AddUserGroup(); break; case "editusergroup": m_editgroups = (editgroups)(LoadControl("controls/user/editgroups.ascx")); m_editgroups.ID = "user"; jsUniqueId.Text = "user_"; DataHolder.Controls.Add(m_editgroups); m_editgroups.EditUserGroup(); break; case "view": m_viewusers = (viewusers)(LoadControl("controls/user/viewusers.ascx")); DataHolder.Controls.Add(m_viewusers); m_viewusers.View(); break; case "addusertosystem": m_adduser = (adduser)(LoadControl("controls/user/adduser.ascx")); m_adduser.ID = "user"; jsUniqueId.Text = "user_"; DataHolder.Controls.Add(m_adduser); m_adduser.AddUserToSystem(); break; case "edituser": if (!(Page.IsPostBack)) { jsUniqueId.Text = ""; m_edituser.setting_data = setting_data; m_edituser.EditUser(); } else { EditUser(); } break; case "mapcmsusergrouptoad": m_viewgroups = (viewgroups)(LoadControl("controls/user/viewgroups.ascx")); m_viewgroups.ID = "user"; m_viewgroups.ActiveDirectory = true; jsUniqueId.Text = "user_"; DataHolder.Controls.Add(m_viewgroups); m_viewgroups.MapCMSUserGroupToAD(); break; case "mapcmsusertoad": m_viewusers = (viewusers)(LoadControl("controls/user/viewusers.ascx")); m_viewusers.ID = "user"; jsUniqueId.Text = "user_"; DataHolder.Controls.Add(m_viewusers); m_viewusers.MapCMSUserToAD(); break; case "reorderproperties": m_viewcustomproperties = (viewcustomproperties)(LoadControl("controls/user/viewcustomproperties.ascx")); m_viewcustomproperties.ID = "userProperties"; DataHolder.Controls.Add(m_viewcustomproperties); break; case "viewcustomprop": m_viewcustomproperties = (viewcustomproperties)(LoadControl("controls/user/viewcustomproperties.ascx")); m_viewcustomproperties.ID = "userProperties"; DataHolder.Controls.Add(m_viewcustomproperties); break; case "addcustomprop": m_addeditCustomproperty = (addcustomproperty)(LoadControl("controls/user/addcustomproperty.ascx")); m_addeditCustomproperty.ID = "addCustomProp"; DataHolder.Controls.Add(m_addeditCustomproperty); break; case "editcustomprop": m_addeditCustomproperty = (addcustomproperty)(LoadControl("controls/user/addcustomproperty.ascx")); m_addeditCustomproperty.ID = "editCustomProp"; DataHolder.Controls.Add(m_addeditCustomproperty); break; case "deletecustomprop": m_addeditCustomproperty = (addcustomproperty)(LoadControl("controls/user/addcustomproperty.ascx")); m_addeditCustomproperty.ID = "delCustomProp"; DataHolder.Controls.Add(m_addeditCustomproperty); break; case "deleteuserfromsystem": DeleteUserFromSystem(); break; case "deleteuserfromgroup": DeleteUserFromGroup(); break; case "doaddusertogroup": AddUserToGroup(); break; case "deletegroup": DeleteGroup(); break; case "updateaduser": UpdateADUser(); break; case "activateuseraccount": ActivateUserAccount(); break; } } catch (Exception ex) { Utilities.ShowError(ex.Message); } }
private void Page_Load(System.Object sender, System.EventArgs e) { jsStyleSheet.Text = (new StyleHelper()).GetClientScript(); m_refMsg = (new CommonApi()).EkMsgRef; if ((m_refContentApi.EkContentRef).IsAllowed(0, 0, "users", "IsLoggedIn", m_refContentApi.UserId) == false) { Response.Redirect("login.aspx?fromLnkPg=1", false); return; } if (m_refContentApi.RequestInformationRef.IsMembershipUser > 0 || m_refContentApi.RequestInformationRef.UserId == 0) { Response.Redirect("reterror.aspx?info=Please login as cms user", false); return; } if (!(Request.QueryString["LangType"] == null)) { if (Request.QueryString["LangType"] != "") { ContentLanguage = Convert.ToInt32(Request.QueryString["LangType"]); m_refApi.SetCookieValue("LastValidLanguageID", ContentLanguage.ToString()); } else { if (m_refApi.GetCookieValue("LastValidLanguageID") != "") { ContentLanguage = Convert.ToInt32(m_refApi.GetCookieValue("LastValidLanguageID")); } } } else { if (m_refApi.GetCookieValue("LastValidLanguageID") != "") { ContentLanguage = Convert.ToInt32(m_refApi.GetCookieValue("LastValidLanguageID")); } } lib_setting_data = m_refContentApi.GetLibrarySettings(0); //Used in the scripting layer SetServerJSVariables(); RegisterResources(); Ektron.Cms.Commerce.IPasswordValidation pv = ObjectFactory.GetPasswordValidation(); string validationString = (string)(pv.GetRegexForMember().Replace("\"", "\\\"").Replace("\\t", "\\\\t")); passwordValidationString.Text = validationString; MakeEmailArea.Text = (new EmailHelper()).MakeEmailArea(); if (!String.IsNullOrEmpty(Request.QueryString["reloadtrees"])) { CloseScriptJS.Text = ClientCloseScriptJS(); } jsADIntegration.Text = "false"; setting_data = m_refSiteApi.GetSiteVariables(m_refSiteApi.UserId); if (setting_data.ADIntegration) { jsADIntegration.Text = "true"; } SitePath = m_refSiteApi.SitePath; jsSitePath.Text = SitePath; if (m_strPageAction == "viewallusers") { m_viewusers = (viewusers)(LoadControl("controls/user/viewusers.ascx")); m_viewusers.ID = "user"; jsUniqueId.Text = "user_"; DataHolder.Controls.Add(m_viewusers); } else if (m_strPageAction == "addusertogroup") { m_editgroups = (editgroups)(LoadControl("controls/user/editgroups.ascx")); m_editgroups.ID = "user"; jsUniqueId.Text = "user_"; DataHolder.Controls.Add(m_editgroups); } else if (m_strPageAction == "viewallgroups") { m_viewgroups = (viewgroups)(LoadControl("controls/user/viewgroups.ascx")); m_viewgroups.ID = "user"; jsUniqueId.Text = "user_"; DataHolder.Controls.Add(m_viewgroups); } }