protected void Page_Load(object sender, EventArgs e) { SetPageLoadPart(); CoreJs.IncludeLanguageCoreJs(this.Page); Response.Cache.SetCacheability(HttpCacheability.NoCache); Response.Cache.SetExpires(DateTime.Now.AddSeconds(-1)); Response.Cache.SetNoStore(); Response.AppendHeader("pragma", "no-cache"); SageFrame.Application.Application app = new SageFrame.Application.Application(); lblVersion.Text = string.Format("V {0}", app.FormatShortVersion(app.Version, true)); AddLanguage(); }
private void RestartApplication() { SageFrame.Application.Application app = new SageFrame.Application.Application(); File.SetLastWriteTime((app.ApplicationMapPath + "\\web.config"), System.DateTime.Now); HttpCookie authenticateCookie = new HttpCookie(System.Web.Security.FormsAuthentication.FormsCookieName + "_" + GetApplicationName + "_" + GetPortalID); authenticateCookie.Expires = DateTime.Now.AddYears(-1); Response.Cookies.Add(authenticateCookie); System.Web.Security.FormsAuthentication.SignOut(); SetUserRoles(string.Empty); Response.Redirect(Page.ResolveUrl("~/" + CommonHelper.DefaultPage), true); }
private void BindData() { Hashtable hsts = GetAllSettings(); SageFrameConfig pagebase = new SageFrameConfig(); txtPortalTitle.Text = hsts[SageFrameSettingKeys.PageTitle].ToString(); txtDescription.Text = hsts[SageFrameSettingKeys.MetaDescription].ToString(); txtKeyWords.Text = hsts[SageFrameSettingKeys.MetaKeywords].ToString(); txtCopyright.Text = Server.HtmlDecode(hsts[SageFrameSettingKeys.PortalCopyright].ToString()); txtLogoTemplate.Text = Server.HtmlDecode(hsts[SageFrameSettingKeys.PortalLogoTemplate].ToString()); txtPortalGoogleAdSenseID.Text = hsts[SageFrameSettingKeys.PortalGoogleAdSenseID].ToString(); chkOptCss.Checked = bool.Parse(hsts[SageFrameSettingKeys.OptimizeCss].ToString()); chkOptJs.Checked = bool.Parse(hsts[SageFrameSettingKeys.OptimizeJs].ToString()); chkLiveFeeds.Checked = bool.Parse(hsts[SageFrameSettingKeys.EnableLiveFeeds].ToString()); txtSiteAdminEmailAddress.Text = hsts[SageFrameSettingKeys.SiteAdminEmailAddress].ToString(); chkShowSidebar.Checked = bool.Parse(hsts[SageFrameSettingKeys.ShowSideBar].ToString()); //scheduler txtScheduler.Checked = bool.Parse(hsts[SageFrameSettingKeys.Scheduler].ToString()); //added by Bj for OpenID chkOpenID.Checked = bool.Parse(hsts[SageFrameSettingKeys.ShowOpenID].ToString()); int userAgent = int.Parse(hsts[SageFrameSettingKeys.UserAgentMode].ToString()); switch (userAgent) { case 1: rdBtnPC.Checked = true; break; case 2: rdBtnMobile.Checked = true; break; case 3: rdBtnDefault.Checked = true; break; } if (chkOpenID.Checked == true) { tblOpenIDInfo.Visible = true; } else { tblOpenIDInfo.Visible = false; } chkDashboardHelp.Checked = bool.Parse(hsts[SageFrameSettingKeys.EnableDasboardHelp].ToString()); txtServerCookieExpiration.Text = hsts[SageFrameSettingKeys.ServerCookieExpiration].ToString(); chkEnableCDN.Checked = bool.Parse(hsts[SageFrameSettingKeys.EnableCDN].ToString()); chkSessionTracker.Checked = bool.Parse(hsts[SageFrameSettingKeys.EnableSessionTracker].ToString()); txtFacebookConsumerKey.Text = hsts[SageFrameSettingKeys.FaceBookConsumerKey].ToString(); txtLinkedInConsumerKey.Text = hsts[SageFrameSettingKeys.LinkedInConsumerKey].ToString(); txtLinkedInSecretKey.Text = hsts[SageFrameSettingKeys.LinkedInSecretKey].ToString(); txtFaceBookSecretKey.Text = hsts[SageFrameSettingKeys.FaceBookSecretkey].ToString(); if (rblPortalShowProfileLink.Items.Count > 0) { string ExistingPortalShowProfileLink = hsts[SageFrameSettingKeys.PortalShowProfileLink].ToString(); rblPortalShowProfileLink.SelectedIndex = rblPortalShowProfileLink.Items.IndexOf(rblPortalShowProfileLink.Items.FindByValue(ExistingPortalShowProfileLink)); } //RemeberMe setting chkEnableRememberme.Checked = bool.Parse(hsts[SageFrameSettingKeys.RememberCheckbox].ToString()); //ssl cbUseSSL.Checked = string.IsNullOrEmpty(hsts[SageFrameSettingKeys.UseSSL].ToString()) ? false : bool.Parse(hsts[SageFrameSettingKeys.UseSSL].ToString().ToLower()); if (rblUserRegistration.Items.Count > 0) { string ExistingData = hsts[SageFrameSettingKeys.PortalUserRegistration].ToString(); rblUserRegistration.SelectedIndex = rblUserRegistration.Items.IndexOf(rblUserRegistration.Items.FindByValue(ExistingData)); } if (ddlLoginPage.Items.Count > 0) { string ExistingPortalLoginpage = hsts[SageFrameSettingKeys.PortalLoginpage].ToString(); ExistingPortalLoginpage = ExistingPortalLoginpage.StartsWith("sf/") ? ExistingPortalLoginpage.Replace("sf/", "") : ExistingPortalLoginpage; ddlLoginPage.SelectedIndex = ddlLoginPage.Items.IndexOf(ddlLoginPage.Items.FindByValue(ExistingPortalLoginpage)); } if (ddlUserRegistrationPage.Items.Count > 0) { string ExistingPortalUserActivation = hsts[SageFrameSettingKeys.PortalUserActivation].ToString(); ExistingPortalUserActivation = ExistingPortalUserActivation.StartsWith("sf/") ? ExistingPortalUserActivation.Replace("sf/", "") : ExistingPortalUserActivation; ddlPortalUserActivation.SelectedIndex = ddlPortalUserActivation.Items.IndexOf(ddlPortalUserActivation.Items.FindByValue(ExistingPortalUserActivation)); } if (ddlUserRegistrationPage.Items.Count > 0) { string ExistingPortalRegistrationPage = hsts[SageFrameSettingKeys.PortalRegistrationPage].ToString(); ExistingPortalRegistrationPage = ExistingPortalRegistrationPage.StartsWith("sf/") ? ExistingPortalRegistrationPage.Replace("sf/", "") : ExistingPortalRegistrationPage; ddlUserRegistrationPage.SelectedIndex = ddlUserRegistrationPage.Items.IndexOf(ddlUserRegistrationPage.Items.FindByValue(ExistingPortalRegistrationPage)); } if (ddlPortalForgotPassword.Items.Count > 0) { string ExistingPortalForgotPassword = hsts[SageFrameSettingKeys.PortalForgotPassword].ToString(); ExistingPortalForgotPassword = ExistingPortalForgotPassword.StartsWith("sf/") ? ExistingPortalForgotPassword.Replace("sf/", "") : ExistingPortalForgotPassword; ddlPortalForgotPassword.SelectedIndex = ddlPortalForgotPassword.Items.IndexOf(ddlPortalForgotPassword.Items.FindByValue(ExistingPortalForgotPassword)); } //ddlPortalPageNotAccessible if (ddlPortalPageNotAccessible.Items.Count > 0) { string ExistingPortalPageNotAccessible = hsts[SageFrameSettingKeys.PortalPageNotAccessible].ToString(); ExistingPortalPageNotAccessible = ExistingPortalPageNotAccessible.StartsWith("sf/") ? ExistingPortalPageNotAccessible.Replace("sf/", "") : ExistingPortalPageNotAccessible; ddlPortalPageNotAccessible.SelectedIndex = ddlPortalPageNotAccessible.Items.IndexOf(ddlPortalPageNotAccessible.Items.FindByValue(ExistingPortalPageNotAccessible)); } //ddlPortalPageNotFound if (ddlPortalPageNotFound.Items.Count > 0) { string ExistingPortalPageNotFound = hsts[SageFrameSettingKeys.PortalPageNotFound].ToString(); ExistingPortalPageNotFound = ExistingPortalPageNotFound.StartsWith("sf/") ? ExistingPortalPageNotFound.Replace("sf/", "") : ExistingPortalPageNotFound; ddlPortalPageNotFound.SelectedIndex = ddlPortalPageNotFound.Items.IndexOf(ddlPortalPageNotFound.Items.FindByValue(ExistingPortalPageNotFound)); } //ddlPortalPasswordRecovery if (ddlPortalPasswordRecovery.Items.Count > 0) { string ExistingPortalPasswordRecovery = hsts[SageFrameSettingKeys.PortalPasswordRecovery].ToString(); ExistingPortalPasswordRecovery = ExistingPortalPasswordRecovery.StartsWith("sf/") ? ExistingPortalPasswordRecovery.Replace("sf/", "") : ExistingPortalPasswordRecovery; ddlPortalPasswordRecovery.SelectedIndex = ddlPortalPasswordRecovery.Items.IndexOf(ddlPortalPasswordRecovery.Items.FindByValue(ExistingPortalPasswordRecovery)); } //ddlPortalDefaultPage if (ddlPortalDefaultPage.Items.Count > 0) { string ExistingPortalDefaultPage = hsts[SageFrameSettingKeys.PortalDefaultPage].ToString(); ExistingPortalDefaultPage = ExistingPortalDefaultPage.StartsWith("sf/") ? ExistingPortalDefaultPage.Replace("sf/", "") : ExistingPortalDefaultPage; ddlPortalDefaultPage.SelectedIndex = ddlPortalDefaultPage.Items.IndexOf(ddlPortalDefaultPage.Items.FindByValue(ExistingPortalDefaultPage)); } //ddlPortalUserProfilePage if (ddlPortalUserProfilePage.Items.Count > 0) { string ExistingPortalUserProfilePage = hsts[SageFrameSettingKeys.PortalUserProfilePage].ToString(); ExistingPortalUserProfilePage = ExistingPortalUserProfilePage.StartsWith("sf/") ? ExistingPortalUserProfilePage.Replace("sf/", "") : ExistingPortalUserProfilePage; ddlPortalUserProfilePage.SelectedIndex = ddlPortalUserProfilePage.Items.IndexOf(ddlPortalUserProfilePage.Items.FindByValue(ExistingPortalUserProfilePage)); } if (ddlDefaultLanguage.Items.Count > 0) { string ExistingDefaultLanguage = hsts[SageFrameSettingKeys.PortalDefaultLanguage].ToString(); ddlDefaultLanguage.SelectedIndex = ddlDefaultLanguage.Items.IndexOf(ddlDefaultLanguage.Items.FindByValue(ExistingDefaultLanguage)); BindddlTimeZone(ddlDefaultLanguage.SelectedValue.ToString()); } if (ddlPortalTimeZone.Items.Count > 0) { string ExistingPortalTimeZone = hsts[SageFrameSettingKeys.PortalTimeZone].ToString(); ddlPortalTimeZone.SelectedIndex = ddlPortalTimeZone.Items.IndexOf(ddlPortalTimeZone.Items.FindByValue(ExistingPortalTimeZone)); } ///Superuser settings SageFrame.Version.SageFrameVersion appVersion = new SageFrame.Version.SageFrameVersion(); lblVVersion.Text = appVersion.FormatVersion(appVersion.Version, true); SageFrame.Application.Application app = new SageFrame.Application.Application(); lblVProduct.Text = app.Description; lblVDataProvider.Text = app.DataProvider; lblVDotNetFrameWork.Text = app.NETFrameworkIISVersion.ToString(); lblVASPDotNetIdentiy.Text = System.Security.Principal.WindowsIdentity.GetCurrent().Name; lblVServerName.Text = app.DNSName; lblVIpAddress.Text = app.ServerIPAddress; lblVPermissions.Text = Framework.SecurityPolicy.Permissions; lblVRelativePath.Text = app.ApplicationPath; lblVPhysicalPath.Text = app.ApplicationMapPath; lblVServerTime.Text = DateTime.Now.ToString(); lblVGUID.Text = hsts[SageFrameSettingKeys.GUID].ToString(); BindSitePortal(); if (ddlHostPortal.Items.Count > 0) { ddlHostPortal.SelectedIndex = ddlHostPortal.Items.IndexOf(ddlHostPortal.Items.FindByValue(hsts[SageFrameSettingKeys.SuperUserPortalId].ToString())); } txtHostTitle.Text = hsts[SageFrameSettingKeys.SuperUserTitle].ToString(); txtHostUrl.Text = hsts[SageFrameSettingKeys.SuperUserURL].ToString(); txtHostEmail.Text = hsts[SageFrameSettingKeys.SuperUserEmail].ToString(); //Apprence chkCopyright.Checked = bool.Parse(hsts[SageFrameSettingKeys.SuperUserCopyright].ToString()); chkUseCustomErrorMessages.Checked = bool.Parse(hsts[SageFrameSettingKeys.UseCustomErrorMessages].ToString()); //SMTP txtSMTPServerAndPort.Text = hsts[SageFrameSettingKeys.SMTPServer].ToString(); BindSMTPAuthntication(); if (rblSMTPAuthentication.Items.Count > 0) { string ExistsSMTPAuth = hsts[SageFrameSettingKeys.SMTPAuthentication].ToString(); if (!string.IsNullOrEmpty(ExistsSMTPAuth)) { rblSMTPAuthentication.SelectedIndex = rblSMTPAuthentication.Items.IndexOf(rblSMTPAuthentication.Items.FindByValue(ExistsSMTPAuth)); } } chkSMTPEnableSSL.Checked = bool.Parse(hsts[SageFrameSettingKeys.SMTPEnableSSL].ToString()); txtSMTPUserName.Text = hsts[SageFrameSettingKeys.SMTPUsername].ToString(); string ExistsSMTPPassword = hsts[SageFrameSettingKeys.SMTPPassword].ToString(); if (!string.IsNullOrEmpty(ExistsSMTPPassword)) { txtSMTPPassword.Attributes.Add("value", ExistsSMTPPassword); } ShowHideSMTPCredentials(); //Others txtFileExtensions.Text = hsts[SageFrameSettingKeys.FileExtensions].ToString(); txtHelpUrl.Text = hsts[SageFrameSettingKeys.HelpURL].ToString(); txtPageExtension.Text = hsts[SageFrameSettingKeys.SettingPageExtension].ToString(); string ms = hsts[SageFrameSettingKeys.MessageTemplate].ToString(); ScriptManager.RegisterClientScriptBlock(this, this.GetType(), "SageMsgTemplate", " var MsgTemplate='" + ms + "';", true); }
private void RestartApplication() { SageFrame.Application.Application app = new SageFrame.Application.Application(); File.SetLastWriteTime((app.ApplicationMapPath + "\\web.config"), System.DateTime.Now); SecurityPolicy objSecurity = new SecurityPolicy(); HttpCookie authenticateCookie = new HttpCookie(objSecurity.FormsCookieName(GetPortalID)); authenticateCookie.Expires = DateTime.Now.AddYears(-1); Response.Cookies.Add(authenticateCookie); System.Web.Security.FormsAuthentication.SignOut(); SetUserRoles(string.Empty); string redUrl = string.Empty; SageFrameConfig sfConfig = new SageFrameConfig(); if (!IsParent) { redUrl = GetParentURL + "/portal/" + GetPortalSEOName + "/" + sfConfig.GetSettingValueByIndividualKey(SageFrameSettingKeys.PortalDefaultPage) + SageFrameSettingKeys.PageExtension; } else { redUrl = GetParentURL + "/" + sfConfig.GetSettingValueByIndividualKey(SageFrameSettingKeys.PortalDefaultPage) + SageFrameSettingKeys.PageExtension; } Response.Redirect(redUrl); }
private void BindLabelText() { SageFrame.Application.Application app = new SageFrame.Application.Application(); Label lblTitle = wizInstallWizard.FindControl("HeaderContainer").FindControl("lblTitle") as Label; Label lblVersion = wizInstallWizard.FindControl("HeaderContainer").FindControl("lblVersion") as Label; if (lblTitle != null) { lblTitle.Text = "Installation"; } if (lblVersion != null) { lblVersion.Text = app.Version.ToString();//String.Format(" Version {0}", app.Version); } lblStepfirstTitle.Text = string.Format("SageFrame Upgrade Wizard - Version {0}", app.FormatVersion(app.Version, true));//app.Version.ToString(3) //"<p>SageFrame version {0} is already Installed. Click the Next button to upgrade to the new version.</p>" lblStepfirstDetail.Text = "Welcome to the SageFrame Installation Wizard. This wizard will guide you through the installation of your SageFrame Application. You may navigate through the Wizard using the Next and Previous buttons. On some pages you will see a third button 'Test ...'. This button will allow you to test the configuration before you continue, to see the effects of changes. The first step is to select the installation method to use, you would like to use for the Installation."; lblChooseInstall.Text = "Select Installation Method:"; lblFilePermissionsTitle.Text = "Checking File Permissions"; lblFilePermissionsDetail.Text = "SageFrame has extensive file upload capabilities for content, modules, and skins. These features require custom security settings so that the application is able to create and remove files in your website. This page checks the current file permissions to ensure that these features will work correctly. Note: The test checks the root folder of your application. In most cases this is good enough, as child folders usually inherit their file and folder permissions from their parent. However, occasionally this test will pass, but there will be a more restrictive permission set on one of the descendant files/folders."; lblPermissions.Text = "File Permissions Summary:"; BindPermissions(false); lblConnectionStringTitle.Text = "Configure Database Connection"; lblConnectionStringDetail.Text = "You can configure the database settings used by SageFrame on this page. If you are installing SageFrame in a 'Hosting Account' your hosting provider should have provided you with the information. In most situations, you should choose the Database option."; lblChooseDatabase.Text = "Select Database:"; lblServer.Text = "Server:"; lblServerHelp.Text = "Enter the Name or IP Address of the computer where the Database is located."; lblDataBase.Text = "Database:"; lblDatabaseHelp.Text = "Enter the Database name"; lblIntegrated.Text = "Integrated Security:"; lblIntegratedHelp.Text = "Check this if you are using SQL Server's Integrated Security, which means you will be using your Windows account to access SQL Server. If you are using SQL Server Express then you will most likely need to check this option. If you have been given a UserId/Password to access your Database, leave this unchecked, and provide the UserId/Password combination."; lblUserID.Text = "User ID:"; lblUserHelp.Text = "Enter the UserID for the Database"; lblPassword.Text = "Password:"******"Enter the Password for the Database"; lblOwner.Text = "Run as db Owner:"; lblOwnerHelp.Text = "Check this if you are running the database as Database Owner - if left unchecked you will be running as the User ID specified"; lblStepDatabaseTitle.Text = "Run Database Installation Scripts"; lblStepDatabaseDetail.Text = "The installation of the database scripts should have started when this page loaded. The Next button will be disabled until the Installation of the Scripts is complete."; lblStepDataBaseFeedBackTitle.Text = "Run Database Installation Scripts"; lblStepDataBaseFeedBackDetail.Text = "The installation of the database scripts should have started when this page loaded. The Next button will be disabled until the Installation of the Scripts is complete."; lblCompleteTitle.Text = "Congratulations"; lblCompleteDetail.Text = "Congratulations, you have successfully installed SageFrame."; lblDataBaseWarning.Text = "The Auto option has been disabled as the SageFrame Application cannot connect to a valid SQL Server database. You can continue to use either of the other Wizard options 'Custom' and configure the Database settings at the appropriate Wizard step."; lblHostWarning.Text = "Your Host Name contains illegal characters (only A-Z, 0-9, - and . are allowed). You should modify the host name used."; }
private void BindPermissions(bool test) { ///Test Strategy 1 try { SageFrame.Application.Application app = new SageFrame.Application.Application(); PermissionsValid = true; lstPermissions.Items.Clear(); //FolderCreate ListItem permissionItem = new ListItem(); if (test) permissionItem.Selected = VerifyFolderCreate(); permissionItem.Enabled = false; permissionItem.Text = "Create Folder"; lstPermissions.Items.Add(permissionItem); //FileCreate permissionItem = new ListItem(); if (test) permissionItem.Selected = VerifyFileCreate(); permissionItem.Enabled = false; permissionItem.Text = "Create File"; lstPermissions.Items.Add(permissionItem); //FileDelete permissionItem = new ListItem(); if (test) permissionItem.Selected = VerifyFileDelete(); permissionItem.Enabled = false; permissionItem.Text = "Delete File"; lstPermissions.Items.Add(permissionItem); //FolderDelete permissionItem = new ListItem(); if (test) permissionItem.Selected = VerifyFolderDelete(); permissionItem.Enabled = false; permissionItem.Text = "Delete Folder"; lstPermissions.Items.Add(permissionItem); } catch (Exception ex) { throw ex; } if (!test) { string strPermissionsError ="<br> Your site failed the permissions check. Using Windows Explorer, browse to the root folder of the website ( {0} ). Right-click the folder and select Sharing and Security from the popup menu. Select the Security tab. Add the appropriate User Account and set the Permissions.<h3>If using Windows 2000 - IIS5</h3>The {Server}\\ASPNET User Account must have Read, Write, and Change Control of the virtual root of your website.<h3>If using Windows 2003, Windows Vista or Windows Server 2008 and IIS6 or IIS7</h3>The NT AUTHORITY\\NETWORK SERVICE User Account must have Read, Write, and Change Control of the virtual root of your Website.<h3>If using Windows 7 or Windows Server 2008 R2 and IIS7.5</h3>The IIS AppPool\\DefaultAppPool User Account must have Read, Write, and Change Control of the virtual root of your Website."; lblPermissionsError.Text = strPermissionsError.Replace("{0}", Request.ApplicationPath); lblPermissionsError.CssClass = "cssClasssNormalRed"; } else { lblPermissionsError.Text = "Your site passed all the permissions check."; lblPermissionsError.CssClass = "cssClasssNormalGreen"; PermissionsValid = true; } lblPermissionsError.Visible = true; }
private void BindData() { SageFrameConfig pagebase = new SageFrameConfig(); txtPortalTitle.Text = pagebase.GetSettingsByKey(SageFrameSettingKeys.PageTitle); txtDescription.Text = pagebase.GetSettingsByKey(SageFrameSettingKeys.MetaDescription); txtKeyWords.Text = pagebase.GetSettingsByKey(SageFrameSettingKeys.MetaKeywords); txtCopyright.Text = Server.HtmlDecode(pagebase.GetSettingsByKey(SageFrameSettingKeys.PortalCopyright)); txtLogoTemplate.Text = Server.HtmlDecode(pagebase.GetSettingsByKey(SageFrameSettingKeys.PortalLogoTemplate)); txtPortalGoogleAdSenseID.Text = pagebase.GetSettingsByKey(SageFrameSettingKeys.PortalGoogleAdSenseID); chkOptCss.Checked = bool.Parse(pagebase.GetSettingsByKey(SageFrameSettingKeys.OptimizeCss)); chkOptJs.Checked = bool.Parse(pagebase.GetSettingsByKey(SageFrameSettingKeys.OptimizeJs)); chkLiveFeeds.Checked = bool.Parse(pagebase.GetSettingsByKey(SageFrameSettingKeys.EnableLiveFeeds)); txtSiteAdminEmailAddress.Text = pagebase.GetSettingsByKey(SageFrameSettingKeys.SiteAdminEmailAddress); chkShowSidebar.Checked = pagebase.GetSettingBollByKey(SageFrameSettingKeys.ShowSideBar); //scheduler txtScheduler.Checked = pagebase.GetSettingBollByKey(SageFrameSettingKeys.Scheduler); //added by Bj for OpenID chkOpenID.Checked = bool.Parse(pagebase.GetSettingsByKey(SageFrameSettingKeys.ShowOpenID)); if (chkOpenID.Checked == true) { tblOpenIDInfo.Visible = true; } else { tblOpenIDInfo.Visible = false; } txtFacebookConsumerKey.Text = pagebase.GetSettingsByKey(SageFrameSettingKeys.FaceBookConsumerKey); txtLinkedInConsumerKey.Text = pagebase.GetSettingsByKey(SageFrameSettingKeys.LinkedInConsumerKey); txtLinkedInSecretKey.Text = pagebase.GetSettingsByKey(SageFrameSettingKeys.LinkedInSecretKey); txtFaceBookSecretKey.Text = pagebase.GetSettingsByKey(SageFrameSettingKeys.FaceBookSecretkey); if (rblPortalShowProfileLink.Items.Count > 0) { string ExistingPortalShowProfileLink = pagebase.GetSettingsByKey(SageFrameSettingKeys.PortalShowProfileLink); rblPortalShowProfileLink.SelectedIndex = rblPortalShowProfileLink.Items.IndexOf(rblPortalShowProfileLink.Items.FindByValue(ExistingPortalShowProfileLink)); } //RemeberMe setting chkEnableRememberme.Checked = pagebase.GetSettingBollByKey(SageFrameSettingKeys.RememberCheckbox); if (rblUserRegistration.Items.Count > 0) { string ExistingData = pagebase.GetSettingsByKey(SageFrameSettingKeys.PortalUserRegistration); rblUserRegistration.SelectedIndex = rblUserRegistration.Items.IndexOf(rblUserRegistration.Items.FindByValue(ExistingData)); } if (ddlLoginPage.Items.Count > 0) { string ExistingPortalLoginpage = pagebase.GetSettingsByKey(SageFrameSettingKeys.PortalLoginpage); ExistingPortalLoginpage = ExistingPortalLoginpage.StartsWith("sf/") ? ExistingPortalLoginpage.Replace("sf/", "") : ExistingPortalLoginpage; ddlLoginPage.SelectedIndex = ddlLoginPage.Items.IndexOf(ddlLoginPage.Items.FindByValue(ExistingPortalLoginpage)); } if (ddlUserRegistrationPage.Items.Count > 0) { string ExistingPortalUserActivation = pagebase.GetSettingsByKey(SageFrameSettingKeys.PortalUserActivation); ExistingPortalUserActivation = ExistingPortalUserActivation.StartsWith("sf/") ? ExistingPortalUserActivation.Replace("sf/", "") : ExistingPortalUserActivation; ddlPortalUserActivation.SelectedIndex = ddlPortalUserActivation.Items.IndexOf(ddlPortalUserActivation.Items.FindByValue(ExistingPortalUserActivation)); } if (ddlUserRegistrationPage.Items.Count > 0) { string ExistingPortalRegistrationPage = pagebase.GetSettingsByKey(SageFrameSettingKeys.PortalRegistrationPage); ExistingPortalRegistrationPage = ExistingPortalRegistrationPage.StartsWith("sf/") ? ExistingPortalRegistrationPage.Replace("sf/", "") : ExistingPortalRegistrationPage; ddlUserRegistrationPage.SelectedIndex = ddlUserRegistrationPage.Items.IndexOf(ddlUserRegistrationPage.Items.FindByValue(ExistingPortalRegistrationPage)); } if (ddlPortalForgotPassword.Items.Count > 0) { string ExistingPortalForgotPassword = pagebase.GetSettingsByKey(SageFrameSettingKeys.PortalForgotPassword); ExistingPortalForgotPassword = ExistingPortalForgotPassword.StartsWith("sf/") ? ExistingPortalForgotPassword.Replace("sf/", "") : ExistingPortalForgotPassword; ddlPortalForgotPassword.SelectedIndex = ddlPortalForgotPassword.Items.IndexOf(ddlPortalForgotPassword.Items.FindByValue(ExistingPortalForgotPassword)); } //ddlPortalPageNotAccessible if (ddlPortalPageNotAccessible.Items.Count > 0) { string ExistingPortalPageNotAccessible = pagebase.GetSettingsByKey(SageFrameSettingKeys.PortalPageNotAccessible); ExistingPortalPageNotAccessible = ExistingPortalPageNotAccessible.StartsWith("sf/") ? ExistingPortalPageNotAccessible.Replace("sf/", "") : ExistingPortalPageNotAccessible; ddlPortalPageNotAccessible.SelectedIndex = ddlPortalPageNotAccessible.Items.IndexOf(ddlPortalPageNotAccessible.Items.FindByValue(ExistingPortalPageNotAccessible)); } //ddlPortalPageNotFound if (ddlPortalPageNotFound.Items.Count > 0) { string ExistingPortalPageNotFound = pagebase.GetSettingsByKey(SageFrameSettingKeys.PortalPageNotFound); ExistingPortalPageNotFound = ExistingPortalPageNotFound.StartsWith("sf/") ? ExistingPortalPageNotFound.Replace("sf/", "") : ExistingPortalPageNotFound; ddlPortalPageNotFound.SelectedIndex = ddlPortalPageNotFound.Items.IndexOf(ddlPortalPageNotFound.Items.FindByValue(ExistingPortalPageNotFound)); } //ddlPortalPasswordRecovery if (ddlPortalPasswordRecovery.Items.Count > 0) { string ExistingPortalPasswordRecovery = pagebase.GetSettingsByKey(SageFrameSettingKeys.PortalPasswordRecovery); ExistingPortalPasswordRecovery = ExistingPortalPasswordRecovery.StartsWith("sf/") ? ExistingPortalPasswordRecovery.Replace("sf/", "") : ExistingPortalPasswordRecovery; ddlPortalPasswordRecovery.SelectedIndex = ddlPortalPasswordRecovery.Items.IndexOf(ddlPortalPasswordRecovery.Items.FindByValue(ExistingPortalPasswordRecovery)); } //ddlPortalDefaultPage if (ddlPortalDefaultPage.Items.Count > 0) { string ExistingPortalDefaultPage = pagebase.GetSettingsByKey(SageFrameSettingKeys.PortalDefaultPage); ExistingPortalDefaultPage = ExistingPortalDefaultPage.StartsWith("sf/") ? ExistingPortalDefaultPage.Replace("sf/", "") : ExistingPortalDefaultPage; ddlPortalDefaultPage.SelectedIndex = ddlPortalDefaultPage.Items.IndexOf(ddlPortalDefaultPage.Items.FindByValue(ExistingPortalDefaultPage)); } //ddlPortalUserProfilePage if (ddlPortalUserProfilePage.Items.Count > 0) { string ExistingPortalUserProfilePage = pagebase.GetSettingsByKey(SageFrameSettingKeys.PortalUserProfilePage); ExistingPortalUserProfilePage = ExistingPortalUserProfilePage.StartsWith("sf/") ? ExistingPortalUserProfilePage.Replace("sf/", "") : ExistingPortalUserProfilePage; ddlPortalUserProfilePage.SelectedIndex = ddlPortalUserProfilePage.Items.IndexOf(ddlPortalUserProfilePage.Items.FindByValue(ExistingPortalUserProfilePage)); } if (ddlDefaultLanguage.Items.Count > 0) { string ExistingDefaultLanguage = pagebase.GetSettingsByKey(SageFrameSettingKeys.PortalDefaultLanguage); ddlDefaultLanguage.SelectedIndex = ddlDefaultLanguage.Items.IndexOf(ddlDefaultLanguage.Items.FindByValue(ExistingDefaultLanguage)); BindddlTimeZone(ddlDefaultLanguage.SelectedValue.ToString()); } if (ddlPortalTimeZone.Items.Count > 0) { string ExistingPortalTimeZone = pagebase.GetSettingsByKey(SageFrameSettingKeys.PortalTimeZone); ddlPortalTimeZone.SelectedIndex = ddlPortalTimeZone.Items.IndexOf(ddlPortalTimeZone.Items.FindByValue(ExistingPortalTimeZone)); } ///Superuser settings SageFrame.Application.Application app = new SageFrame.Application.Application(); lblVProduct.Text = app.Description; lblVVersion.Text = app.FormatVersion(app.Version, true); lblVDataProvider.Text = app.DataProvider; lblVDotNetFrameWork.Text = app.NETFrameworkIISVersion.ToString(); lblVASPDotNetIdentiy.Text = System.Security.Principal.WindowsIdentity.GetCurrent().Name; lblVServerName.Text = app.DNSName; lblVIpAddress.Text = app.ServerIPAddress; lblVPermissions.Text = Framework.SecurityPolicy.Permissions; lblVRelativePath.Text = app.ApplicationPath; lblVPhysicalPath.Text = app.ApplicationMapPath; lblVServerTime.Text = DateTime.Now.ToString(); lblVGUID.Text = pagebase.GetSettingsByKey(SageFrameSettingKeys.GUID); BindSitePortal(); if (ddlHostPortal.Items.Count > 0) { ddlHostPortal.SelectedIndex = ddlHostPortal.Items.IndexOf(ddlHostPortal.Items.FindByValue(pagebase.GetSettingsByKey(SageFrameSettingKeys.SuperUserPortalId))); } txtHostTitle.Text = pagebase.GetSettingsByKey(SageFrameSettingKeys.SuperUserTitle); txtHostUrl.Text = pagebase.GetSettingsByKey(SageFrameSettingKeys.SuperUserURL); txtHostEmail.Text = pagebase.GetSettingsByKey(SageFrameSettingKeys.SuperUserEmail); //Apprence chkCopyright.Checked = pagebase.GetSettingBollByKey(SageFrameSettingKeys.SuperUserCopyright); chkUseCustomErrorMessages.Checked = pagebase.GetSettingBollByKey(SageFrameSettingKeys.UseCustomErrorMessages); //SMTP txtSMTPServerAndPort.Text = pagebase.GetSettingsByKey(SageFrameSettingKeys.SMTPServer); BindSMTPAuthntication(); if (rblSMTPAuthentication.Items.Count > 0) { string ExistsSMTPAuth = pagebase.GetSettingsByKey(SageFrameSettingKeys.SMTPAuthentication); if (!string.IsNullOrEmpty(ExistsSMTPAuth)) { rblSMTPAuthentication.SelectedIndex = rblSMTPAuthentication.Items.IndexOf(rblSMTPAuthentication.Items.FindByValue(ExistsSMTPAuth)); } } chkSMTPEnableSSL.Checked = pagebase.GetSettingBollByKey(SageFrameSettingKeys.SMTPEnableSSL); txtSMTPUserName.Text = pagebase.GetSettingsByKey(SageFrameSettingKeys.SMTPUsername); string ExistsSMTPPassword = pagebase.GetSettingsByKey(SageFrameSettingKeys.SMTPPassword); if (!string.IsNullOrEmpty(ExistsSMTPPassword)) { txtSMTPPassword.Attributes.Add("value", ExistsSMTPPassword); } ShowHideSMTPCredentials(); //Others txtFileExtensions.Text = pagebase.GetSettingsByKey(SageFrameSettingKeys.FileExtensions); txtHelpUrl.Text = pagebase.GetSettingsByKey(SageFrameSettingKeys.HelpURL); txtPageExtension.Text = pagebase.GetSettingsByKey(SageFrameSettingKeys.SettingPageExtension); SageFrameConfig sfConfig = new SageFrameConfig(); string ms = sfConfig.GetSettingsByKey(SageFrameSettingKeys.MessageTemplate); ScriptManager.RegisterClientScriptBlock(this, this.GetType(), "SageMsgTemplate", " var MsgTemplate='" + ms + "';", true); }