webdav portal auth via ad

This commit is contained in:
vfedosevich 2015-01-13 04:18:56 -08:00
parent 05d9fddb5d
commit 7dd090820b
56 changed files with 927 additions and 281 deletions

View file

@ -5,4 +5,6 @@
<br/>
<h4 id="errorMessage">
@Html.Raw(Model.Message)
@Html.Raw(Model.Exception)
</h4>

View file

@ -1,6 +1,7 @@
@using WebsitePanel.WebDav.Core.Client
@using WebsitePanel.WebDav.Core
@using WebsitePanel.WebDav.Core.Client
@using Ninject
@using WebsitePanel.WebDavPortal.Config
@using WebsitePanel.WebDav.Core.Config
@model WebsitePanel.WebDavPortal.Models.ModelForWebDav
@{
@ -24,7 +25,7 @@ else
<div class="container">
@if (Model != null)
{
string header = webDavManager.OrganizationName;
string header = WspContext.User.OrganizationId;
<a href="/@header/" class="btn btn-primary btn-sm active" role="button">@header</a>
string[] elements = Model.UrlSuffix.Split(new[] {"/"}, StringSplitOptions.RemoveEmptyEntries);
for (int i = 0; i < elements.Length; i++)

View file

@ -1,12 +1,12 @@
@using WebsitePanel.WebDav.Core.Client
@using WebsitePanel.WebDavPortal.Config
@using WebsitePanel.WebDav.Core.Config
@using WebsitePanel.WebDavPortal.FileOperations
@using Ninject;
@model IHierarchyItem
@{
string actualPath = Model.ItemType == ItemType.Folder ? "~/Content/Images/folder_100x100.png" : WebDavAppConfigManager.Instance.FileIcons[Path.GetExtension(Model.DisplayName.Trim('/'))];
string name = Model.ItemType == ItemType.Folder ? Model.DisplayName.Trim('/') : Model.DisplayName;
string name = Model.DisplayName.Trim('/');
var opener = new FileOpenerManager()[Path.GetExtension(Model.DisplayName)];
bool isTargetBlank;
string href = "/";
@ -23,7 +23,7 @@
}
}
<div class="col-sm-2 element-container">
<a href="@href" @Html.Raw(isTargetBlank ? "target=\"_blank\"" : string.Empty) title="@Model.DisplayName.Trim('/')">
<a href="@href" @Html.Raw(isTargetBlank ? "target=\"_blank\"" : string.Empty) title="@name">
<img class="icon-size" src="@Url.Content(actualPath)" />
<p style="word-wrap: break-word;">@name</p>
</a>

View file

@ -1,13 +1,10 @@
@using Ninject
@using WebsitePanel.WebDavPortal.Config
@using WebsitePanel.WebDav.Core
@using WebsitePanel.WebDav.Core.Config
@using WebsitePanel.WebDavPortal.DependencyInjection
@using WebsitePanel.WebDavPortal.Models
@using WebsitePanel.WebDavPortal.UI.Routes;
@{
var account = DependencyResolver.Current.GetService<AccountModel>();
}
<!DOCTYPE html>
<html>
<head>
@ -30,10 +27,10 @@
</div>
<div class="navbar-collapse collapse">
@{
if (account != null)
if (WspContext.User != null)
{
<a id="logout" class="nav navbar-text navbar-right" href="@Url.RouteUrl(AccountRouteNames.Logout)" title="Log out"><i class="glyphicon glyphicon-log-out"></i></a>
<h4 id="username" class="nav navbar-text navbar-right">@account.Login</h4>
<h4 id="username" class="nav navbar-text navbar-right">@WspContext.User.Login</h4>
}
}
</div>
@ -45,6 +42,18 @@
@Scripts.Render("~/bundles/jquery")
@Scripts.Render("~/bundles/bootstrap")
@if (WspContext.User != null)
{
@Scripts.Render("~/bundles/authScripts")
<script>
StartAuthExpirationCheckTimer("@WebDavAppConfigManager.Instance.AuthTimeoutCookieName", "@Url.RouteUrl(AccountRouteNames.Logout)");
</script>
}
@RenderSection("scripts", required: false)
</body>
</html>