Many fixes
* Profile.aspx: * ProfileEdition.cs: Fixes the username modification * Book-next.aspx: pollution * NpgsqlMembershipProvider.cs: xmldoc * NpgsqlProfileProvider.cs: use default values from configuration * NpgsqlUserNameProvider.cs: Fixes the username detection * test-domain-TestAPI.config: profile dates must be returned as DateTime * instdbws.sql: The conversion to a valid .Net DateTime requires a credible date time as source value, the null one is not supported. * style.css: Fixes the new notification style * AccountController.cs: Fixes the profile edition. Now using the anti forgery key at login time * Book.aspx: * LocalizedText.resx: * LocalizedText.fr.resx: * CalendarApi.cs: * GoogleController.cs: * LocalizedText.Designer.cs: * LocalizedText.fr.Designer.cs: WIP booking * HomeController.cs: code prettying * Global.asax.cs: Limits the usage of titles in a route to the blog controller * OAuth2.cs: Profile values may be of type DBNull ... * T.cs: All translated strings will be Html encoded, as expected from an html helper * YavscHelpers.cs: A new method to build a javascript string... * App.master: * AppAdmin.master: Notification.body is now a js string literal * NoLogin.master: sync with the true master * Login.aspx: Permits the anti forgery key usage * Estimate.aspx: refactoring * Web.config: Fixes a later commit on the catalog name space * Web.csproj: An ajax helper to notify * ChangePasswordModel.cs: * RegisterClientModel.cs: A regexp for user name * LoginModel.cs: A regexp for user name and password * Profile.cs: A regexp for user name, and profile usage fixes * UserManager.cs: Checks for username availability before trying to modify it * YavscModel.csproj: `ProfileEdition` class addition * ChangeLog: should not be indexed * ChangeLog: useless here * ValidateAjaxAttribute.cs: Fixes usage of HtmlFieldPrefix * BookQuery.cs: Start, end hour and role are required * OtherWebException.cs: useless
This commit is contained in:
parent
0a91d3935b
commit
d9d5bb308e
42 changed files with 441 additions and 275 deletions
|
|
@ -45,6 +45,7 @@ namespace Yavsc.Model.Calendar
|
|||
/// <value>The minimum time.</value>
|
||||
[RegularExpression("\\d\\d:\\d\\d")]
|
||||
[Display(ResourceType=typeof(LocalizedText),Name="StartHour")]
|
||||
[Required(ErrorMessage= "S'il vous plait, saisissez une heure de début d'intervention")]
|
||||
public string StartHour { get; set; }
|
||||
|
||||
/// <summary>
|
||||
|
|
@ -62,7 +63,7 @@ namespace Yavsc.Model.Calendar
|
|||
/// </summary>
|
||||
/// <value>The duration.</value>
|
||||
[RegularExpression("\\d\\d:\\d\\d")]
|
||||
[Required(ErrorMessage= "S'il vous plait, saisissez une durée minimale d'intervention")]
|
||||
[Required(ErrorMessage= "S'il vous plait, saisissez une heure de fin d'intervention")]
|
||||
[Display(Name="EndHour",ResourceType=typeof(LocalizedText))]
|
||||
public string EndHour { get; set; }
|
||||
|
||||
|
|
@ -77,6 +78,7 @@ namespace Yavsc.Model.Calendar
|
|||
/// Gets or sets the role.
|
||||
/// </summary>
|
||||
/// <value>The role.</value>
|
||||
[Required(ErrorMessage= "S'il vous plait, saisissez le type d'intervention souhaité")]
|
||||
[Display(Name="Role",ResourceType=typeof(LocalizedText))]
|
||||
public string Role { get; set; }
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,3 +1,39 @@
|
|||
2015-11-01 Paul Schneider <paul@pschneider.fr>
|
||||
|
||||
* ProfileEdition.cs: Fixes the username modification
|
||||
|
||||
* LocalizedText.resx:
|
||||
* LocalizedText.fr.resx:
|
||||
* LocalizedText.Designer.cs:
|
||||
* LocalizedText.fr.Designer.cs: WIP booking
|
||||
|
||||
* ChangePasswordModel.cs:
|
||||
* RegisterClientModel.cs: A regexp for user name
|
||||
|
||||
* LoginModel.cs: A regexp for user name and password
|
||||
|
||||
* Profile.cs: A regexp for user name, and profile usage fixes
|
||||
|
||||
* UserManager.cs: Checks for username availability before
|
||||
trying to modify it
|
||||
|
||||
* YavscModel.csproj: `ProfileEdition` class addition
|
||||
|
||||
* ChangeLog: useless here
|
||||
|
||||
* BookQuery.cs: Start, end hour and role are required
|
||||
|
||||
* OtherWebException.cs: useless
|
||||
|
||||
2015-10-31 Paul Schneider <paul@pschneider.fr>
|
||||
|
||||
* LocalizedText.resx:
|
||||
* OtherWebException.cs:
|
||||
* BookQuery.cs:
|
||||
* LocalizedText.fr.resx:
|
||||
* LocalizedText.Designer.cs:
|
||||
* LocalizedText.fr.Designer.cs:
|
||||
|
||||
2015-10-30 Paul Schneider <paul@pschneider.fr>
|
||||
|
||||
* LocalizedText.resx:
|
||||
|
|
|
|||
12
yavscModel/LocalizedText.Designer.cs
generated
12
yavscModel/LocalizedText.Designer.cs
generated
|
|
@ -52,6 +52,12 @@ namespace Yavsc.Model {
|
|||
}
|
||||
}
|
||||
|
||||
public static string StartDateAfterEndDate {
|
||||
get {
|
||||
return ResourceManager.GetString("StartDateAfterEndDate", resourceCulture);
|
||||
}
|
||||
}
|
||||
|
||||
public static string ProviderId {
|
||||
get {
|
||||
return ResourceManager.GetString("ProviderId", resourceCulture);
|
||||
|
|
@ -519,5 +525,11 @@ namespace Yavsc.Model {
|
|||
return ResourceManager.GetString("Non_existent_user", resourceCulture);
|
||||
}
|
||||
}
|
||||
|
||||
public static string FillInAFutureDate {
|
||||
get {
|
||||
return ResourceManager.GetString("FillInAFutureDate", resourceCulture);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
28
yavscModel/LocalizedText.fr.Designer.cs
generated
28
yavscModel/LocalizedText.fr.Designer.cs
generated
|
|
@ -52,6 +52,12 @@ namespace Yavsc.Model {
|
|||
}
|
||||
}
|
||||
|
||||
public static string StartDateAfterEndDate {
|
||||
get {
|
||||
return ResourceManager.GetString("StartDateAfterEndDate", resourceCulture);
|
||||
}
|
||||
}
|
||||
|
||||
public static string ProviderId {
|
||||
get {
|
||||
return ResourceManager.GetString("ProviderId", resourceCulture);
|
||||
|
|
@ -64,12 +70,6 @@ namespace Yavsc.Model {
|
|||
}
|
||||
}
|
||||
|
||||
public static string Location {
|
||||
get {
|
||||
return ResourceManager.GetString("Location", resourceCulture);
|
||||
}
|
||||
}
|
||||
|
||||
public static string Circles {
|
||||
get {
|
||||
return ResourceManager.GetString("Circles", resourceCulture);
|
||||
|
|
@ -286,9 +286,9 @@ namespace Yavsc.Model {
|
|||
}
|
||||
}
|
||||
|
||||
public static string StartHour {
|
||||
public static string Location {
|
||||
get {
|
||||
return ResourceManager.GetString("StartHour", resourceCulture);
|
||||
return ResourceManager.GetString("Location", resourceCulture);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -460,6 +460,12 @@ namespace Yavsc.Model {
|
|||
}
|
||||
}
|
||||
|
||||
public static string StartHour {
|
||||
get {
|
||||
return ResourceManager.GetString("StartHour", resourceCulture);
|
||||
}
|
||||
}
|
||||
|
||||
public static string Unitary_cost {
|
||||
get {
|
||||
return ResourceManager.GetString("Unitary_cost", resourceCulture);
|
||||
|
|
@ -507,5 +513,11 @@ namespace Yavsc.Model {
|
|||
return ResourceManager.GetString("Non_existent_user", resourceCulture);
|
||||
}
|
||||
}
|
||||
|
||||
public static string FillInAFutureDate {
|
||||
get {
|
||||
return ResourceManager.GetString("FillInAFutureDate", resourceCulture);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -36,6 +36,7 @@
|
|||
<data name="Estimate_not_found"><value>Devis non trouvé</value></data>
|
||||
<data name="EventWebPage"><value>Page web de l'événement</value></data>
|
||||
<data name="ExistantDB"><value>Base de données éxistante</value></data>
|
||||
<data name="FillInAFutureDate"><value>Veuilliez, s'il vous plait, utiliser une date future.</value></data>
|
||||
<data name="Google_calendar"><value>Agenda Google</value></data>
|
||||
<data name="Google_error"><value>Erreur Google : {0}</value></data>
|
||||
<data name="Hide_source"><value>Cacher le texte source du billet</value></data>
|
||||
|
|
@ -75,6 +76,7 @@
|
|||
<data name="Remove"><value>Supprimer</value></data>
|
||||
<data name="role_created"><value>Rôle créé</value></data>
|
||||
<data name="StartDate"><value>Date de début</value></data>
|
||||
<data name="StartDateAfterEndDate"><value>La date de fin doit être postérieure à la date de début.</value></data>
|
||||
<data name="StartHour"><value>Heure de début</value></data>
|
||||
<data name="Submit"><value>Soumettre</value></data>
|
||||
<data name="Tag_name"><value>Nom du tag</value></data>
|
||||
|
|
|
|||
|
|
@ -36,6 +36,7 @@
|
|||
<data name="Estimate_not_found"><value>Estimate not found</value></data>
|
||||
<data name="EventWebPage"><value>Event Web page</value></data>
|
||||
<data name="ExistantDB"><value>Existant data base</value></data>
|
||||
<data name="FillInAFutureDate"><value>Please, use a date in the future as starting date.</value></data>
|
||||
<data name="Home"><value>Home</value></data>
|
||||
<data name="Hide"><value>Hide</value></data>
|
||||
<data name="Hide_source"><value>Hide the bill source text</value></data>
|
||||
|
|
@ -80,6 +81,7 @@
|
|||
<data name="Submit"><value>Submit</value></data>
|
||||
<data name="StartHour"><value>Start hour</value></data>
|
||||
<data name="StartDate"><value>Start date</value></data>
|
||||
<data name="StartDateAfterEndDate"><value>The ending date must be later than the starting one.</value></data>
|
||||
<data name="Tag_name"><value>Tag name</value></data>
|
||||
<data name="Tex_version"><value>LaTeX version</value></data>
|
||||
<data name="ThisSiteUsesCookies"><value>This site uses cookies</value></data>
|
||||
|
|
|
|||
|
|
@ -28,7 +28,7 @@ namespace Yavsc.Model
|
|||
/// <summary>
|
||||
/// Google error exception.
|
||||
/// </summary>
|
||||
public class OtherWebException : Exception
|
||||
public class OtherWebException : WebException
|
||||
{
|
||||
/// <summary>
|
||||
/// Gets or sets the title.
|
||||
|
|
|
|||
|
|
@ -12,7 +12,7 @@ namespace Yavsc.Model.RolesAndMembers
|
|||
/// Gets or sets the username.
|
||||
/// </summary>
|
||||
/// <value>The username.</value>
|
||||
[Required(ErrorMessage = "Please, enter your user name")]
|
||||
[Required(ErrorMessage = "Please, enter your user name"),RegularExpression("([a-z]|[A-Z]|[\\s-_.~]|[0-9])+")]
|
||||
public string Username { get; set; }
|
||||
|
||||
/// <summary>
|
||||
|
|
|
|||
|
|
@ -15,7 +15,7 @@ namespace Yavsc.Model.RolesAndMembers
|
|||
/// <value>The name of the user.</value>
|
||||
[DisplayName("Nom d'utilisateur"),
|
||||
Required(ErrorMessage = "S'il vous plait, entrez un nom d'utilisateur ([a-z]|[A-Z]|[-_.~]|[0-9])+"),
|
||||
RegularExpression("([a-z]|[A-Z]|[-_.~]|[0-9])+")]
|
||||
RegularExpression("([a-z]|[A-Z]|[0-9])+")]
|
||||
public string UserName { get; set; }
|
||||
|
||||
/// <summary>
|
||||
|
|
@ -23,8 +23,7 @@ namespace Yavsc.Model.RolesAndMembers
|
|||
/// </summary>
|
||||
/// <value>The password.</value>
|
||||
[DisplayName("Mot de passe"),
|
||||
Required(ErrorMessage = "S'il vous plait, entez un mot de passe"),
|
||||
RegularExpression("([a-z]|[A-Z]|[0-9]|[-_.~#{}`'\\^])+")]
|
||||
RegularExpression("([a-z]|[A-Z]|[\\s-_.~]|[0-9])+")]
|
||||
public string Password { get; set; }
|
||||
|
||||
/// <summary>
|
||||
|
|
|
|||
|
|
@ -219,7 +219,11 @@ namespace Yavsc.Model.RolesAndMembers
|
|||
/// Gets or sets the name of the user.
|
||||
/// </summary>
|
||||
/// <value>The name of the user.</value>
|
||||
public string UserName { get { return userName; } }
|
||||
[Localizable(true), Required(ErrorMessage = "S'il vous plait, entrez un nom d'utilisateur valide")
|
||||
,Display(ResourceType=typeof(LocalizedText),Name="User_name"),
|
||||
RegularExpression("([a-z]|[A-Z]|[\\s-_.~]|[0-9])+")
|
||||
]
|
||||
public string UserName { get { return userName; } set { userName=value; } }
|
||||
|
||||
public Profile () : base ()
|
||||
{
|
||||
|
|
@ -276,7 +280,6 @@ namespace Yavsc.Model.RolesAndMembers
|
|||
|
||||
userName = profile.UserName;
|
||||
|
||||
|
||||
s = profile.GetPropertyValue ("BankCode");
|
||||
BankCode = (s is DBNull) ? null : (string)s;
|
||||
|
||||
|
|
@ -290,11 +293,10 @@ namespace Yavsc.Model.RolesAndMembers
|
|||
WicketCode = (s is DBNull) ? null : (string)s;
|
||||
|
||||
s = profile.GetPropertyValue ("AccountNumber");
|
||||
this.AccountNumber = (s is DBNull) ? null : (string)s;
|
||||
|
||||
s = profile.GetPropertyValue ("BankedKey");
|
||||
BankedKey = (s == null) ? 0 : (s is DBNull)? 0 : (int)s;
|
||||
AccountNumber = (s is DBNull) ? null : (string)s;
|
||||
|
||||
object o = profile.GetPropertyValue ("BankedKey");
|
||||
BankedKey = (int)0;
|
||||
s = profile.GetPropertyValue ("gcalid");
|
||||
GoogleCalendar = (s is DBNull)? null : (string) s;
|
||||
}
|
||||
|
|
|
|||
46
yavscModel/RolesAndMembers/ProfileEdition.cs
Normal file
46
yavscModel/RolesAndMembers/ProfileEdition.cs
Normal file
|
|
@ -0,0 +1,46 @@
|
|||
//
|
||||
// ProfileEdition.cs
|
||||
//
|
||||
// Author:
|
||||
// Paul Schneider <paul@pschneider.fr>
|
||||
//
|
||||
// Copyright (c) 2015 GNU GPL
|
||||
//
|
||||
// This program is free software: you can redistribute it and/or modify
|
||||
// it under the terms of the GNU Lesser General Public License as published by
|
||||
// the Free Software Foundation, either version 3 of the License, or
|
||||
// (at your option) any later version.
|
||||
//
|
||||
// This program is distributed in the hope that it will be useful,
|
||||
// but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
// GNU Lesser General Public License for more details.
|
||||
//
|
||||
// You should have received a copy of the GNU Lesser General Public License
|
||||
// along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
using System;
|
||||
using System.ComponentModel;
|
||||
using System.ComponentModel.DataAnnotations;
|
||||
using System.Web.Profile;
|
||||
|
||||
namespace Yavsc.Model.RolesAndMembers
|
||||
{
|
||||
public class ProfileEdition : Profile
|
||||
{
|
||||
public ProfileEdition()
|
||||
{}
|
||||
|
||||
|
||||
public ProfileEdition(ProfileBase pr): base(pr)
|
||||
{
|
||||
NewUserName = UserName;
|
||||
}
|
||||
|
||||
[Localizable(true), Required(ErrorMessage = "S'il vous plait, entrez un nom d'utilisateur valide")
|
||||
,Display(ResourceType=typeof(LocalizedText),Name="User_name"),
|
||||
RegularExpression("([a-z]|[A-Z]|[\\s-_.~]|[0-9])+")
|
||||
]
|
||||
public string NewUserName { get; set; }
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -35,7 +35,8 @@ namespace Yavsc.Model.RolesAndMembers
|
|||
/// </summary>
|
||||
/// <value>The full name.</value>
|
||||
[DisplayName("Nom complet")]
|
||||
[Required(ErrorMessage="S'il vous plait, saisissez le nom complet")]
|
||||
[Required(ErrorMessage="S'il vous plait, saisissez le nom complet"),
|
||||
RegularExpression("([a-z]|[A-Z]|[\\s-_.~]|[0-9])+")]
|
||||
public string Name { get; set; }
|
||||
/// <summary>
|
||||
/// Gets or sets the address.
|
||||
|
|
|
|||
|
|
@ -15,6 +15,12 @@ namespace Yavsc.Model.RolesAndMembers
|
|||
/// <param name="oldName">Old name.</param>
|
||||
/// <param name="newName">New name.</param>
|
||||
public static void ChangeName (string oldName, string newName) {
|
||||
if (!IsAvailable (newName))
|
||||
throw new Exception (
|
||||
string.Format(
|
||||
LocalizedText.DuplicateUserName,
|
||||
newName
|
||||
));
|
||||
Provider.ChangeName (oldName, newName);
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -179,6 +179,7 @@
|
|||
<Compile Include="Calendar\ICalendarManager.cs" />
|
||||
<Compile Include="Messaging\Notification.cs" />
|
||||
<Compile Include="FileSystem\WebFileSystemManager.cs" />
|
||||
<Compile Include="RolesAndMembers\ProfileEdition.cs" />
|
||||
</ItemGroup>
|
||||
<Import Project="$(MSBuildBinPath)\Microsoft.CSharp.targets" />
|
||||
<ItemGroup>
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue