/// <summary> /// Constructor /// </summary> public Sync() { _presenter = new SyncRelationshipsPresenter(this); _commonApi = new CommonApi(); _siteApi = new SiteAPI(); _styleHelper = new StyleHelper(); }
public SyncHistory() { _presenter = new SyncHistoryPresenter(this); _commonApi = new CommonApi(); _siteApi = new SiteAPI(); _styleHelper = new StyleHelper(); }
private bool DisplayEditScreen() { SiteAPI m_refSiteApi = new SiteAPI(); UserAPI m_refUserApi = new UserAPI(); try { AppImgPath = m_refSiteApi.AppImgPath; AppName = m_refSiteApi.AppName; SITEPATH = m_refSiteApi.SitePath; //jsContentLanguage.Text = Convert.ToString(settings_data.Language) td_asset_loc.InnerHtml = "<input type=\"text\" size=\"50\" maxlength=\"255\" name=\"asset_loc\" id=\"asset_loc\" value=\"" + "assets" + "\">"; td_private_asset_loc.InnerHtml = "<input type=\"text\" id=\"private_asset_loc\" name=\"private_asset_loc\" size=\"50\" maxlength=\"255\" value=\"" + "privateassets" + "\">"; td_DomainUserName.InnerHtml = "<input type=\"text\" id=\"DomainUserName\" name=\"DomainUserName\" size=\"50\" maxlength=\"255\" value=\"" + "user name" + "\">"; td_ConfirmPassword.InnerHtml = "<input type=\"password\" id=\"ConfirmPassword\" name=\"ConfirmPassword\" size=\"50\" maxlength=\"255\" value=\"" + "user1" + "\">"; td_Password.InnerHtml = "<input type=\"password\" id=\"Password\" name=\"Password\" size=\"50\" maxlength=\"255\" value=\"" + "user1" + "\">"; return false; } catch (Exception) { return false; } }
public bool ProcessSubmission() { SiteAPI m_refSiteApi = new SiteAPI(); //read form fields here and call update api return true; }
protected void Page_Load(object sender, EventArgs e) { try { contentAPI = new ContentAPI(); siteAPI = new SiteAPI(); switch( Request.QueryString["action"]) { case "getdavurl": Response.Write(GetSharepointUploadPath()); break; case "getdetails": Response.Write( "showRedistributionStatusCallback(\"" + EscapeString(GetRedistributionDetails()) + "\");cleanUp(\"" + Request.QueryString["cleanupid"] + "\");"); break; default: Response.Write( "distributeCallback(" + IsDocumentPromoted().ToString().ToLowerInvariant() + ");cleanUp(\"" + Request.QueryString["cleanupid"] + "\");"); break; } } catch (Exception ex) { DisplayError(ex.Message); } }
public string GetFolderPath(long Id) { ContentAPI contentAPI = new ContentAPI(); SiteAPI siteAPI = new SiteAPI(); szdavfolder = "ekdavroot"; string sitePath = (string) (siteAPI.SitePath.ToString().TrimEnd(new char[] {'/'}).TrimStart(new char[] {'/'})); szdavfolder = (string) (szdavfolder.TrimEnd(new char[] {'/'}).TrimStart(new char[] {'/'})); if (Page.Request.Url.Host.ToLower() == "localhost") { szdavfolder = Page.Request.Url.Scheme + Uri.SchemeDelimiter + System.Net.Dns.GetHostName() + "/" + sitePath + "/" + szdavfolder + "_" + siteAPI.UserId + "_" + siteAPI.UniqueId + (((Context.Request.QueryString["LangType"] != null) ? ("_" + Context.Request.QueryString["LangType"].ToString()) : "") ) + "/"; } else { szdavfolder = Page.Request.Url.Scheme + Uri.SchemeDelimiter + Page.Request.Url.Authority + "/" + sitePath + "/" + szdavfolder + "_" + siteAPI.UserId + "_" + siteAPI.UniqueId + (((Context.Request.QueryString["LangType"] != null) ? ("_" + Context.Request.QueryString["LangType"].ToString()) : "") ) + "/"; } string szFolderPath = contentAPI.EkContentRef.GetFolderPath(Id); szFolderPath = szFolderPath.Replace("\\", "/"); szFolderPath = szFolderPath.TrimStart(new char[] {'/'}); szFolderPath = szFolderPath.Replace("\\\\", "/"); if (szFolderPath.Length > 0) { szFolderPath = szdavfolder + szFolderPath + "/"; } else { szFolderPath = szdavfolder; } return szFolderPath; }
/// <summary> /// Constructor /// </summary> /// <param name="context">Current HTTP context</param> public LoadBalanceManager(HttpContext context) { _contentApi = new ContentAPI(); _siteApi = new SiteAPI(); _loadBalanceSyncManager = new LoadBalanceSynchronizationManager(); _context = context; }
protected WidgetControls_widget() { _contentApi = new ContentAPI(); _siteApi = new SiteAPI(); _ApplicationPath = _contentApi.ApplicationPath.TrimEnd(new char[] { '/' }); _SitePath = _contentApi.SitePath.TrimEnd(new char[] { '/' }); }
protected Attributes() { _contentApi = new ContentAPI(); _siteApi = new SiteAPI(); _MessageHelper = _contentApi.EkMsgRef; this.SitePath = _contentApi.SitePath.TrimEnd(new char[] { '/' }); this.ApplicationPath = _siteApi.ApplicationPath.TrimEnd(new char[] { '/' }); }
/// <summary> /// Constructor /// </summary> public SyncSchedule() { Interval = ScheduleInterval.None; StartTime = DateTime.Now; IsEnabled = true; _siteApi = new SiteAPI(); }
/// <summary> /// /// </summary> /// <param name="sender"></param> /// <param name="e"></param> protected void Page_Init(object sender, EventArgs e) { _siteApi = new SiteAPI(); _styleHelper = new StyleHelper(); _parameters = new RestoreParameters(Request); RegisterResources(); }
protected Membership() { _ContentApi = new ContentAPI(); _SiteApi = new SiteAPI(); this.SitePath = _ContentApi.SitePath.TrimEnd(new char[] { '/' }); this.ApplicationPath = _SiteApi.ApplicationPath.TrimEnd(new char[] { '/' }); }
public void Display_View() { SiteAPI m_refSiteApi = new SiteAPI(); setting_data = m_refSiteApi.GetSiteVariables(m_refSiteApi.UserId); int m_intTotalItems = 0; m_aInvitations = m_refFriendsApi.GetSentFriendInvitations(this.m_refContentApi.UserId, m_intCurrentPage, System.Convert.ToInt32(m_PageSize > 0 ? m_PageSize : 0), ref m_intTotalPages, ref m_intTotalItems); Populate_ViewFriendsGrid(m_aInvitations); }
public void Display_View() { SiteAPI m_refSiteApi = new SiteAPI(); setting_data = m_refSiteApi.GetSiteVariables(m_refSiteApi.UserId); m_aUsers = m_refFriendsApi.GetMyFriends(m_intCurrentPage, System.Convert.ToInt32(m_PageSize > 0 ? m_PageSize : 0), ref m_intTotalPages); m_aSelectedFriends = m_refFriendsApi.GetSelectedFriendsForUser(this.m_refContentApi.UserId); Populate_ViewFriendsGrid(m_aUsers); }
public Workarea_controls_search_addsuggestedresult() { _siteApi = new SiteAPI(); _styleHelper = new StyleHelper(); _appImgPath = string.Empty; _contentLanguage = string.Empty; _pageMode = string.Empty; _pageAction = string.Empty; _originalPhrase = string.Empty; _suggestedResultRecommendedMaxSize = 10; }
public void DisplayInfo() { TagData td = new TagData(); SiteAPI siteApi = new SiteAPI(); LanguageData langData; int language = 0; try { tagLangLabelLit.Text = m_containerPage.RefMsg.GetMessage("generic language"); tagNameLabelLit.Text = m_containerPage.RefMsg.GetMessage("generic name"); // If editing an existing tag, show current values: if (0 < m_containerPage.TagId) { tagIdLabelLit.Text = m_containerPage.RefMsg.GetMessage("generic id") + ": "; td = m_tagApi.GetTagByID(m_containerPage.TagId); if (td != null) { tagIdLit.Text = "<b>" + td.Id.ToString() + "</b><br />"; tagNameTxt.Text = td.Text; tagDescTxt.Text = ""; tagLangIdHdn.Value = td.LanguageId.ToString(); language = td.LanguageId; } } else { language = m_containerPage.ContentLanguage; } if (language == -1) { tagLangLit.Text = m_containerPage.RefMsg.GetMessage("generic all"); } else { langData = siteApi.GetLanguageById(language); tagLangLit.Text = langData.Name; } } catch (Exception) { } finally { td = null; } }
public CouponBase() { _UserApi = new UserAPI(); _CouponApi = new CouponApi(); _ContentApi = new ContentAPI(); _SiteApi = new SiteAPI(); _CurrencyApi = new CurrencyApi(); m_refMsg = m_refContentApi.EkMsgRef; this.IsAdmin = _ContentApi.IsAdmin(); this.IsCommerceAdmin = _UserApi.EkUserRef.IsARoleMember_CommerceAdmin(); this.SitePath = _ContentApi.SitePath.TrimEnd(new char[] { '/' }); this.ApplicationPath = _SiteApi.ApplicationPath.TrimEnd(new char[] { '/' }); }
public DatePicker() { _refContentApi = new ContentAPI(); _refSiteApi = new SiteAPI(); if (_refContentApi.UserId > 0) { _cult = new System.Globalization.CultureInfo(_refContentApi.UserLanguage); } else { _cult = new System.Globalization.CultureInfo(_refContentApi.RequestInformationRef.DefaultContentLanguage); } LabelText = GetMessage("generic date label"); BadDateFormatMessage = GetMessage("msg bad date format"); }
private void Page_Load(System.Object sender, System.EventArgs e) { SiteAPI m_refSiteApi = new SiteAPI(); UserAPI m_refUserApi = new UserAPI(); m_refMsg = m_refSiteApi.EkMsgRef; AppImgPath = m_refSiteApi.AppImgPath; AppName = m_refSiteApi.AppName; SITEPATH = m_refSiteApi.SitePath; //call api and display values td_asset_loc.InnerHtml = "assets"; td_private_asset_loc.InnerHtml = "private"; td_domain_username.InnerHtml = "user1"; }
protected string GenerateCategoryHtml(string controlId, int languageID, long taxonomyId) { StringBuilder sb = new StringBuilder(); Taxonomy taxonomyAPI = new Taxonomy(); TaxonomyRequest taxonomyRequest = new TaxonomyRequest(); taxonomyRequest.TaxonomyId = taxonomyId; taxonomyRequest.TaxonomyLanguage = languageID; TaxonomyData taxonomyData = taxonomyAPI.LoadTaxonomy(ref taxonomyRequest); SiteAPI siteAPI = new SiteAPI(); sb.Append("<li id=\"ekTaxonomy"); sb.Append(controlId); sb.Append("_"); sb.Append(taxonomyId.ToString()); sb.Append("\">"); if (taxonomyData.Taxonomy.Length > 0) { sb.Append("<a href=\"#\" onclick=\"toggleTree('"); sb.Append(controlId); sb.Append("', "); sb.Append(taxonomyId.ToString()); sb.Append(");\"><img id=\"ekIMG"); sb.Append(controlId); sb.Append("_"); sb.Append(taxonomyId.ToString()); sb.Append("\" src=\""); sb.Append(siteAPI.SitePath); sb.Append("Workarea/images/ui/icons/tree/taxonomyCollapsed.png\" border=\"0\"></img></a>"); } else { sb.Append("<img src=\""); sb.Append(siteAPI.SitePath); sb.Append("Workarea/images/ui/icons/tree/taxonomy.png\"></img>"); } sb.Append("<input type=\"checkbox\" id=\""); sb.Append("ekCheck"); sb.Append(controlId); sb.Append("_"); sb.Append(taxonomyId.ToString()); sb.Append("\" onclick=\"selectCategory(this);\">"); sb.Append(taxonomyData.TaxonomyName); return sb.ToString(); }
public CouponUserControlBase() { _UserApi = new UserAPI(); _CouponApi = new CouponApi(); _ContentApi = new ContentAPI(); _SiteApi = new SiteAPI(); _CurrencyApi = new CurrencyApi(); this.SitePath = _ContentApi.SitePath.TrimEnd(new char[] { '/' }); this.ApplicationPath = _SiteApi.ApplicationPath.TrimEnd(new char[] { '/' }); this.IsAdmin = _ContentApi.IsAdmin(); this.IsCommerceAdmin = _UserApi.EkUserRef.IsARoleMember_CommerceAdmin(); //check permissions - both admin and commerce admin can edit this.IsEditable = (this.IsCommerceAdmin == true || this.IsAdmin == true) ? true : false; }
public void DisplayInfo() { TagData td; SiteAPI siteApi = new SiteAPI(); LanguageData langData; try { tagIdLabelLit.Text = m_containerPage.RefMsg.GetMessage("generic id"); tagLangLabelLit.Text = m_containerPage.RefMsg.GetMessage("generic language"); tagNameLabelLit.Text = m_containerPage.RefMsg.GetMessage("generic name"); tagStatisticsLabel.Text = m_containerPage.RefMsg.GetMessage("lbl tag statistics"); td = m_tagApi.GetTagByID(m_containerPage.TagId); if (td != null) { tagNameLit.Text = td.Text; tagIdLit.Text = td.Id.ToString(); if (td.LanguageId == -1) { tagLangLit.Text = m_containerPage.RefMsg.GetMessage("generic all"); } else { langData = siteApi.GetLanguageById(td.LanguageId); tagLangLit.Text = langData.Name; } tagIdHdn.Value = td.Id.ToString(); tagLangIdHdn.Value = td.LanguageId.ToString(); SetupStatisticsGrid(); tagStatsGrid.DataSource = GetStatisticsTable(); tagStatsGrid.DataBind(); } } catch (Exception) { } finally { td = null; } }
protected void Page_Load(object sender, EventArgs e) { string username = Request.QueryString["u"]; // username string password = Request.QueryString["p"]; // password string domain = Request.QueryString["d"]; // domain string action = Request.QueryString["action"]; if (action != null && action.ToLower() == "getp") { // the action "getp" treats "u" as userid and "p" as uniqueid SiteAPI siteAPI = new SiteAPI(); // impersonate the administrator to call GetUserByID long callerId = siteAPI.RequestInformationRef.CallerId; siteAPI.RequestInformationRef.CallerId = (int)EkConstants.InternalAdmin; Microsoft.VisualBasic.Collection userData = siteAPI.EkUserRef.GetUserByID(int.Parse(username), false, false); // restore the original caller siteAPI.RequestInformationRef.CallerId = callerId; // check if the given uniqueid is the same as the stored uniqueid if (password != userData["LoginNumber"].ToString()) { // if it isn't return username and password as null Response.Write(","); Response.End(); return; } // otherwise return username and password separated by a comma Response.Write((string)userData["Username"] + "," + DecryptString((string)userData["Password"])); Response.End(); return; } // if the domain is null, then set it to empty string domain = (domain == null ? "" : domain); // check if we have all the needed parameters if (username == null || password == null || Request.ServerVariables["SERVER_NAME"] == null) { return; } // and login Login(username, password, domain); }
private void Page_Load(System.Object sender, System.EventArgs e) { Response.CacheControl = "no-cache"; Response.AddHeader("Pragma", "no-cache"); Response.Expires = -1; SiteAPI m_refSiteApi = new SiteAPI(); m_refMsg = m_refSiteApi.EkMsgRef; AppImgPath = m_refSiteApi.AppImgPath; AppPath = m_refSiteApi.AppPath; AppName = m_refSiteApi.AppName; SITEPATH = m_refSiteApi.SitePath; litTitle.Text = AppName + " " + m_refMsg.GetMessage("config page html title"); if ((m_refSiteApi.EkContentRef).IsAllowed(0, 0, "users", "IsLoggedIn",0) == false) { Response.Redirect("login.aspx?fromLnkPg=1", true); return; } if ( Convert.ToBoolean(m_refSiteApi.RequestInformationRef.IsMembershipUser) || m_refSiteApi.RequestInformationRef.UserId == 0) { Response.Redirect("reterror.aspx?info=Please login as cms user", true); return; } RegisterResources(); if (!(Request.QueryString["action"] == null)) { m_strPageAction = Request.QueryString["action"]; if (m_strPageAction.Length > 0) { m_strPageAction = m_strPageAction.ToLower(); } } if (!(Request.QueryString["RefreshFrame"] == null)) { if (Request.QueryString["RefreshFrame"].ToLower() == "true") { m_blnRefreshFrame = true; } } StyleSheetJS.Text = m_refStyle.GetClientScript(); divTitleBar.InnerHtml = m_refStyle.GetTitleBar(m_refMsg.GetMessage("config page title")); divToolBar.InnerHtml = ConfigToolBar(); }
/// <summary> /// Constructor /// </summary> public Workarea_customproperties() { _siteApi = new SiteAPI(); _commonApi = new CommonApi(); _customPropertyApi = new CustomProperty(); _customPropertyCore = new CustomPropertyBL(); _styleHelper = new StyleHelper(); _pageAction = string.Empty; _propertyId = 0; _language = -1; _pageType = string.Empty; _translate = false; _originalLanguage = 0; _currentPage = 1; _messageHelper = _commonApi.EkMsgRef; _enableMultiLanguage = _commonApi.EnableMultilingual; _appImgPath = _commonApi.AppImgPath; _imageIconPath = _commonApi.AppPath + RelativeIconPath; _commonApi.ContentLanguage = _language; }
protected Item() { _contentApi = new ContentAPI(); _siteApi = new SiteAPI(); _itemData = null; _Currency = new Currency(); this.SitePath = _contentApi.SitePath.TrimEnd(new char[] { '/' }); this.ApplicationPath = _siteApi.ApplicationPath.TrimEnd(new char[] { '/' }); }
/// <summary> /// Generate the HTML for one row of the file tree. /// </summary> /// <param name="controlId">The ID of the surrounding AJAX folder control.</param> /// <param name="folder">The folder data.</param> /// <returns>The HTML list element for one row of the folder tree.</returns> protected string GenerateFolderHtml(string controlId, FolderData folder) { siteAPI = new SiteAPI(); // If we're at the root, return the site path string sitePath = siteAPI.SitePath.ToString().TrimEnd(new char[] { '/' }) .TrimStart(new char[] { '/' }); if (sitePath != "") sitePath += "/"; if (Page.Request.Url.Host.ToLower().Equals("localhost")) sitePath = Context.Request.Url.Scheme + Uri.SchemeDelimiter + System.Net.Dns.GetHostName() + "/" + sitePath; else sitePath = Context.Request.Url.Scheme + Uri.SchemeDelimiter + Page.Request.Url.Authority + "/" + sitePath; /* * Generate the following HTML: * * <li id="ekFolder#controlId#_#folderId#\> * <a href="#" onclick="toggleTree('#controlId#', #folderId);"> * <img src="#sitePath#Workarea/Tree/images/xp/plusopenfolder.gif" border="0" * </img> * </a> * <a href="#" onclick="ekSelectFolder#controlId#(#folderId)"> * #folder.Name# * </a> * </li> */ StringBuilder sb = new StringBuilder(); string folderId = folder.Id.ToString(); sb.Append("<li id=\"ekFolder"); sb.Append(controlId); sb.Append("_"); sb.Append(folderId); sb.Append("\">"); // If the folder has children, then output the folder image with a [+] next to it // Get a list of subfolders filtered according to user's privs. If the folder has children, // then output the folder image with a [+] next to it List<FolderData> childFolders = new List<FolderData>(GetFilteredChildFolders( folder.Id, false, EkEnumeration.FolderOrderBy.Id)); if (childFolders.Count > 0) { sb.Append("<a onclick=\"toggleTree('"); sb.Append(controlId); sb.Append("', "); sb.Append(folderId); sb.Append(");\"><img src=\""); sb.Append(sitePath); sb.Append("Workarea/Tree/images/xp/plusopenfolder.gif\" border=\"0\"></img></a>"); } // Otherwise output standard folder image else { sb.Append("<img src=\""); sb.Append(sitePath); sb.Append("Workarea/Tree/images/xp/folder.gif\"></img>"); } sb.Append("<a href=\"#\" onclick=\"ekSelectFolder"); sb.Append(controlId); sb.Append("(this,"); sb.Append(folderId); sb.Append(")\">"); sb.Append(folder.Name); sb.Append("</a></li>"); return sb.ToString(); }
/// <summary> /// Generates the HTML for the child folders under the given folder /// </summary> /// <param name="controlId">The ID of the surrounding AJAX folder control.</param> /// <param name="folderId">The folder ID.</param> /// <returns>The HTML list element for one row of the folder tree.</returns> protected string GenerateTreeHtml(string controlId, long folderId, string username, string password) { contentAPI = new Ektron.Cms.ContentAPI(); siteAPI = new SiteAPI(); if (!siteAPI.IsLoggedIn) return "<div class=\"ekError\">Please login</div>"; // Get the children for the specified folder List<FolderData> folderList = null; try { folderList = new List<FolderData>( GetFilteredChildFolders( folderId, false, EkEnumeration.FolderOrderBy.Name)); } catch { // Exception likely occurred due to the user not being logged in. // Unfortunately, ContentAPI.IsLoggedIn is not reliable enough (still // returns true if user is user is logged out from a different client) // to check in this case. } StringBuilder sb = new StringBuilder(); if (folderList != null) { if (folderList.Count != 0) { sb.Append("<ul>"); foreach (FolderData folder in folderList) { sb.Append(GenerateFolderHtml(controlId, folder)); } sb.Append("</ul>"); } } return sb.ToString(); }
protected override void Page_Load(System.Object sender, System.EventArgs e) { //Put user code to initialize the page here if (! (Request.QueryString["grouptype"] == null) && Request.QueryString["grouptype"] != "") { m_intGroupType = Convert.ToInt32(Request.QueryString["grouptype"]); } if (! (Request.QueryString["groupid"] == null) && Request.QueryString["groupid"] != "") { m_intGroupId = Convert.ToInt64(Request.QueryString["groupid"]); } Hashtable hts = new Hashtable(); string connection = ""; UserAPI m_refUserApi = new UserAPI(); Ektron.Cms.User.EkUser m_refUser; string tmpPath = ""; string path = ""; string strUser = ""; string[] arrUser; SettingsData setting_data; SiteAPI m_refSiteApi = new SiteAPI(); StringBuilder sbTemp = new StringBuilder(); StringBuilder sbBrowseJS = new StringBuilder(); try { if (Request.QueryString["method"] != "") { sMethod = Request.QueryString["method"]; if (Page.IsPostBack == true && Request.Form["cn_path"] != "" && Request.Form["cn_name"] != "") { AddLDAPUsersToSystem(); Response.Redirect("../users.aspx?action=viewallusers&grouptype=" + m_intGroupType.ToString() + "&groupid=" + m_intGroupId.ToString() + "&id=" + m_intGroupId.ToString() + "&OrderBy=user_name", false); return; } } m_refMsg = m_refUserApi.EkMsgRef; setting_data = m_refSiteApi.GetSiteVariables(-1); StyleSheetJS.Text = m_refStyle.GetClientScript(); if (Request.QueryString["path"] != null) { path = (string) (Request.QueryString["path"].ToString().Replace("~", "=")); } m_refUser = m_refUserApi.EkUserRef; if (setting_data.LDAPSettings.ServerType == Ektron.Cms.Common.EkEnumeration.LDAPServerType.ActiveDirectory || setting_data.LDAPSettings.ServerType == Ektron.Cms.Common.EkEnumeration.LDAPServerType.Novell) { hts = m_refUser.BrowseLDAPTree(path, ref connection, m_refUserApi.RequestInformationRef.ADUsername, m_refUserApi.RequestInformationRef.ADPassword); } else { hts = m_refUser.BrowseLDAPTree(path, ref connection, "", ""); } if (path.EndsWith(",")) { tmpPath = path.Remove(System.Convert.ToInt32(path.Length - 1), 1); } ltrorgdomain.Text = connection; ltrpath.Text = tmpPath; sbTemp.Append("<script language=\"javascript\">" + Environment.NewLine); sbTemp.Append(" var connection = \'" + connection + "\';" + Environment.NewLine); sbTemp.Append(" var path = \'" + tmpPath + "\';" + Environment.NewLine); sbTemp.Append("</script>" + Environment.NewLine); sbBrowseJS.Append(" <script language=\"javascript\">" + Environment.NewLine); sbBrowseJS.Append(" function toggleVisibility(me){").Append(Environment.NewLine); sbBrowseJS.Append(" if (me.style.visibility==\"hidden\"){").Append(Environment.NewLine); sbBrowseJS.Append(" me.style.visibility=\"visible\";").Append(Environment.NewLine); sbBrowseJS.Append(" }").Append(Environment.NewLine); sbBrowseJS.Append(" else {").Append(Environment.NewLine); sbBrowseJS.Append(" me.style.visibility=\"hidden\";").Append(Environment.NewLine); sbBrowseJS.Append(" }").Append(Environment.NewLine); sbBrowseJS.Append(" }").Append(Environment.NewLine); sbBrowseJS.Append(" function SelectUser(cn) {" + Environment.NewLine); sbBrowseJS.Append(" var rExp;" + Environment.NewLine); sbBrowseJS.Append(" var path2;" + Environment.NewLine); sbBrowseJS.Append(" rExp = /ou=/gi;" + Environment.NewLine); sbBrowseJS.Append(" if (path.length == 0){path2 = path;} else {path2 = path + \',\';}" + Environment.NewLine); if (sMethod == "select") { // sbBrowseJS.Append(" alert(path2 + connection);" & Environment.NewLine) sbBrowseJS.Append(" toggleVisibility(document.getElementById(\'dvHoldMessage\'));" + Environment.NewLine); sbBrowseJS.Append(" document.getElementById(\'cn_name\').value = cn;" + Environment.NewLine); sbBrowseJS.Append(" document.getElementById(\'cn_path\').value = path2 + connection;" + Environment.NewLine); sbBrowseJS.Append(" document.forms[0].submit();" + Environment.NewLine); } else { if (Request.QueryString["from"] == "users") { sbBrowseJS.Append(" window.opener.document.forms[0]." + (Request.QueryString["uniqueid"]) + "LDAP_username.value = cn;" + Environment.NewLine); if (setting_data.LDAPSettings.ServerType == Ektron.Cms.Common.EkEnumeration.LDAPServerType.ActiveDirectory) { sbBrowseJS.Append(" var rExp_cn;" + Environment.NewLine); sbBrowseJS.Append(" rExp_cn = /cn=/gi;" + Environment.NewLine); } sbBrowseJS.Append(" window.opener.document.forms[0]." + (Request.QueryString["uniqueid"]) + "LDAP_ldapdomain.value = path2 + connection;" + Environment.NewLine); } else if (Request.QueryString["from"] == "members") { sbBrowseJS.Append(" window.opener.userinfo.username.value = cn;" + Environment.NewLine); sbBrowseJS.Append(" window.opener.userinfo.domain.value = path2 + connection;" + Environment.NewLine); } else if (Request.QueryString["from"] == "setup") { sbBrowseJS.Append(" window.opener.userinfo.username.value = cn;" + Environment.NewLine); sbBrowseJS.Append(" window.opener.userinfo.domain.value = path2 + connection;" + Environment.NewLine); } sbBrowseJS.Append(" self.close();" + Environment.NewLine); } sbBrowseJS.Append(" }" + Environment.NewLine); sbBrowseJS.Append(" </script>" + Environment.NewLine); if (path.Length > 0) { path = path.Replace("=", "~"); sbTemp.Append("<br/><a href=\"#\" onClick=\"history.back(1);\">Up</a><br/>"); } else { sbTemp.Append("<br/> <br/>"); } IDictionaryEnumerator Enumerator; Enumerator = hts.GetEnumerator(); while (Enumerator.MoveNext()) { //Response.Write(Enumerator.Key.ToString() & "<br/>") if (setting_data.LDAPSettings.ServerType == Ektron.Cms.Common.EkEnumeration.LDAPServerType.ActiveDirectory) { string[] aRay; string cnstring = ""; string userstring = ""; string tString = Enumerator.Key.ToString(); aRay = tString.Split(new string[] {"||"}, StringSplitOptions.None); userstring = aRay[0]; cnstring = aRay[1]; if (!string.IsNullOrEmpty(userstring) && (cnstring.ToLower().IndexOf("cn=") == 0) || (cnstring.ToLower().IndexOf("uid=") > -1)) { strUser = userstring.Replace("\'", "\\\'"); sbTemp.Append("<br><a href=\"#\" onclick=\"SelectUser(\'" + strUser + "\');\">"); sbTemp.Append("<img src=\"" + AppImgPath + "../UI/Icons/user.png\" /></a>"); sbTemp.Append(" " + cnstring); //+ "<b>(" + Enumerator.Value.ToString() + ")</b>") } else if ((cnstring.ToLower().IndexOf("ou=") == 0) || (cnstring.ToLower().IndexOf("cn=") == 0)) { sbTemp.Append("<br><a href=\"browse.aspx?grouptype=" + m_intGroupType + "&groupid=" + m_intGroupId.ToString() + "&method=" + sMethod + ("&from=" + Request.QueryString["from"] + "&uniqueid=" + Request.QueryString["uniqueid"] + "&path=" + cnstring.Replace("=", "~") + "," + path + "\">")); sbTemp.Append("<img src=\"" + AppImgPath + "ico_menu-closed.gif\" border=0/></a> "); sbTemp.Append(" " + cnstring.ToString()); //+ "<b>(" + Enumerator.Value.ToString() + ")</b>") } } else { if (Enumerator.Value.ToString().ToLower().IndexOf("nsmanageddomain") > -1 || Enumerator.Value.ToString().ToLower().IndexOf("person") > -1 || Enumerator.Value.ToString().ToLower().IndexOf("organizational") > -1 || Enumerator.Value.ToString().ToLower().IndexOf("organization") > -1) { if ((Enumerator.Key.ToString().ToLower().IndexOf("cn=") == 0) || (Enumerator.Key.ToString().ToLower().IndexOf("uid=") > -1)) { arrUser = (Enumerator.Key.ToString()).Split('='); strUser = arrUser[1]; strUser = strUser.Replace("\'", "\\\'"); sbTemp.Append("<br><a href=\"#\" onclick=\"SelectUser(\'" + strUser + "\');\">"); sbTemp.Append("<img src=\"" + AppImgPath + "../UI/Icons/user.png\" /></a>"); sbTemp.Append(" " + Enumerator.Key.ToString()); //+ "<b>(" + Enumerator.Value.ToString() + ")</b>") } else if ((Enumerator.Key.ToString().ToLower().IndexOf("ou=") == 0) || (Enumerator.Key.ToString().ToLower().IndexOf("o=") == 0) || (Enumerator.Key.ToString().ToLower().IndexOf("dc=") == 0)) { sbTemp.Append("<br><a href=\"browse.aspx?grouptype=" + m_intGroupType + "&groupid=" + m_intGroupId.ToString() + "&method=" + sMethod + ("&from=" + Request.QueryString["from"] + "&uniqueid=" + Request.QueryString["uniqueid"] + "&path=" + Enumerator.Key.ToString().Replace("=", "~") + "," + path + "\">")); sbTemp.Append("<img src=\"" + AppImgPath + "ico_menu-closed.gif\" border=0/></a> "); sbTemp.Append(" " + Enumerator.Key.ToString()); //+ "<b>(" + Enumerator.Value.ToString() + ")</b>") } } } } ltrMain.Text = sbTemp.ToString(); ltrBrowseJS.Text = sbBrowseJS.ToString(); BrowseLDAPToolBar(); } catch (Exception ex) { if (ex.Message.IndexOf("operational") > -1 || ex.Message.ToLower().IndexOf("no such object") > -1) { Utilities.ShowError(m_refMsg.GetMessage("ldap setup err")); //"Unable to connect to your LDAP Server. Please verify your setup configuration.") } else { Utilities.ShowError(ex.Message); } } }
private void LogoutUser() { if (!IsPostBack && m_strAction.ToLower() != "logoutnoprompt") { LanguageData language_data; SiteAPI m_refSiteApi = new SiteAPI(); language_data = m_refSiteApi.GetLanguageById(m_refSiteApi.UserLanguage); //logoutmsg.InnerHtml = m_refMsg.GetMessage("logout message") logoutmsg.Text = _ContentApi.AppName + " " + m_refMsg.GetMessage("generic logout msg"); LogoutPanel.Visible = true; //fixed defect # 19069 System.Text.StringBuilder strCloser = new System.Text.StringBuilder(); strCloser.AppendLine("<script type=\"text/javascript\">"); strCloser.AppendLine("document.forms[0].action = \'login.aspx?action=logout&i=19069\';"); strCloser.AppendLine("</script>"); Page.ClientScript.RegisterStartupScript(this.GetType(), "formsubmit", strCloser.ToString()); ltr_olduser.Text = "<input type=\"hidden\" id=\"hdn_olduser\" name=\"hdn_olduser\" value=\"" + m_refUserApi.UserId + "\" />"; } else { long oldUserId = 0; if (!string.IsNullOrEmpty(Request.Form["hdn_olduser"]) && Information.IsNumeric(Request.Form["hdn_olduser"])) { oldUserId = Convert.ToInt64(Request.Form["hdn_olduser"]); } if (oldUserId > 0) { m_refUserApi.clearUserUniqueIdentification(oldUserId); if (HttpContext.Current != null && HttpContext.Current.Session != null) { HttpContext.Current.Session["ekismembershipuser"] = 0; } } if (m_refUserApi.RequestInformationRef.CommerceSettings.ComplianceMode && oldUserId > 0 && m_refUserApi.EkUserRef.IsUserIdCommerceAdmin(oldUserId)) { Ektron.Cms.Instrumentation.Log.WriteMessage(string.Format(m_refMsg.GetMessage("log commerce auth-commerceadmin logout"), oldUserId), new string[] { "CommerceAuthentication" }, GetLogProperties(oldUserId)); } System.Text.StringBuilder strCloser = new System.Text.StringBuilder(); // Render script to close the Workarea: strCloser.Append("<script type=\"text/javascript\">" + "\r\n"); strCloser.Append("window.open(\'close.aspx?logout=true\',\'Admin400\',\'toolbar=0,location=0,scrollbars=0,width=1,height=1\');" + "\r\n"); strCloser.Append("</script>" + "\r\n"); WorkareaCloserJS.Text = strCloser.ToString(); if (!(Session["DDSnip"] == null)) { Session["DDSnip"] = null; } if (!(Session["LibCategory"] == null)) { Session["LibCategory"] = null; } if (Response.Cookies[System.Web.Security.FormsAuthentication.FormsCookieName] != null) { Response.Cookies[System.Web.Security.FormsAuthentication.FormsCookieName].Expires = DateTime.Now; } Response.Cookies["ecm"].Expires = DateTime.Now; Response.Cookies["ecmSecure"].Expires = DateTime.Now; LoginSuceededPanel.Visible = true; } }