Registration and approval problem

If you have questions about using mojoPortal, you can post them here.

You may want to first review our site administration documentation to see if your question is answered there.

This thread is closed to new posts. You must sign in to post in the forums.
12/12/2011 4:51:14 AM
Gravatar
Total Posts 38

Registration and approval problem

I'm sure this is self inflicted, but after testing and changing the various registration types in site settings, I've managed to confuse my registration process...

I want the registration process to work as follows:  User Registration-->User Email confirmation -->Administrator Approval-- User notification / logon.

I've ticked the boxes:

 "Require email confirmation for registration" and  "Require approval before new users can sign in"

The behaviour I'm getting is that, when the user completes registration, he gets the message "After confirmation, you will be allowed to login to the site".  So he confirms by email.  If he attempts to login, he gets the message "Sorry, approval required...".  However there are no names displayed in the member list when button "Show users waiting for approval" is clicked.  However, the the administrator does receive the email notification "You are receiving this message because your site is configured to require approval before newly registered users can sign into the site..." along with a link to the userid.    If I look up the user in the alphabetical list and click "Approve" the user is then allowed to login.

So, not sure what I've messed up here.  

In summary, the issue is that 1) the user receives an invalid confirmation that the account is ready but if he tries to logon he is rejected as not approved.  2) the registrations awaiting approval do not appear on the list. 

Any suggestions on what I'm doing wrong? 

(2.3.6.7 MSSQL)

12/16/2011 4:44:55 AM
Gravatar
Total Posts 38

Re: Registration and approval problem

I believe I've traced the problem to the stored procedures [mp_Users_SelectLockedPage] and [mp_Users_SelectNotApprovedPage].  I created a virgin mojoPortal database from file mojoportal-2-3-6-7-mssql-net40-deploymentfiles.zip to double check I hadn't corrupted them myself.

Both of these stored procedures use the literal numeric value 1 instead of the sql variable @SiteID, and that's why my approved users were not showing up in the list.    

I edited the stored proc lines "WHERE SiteID = 1" to "WHERE SiteID = @SiteID" to fix.

 

Here they are:

 

USE [mojo2-3-6-7]
GO

/****** Object: StoredProcedure [dbo].[mp_Users_SelectNotApprovedPage] Script Date: 12/16/2011 09:42:22 ******/
SET ANSI_NULLS ON
GO

SET QUOTED_IDENTIFIER ON
GO

CREATE PROCEDURE [dbo].[mp_Users_SelectNotApprovedPage]

/*
Author: Joe Audette
Created: 2011-01-17
Last Modified: 2011-01-17

*/

@SiteID int,
@PageNumber int,
@PageSize int

AS
DECLARE @PageLowerBound int
DECLARE @PageUpperBound int

SET @PageLowerBound = (@PageSize * @PageNumber) - @PageSize
SET @PageUpperBound = @PageLowerBound + @PageSize + 1

CREATE TABLE #PageIndexForUsers
(
IndexID int IDENTITY (1, 1) NOT NULL,
UserID int
)

BEGIN
INSERT INTO #PageIndexForUsers (UserID)

SELECT UserID
FROM mp_Users
WHERE
SiteID = 1
AND ApprovedForForums = 0

ORDER BY [Name]

END

SELECT u.*

FROM mp_Users u

JOIN #PageIndexForUsers p
ON u.UserID = p.UserID

WHERE
u.SiteID = 1
AND p.IndexID > @PageLowerBound
AND p.IndexID < @PageUpperBound

ORDER BY p.IndexID

DROP TABLE #PageIndexForUsers

GO

USE [mojo2-3-6-7]
GO

/****** Object: StoredProcedure [dbo].[mp_Users_SelectLockedPage] Script Date: 12/16/2011 09:42:53 ******/
SET ANSI_NULLS ON
GO

SET QUOTED_IDENTIFIER ON
GO

CREATE PROCEDURE [dbo].[mp_Users_SelectLockedPage]

/*
Author: Joe Audette
Created: 2010-06-02
Last Modified: 2010-06-02

*/

@SiteID int,
@PageNumber int,
@PageSize int

AS
DECLARE @PageLowerBound int
DECLARE @PageUpperBound int

SET @PageLowerBound = (@PageSize * @PageNumber) - @PageSize
SET @PageUpperBound = @PageLowerBound + @PageSize + 1

CREATE TABLE #PageIndexForUsers
(
IndexID int IDENTITY (1, 1) NOT NULL,
UserID int
)

BEGIN
INSERT INTO #PageIndexForUsers (UserID)

SELECT UserID
FROM mp_Users
WHERE
SiteID = 1
AND IsLockedOut = 1

ORDER BY [Name]

END

SELECT u.*

FROM mp_Users u

JOIN #PageIndexForUsers p
ON u.UserID = p.UserID

WHERE
u.SiteID = 1
AND p.IndexID > @PageLowerBound
AND p.IndexID < @PageUpperBound

ORDER BY p.IndexID

DROP TABLE #PageIndexForUsers

GO

 

 

12/16/2011 7:21:58 AM
Gravatar
Total Posts 18439

Re: Registration and approval problem

Hi,

Thanks for the bug report and fix. I will correct those for the next release with the same chnages as you made.

Best,

Joe

12/17/2011 9:30:16 AM
Gravatar
Total Posts 38

Re: Registration and approval problem

I'm pleased to have made a very small contribution to this great project.  Thanks again for all your support.

10/8/2012 7:16:00 PM
Gravatar
Total Posts 3

Re: Registration and approval problem

This does not appear to be fixed in 2.3.9.0.

From the definition of mp_users_SelectNotApprovedPage:

CREATE TABLE #PageIndexForUsers
(
IndexID int IDENTITY (1, 1) NOT NULL,
UserID int
)

INSERT INTO #PageIndexForUsers (UserID)
SELECT UserID
FROM [dbo].mp_Users
WHERE
SiteID = @SiteID
AND ApprovedForForums = 0
ORDER BY [Name]

SELECT u.*
FROM [dbo].mp_Users u
JOIN #PageIndexForUsers p
ON u.UserID = p.UserID
WHERE
u.SiteID = 1
AND p.IndexID > @PageLowerBound
AND p.IndexID < @PageUpperBound
ORDER BY p.IndexID

The restriction when selecting users out of the temporary table still has the hard-coded SiteID = 1 instead of referencing the @SiteID parameter.

 

Thanks,

Chris

10/9/2012 10:11:36 AM
Gravatar
Total Posts 18439

Re: Registration and approval problem

Hi Chris,

Thanks for the bug report. This is now fixed in the source code repository so it will be fixed in the coming release.

Best,

Joe

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