Fixes the membership update.

This commit is contained in:
Paul Schneider 2015-08-01 22:34:59 +02:00
commit 294c54099c
35 changed files with 2683 additions and 11 deletions

View file

@ -1,3 +1,7 @@
2015-08-01 Paul Schneider <paul@pschneider.fr>
* NpgsqlMembershipProvider.cs: Fixes the membership update.
2015-07-15 Paul Schneider <paul@pschneider.fr>
* NpgsqlMRPProviders.csproj: Moves to Mono framework

View file

@ -1,20 +1,17 @@
using System.Web.Security;
using System.Configuration.Provider;
using System.Web.Configuration;
using System.Collections.Specialized;
using System;
using System.Data;
using Npgsql;
using NpgsqlTypes;
using System.Configuration.Provider;
using System.Configuration;
using System.Diagnostics;
using System.Web;
using System.Globalization;
using System.Security.Cryptography;
using NpgsqlTypes;
using System.Data;
using System.Text;
using System.Web.Configuration;
using System.Security.Cryptography;
namespace Npgsql.Web
{
/// <summary>
/// Npgsql membership provider.
/// </summary>
@ -932,13 +929,12 @@ namespace Npgsql.Web
{
using (NpgsqlConnection conn = new NpgsqlConnection (connectionString)) {
using (NpgsqlCommand cmd = new NpgsqlCommand ("UPDATE users " +
" SET :username = :username, email = :email, comment = :comment," +
" SET email = :email, comment = :comment," +
" isapproved = :isapproved" +
" WHERE pkid = :pkid and applicationname = :appname", conn)) {
cmd.Parameters.AddWithValue ("email", user.Email);
cmd.Parameters.AddWithValue ("comment", user.Comment);
cmd.Parameters.AddWithValue ("isapproved", user.IsApproved);
cmd.Parameters.AddWithValue ("username", user.UserName);
cmd.Parameters.AddWithValue ("pkid", user.ProviderUserKey);
cmd.Parameters.AddWithValue ("appname", pApplicationName);
conn.Open ();

View file

@ -0,0 +1,53 @@
//
// NpgsqlUserNameProvider.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.Web.Security;
using System.Configuration.Provider;
using System.Collections.Specialized;
using System;
using System.Data;
using Npgsql;
using NpgsqlTypes;
using System.Configuration;
using System.Diagnostics;
using System.Web;
using System.Globalization;
using System.Security.Cryptography;
using System.Text;
using System.Web.Configuration;
namespace Npgsql.Web
{
using Yavsc.Model.RolesAndMembers;
public class NpgsqlUserNameProvider: ChangeUserNameProvider {
#region implemented abstract members of ChangeUserNameProvider
public override void ChangeName (string oldName, string newName)
{
throw new NotImplementedException ();
}
public override bool IsNameAvailable (string name)
{
throw new NotImplementedException ();
}
#endregion
}
}