webdav portal auth via ad
This commit is contained in:
parent
05d9fddb5d
commit
7dd090820b
56 changed files with 927 additions and 281 deletions
|
@ -1,25 +0,0 @@
|
|||
using System.Web.SessionState;
|
||||
using Ninject;
|
||||
using Ninject.Activation;
|
||||
using WebsitePanel.WebDavPortal.Config;
|
||||
using WebsitePanel.WebDavPortal.Models;
|
||||
|
||||
namespace WebsitePanel.WebDavPortal.DependencyInjection.Providers
|
||||
{
|
||||
public class AccountInfoProvider : Provider<AccountModel>
|
||||
{
|
||||
protected override AccountModel CreateInstance(IContext context)
|
||||
{
|
||||
var session = context.Kernel.Get<HttpSessionState>();
|
||||
|
||||
AccountModel accountInfo = null;
|
||||
|
||||
if (session != null)
|
||||
{
|
||||
accountInfo = session[WebDavAppConfigManager.Instance.SessionKeys.AccountInfo] as AccountModel;
|
||||
}
|
||||
|
||||
return accountInfo;
|
||||
}
|
||||
}
|
||||
}
|
|
@ -1,7 +1,11 @@
|
|||
using System.Web.SessionState;
|
||||
using System.Net;
|
||||
using System.Web.SessionState;
|
||||
using Ninject;
|
||||
using Ninject.Activation;
|
||||
using WebsitePanel.WebDavPortal.Config;
|
||||
using WebsitePanel.WebDav.Core;
|
||||
using WebsitePanel.WebDav.Core.Config;
|
||||
using WebsitePanel.WebDav.Core.Security.Cryptography;
|
||||
using WebsitePanel.WebDavPortal.Exceptions;
|
||||
using WebsitePanel.WebDavPortal.Models;
|
||||
|
||||
namespace WebsitePanel.WebDavPortal.DependencyInjection.Providers
|
||||
|
@ -17,6 +21,15 @@ namespace WebsitePanel.WebDavPortal.DependencyInjection.Providers
|
|||
if (session != null)
|
||||
{
|
||||
webDavManager = session[WebDavAppConfigManager.Instance.SessionKeys.WebDavManager] as WebDavManager;
|
||||
|
||||
if (webDavManager == null)
|
||||
{
|
||||
var cryptography = context.Kernel.Get<ICryptography>();
|
||||
|
||||
webDavManager = new WebDavManager(cryptography);
|
||||
|
||||
session[WebDavAppConfigManager.Instance.SessionKeys.WebDavManager] = webDavManager;
|
||||
}
|
||||
}
|
||||
|
||||
return webDavManager;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue