Released windows auth, connect to ES.Services.

This commit is contained in:
ITRANSITION\e.revyakin 2014-12-03 11:43:26 +03:00
parent 2569e55609
commit d29c347ff4
294 changed files with 329583 additions and 2315 deletions

View file

@ -0,0 +1,17 @@
using System.Configuration;
using WebsitePanel.WebDavPortal.WebConfigSections;
namespace WebsitePanel.WebDavPortal.Config.Entities
{
public abstract class AbstractConfigCollection
{
protected WebDavExplorerConfigurationSettingsSection ConfigSection;
protected AbstractConfigCollection()
{
ConfigSection =
(WebDavExplorerConfigurationSettingsSection)
ConfigurationManager.GetSection(WebDavExplorerConfigurationSettingsSection.SectionName);
}
}
}

View file

@ -0,0 +1,39 @@
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;
}
}
}
}

View file

@ -0,0 +1,14 @@
namespace WebsitePanel.WebDavPortal.Config.Entities
{
public class ElementsRendering : AbstractConfigCollection
{
public int DefaultCount { get; private set; }
public int AddElementsCount { get; private set; }
public ElementsRendering()
{
DefaultCount = ConfigSection.ElementsRendering.DefaultCount;
AddElementsCount = ConfigSection.ElementsRendering.AddElementsCount;
}
}
}

View file

@ -0,0 +1,60 @@
using System.Collections;
using System.Collections.Generic;
using System.Linq;
using WebsitePanel.WebDavPortal.WebConfigSections;
namespace WebsitePanel.WebDavPortal.Config.Entities
{
public class FileIconsDictionary : AbstractConfigCollection, IReadOnlyDictionary<string, string>
{
private readonly IDictionary<string, string> _fileIcons;
public FileIconsDictionary()
{
DefaultPath = ConfigSection.FileIcons.DefaultPath;
_fileIcons = ConfigSection.FileIcons.Cast<FileIconsElement>().ToDictionary(x => x.Extension, y => y.Path);
}
public string DefaultPath { get; private set; }
public IEnumerator<KeyValuePair<string, string>> GetEnumerator()
{
return _fileIcons.GetEnumerator();
}
IEnumerator IEnumerable.GetEnumerator()
{
return GetEnumerator();
}
public int Count
{
get { return _fileIcons.Count; }
}
public bool ContainsKey(string extension)
{
return _fileIcons.ContainsKey(extension);
}
public bool TryGetValue(string extension, out string path)
{
return _fileIcons.TryGetValue(extension, out path);
}
public string this[string extension]
{
get { return ContainsKey(extension) ? _fileIcons[extension] : DefaultPath; }
}
public IEnumerable<string> Keys
{
get { return _fileIcons.Keys; }
}
public IEnumerable<string> Values
{
get { return _fileIcons.Values; }
}
}
}

View file

@ -0,0 +1,22 @@
using System.Globalization;
using Resources.Resource;
namespace WebsitePanel.WebDavPortal.Config.Entities
{
public class HttpErrorsCollection
{
public string this[int statusCode]
{
get
{
var message = errors.ResourceManager.GetString("_" + statusCode.ToString(CultureInfo.InvariantCulture));
return message ?? Default;
}
}
public string Default
{
get { return errors.Default; }
}
}
}

View file

@ -0,0 +1,42 @@
using System.Collections;
using System.Collections.Generic;
using System.Linq;
using WebsitePanel.WebDavPortal.WebConfigSections;
namespace WebsitePanel.WebDavPortal.Config.Entities
{
public class OfficeOnlineCollection : AbstractConfigCollection, IReadOnlyCollection<string>
{
private readonly IList<string> _officeExtensions;
public OfficeOnlineCollection()
{
IsEnabled = ConfigSection.OfficeOnline.IsEnabled;
Url = ConfigSection.OfficeOnline.Url;
_officeExtensions = ConfigSection.OfficeOnline.Cast<OfficeOnlineElement>().Select(x => x.Extension).ToList();
}
public bool IsEnabled { get; private set; }
public string Url { get; private set; }
public IEnumerator<string> GetEnumerator()
{
return _officeExtensions.GetEnumerator();
}
IEnumerator IEnumerable.GetEnumerator()
{
return GetEnumerator();
}
public int Count
{
get { return _officeExtensions.Count; }
}
public bool Contains(string extension)
{
return _officeExtensions.Contains(extension);
}
}
}

View file

@ -0,0 +1,16 @@
namespace WebsitePanel.WebDavPortal.Config.Entities
{
public class Rfc2898CryptographyParameters : AbstractConfigCollection
{
public string PasswordHash { get; private set; }
public string SaltKey { get; private set; }
public string VIKey { get; private set; }
public Rfc2898CryptographyParameters()
{
PasswordHash = ConfigSection.Rfc2898Cryptography.PasswordHash;
SaltKey = ConfigSection.Rfc2898Cryptography.SaltKey;
VIKey = ConfigSection.Rfc2898Cryptography.VIKey;
}
}
}

View file

@ -0,0 +1,55 @@
using System.Collections.Generic;
using System.Configuration;
using System.Linq;
using WebsitePanel.WebDavPortal.WebConfigSections;
namespace WebsitePanel.WebDavPortal.Config.Entities
{
public class SessionKeysCollection : AbstractConfigCollection
{
private readonly IEnumerable<SessionKeysElement> _sessionKeys;
public SessionKeysCollection()
{
_sessionKeys = ConfigSection.SessionKeys.Cast<SessionKeysElement>();
}
public string AccountInfo
{
get
{
SessionKeysElement sessionKey =
_sessionKeys.FirstOrDefault(x => x.Key == SessionKeysElement.AccountInfoKey);
return sessionKey != null ? sessionKey.Value : null;
}
}
public string WebDavManager
{
get
{
SessionKeysElement sessionKey =
_sessionKeys.FirstOrDefault(x => x.Key == SessionKeysElement.WebDavManagerKey);
return sessionKey != null ? sessionKey.Value : null;
}
}
public string ResourseRenderCount
{
get
{
SessionKeysElement sessionKey = _sessionKeys.FirstOrDefault(x => x.Key == SessionKeysElement.ResourseRenderCountKey);
return sessionKey != null ? sessionKey.Value : null;
}
}
public string ItemId
{
get
{
SessionKeysElement sessionKey = _sessionKeys.FirstOrDefault(x => x.Key == SessionKeysElement.ItemIdSessionKey);
return sessionKey != null ? sessionKey.Value : null;
}
}
}
}

View file

@ -0,0 +1,14 @@
namespace WebsitePanel.WebDavPortal.Config.Entities
{
public class WebsitePanelConstantUserParameters : AbstractConfigCollection
{
public string Login { get; private set; }
public string Password { get; private set; }
public WebsitePanelConstantUserParameters()
{
Login = ConfigSection.WebsitePanelConstantUser.Login;
Password = ConfigSection.WebsitePanelConstantUser.Password;
}
}
}