WebDav Explorer code cleanup

This commit is contained in:
vfedosevich 2014-12-30 03:41:58 -08:00
parent a4c6331a2a
commit f5b41b5c85
17 changed files with 210 additions and 216 deletions

View file

@ -41,14 +41,6 @@ namespace WebsitePanel.WebDavPortal.Controllers
[HttpPost]
public ActionResult Login(AccountModel model)
{
//var ldapConnectionString = WebDavAppConfigManager.Instance.ConnectionStrings.LdapServer;
//if (ldapConnectionString == null || !Regex.IsMatch(ldapConnectionString, @"^LDAP://([\w-]+.)+[\w-]+(/[\w- ./?%&=])?$"))
// return View(new AccountModel { LdapError = "LDAP server address is invalid" });
//var principal = new WebDavPortalIdentity(model.Login, model.Password);
//bool isAuthenticated = principal.Identity.IsAuthenticated;
//var organizationId = principal.GetOrganizationId();
AutheticationToServicesUsingWebsitePanelUser();
var exchangeAccount = ES.Services.ExchangeServer.GetAccountByAccountNameWithoutItemId(model.Login);
var isAuthenticated = exchangeAccount != null && exchangeAccount.AccountPassword == model.Password;
@ -63,7 +55,6 @@ namespace WebsitePanel.WebDavPortal.Controllers
{
Session[WebDavAppConfigManager.Instance.SessionKeys.AccountInfo] = model;
Session[WebDavAppConfigManager.Instance.SessionKeys.WebDavManager] = new WebDavManager(new NetworkCredential(model.Login, model.Password, WebDavAppConfigManager.Instance.UserDomain), exchangeAccount.ItemId);
//Session[WebDavAppConfigManager.Instance.SessionKeys.WebDavManager] = new WebDavManager(new NetworkCredential("Administrator", "WSP99cc$$1", WebDavAppConfigManager.Instance.UserDomain), exchangeAccount.ItemId);
}
catch (ConnectToWebDavServerException exception)
{

View file

@ -31,11 +31,6 @@ namespace WebsitePanel.WebDavPortal.Controllers
if (org != webDavManager.OrganizationName)
return new HttpStatusCodeResult(HttpStatusCode.NoContent);
var test = Url.Action("ShowContent", "FileSystem");
var tetet = Url.Action("ShowContent", "FileSystem", new { org = "pgrorg" });
string fileName = pathPart.Split('/').Last();
if (webDavManager.IsFile(fileName))
{
@ -52,7 +47,7 @@ namespace WebsitePanel.WebDavPortal.Controllers
return View(model);
}
catch (UnauthorizedException exc)
catch (UnauthorizedException)
{
throw new HttpException(404, "Not Found");
}
@ -81,7 +76,7 @@ namespace WebsitePanel.WebDavPortal.Controllers
return PartialView("_ResourseCollectionPartial", result);
}
return null;
return new HttpStatusCodeResult(HttpStatusCode.NoContent); ;
}
}
}