diff --git a/ChangeLog b/ChangeLog index 8c8064aa..13ecca77 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,8 @@ +2015-11-21 Paul Schneider + + * Makefile: retour au débuggage de la copie de travaille, et + pas de la déployée + 2015-11-19 Paul Schneider * .gitignore: ignore my new config transformation sources diff --git a/Makefile b/Makefile index 9482a98a..fbda41d6 100644 --- a/Makefile +++ b/Makefile @@ -59,8 +59,8 @@ distclean: clean sourcepkg: git archive --format=tar --prefix=yavsc-$(CONFIG)/ $(CONFIG) | bzip2 > yavsc-$(CONFIG).tar.bz2 -start_xsp: deploy - (cd $(LDYDESTDIR); export MONO_OPTIONS=--debug; xsp4 --port 8080) +start_xsp: build + (cd web; export MONO_OPTIONS=--debug; xsp4 --port 8080) xmldoc: $(patsubst %,web/bin/%,$(DOCASSBS)) mdoc-update $^ $(patsubst %.dll,-i%.xml,$^) --out web/xmldoc @@ -84,3 +84,5 @@ nuget_restore: nuget_update: for prj in ITContentProvider NpgsqlBlogProvider NpgsqlContentProvider NpgsqlMRPProviders Presta SalesCatalog TestAPI web WebControls yavscclient yavscModel; do nuget update "$${prj}/packages.config" ; done + + diff --git a/web/ApiControllers/AccountController.cs b/web/ApiControllers/AccountController.cs index 397113b0..bb3c6c7b 100644 --- a/web/ApiControllers/AccountController.cs +++ b/web/ApiControllers/AccountController.cs @@ -96,20 +96,32 @@ namespace Yavsc.ApiControllers [ValidateAjax] public void ResetPassword (LostPasswordModel model) { - StringDictionary errors; - MembershipUser user; - YavscHelpers.ValidatePasswordReset (model, out errors, out user); - foreach (string key in errors.Keys) - ModelState.AddModelError (key, errors [key]); - if (user != null && ModelState.IsValid) - Url.SendActivationMessage (user); + if (ModelState.IsValid) { + StringDictionary errors; + MembershipUser user; + YavscHelpers.ValidatePasswordReset (model, out errors, out user); + foreach (string key in errors.Keys) + ModelState.AddModelError (key, errors [key]); + if (user != null && ModelState.IsValid) + Url.SendActivationMessage (user); + } } [ValidateAjax] [Authorize(Roles="Admin")] public void AddUserToRole(UserRole model) { - Roles.AddUserToRole (model.UserName, model.Role); + if (ModelState.IsValid) + Roles.AddUserToRole (model.UserName, model.Role); + } + + [ValidateAjax] + [Authorize(Roles="Admin")] + public void RemoveUserFromRole(UserRole model) + { + if (ModelState.IsValid) + Roles.RemoveUserFromRoles (model.UserName, + new string [] { model.Role } ); } } diff --git a/web/App_Themes/style.css b/web/App_Themes/style.css index 2fb4dd2f..7b308238 100644 --- a/web/App_Themes/style.css +++ b/web/App_Themes/style.css @@ -154,13 +154,16 @@ ul.editablelist>li { border: solid grey 1px; border-radius: 1em; } - +ul.editablelist>li:before { + font-family: 'FontAwesome'; + content: "\f007"; + } ul.editablelist>li:hover { background-color: rgba(128,0,0,0.5); cursor:pointer; } -ul.editablelist>li:hover:after { +ul.editablelist>li:hover:before { font-family: 'FontAwesome'; content: "\f00d"; } diff --git a/web/AuthorizeAttribute.cs b/web/AuthorizeAttribute.cs index 05ddb9ab..a184cf41 100644 --- a/web/AuthorizeAttribute.cs +++ b/web/AuthorizeAttribute.cs @@ -40,11 +40,16 @@ namespace Yavsc { // let the client know which role were allowed here // filterContext.ActionDescriptor.ControllerDescriptor. - filterContext.Result = new System.Web.Mvc.RedirectResult ("~/Home/RestrictedArea"); + var result = new System.Web.Mvc.ViewResult(); + filterContext.Controller.ViewData ["ActionName"] = filterContext.ActionDescriptor.ActionName; filterContext.Controller.ViewData ["ControllerName"] = filterContext.ActionDescriptor.ControllerDescriptor.ControllerName; filterContext.Controller.ViewData ["Roles"] = Roles; filterContext.Controller.ViewData ["Users"] = Users; + result.ViewName = "RestrictedArea"; + result.ViewData = filterContext.Controller.ViewData; + filterContext.Result = result; + } else filterContext.Result = new System.Web.Mvc.HttpStatusCodeResult((int)System.Net.HttpStatusCode.Forbidden); } diff --git a/web/ChangeLog b/web/ChangeLog index 53a4664a..ed07c255 100644 --- a/web/ChangeLog +++ b/web/ChangeLog @@ -1,3 +1,87 @@ +2015-11-21 Paul Schneider + + * Microsoft.Web.XmlTransform.dll: Copié de l'import Nuget de + Mono.Web.Xdt (transformations de fichiers de configuration) + + * yavsc.admin.js: Implémente les méthodes Javascript de + l'interface utilisateur de suppression et d'ajout d'un + utilisateur à un groupe: + un widget jQuery pour la suppression, l'accès à l'API + + * RestrictedArea.aspx: Page vue par l'utilisateur si par + malheur il suivait un lien vers un contenu d'accès restreint, + à la place d'un code Http 404 ou autre. + Si cet utilisateur est administrateur, la page lui affiche les + rôles ou utilisateurs autorisés à accèder au contenu. + + + * RestrictedArea.aspx: + * RestrictedArea.aspx: + * RestrictedArea.aspx: + * RestrictedArea.aspx: + * RestrictedArea.aspx: + * RestrictedArea.aspx: + * RestrictedArea.aspx: Page vue par l'utilisateur si par + malheur il suivait un lien vers un contenu d'accès restreint, + à la place d'un code Http 404 ou autre. + Si cet utilisateur est administrateur, la page lui affiche les + rôles ou utilisateurs autorisés à accèder au contenu. + + * AccountController.cs: Evite de mettre à jour un mot de passe + avec des valeures non attendues + + * style.css: corrige un mouvement de la disposition au survol + de la souris + + * AuthorizeAttribute.cs: enlève la redirection à l'accès + restreint, et fixe pas la même la transmission des données + `Roles` et `Users` de la vue + + + * AdminController.cs: Evite de supprimer un utilisateur d'un + groupe avec des valeures non attendues + + * HomeController.cs: Il n'y avait pas à créer de methode pour + la vue publique de l'accès restreint. + + * YavscAjaxHelper.cs: évite d'avoir à convertir en chaine les + valeurs de la vue. + + + * App.master: Cette page maître affiche encore beaucoup de + billets de blog, on y installe le coteur, de base. Ça changera + quand les blogs auront (enfin) leur page maître dédiée. + + + * AppAdmin.master: synchronisation avec la page maître + principale (thémes) + + * NoLogin.master: synchronisation avec la page maître + principale.(thémes) + + * yavsc.rate.js: supprime l'initialisation de tous les type de + cotes depuis le script global. + C'est fait sur les pages qui en ont besoin, et seulement pour + les types de cotes concernés. + + * AddUserToRole.ascx: Ce formulaire est maintenant à la fois + opérationel depuis une interface web sans javascript, et à la + Ajax quand Javascript activé. + + + * UsersInRole.aspx: implémente l'interface utilisateur pour + l'ajout et la suppression d'un utilisateur à un groupe + + * Skills.aspx: initialise le coteur js des compétences site + + * UserSkills.aspx: initialise le coteur js de compétences + utilisateur + + * Web.csproj: un script et des pages d'erreur d'accès, il en + faut une par controlleur + qui restreint quelque de ses accès. + + 2015-11-19 Paul Schneider * PayPalController.cs: implements a Paypal controller diff --git a/web/Controllers/AdminController.cs b/web/Controllers/AdminController.cs index d292d4da..8a137198 100644 --- a/web/Controllers/AdminController.cs +++ b/web/Controllers/AdminController.cs @@ -133,6 +133,7 @@ namespace Yavsc.Controllers BuildBackupList (datac); return View (datac); } + private void BuildBackupList(DataAccess datac) { // build ViewData ["Backups"]; @@ -151,16 +152,18 @@ namespace Yavsc.Controllers /// Rolename. /// Return URL. [Authorize(Roles="Admin")] - public ActionResult RemoveFromRole(string username, string rolename, string returnUrl) + public ActionResult RemoveUserFromRole(string username, string rolename, string returnUrl) { - Roles.RemoveUserFromRole(username,rolename); + if (ModelState.IsValid) + Roles.RemoveUserFromRole(username,rolename); return Redirect(returnUrl); } [Authorize(Roles="Admin")] public ActionResult AddUserToRole(string username, string rolename, string returnUrl) { - Roles.AddUsersToRole(new string[] { username } ,rolename); + if (ModelState.IsValid) + Roles.AddUsersToRole(new string[] { username } ,rolename); return Redirect(returnUrl); } /// diff --git a/web/Controllers/HomeController.cs b/web/Controllers/HomeController.cs index 0a59f638..35bb3cbb 100644 --- a/web/Controllers/HomeController.cs +++ b/web/Controllers/HomeController.cs @@ -101,10 +101,6 @@ namespace Yavsc.Controllers return View (); } - public ActionResult RestrictedArea () - { - return View (); - } /// /// Contact the specified email, reason and body. /// diff --git a/web/Helpers/YavscAjaxHelper.cs b/web/Helpers/YavscAjaxHelper.cs index 83487ba6..d7dedfd2 100644 --- a/web/Helpers/YavscAjaxHelper.cs +++ b/web/Helpers/YavscAjaxHelper.cs @@ -36,12 +36,12 @@ namespace Yavsc.Helpers /// Helper. /// Message. /// Click action. - public static void Notify(this AjaxHelper helper, string message, string click_action=null) { + public static void Notify(this AjaxHelper helper, object message, string click_action=null) { if (helper.ViewData ["Notifications"] == null) helper.ViewData ["Notifications"] = new List (); (helper.ViewData ["Notifications"] as List).Add ( - new Notification { body = QuoteJavascriptString(message), + new Notification { body = QuoteJavascriptString((string)message), click_action = click_action } ) ; } @@ -50,15 +50,21 @@ namespace Yavsc.Helpers /// /// The javascript string. /// String. - public static string QuoteJavascriptString(string str) + public static string QuoteJavascriptString(object str) { - str = str.Replace ("\n", "\\n"); - if (str.Contains ("'")) - if (str.Contains ("\"")) - return "'" + str.Replace ("'", "\\'") + "'"; + string tmpstr = (string) str; + tmpstr = tmpstr.Replace ("\n", "\\n"); + if (tmpstr.Contains ("'")) + if (tmpstr.Contains ("\"")) + return "'" + tmpstr.Replace ("'", "\\'") + "'"; else - return "\"" + str + "\""; - return "'" + str + "'"; + return "\"" + tmpstr + "\""; + return "'" + tmpstr + "'"; + } + + public static string JString(this AjaxHelper helper, object str) + { + return QuoteJavascriptString (str); } } } diff --git a/web/Microsoft.Web.XmlTransform.dll b/web/Microsoft.Web.XmlTransform.dll new file mode 100755 index 00000000..af41f33e Binary files /dev/null and b/web/Microsoft.Web.XmlTransform.dll differ diff --git a/web/Models/App.master b/web/Models/App.master index 5581077f..8099d811 100644 --- a/web/Models/App.master +++ b/web/Models/App.master @@ -23,6 +23,9 @@ Page.StyleSheetTheme = (string) Profile.UITheme; %> <%=Ajax.GlobalizationScript()%> diff --git a/web/Models/AppAdmin.master b/web/Models/AppAdmin.master index 77f74720..fdd1c29f 100644 --- a/web/Models/AppAdmin.master +++ b/web/Models/AppAdmin.master @@ -4,18 +4,14 @@ <% ViewState["orgtitle"] = Html.Translate(Page.Title); %> <% Page.Title = ViewState["orgtitle"] + " - " + YavscHelpers.SiteName; Page.Theme = (string) Profile.UITheme; -Page.StyleSheetTheme = (string) Profile.UITheme; - -%> +Page.StyleSheetTheme = (string) Profile.UITheme; %> - - + -" /> -" /> +<%= Html.ThemeCSSLinks(Page.StyleSheetTheme,"style")%> " /> " /> " /> @@ -49,7 +45,7 @@ var apiBaseUrl = '<%=Url.Content(Yavsc.WebApiConfig.UrlPrefixRelative)%>'; $(document).ready(function(){ <% foreach (Notification note in (IEnumerable) ViewData ["Notifications"] ) { if (note.click_action == null) {%> Yavsc.notice(<%=note.body%>); <% } -else {%> Yavsc.notice(<%=note.body%>, <%=note.click_action%>); <% } %> +else {%> Yavsc.notice(<%=note.body%>, <%=note.click_action%>, <%=note.click_action_name%>); <% } %> <% } %> }); diff --git a/web/Models/NoLogin.master b/web/Models/NoLogin.master index 0bb0b48a..522b627f 100644 --- a/web/Models/NoLogin.master +++ b/web/Models/NoLogin.master @@ -4,18 +4,14 @@ <% ViewState["orgtitle"] = Html.Translate(Page.Title); %> <% Page.Title = ViewState["orgtitle"] + " - " + YavscHelpers.SiteName; Page.Theme = (string) Profile.UITheme; -Page.StyleSheetTheme = (string) Profile.UITheme; - -%> +Page.StyleSheetTheme = (string) Profile.UITheme; %> - -" /> -" /> +<%= Html.ThemeCSSLinks(Page.StyleSheetTheme,"style")%> " /> " /> " /> @@ -27,9 +23,14 @@ Page.StyleSheetTheme = (string) Profile.UITheme; <%=Ajax.GlobalizationScript()%> + + diff --git a/web/Scripts/yavsc.admin.js b/web/Scripts/yavsc.admin.js new file mode 100644 index 00000000..a66dab22 --- /dev/null +++ b/web/Scripts/yavsc.admin.js @@ -0,0 +1,37 @@ + +var Admin = (function(){ +var self = {}; +self.addUserToRole = function (user,role,callback) { + Yavsc.ajax('Account/AddUserToRole', + { username: user, role: role }, callback ); +}; +self.removeUserFromRole = function (user,role,callback) { + Yavsc.ajax('Account/RemoveUserFromRole', + { username: user, role: role }, callback ); + } + +return self; +})(); + +(function() { + (function(jQuery) { + return jQuery.widget('Yavsc.decharger', { + options: { + roleName: 'Admin', + }, + _create: function() { + var _this = this; + var $bgobj = $(this.element); + // console.log ('Dechargeable:'+$bgobj.text()); + $bgobj.click(function() { + var user = $bgobj.text(); + Admin.removeUserFromRole(user,_this.options.roleName, + function() { + $bgobj.remove(); + }); + }); + }, +}); +})(jQuery); +}).call(this); + diff --git a/web/Scripts/yavsc.rate.js b/web/Scripts/yavsc.rate.js index 58f22d96..febdc9a7 100644 --- a/web/Scripts/yavsc.rate.js +++ b/web/Scripts/yavsc.rate.js @@ -49,9 +49,3 @@ }, })})(jQuery); }).call(this); - - $(document).ready(function(){ - $('[data-type="rate-site-skill"]').rate({target: 'Skill/RateSkill'}); - $('[data-type="rate-user-skill"]').rate({target: 'Skill/RateUserSkill'}); - $('[data-type="rate-bill"]').rate({target: 'Blogs/Rate'}); - }); diff --git a/web/Views/Account/RestrictedArea.aspx b/web/Views/Account/RestrictedArea.aspx new file mode 100644 index 00000000..cfbca610 --- /dev/null +++ b/web/Views/Account/RestrictedArea.aspx @@ -0,0 +1,13 @@ +<%@ Page Language="C#" Inherits="System.Web.Mvc.ViewPage" MasterPageFile="~/Models/App.master"%> + + Ce contenu est d'accès restreint :
+ <<%= Html.Encode(ViewData["ControllerName"]) %>/<%= Html.Encode(ViewData["ActionName"]) %>>
+ + <% if (Roles.IsUserInRole("Admin")) { %> + Admin only: + Ci après les tièrces parties autorisée actuellement :
+ + Roles autorisés : <%= Html.Encode(ViewData["Roles"]) %>
+ Utilisateurs autorisés :<%= Html.Encode(ViewData["Users"]) %>
+ <% } %> +
\ No newline at end of file diff --git a/web/Views/Admin/AddUserToRole.ascx b/web/Views/Admin/AddUserToRole.ascx index 214282db..8aaf2c2a 100644 --- a/web/Views/Admin/AddUserToRole.ascx +++ b/web/Views/Admin/AddUserToRole.ascx @@ -1,18 +1,17 @@ <%@ Control Language="C#" Inherits="System.Web.Mvc.ViewUserControl" %> <%= Html.ValidationSummary() %> -<% using(Html.BeginForm("AddUserToRole", "Admin")) - { %> +
-
<% if (ViewData ["UserName"] != null) { %> <%= Html.Hidden("RoleName",ViewData ["RoleName"]) %> <% } else { %>
- + +
+ <%= Html.ValidationMessage("UserName", "*") %>
<% } %> - <% if (ViewData ["RoleName"] != null) { %> <%= Html.Hidden("RoleName",ViewData ["RoleName"]) %> <% } else { %> @@ -22,8 +21,20 @@ <%= Html.ValidationMessage("RoleName", "*") %> <% } %> - -<%= Html.Hidden("ReturnUrl", Request.Url.PathAndQuery ) %> - + +" onclick="return ajaxSubmit();" >
-<% } %> \ No newline at end of file +
diff --git a/web/Views/Admin/RestrictedArea.aspx b/web/Views/Admin/RestrictedArea.aspx new file mode 100644 index 00000000..cfbca610 --- /dev/null +++ b/web/Views/Admin/RestrictedArea.aspx @@ -0,0 +1,13 @@ +<%@ Page Language="C#" Inherits="System.Web.Mvc.ViewPage" MasterPageFile="~/Models/App.master"%> + + Ce contenu est d'accès restreint :
+ <<%= Html.Encode(ViewData["ControllerName"]) %>/<%= Html.Encode(ViewData["ActionName"]) %>>
+ + <% if (Roles.IsUserInRole("Admin")) { %> + Admin only: + Ci après les tièrces parties autorisée actuellement :
+ + Roles autorisés : <%= Html.Encode(ViewData["Roles"]) %>
+ Utilisateurs autorisés :<%= Html.Encode(ViewData["Users"]) %>
+ <% } %> +
\ No newline at end of file diff --git a/web/Views/Admin/UsersInRole.aspx b/web/Views/Admin/UsersInRole.aspx index 7b073f84..d00255ac 100644 --- a/web/Views/Admin/UsersInRole.aspx +++ b/web/Views/Admin/UsersInRole.aspx @@ -2,7 +2,16 @@ <% ViewState["orgtitle"] = string.Format ( LocalizedText.UsersInRole , Html.Encode(ViewData["RoleName"])); %> <% Page.Title = ViewState["orgtitle"] + " - " + YavscHelpers.SiteName; %> - + + + +

"> @@ -11,7 +20,8 @@

-
    +
      " data-type="userlist"> + <%foreach (string username in (string[]) ViewData["UsersInRole"]){ %>
    • <%= username %>
    • <% } %> diff --git a/web/Views/BackOffice/RestrictedArea.aspx b/web/Views/BackOffice/RestrictedArea.aspx new file mode 100644 index 00000000..cfbca610 --- /dev/null +++ b/web/Views/BackOffice/RestrictedArea.aspx @@ -0,0 +1,13 @@ +<%@ Page Language="C#" Inherits="System.Web.Mvc.ViewPage" MasterPageFile="~/Models/App.master"%> + + Ce contenu est d'accès restreint :
      + <<%= Html.Encode(ViewData["ControllerName"]) %>/<%= Html.Encode(ViewData["ActionName"]) %>>
      + + <% if (Roles.IsUserInRole("Admin")) { %> + Admin only: + Ci après les tièrces parties autorisée actuellement :
      + + Roles autorisés : <%= Html.Encode(ViewData["Roles"]) %>
      + Utilisateurs autorisés :<%= Html.Encode(ViewData["Users"]) %>
      + <% } %> +
      \ No newline at end of file diff --git a/web/Views/Blogs/RestrictedArea.aspx b/web/Views/Blogs/RestrictedArea.aspx new file mode 100644 index 00000000..cfbca610 --- /dev/null +++ b/web/Views/Blogs/RestrictedArea.aspx @@ -0,0 +1,13 @@ +<%@ Page Language="C#" Inherits="System.Web.Mvc.ViewPage" MasterPageFile="~/Models/App.master"%> + + Ce contenu est d'accès restreint :
      + <<%= Html.Encode(ViewData["ControllerName"]) %>/<%= Html.Encode(ViewData["ActionName"]) %>>
      + + <% if (Roles.IsUserInRole("Admin")) { %> + Admin only: + Ci après les tièrces parties autorisée actuellement :
      + + Roles autorisés : <%= Html.Encode(ViewData["Roles"]) %>
      + Utilisateurs autorisés :<%= Html.Encode(ViewData["Users"]) %>
      + <% } %> +
      \ No newline at end of file diff --git a/web/Views/FileSystem/RestrictedArea.aspx b/web/Views/FileSystem/RestrictedArea.aspx new file mode 100644 index 00000000..cfbca610 --- /dev/null +++ b/web/Views/FileSystem/RestrictedArea.aspx @@ -0,0 +1,13 @@ +<%@ Page Language="C#" Inherits="System.Web.Mvc.ViewPage" MasterPageFile="~/Models/App.master"%> + + Ce contenu est d'accès restreint :
      + <<%= Html.Encode(ViewData["ControllerName"]) %>/<%= Html.Encode(ViewData["ActionName"]) %>>
      + + <% if (Roles.IsUserInRole("Admin")) { %> + Admin only: + Ci après les tièrces parties autorisée actuellement :
      + + Roles autorisés : <%= Html.Encode(ViewData["Roles"]) %>
      + Utilisateurs autorisés :<%= Html.Encode(ViewData["Users"]) %>
      + <% } %> +
      \ No newline at end of file diff --git a/web/Views/FrontOffice/RestrictedArea.aspx b/web/Views/FrontOffice/RestrictedArea.aspx new file mode 100644 index 00000000..cfbca610 --- /dev/null +++ b/web/Views/FrontOffice/RestrictedArea.aspx @@ -0,0 +1,13 @@ +<%@ Page Language="C#" Inherits="System.Web.Mvc.ViewPage" MasterPageFile="~/Models/App.master"%> + + Ce contenu est d'accès restreint :
      + <<%= Html.Encode(ViewData["ControllerName"]) %>/<%= Html.Encode(ViewData["ActionName"]) %>>
      + + <% if (Roles.IsUserInRole("Admin")) { %> + Admin only: + Ci après les tièrces parties autorisée actuellement :
      + + Roles autorisés : <%= Html.Encode(ViewData["Roles"]) %>
      + Utilisateurs autorisés :<%= Html.Encode(ViewData["Users"]) %>
      + <% } %> +
      \ No newline at end of file diff --git a/web/Views/FrontOffice/Skills.aspx b/web/Views/FrontOffice/Skills.aspx index f14932cf..dccba582 100644 --- a/web/Views/FrontOffice/Skills.aspx +++ b/web/Views/FrontOffice/Skills.aspx @@ -2,6 +2,11 @@ + diff --git a/web/Views/FrontOffice/UserSkills.aspx b/web/Views/FrontOffice/UserSkills.aspx index 91ae4482..ba60e268 100644 --- a/web/Views/FrontOffice/UserSkills.aspx +++ b/web/Views/FrontOffice/UserSkills.aspx @@ -2,6 +2,11 @@ + diff --git a/web/Views/Google/RestrictedArea.aspx b/web/Views/Google/RestrictedArea.aspx new file mode 100644 index 00000000..cfbca610 --- /dev/null +++ b/web/Views/Google/RestrictedArea.aspx @@ -0,0 +1,13 @@ +<%@ Page Language="C#" Inherits="System.Web.Mvc.ViewPage" MasterPageFile="~/Models/App.master"%> + + Ce contenu est d'accès restreint :
      + <<%= Html.Encode(ViewData["ControllerName"]) %>/<%= Html.Encode(ViewData["ActionName"]) %>>
      + + <% if (Roles.IsUserInRole("Admin")) { %> + Admin only: + Ci après les tièrces parties autorisée actuellement :
      + + Roles autorisés : <%= Html.Encode(ViewData["Roles"]) %>
      + Utilisateurs autorisés :<%= Html.Encode(ViewData["Users"]) %>
      + <% } %> +
      \ No newline at end of file diff --git a/web/Views/Home/RestrictedArea.aspx b/web/Views/Home/RestrictedArea.aspx index c5661362..cfbca610 100644 --- a/web/Views/Home/RestrictedArea.aspx +++ b/web/Views/Home/RestrictedArea.aspx @@ -3,9 +3,11 @@ Ce contenu est d'accès restreint :
      <<%= Html.Encode(ViewData["ControllerName"]) %>/<%= Html.Encode(ViewData["ActionName"]) %>>
      - + <% if (Roles.IsUserInRole("Admin")) { %> + Admin only: Ci après les tièrces parties autorisée actuellement :
      - Roles autorisés :<%= Html.Encode(ViewData["Roles"]) %>
      + Roles autorisés : <%= Html.Encode(ViewData["Roles"]) %>
      Utilisateurs autorisés :<%= Html.Encode(ViewData["Users"]) %>
      + <% } %>
      \ No newline at end of file diff --git a/web/Web.csproj b/web/Web.csproj index 09cfaae6..70ec4def 100644 --- a/web/Web.csproj +++ b/web/Web.csproj @@ -498,6 +498,14 @@ + + + + + + + + diff --git a/yavscModel/ChangeLog b/yavscModel/ChangeLog index 2875730b..f8e81113 100644 --- a/yavscModel/ChangeLog +++ b/yavscModel/ChangeLog @@ -1,3 +1,9 @@ +2015-11-21 Paul Schneider + + * UserNameBase.cs: Permet l'usage des espaces dans les noms + d'utilisateurs, + à la création legacy, ou autres usage du nom d'utilisateur. + 2015-11-19 Paul Schneider * YavscModel.csproj: Lua config diff --git a/yavscModel/RolesAndMembers/UserNameBase.cs b/yavscModel/RolesAndMembers/UserNameBase.cs index f6a51328..f362566d 100644 --- a/yavscModel/RolesAndMembers/UserNameBase.cs +++ b/yavscModel/RolesAndMembers/UserNameBase.cs @@ -31,7 +31,7 @@ namespace Yavsc.Model.RolesAndMembers /// /// The name of the user. [Localizable(true), Required(ErrorMessage = "S'il vous plait, entrez un nom d'utilisateur") - ,Display(ResourceType=typeof(LocalizedText),Name="User_name"),RegularExpression("([a-z]|[A-Z]|[0-9] )+")] + ,Display(ResourceType=typeof(LocalizedText),Name="User_name"),RegularExpression(@"^[a-zA-Z .-_#]{1,100}$")] public string UserName { get; set; } }