Bug fixes
* Index.aspx: Gives this page a title * AdminController.cs: Trying to fix this Index : /Admin ... a 404 * YavscModel.csproj: * Commande.cs: * FileSystemController.cs: * WebFileSystemManager.cs: Refactoring the name of the files manager class * Index.aspx: Fixes the file system access * RemoveRole.aspx: Role removal form, had not a canonical name! * Web.csproj: a page was renamed
This commit is contained in:
parent
0b1b8f9a81
commit
2a30ae85a9
11 changed files with 50 additions and 25 deletions
|
|
@ -1,3 +1,20 @@
|
||||||
|
2015-10-29 Paul Schneider <paul@pschneider.fr>
|
||||||
|
|
||||||
|
* Index.aspx: Gives this page a title
|
||||||
|
|
||||||
|
* AdminController.cs: Trying to fix this Index : /Admin ... a
|
||||||
|
404
|
||||||
|
|
||||||
|
* FileSystemController.cs: Refactoring the name of the files
|
||||||
|
manager class
|
||||||
|
|
||||||
|
* Index.aspx: Fixes the file system access
|
||||||
|
|
||||||
|
* RemoveRole.aspx: Role removal form, had not a canonical
|
||||||
|
name!
|
||||||
|
|
||||||
|
* Web.csproj: a page was renamed
|
||||||
|
|
||||||
2015-10-28 Paul Schneider <paul@pschneider.fr>
|
2015-10-28 Paul Schneider <paul@pschneider.fr>
|
||||||
|
|
||||||
* yavsc.circles.js:
|
* yavsc.circles.js:
|
||||||
|
|
|
||||||
|
|
@ -29,7 +29,8 @@ namespace Yavsc.Controllers
|
||||||
YavscHelpers.Notify (ViewData, roleName + " " + LocalizedText.role_created);
|
YavscHelpers.Notify (ViewData, roleName + " " + LocalizedText.role_created);
|
||||||
|
|
||||||
}
|
}
|
||||||
return View ("Index");
|
|
||||||
|
return View ();
|
||||||
}
|
}
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Inits the db.
|
/// Inits the db.
|
||||||
|
|
|
||||||
|
|
@ -33,7 +33,7 @@ namespace Yavsc.Controllers
|
||||||
[Authorize]
|
[Authorize]
|
||||||
public ActionResult Index (string user, string filename)
|
public ActionResult Index (string user, string filename)
|
||||||
{
|
{
|
||||||
FileSystemManager fsmgr = new FileSystemManager ();
|
WebFileSystemManager fsmgr = new WebFileSystemManager ();
|
||||||
var files = fsmgr.GetFiles (user,filename);
|
var files = fsmgr.GetFiles (user,filename);
|
||||||
return View (files);
|
return View (files);
|
||||||
}
|
}
|
||||||
|
|
@ -54,7 +54,7 @@ namespace Yavsc.Controllers
|
||||||
/// <param name="filename">Filename.</param>
|
/// <param name="filename">Filename.</param>
|
||||||
public ActionResult Details (string user, string filename)
|
public ActionResult Details (string user, string filename)
|
||||||
{
|
{
|
||||||
FileSystemManager fsmgr = new FileSystemManager ();
|
WebFileSystemManager fsmgr = new WebFileSystemManager ();
|
||||||
FileInfo fi = fsmgr.FileInfo (filename);
|
FileInfo fi = fsmgr.FileInfo (filename);
|
||||||
|
|
||||||
ViewData ["filename"] = filename;
|
ViewData ["filename"] = filename;
|
||||||
|
|
|
||||||
|
|
@ -1,6 +1,6 @@
|
||||||
<%@ Page Language="C#" MasterPageFile="~/Models/App.master" Inherits="System.Web.Mvc.ViewPage<Yavsc.Model.FileSystem.FileInfoCollection>" %>
|
<%@ Page Title="Files" Language="C#" MasterPageFile="~/Models/App.master" Inherits="System.Web.Mvc.ViewPage<System.IO.FileInfo[]>" %>
|
||||||
<asp:Content ID="MainContentContent" ContentPlaceHolderID="MainContent" runat="server">
|
<asp:Content ID="MainContentContent" ContentPlaceHolderID="MainContent" runat="server">
|
||||||
<h1> Index of <%= Model.Owner %>'s files (<%= Html.Encode(Model.Count) %>)
|
<h1> Index
|
||||||
</h1>
|
</h1>
|
||||||
<ul>
|
<ul>
|
||||||
<% foreach (System.IO.FileInfo fi in Model) { %>
|
<% foreach (System.IO.FileInfo fi in Model) { %>
|
||||||
|
|
|
||||||
4
web/Views/Google/Index.aspx
Normal file
4
web/Views/Google/Index.aspx
Normal file
|
|
@ -0,0 +1,4 @@
|
||||||
|
<%@ Page Title="Google interface" Language="C#" Inherits="System.Web.Mvc.ViewPage" MasterPageFile="~/Models/App.master" %>
|
||||||
|
<asp:Content ContentPlaceHolderID="MainContent" ID="MainContentContent" runat="server">
|
||||||
|
</asp:Content>
|
||||||
|
|
||||||
|
|
@ -286,7 +286,6 @@
|
||||||
<Content Include="robots.txt" />
|
<Content Include="robots.txt" />
|
||||||
<Content Include="Scripts\form-new-user.js" />
|
<Content Include="Scripts\form-new-user.js" />
|
||||||
<Content Include="Views\FrontOffice\Estimate.aspx" />
|
<Content Include="Views\FrontOffice\Estimate.aspx" />
|
||||||
<Content Include="Views\Admin\RemoveRole..aspx" />
|
|
||||||
<Content Include="Views\FrontOffice\EventPub.aspx" />
|
<Content Include="Views\FrontOffice\EventPub.aspx" />
|
||||||
<Content Include="Views\Account\Circles.aspx" />
|
<Content Include="Views\Account\Circles.aspx" />
|
||||||
<Content Include="Views\Account\Register.ascx" />
|
<Content Include="Views\Account\Register.ascx" />
|
||||||
|
|
@ -461,6 +460,8 @@
|
||||||
<Content Include="Views\Google\ChooseADate.aspx" />
|
<Content Include="Views\Google\ChooseADate.aspx" />
|
||||||
<Content Include="Views\Google\OtherWebException.aspx" />
|
<Content Include="Views\Google\OtherWebException.aspx" />
|
||||||
<Content Include="Models\AppAdmin.master" />
|
<Content Include="Models\AppAdmin.master" />
|
||||||
|
<Content Include="Views\Google\Index.aspx" />
|
||||||
|
<Content Include="Views\Admin\RemoveRole.aspx" />
|
||||||
</ItemGroup>
|
</ItemGroup>
|
||||||
<Import Project="$(MSBuildBinPath)\Microsoft.CSharp.targets" />
|
<Import Project="$(MSBuildBinPath)\Microsoft.CSharp.targets" />
|
||||||
<Import Project="$(MSBuildExtensionsPath)\Microsoft\VisualStudio\v10.0\WebApplications\Microsoft.WebApplication.targets" />
|
<Import Project="$(MSBuildExtensionsPath)\Microsoft\VisualStudio\v10.0\WebApplications\Microsoft.WebApplication.targets" />
|
||||||
|
|
|
||||||
|
|
@ -1,3 +1,10 @@
|
||||||
|
2015-10-29 Paul Schneider <paul@pschneider.fr>
|
||||||
|
|
||||||
|
* YavscModel.csproj:
|
||||||
|
* Commande.cs:
|
||||||
|
* WebFileSystemManager.cs: Refactoring the name of the files
|
||||||
|
manager class
|
||||||
|
|
||||||
2015-10-28 Paul Schneider <paul@pschneider.fr>
|
2015-10-28 Paul Schneider <paul@pschneider.fr>
|
||||||
|
|
||||||
* ICalendarManager.cs: WIP booking TODO a calendar provider
|
* ICalendarManager.cs: WIP booking TODO a calendar provider
|
||||||
|
|
|
||||||
|
|
@ -38,7 +38,7 @@ namespace Yavsc.Model.FileSystem
|
||||||
/// It just provides simple method for a small set of
|
/// It just provides simple method for a small set of
|
||||||
/// files, in a small tree of sub-folders .
|
/// files, in a small tree of sub-folders .
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public class FileSystemManager
|
public class WebFileSystemManager
|
||||||
{
|
{
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Gets or sets the size of the max file.
|
/// Gets or sets the size of the max file.
|
||||||
|
|
@ -56,23 +56,18 @@ namespace Yavsc.Model.FileSystem
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Initializes a new instance of the <see cref="Yavsc.Model.FileSystem.FileSystemManager"/> class.
|
/// Initializes a new instance of the <see cref="Yavsc.Model.FileSystem.FileSystemManager"/> class.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public FileSystemManager (string rootDirectory="~/users/{0}")
|
public WebFileSystemManager (string rootDirectory="~/users")
|
||||||
{
|
{
|
||||||
|
string rootpath = HttpContext.Current.Server.MapPath (rootDirectory);
|
||||||
|
var rdi = new DirectoryInfo (rootpath);
|
||||||
|
if (!rdi.Exists)
|
||||||
|
rdi.Create ();
|
||||||
MembershipUser user = Membership.GetUser ();
|
MembershipUser user = Membership.GetUser ();
|
||||||
if (user == null)
|
if (user == null)
|
||||||
throw new Exception ("Not membership available");
|
throw new Exception ("Not membership available");
|
||||||
Prefix = HttpContext.Current.Server.MapPath (
|
Prefix = Path.Combine(rootpath, user.ProviderUserKey.ToString());
|
||||||
string.Format (rootDirectory, user.UserName));
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// Initializes a new instance of the <see cref="Yavsc.Model.FileSystem.FileSystemManager"/> class.
|
|
||||||
/// </summary>
|
|
||||||
public FileSystemManager (string username, string rootDirectory="~/users/{0}")
|
|
||||||
{
|
|
||||||
Prefix = HttpContext.Current.Server.MapPath (
|
|
||||||
string.Format (rootDirectory, username));
|
|
||||||
}
|
|
||||||
string regexFileName = "^[A-Za-z0-9#^!+ _~\\-.]+$";
|
string regexFileName = "^[A-Za-z0-9#^!+ _~\\-.]+$";
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Determines if the specified name is OK.
|
/// Determines if the specified name is OK.
|
||||||
|
|
@ -166,7 +161,7 @@ namespace Yavsc.Model.FileSystem
|
||||||
return (di.GetFiles ());
|
return (di.GetFiles ());
|
||||||
}
|
}
|
||||||
|
|
||||||
public IEnumerable<FileInfo> GetFiles (string username, string subdir, bool createNonExistent = false)
|
public FileInfo[] GetFiles (string username, string subdir)
|
||||||
{
|
{
|
||||||
string path = Prefix;
|
string path = Prefix;
|
||||||
if (subdir != null) {
|
if (subdir != null) {
|
||||||
|
|
@ -174,9 +169,9 @@ namespace Yavsc.Model.FileSystem
|
||||||
path = Path.Combine (Prefix, subdir);
|
path = Path.Combine (Prefix, subdir);
|
||||||
}
|
}
|
||||||
DirectoryInfo di = new DirectoryInfo (path);
|
DirectoryInfo di = new DirectoryInfo (path);
|
||||||
if (createNonExistent)
|
|
||||||
if (!di.Exists)
|
if (!di.Exists)
|
||||||
di.Create ();
|
return new FileInfo[0];
|
||||||
return (di.GetFiles ());
|
return (di.GetFiles ());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -89,8 +89,8 @@ namespace Yavsc.Model.FrontOffice
|
||||||
FromPost (collection, files);
|
FromPost (collection, files);
|
||||||
}
|
}
|
||||||
|
|
||||||
private FileSystemManager GetFSM() {
|
private WebFileSystemManager GetFSM() {
|
||||||
return new FileSystemManager ("~/commands/{0}");
|
return new WebFileSystemManager ("~/commands/{0}");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -114,7 +114,6 @@
|
||||||
<Compile Include="FrontOffice\Catalog\CatalogHelper.cs" />
|
<Compile Include="FrontOffice\Catalog\CatalogHelper.cs" />
|
||||||
<Compile Include="FrontOffice\Catalog\CatalogManager.cs" />
|
<Compile Include="FrontOffice\Catalog\CatalogManager.cs" />
|
||||||
<Compile Include="FrontOffice\Catalog\CatalogProvider.cs" />
|
<Compile Include="FrontOffice\Catalog\CatalogProvider.cs" />
|
||||||
<Compile Include="FileSystem\FileSystemManager.cs" />
|
|
||||||
<Compile Include="FileSystem\InvalidDirNameException.cs" />
|
<Compile Include="FileSystem\InvalidDirNameException.cs" />
|
||||||
<Compile Include="FileSystem\WebFileInfo.cs" />
|
<Compile Include="FileSystem\WebFileInfo.cs" />
|
||||||
<Compile Include="FrontOffice\CommandStatus.cs" />
|
<Compile Include="FrontOffice\CommandStatus.cs" />
|
||||||
|
|
@ -179,6 +178,7 @@
|
||||||
<Compile Include="Calendar\IFreeDateSet.cs" />
|
<Compile Include="Calendar\IFreeDateSet.cs" />
|
||||||
<Compile Include="Calendar\ICalendarManager.cs" />
|
<Compile Include="Calendar\ICalendarManager.cs" />
|
||||||
<Compile Include="Messaging\Notification.cs" />
|
<Compile Include="Messaging\Notification.cs" />
|
||||||
|
<Compile Include="FileSystem\WebFileSystemManager.cs" />
|
||||||
</ItemGroup>
|
</ItemGroup>
|
||||||
<Import Project="$(MSBuildBinPath)\Microsoft.CSharp.targets" />
|
<Import Project="$(MSBuildBinPath)\Microsoft.CSharp.targets" />
|
||||||
<ItemGroup>
|
<ItemGroup>
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue