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.
When posting in this forum, please try to provide as many relevant details as possible. Particularly the following:
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
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 ;");
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 ;");
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 ");
Hi Bruno,
Thanks for the bug report and fix. This is now fixed in the repository.
Best,
Joe