Web.config section fix
This commit is contained in:
parent
f5b41b5c85
commit
58b6b89ab0
10 changed files with 3 additions and 104 deletions
|
@ -3,7 +3,7 @@
|
||||||
<!-- Display Settings -->
|
<!-- Display Settings -->
|
||||||
<PortalName>WebsitePanel</PortalName>
|
<PortalName>WebsitePanel</PortalName>
|
||||||
<!-- Enterprise Server -->
|
<!-- Enterprise Server -->
|
||||||
<EnterpriseServer>http://localhost:9002</EnterpriseServer>
|
<EnterpriseServer>http://127.0.0.1:9555</EnterpriseServer>
|
||||||
<!-- General Settings -->
|
<!-- General Settings -->
|
||||||
<CultureCookieName>UserCulture</CultureCookieName>
|
<CultureCookieName>UserCulture</CultureCookieName>
|
||||||
<ThemeCookieName>UserTheme</ThemeCookieName>
|
<ThemeCookieName>UserTheme</ThemeCookieName>
|
||||||
|
|
|
@ -1,39 +0,0 @@
|
||||||
using System.Collections.Generic;
|
|
||||||
using System.Configuration;
|
|
||||||
using System.Linq;
|
|
||||||
using WebsitePanel.WebDavPortal.WebConfigSections;
|
|
||||||
|
|
||||||
namespace WebsitePanel.WebDavPortal.Config.Entities
|
|
||||||
{
|
|
||||||
public class ConnectionStringsCollection : AbstractConfigCollection
|
|
||||||
{
|
|
||||||
private readonly IEnumerable<AppConnectionStringsElement> _appConnectionStringsElements;
|
|
||||||
|
|
||||||
public ConnectionStringsCollection()
|
|
||||||
{
|
|
||||||
_appConnectionStringsElements = ConfigSection.ConnectionStrings.Cast<AppConnectionStringsElement>();
|
|
||||||
}
|
|
||||||
|
|
||||||
public string WebDavServer
|
|
||||||
{
|
|
||||||
get
|
|
||||||
{
|
|
||||||
AppConnectionStringsElement connectionStr =
|
|
||||||
_appConnectionStringsElements.FirstOrDefault(
|
|
||||||
x => x.Key == AppConnectionStringsElement.WebdavConnectionStringKey);
|
|
||||||
return connectionStr != null ? connectionStr.ConnectionString : null;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
public string LdapServer
|
|
||||||
{
|
|
||||||
get
|
|
||||||
{
|
|
||||||
AppConnectionStringsElement connectionStr =
|
|
||||||
_appConnectionStringsElements.FirstOrDefault(
|
|
||||||
x => x.Key == AppConnectionStringsElement.LdapConnectionStringKey);
|
|
||||||
return connectionStr != null ? connectionStr.ConnectionString : null;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
|
@ -8,7 +8,6 @@ namespace WebsitePanel.WebDavPortal.Config
|
||||||
string ApplicationName { get; }
|
string ApplicationName { get; }
|
||||||
ElementsRendering ElementsRendering { get; }
|
ElementsRendering ElementsRendering { get; }
|
||||||
WebsitePanelConstantUserParameters WebsitePanelConstantUserParameters { get; }
|
WebsitePanelConstantUserParameters WebsitePanelConstantUserParameters { get; }
|
||||||
ConnectionStringsCollection ConnectionStrings { get; }
|
|
||||||
SessionKeysCollection SessionKeys { get; }
|
SessionKeysCollection SessionKeys { get; }
|
||||||
FileIconsDictionary FileIcons { get; }
|
FileIconsDictionary FileIcons { get; }
|
||||||
HttpErrorsCollection HttpErrors { get; }
|
HttpErrorsCollection HttpErrors { get; }
|
||||||
|
|
|
@ -14,7 +14,6 @@ namespace WebsitePanel.WebDavPortal.Config
|
||||||
_configSection = ((WebDavExplorerConfigurationSettingsSection) ConfigurationManager.GetSection(WebDavExplorerConfigurationSettingsSection.SectionName));
|
_configSection = ((WebDavExplorerConfigurationSettingsSection) ConfigurationManager.GetSection(WebDavExplorerConfigurationSettingsSection.SectionName));
|
||||||
WebsitePanelConstantUserParameters = new WebsitePanelConstantUserParameters();
|
WebsitePanelConstantUserParameters = new WebsitePanelConstantUserParameters();
|
||||||
ElementsRendering = new ElementsRendering();
|
ElementsRendering = new ElementsRendering();
|
||||||
ConnectionStrings = new ConnectionStringsCollection();
|
|
||||||
SessionKeys = new SessionKeysCollection();
|
SessionKeys = new SessionKeysCollection();
|
||||||
FileIcons = new FileIconsDictionary();
|
FileIcons = new FileIconsDictionary();
|
||||||
HttpErrors = new HttpErrorsCollection();
|
HttpErrors = new HttpErrorsCollection();
|
||||||
|
@ -38,7 +37,6 @@ namespace WebsitePanel.WebDavPortal.Config
|
||||||
|
|
||||||
public ElementsRendering ElementsRendering { get; private set; }
|
public ElementsRendering ElementsRendering { get; private set; }
|
||||||
public WebsitePanelConstantUserParameters WebsitePanelConstantUserParameters { get; private set; }
|
public WebsitePanelConstantUserParameters WebsitePanelConstantUserParameters { get; private set; }
|
||||||
public ConnectionStringsCollection ConnectionStrings { get; private set; }
|
|
||||||
public SessionKeysCollection SessionKeys { get; private set; }
|
public SessionKeysCollection SessionKeys { get; private set; }
|
||||||
public FileIconsDictionary FileIcons { get; private set; }
|
public FileIconsDictionary FileIcons { get; private set; }
|
||||||
public HttpErrorsCollection HttpErrors { get; private set; }
|
public HttpErrorsCollection HttpErrors { get; private set; }
|
||||||
|
|
|
@ -68,7 +68,7 @@ namespace WebsitePanel.WebDavPortal.Controllers
|
||||||
private void AutheticationToServicesUsingWebsitePanelUser()
|
private void AutheticationToServicesUsingWebsitePanelUser()
|
||||||
{
|
{
|
||||||
var crypto = _kernel.Get<ICryptography>();
|
var crypto = _kernel.Get<ICryptography>();
|
||||||
var websitePanelLogin = crypto.Decrypt(WebDavAppConfigManager.Instance.WebsitePanelConstantUserParameters.Login);
|
var websitePanelLogin = WebDavAppConfigManager.Instance.WebsitePanelConstantUserParameters.Login;
|
||||||
var websitePanelPassword = crypto.Decrypt(WebDavAppConfigManager.Instance.WebsitePanelConstantUserParameters.Password);
|
var websitePanelPassword = crypto.Decrypt(WebDavAppConfigManager.Instance.WebsitePanelConstantUserParameters.Password);
|
||||||
var authTicket = new FormsAuthenticationTicket(1, websitePanelLogin, DateTime.Now, DateTime.Now.Add(FormsAuthentication.Timeout),
|
var authTicket = new FormsAuthenticationTicket(1, websitePanelLogin, DateTime.Now, DateTime.Now.Add(FormsAuthentication.Timeout),
|
||||||
FormsAuthentication.SlidingExpiration, websitePanelPassword + Environment.NewLine);
|
FormsAuthentication.SlidingExpiration, websitePanelPassword + Environment.NewLine);
|
||||||
|
|
|
@ -25,11 +25,7 @@
|
||||||
<!--<userDomain value=""/>-->
|
<!--<userDomain value=""/>-->
|
||||||
<applicationName value="WebDAV Explorer"/>
|
<applicationName value="WebDAV Explorer"/>
|
||||||
<elementsRendering defaultCount="20" addElementsCount="20"/>
|
<elementsRendering defaultCount="20" addElementsCount="20"/>
|
||||||
<websitePanelConstantUser login="8P5wdPdqguwaFOGe/Zn06idbqaeoa7ZhST/U0hFYrYA=" password="HtR7J8dtBhovYLigXNtVutxqpvaE48Z+FBIokWZlR/g=" />
|
<websitePanelConstantUser login="serveradmin" password="HtR7J8dtBhovYLigXNtVutxqpvaE48Z+FBIokWZlR/g=" />
|
||||||
<appConnectionStrings>
|
|
||||||
<add key="WebDavServerConnectionString" connectionString="http://webdavtest.com"/>
|
|
||||||
<add key="LdapServerConnectionString" connectionString="LDAP://itransition.corp"/>
|
|
||||||
</appConnectionStrings>
|
|
||||||
<sessionKeys>
|
<sessionKeys>
|
||||||
<add key="AccountInfoSessionKey" value="AccountInfo"/>
|
<add key="AccountInfoSessionKey" value="AccountInfo"/>
|
||||||
<add key="WebDavManagerSessionKey" value="WebDavManager"/>
|
<add key="WebDavManagerSessionKey" value="WebDavManager"/>
|
||||||
|
|
|
@ -1,27 +0,0 @@
|
||||||
using System.Configuration;
|
|
||||||
|
|
||||||
namespace WebsitePanel.WebDavPortal.WebConfigSections
|
|
||||||
{
|
|
||||||
public class AppConnectionStringsElement : ConfigurationElement
|
|
||||||
{
|
|
||||||
private const string ConnectionStringKey = "key";
|
|
||||||
private const string ConnectionStringValue = "connectionString";
|
|
||||||
|
|
||||||
public const string WebdavConnectionStringKey = "WebDavServerConnectionString";
|
|
||||||
public const string LdapConnectionStringKey = "LdapServerConnectionString";
|
|
||||||
|
|
||||||
[ConfigurationProperty(ConnectionStringKey, IsKey = true, IsRequired = true)]
|
|
||||||
public string Key
|
|
||||||
{
|
|
||||||
get { return (string) this[ConnectionStringKey]; }
|
|
||||||
set { this[ConnectionStringKey] = value; }
|
|
||||||
}
|
|
||||||
|
|
||||||
[ConfigurationProperty(ConnectionStringValue, IsKey = true, IsRequired = true)]
|
|
||||||
public string ConnectionString
|
|
||||||
{
|
|
||||||
get { return (string) this[ConnectionStringValue]; }
|
|
||||||
set { this[ConnectionStringValue] = value; }
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
|
@ -1,18 +0,0 @@
|
||||||
using System.Configuration;
|
|
||||||
|
|
||||||
namespace WebsitePanel.WebDavPortal.WebConfigSections
|
|
||||||
{
|
|
||||||
[ConfigurationCollection(typeof (AppConnectionStringsElement))]
|
|
||||||
public class AppConnectionStringsElementCollection : ConfigurationElementCollection
|
|
||||||
{
|
|
||||||
protected override ConfigurationElement CreateNewElement()
|
|
||||||
{
|
|
||||||
return new AppConnectionStringsElement();
|
|
||||||
}
|
|
||||||
|
|
||||||
protected override object GetElementKey(ConfigurationElement element)
|
|
||||||
{
|
|
||||||
return ((AppConnectionStringsElement) element).Key;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
|
@ -44,13 +44,6 @@ namespace WebsitePanel.WebDavPortal.WebConfigSections
|
||||||
set { this[ElementsRenderingKey] = value; }
|
set { this[ElementsRenderingKey] = value; }
|
||||||
}
|
}
|
||||||
|
|
||||||
[ConfigurationProperty(ConnectionStringsKey, IsDefaultCollection = false)]
|
|
||||||
public AppConnectionStringsElementCollection ConnectionStrings
|
|
||||||
{
|
|
||||||
get { return (AppConnectionStringsElementCollection) this[ConnectionStringsKey]; }
|
|
||||||
set { this[ConnectionStringsKey] = value; }
|
|
||||||
}
|
|
||||||
|
|
||||||
[ConfigurationProperty(SessionKeysKey, IsDefaultCollection = false)]
|
[ConfigurationProperty(SessionKeysKey, IsDefaultCollection = false)]
|
||||||
public SessionKeysElementCollection SessionKeys
|
public SessionKeysElementCollection SessionKeys
|
||||||
{
|
{
|
||||||
|
|
|
@ -143,7 +143,6 @@
|
||||||
<Compile Include="App_Start\FilterConfig.cs" />
|
<Compile Include="App_Start\FilterConfig.cs" />
|
||||||
<Compile Include="App_Start\RouteConfig.cs" />
|
<Compile Include="App_Start\RouteConfig.cs" />
|
||||||
<Compile Include="Config\Entities\AbstractConfigCollection.cs" />
|
<Compile Include="Config\Entities\AbstractConfigCollection.cs" />
|
||||||
<Compile Include="Config\Entities\ConnectionStringsCollection.cs" />
|
|
||||||
<Compile Include="Config\Entities\ElementsRendering.cs" />
|
<Compile Include="Config\Entities\ElementsRendering.cs" />
|
||||||
<Compile Include="Config\Entities\FileIconsDictionary.cs" />
|
<Compile Include="Config\Entities\FileIconsDictionary.cs" />
|
||||||
<Compile Include="Config\Entities\HttpErrorsCollection.cs" />
|
<Compile Include="Config\Entities\HttpErrorsCollection.cs" />
|
||||||
|
@ -180,8 +179,6 @@
|
||||||
<Compile Include="Models\OfficeOnlineModel.cs" />
|
<Compile Include="Models\OfficeOnlineModel.cs" />
|
||||||
<Compile Include="Models\WebDavManager.cs" />
|
<Compile Include="Models\WebDavManager.cs" />
|
||||||
<Compile Include="Properties\AssemblyInfo.cs" />
|
<Compile Include="Properties\AssemblyInfo.cs" />
|
||||||
<Compile Include="WebConfigSections\AppConnectionStringsElement.cs" />
|
|
||||||
<Compile Include="WebConfigSections\AppConnectionStringsElementCollection.cs" />
|
|
||||||
<Compile Include="WebConfigSections\ApplicationNameElement.cs" />
|
<Compile Include="WebConfigSections\ApplicationNameElement.cs" />
|
||||||
<Compile Include="WebConfigSections\ElementsRenderingElement.cs" />
|
<Compile Include="WebConfigSections\ElementsRenderingElement.cs" />
|
||||||
<Compile Include="WebConfigSections\FileIconsElement.cs" />
|
<Compile Include="WebConfigSections\FileIconsElement.cs" />
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue