webdav portal auth via ad
This commit is contained in:
parent
05d9fddb5d
commit
7dd090820b
56 changed files with 927 additions and 281 deletions
|
@ -0,0 +1,17 @@
|
|||
using System.Configuration;
|
||||
using WebsitePanel.WebDavPortal.WebConfigSections;
|
||||
|
||||
namespace WebsitePanel.WebDav.Core.Config.Entities
|
||||
{
|
||||
public abstract class AbstractConfigCollection
|
||||
{
|
||||
protected WebDavExplorerConfigurationSettingsSection ConfigSection;
|
||||
|
||||
protected AbstractConfigCollection()
|
||||
{
|
||||
ConfigSection =
|
||||
(WebDavExplorerConfigurationSettingsSection)
|
||||
ConfigurationManager.GetSection(WebDavExplorerConfigurationSettingsSection.SectionName);
|
||||
}
|
||||
}
|
||||
}
|
|
@ -0,0 +1,19 @@
|
|||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
|
||||
namespace WebsitePanel.WebDav.Core.Config.Entities
|
||||
{
|
||||
public class ElementsRendering : AbstractConfigCollection
|
||||
{
|
||||
public int DefaultCount { get; private set; }
|
||||
public int AddElementsCount { get; private set; }
|
||||
public List<string> ElementsToIgnore { get; private set; }
|
||||
|
||||
public ElementsRendering()
|
||||
{
|
||||
DefaultCount = ConfigSection.ElementsRendering.DefaultCount;
|
||||
AddElementsCount = ConfigSection.ElementsRendering.AddElementsCount;
|
||||
ElementsToIgnore = ConfigSection.ElementsRendering.ElementsToIgnore.Split(',').ToList();
|
||||
}
|
||||
}
|
||||
}
|
|
@ -0,0 +1,60 @@
|
|||
using System.Collections;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using WebsitePanel.WebDav.Core.Config.WebConfigSections;
|
||||
|
||||
namespace WebsitePanel.WebDav.Core.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; }
|
||||
}
|
||||
}
|
||||
}
|
|
@ -0,0 +1,21 @@
|
|||
using System.Globalization;
|
||||
|
||||
namespace WebsitePanel.WebDav.Core.Config.Entities
|
||||
{
|
||||
public class HttpErrorsCollection
|
||||
{
|
||||
public string this[int statusCode]
|
||||
{
|
||||
get
|
||||
{
|
||||
var message = Resources.HttpErrors.ResourceManager.GetString("_" + statusCode.ToString(CultureInfo.InvariantCulture));
|
||||
return message ?? Default;
|
||||
}
|
||||
}
|
||||
|
||||
public string Default
|
||||
{
|
||||
get { return Resources.HttpErrors.Default; }
|
||||
}
|
||||
}
|
||||
}
|
|
@ -0,0 +1,42 @@
|
|||
using System.Collections;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using WebsitePanel.WebDavPortal.WebConfigSections;
|
||||
|
||||
namespace WebsitePanel.WebDav.Core.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);
|
||||
}
|
||||
}
|
||||
}
|
|
@ -0,0 +1,54 @@
|
|||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using WebsitePanel.WebDavPortal.WebConfigSections;
|
||||
|
||||
namespace WebsitePanel.WebDav.Core.Config.Entities
|
||||
{
|
||||
public class SessionKeysCollection : AbstractConfigCollection
|
||||
{
|
||||
private readonly IEnumerable<SessionKeysElement> _sessionKeys;
|
||||
|
||||
public SessionKeysCollection()
|
||||
{
|
||||
_sessionKeys = ConfigSection.SessionKeys.Cast<SessionKeysElement>();
|
||||
}
|
||||
|
||||
public string AuthTicket
|
||||
{
|
||||
get
|
||||
{
|
||||
SessionKeysElement sessionKey =
|
||||
_sessionKeys.FirstOrDefault(x => x.Key == SessionKeysElement.AuthTicketKey);
|
||||
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;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
|
@ -0,0 +1,14 @@
|
|||
namespace WebsitePanel.WebDav.Core.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;
|
||||
}
|
||||
}
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue