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
|
|
@ -1,3 +1,12 @@
|
|||
2015-11-01 Paul Schneider <paul@pschneider.fr>
|
||||
|
||||
* NpgsqlMembershipProvider.cs: xmldoc
|
||||
|
||||
* NpgsqlProfileProvider.cs: use default values from
|
||||
configuration
|
||||
|
||||
* NpgsqlUserNameProvider.cs: Fixes the username detection
|
||||
|
||||
2015-10-28 Paul Schneider <paul@pschneider.fr>
|
||||
|
||||
* NpgsqlProfileProvider.cs: Fixes the defaultValue
|
||||
|
|
|
|||
|
|
@ -951,11 +951,13 @@ namespace Npgsql.Web
|
|||
//
|
||||
// MembershipProvider.ValidateUser
|
||||
//
|
||||
/// <Docs>To be added.</Docs>
|
||||
/// <Docs>Validates an user identification by password,
|
||||
/// and, when he's approuved, updates its last login date and
|
||||
/// returns true.</Docs>
|
||||
/// <summary>
|
||||
/// Validates the user.
|
||||
/// Validates the user at login time.
|
||||
/// </summary>
|
||||
/// <returns><c>true</c>, if user was validated, <c>false</c> otherwise.</returns>
|
||||
/// <returns><c>true</c>, if user was approuved and its password is valid, <c>false</c> otherwise.</returns>
|
||||
/// <param name="username">Username.</param>
|
||||
/// <param name="password">Password.</param>
|
||||
public override bool ValidateUser (string username, string password)
|
||||
|
|
|
|||
|
|
@ -221,7 +221,7 @@ namespace Npgsql.Web
|
|||
} else {
|
||||
foreach (SettingsProperty p in collection) {
|
||||
SettingsPropertyValue v = new SettingsPropertyValue (p);
|
||||
v.PropertyValue = p.DefaultValue;
|
||||
v.PropertyValue = GetDefaultValue(p);
|
||||
c.Add (v);
|
||||
}
|
||||
}
|
||||
|
|
@ -230,6 +230,24 @@ namespace Npgsql.Web
|
|||
return c;
|
||||
|
||||
}
|
||||
|
||||
private object GetDefaultValue(SettingsProperty setting)
|
||||
{
|
||||
if (setting.PropertyType.IsEnum)
|
||||
return Enum.Parse(setting.PropertyType, setting.DefaultValue.ToString());
|
||||
|
||||
// Return the default value if it is set
|
||||
// Return the default value if it is set
|
||||
if (setting.DefaultValue != null)
|
||||
{
|
||||
System.ComponentModel.TypeConverter tc = System.ComponentModel.TypeDescriptor.GetConverter(setting.PropertyType);
|
||||
return tc.ConvertFromString(setting.DefaultValue.ToString());
|
||||
}
|
||||
else // If there is no default value return the default object
|
||||
{
|
||||
return Activator.CreateInstance(setting.PropertyType);
|
||||
}
|
||||
}
|
||||
/// <summary>
|
||||
/// Sets the property values.
|
||||
/// </summary>
|
||||
|
|
|
|||
|
|
@ -91,7 +91,7 @@ namespace Npgsql.Web.RolesAndMembers
|
|||
using (NpgsqlConnection conn = new NpgsqlConnection (connectionString)) {
|
||||
conn.Open ();
|
||||
using (NpgsqlCommand cmd = new NpgsqlCommand (
|
||||
"SELECT count(*)>0 FROM users " +
|
||||
"SELECT count(*)=0 FROM users " +
|
||||
"WHERE username = :uname AND ApplicationName = :appname", conn)) {
|
||||
cmd.Parameters.AddWithValue ("uname", name);
|
||||
cmd.Parameters.AddWithValue ("appname", this.applicationName);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue