Unlocking Users - Postgres only

This is the place to report bugs and get support. When posting in this forum, please always provide as much detail as possible.

Please do not report problems with a custom build or custom code in this forum. If you are producing your own build from the source code and have problems or questions, ask in the developer forum, do not report it as a bug.

This is the place to report bugs and get support

When posting in this forum, please try to provide as many relevant details as possible. Particularly the following:

  • What operating system were you running when the bug appeared?
  • What database platform is your site using?
  • What version of mojoPortal are you running?
  • What version of .NET do you use?
  • What steps are necessary to reproduce the issue? Compare expected results vs actual results.
Please do not report problems with a custom build or custom code in this forum. If you are producing your own build from the source code and have problems or questions, ask in the developer forum.
This thread is closed to new posts. You must sign in to post in the forums.
8/16/2010 10:36:53 PM
Gravatar
Total Posts 70

Unlocking Users - Postgres only

Hi Joe, this seems to be a Postgres specific bug.

When trying to unlock a locked user, the following error occurs:

ERROR: 42804: column "failedpasswordattemptcount" is of type integer but expression is of type boolean

mojoPortal.Data.DBSiteUser.AccountClearLockout(Guid userGuid) in E:\mojoportal\mojoPortal.Data.pgsql\dbSiteUser.cs:1530

 

I found out that dbSiteUser.db (postgresql version) had the following code:

        public static bool AccountClearLockout(Guid userGuid)
        {
            StringBuilder sqlCommand = new StringBuilder();
            sqlCommand.Append("UPDATE mp_users ");
            sqlCommand.Append("SET islockedout = false, ");
            sqlCommand.Append("failedpasswordattemptcount = false, ");
            sqlCommand.Append("failedpwdanswerattemptcount = false ");

            sqlCommand.Append("WHERE userguid = :userguid ;");

To fix it, I just changed false to 0 (zero). Everything worked like a charm. Please confirm it. (since I don't have SQL, I couldn't confirm it).

        public static bool AccountClearLockout(Guid userGuid)
        {
            StringBuilder sqlCommand = new StringBuilder();
            sqlCommand.Append("UPDATE mp_users ");
            sqlCommand.Append("SET islockedout = false, ");
            sqlCommand.Append("failedpasswordattemptcount = 0, ");
            sqlCommand.Append("failedpwdanswerattemptcount = 0 ");

            sqlCommand.Append("WHERE userguid = :userguid ;");

8/17/2010 6:47:11 AM
Gravatar
Total Posts 18439

Re: Unlocking Users - Postgres only

Hi Bruno,

Thanks for the bug report and fix. This is now fixed in the repository.

Best,

Joe

You must sign in to post in the forums. This thread is closed to new posts.