Activate "REQUIRE ADMIN APPROVAL" for registration

aftab 25 May, 2008
Hi All,

I have figured out some basic functionality about ChronoForms. I would like to share them for everyone's help as soon as I finish my current project. I can recommend to anyone, if you are looking for both simple and complex registration form (as well as other direct DB mining forms) use ChronoForms.

Now let me get into my problem spec.

I am having a problem (since I am not a Joomla coder) and that is my Chrono registration form is getting user inputs and sending a mail to the recipient (and to the admin). Once they click the activation link from the email, they gets access to the site. But I want to make it like: After clicking the email link and getting registered, my site's admin will confirm (or activate) the new user. Till then, new users have to wait for the site admin to approve site access.

Is there any way to do so?

Sorry, if it is a re-post.

Thanks in advance
Aftab
GreyHead 25 May, 2008
Hi Aftab,

As a far as I can see there is nothing 'built in' to Joomla to allow moderated registration. You'd need either to find an extension or to specify and build something from scratch.

Bob
aftab 25 May, 2008
Thanks a lot Bob.

Sorry, not to mention that I was using Community Builder. CB gives a moderated option to approve users to apply. Let me give you the idea first what I want to do.

I have a site and I want a visitor to apply for registration with a file upload. Meanwhile, s/he can continue verifying her/his email address. After we verify the file (if it is ok or not) we will approve/deny his/her registration.

I have gone through the cf_cb_registration.php and I was looking for the place where the approved field value in jos_comprofiler is set to 1 (see attachment). I need it to set to 0.

Please rectify if I am wrong:
1. confirmed field in jos_comprofiler is for email confirmation
2. approved field in jos_comprofiler is for approved by admin
3. block field in jos_users is for blocking the user
4. sendMail field in jos_users is the user was successfully sent mail or not
5. gid field in jos_users is 18 if a normal user, 25 if a superadmin

One more thing, if I have two name fields (firstname and lastname) how do I combine them to be used in name field in CB plugin textbox? (fname+lname)?

Thanks again Bob for always giving prompt replies.

Aftab Activate
GreyHead 25 May, 2008
Hi aftab,

From the end . . . you can combine fields with:
    // Set User name
    $lastname = JRequest::getString( 'lastname', '', 'post' );
    $firstname = JRequest::getString( 'firstname', '', 'post' );
    $user->set( 'name', $firstname . " " . $lastname );

The other question is trickier, I don't have Cb installed but it looks as though Max is reading from the CB User table in line 229 and writing the new record back in line 239 so something needs to be added in there but I'm not exactly sure what. Ask me again if you need me to dig deeper.

Bob
aftab 25 May, 2008
Good one Bob. That worked like miracle.
Also I noticed, if I set the default value of jos_comprofiler confirmed and approved fields to 0, it works like charm.

Hats Off to CF team.

This is what I have used in Line 195 of CF_CB_REGISTRATION.PHP

$firstname = JRequest::getVar($params->firstname, '', 'post', 'firstname');
		$lastname = JRequest::getVar($params->lastname, '', 'post', 'lastname');
		$post['name']	= $firstname. " ". $lastname;


Aftab
aftab 25 May, 2008
Again,

I did not find in CF_CB_REGISTRATION.php file a piece of code, that generates, email confirmation link to make a registrant verify his email. Instead, Joomla's default is used. Besides it is not showing the password in the user email.

Is there any option to generate cbactivation in that file and send CB activation mail?

I wish I had the time to do the researches and make CF more flexi.

Thanks in advance
Aftab
GreyHead 25 May, 2008
Hi Aftab,

The activation email is actually sent from the _sendMail() function from line 260 on. The message that I last used from the Joomla Regsitration was
$message = sprintf( JText::_( 'SEND_MSG_ACTIVATE' ), $name, $sitename, $siteURL . "index.php?option=com_user&task=activate&activation=" . $user->get( 'activation' ), $siteURL, $username, $password );
Bob
cjmicro 24 Aug, 2008

From the end . . . you can combine fields with:
Code: Select all
// Set User name
$lastname = JRequest::getString( 'lastname', '', 'post' );
$firstname = JRequest::getString( 'firstname', '', 'post' );
$user->set( 'name', $firstname . " " . $lastname );



I would like to set this up, but not sure where I am supposed to put that code.

Cheryl
cjmicro 24 Aug, 2008
Also I noticed, if I set the default value of jos_comprofiler confirmed and approved fields to 0, it works like charm. 

Hats Off to CF team. 


Thanks for this info, I did the same (set the default to 0 in the db) and the approval is working!

Cheryl
farzananosheen 19 Jan, 2010
I used CB for registration , all process is going smothly as under

user register, receive email for email varification, click to varify,
admin received email for approving user,

but at that point, there is no link in the admin email so that admin click it and user is approved.

all other processes are as it is as instructed.

please sort out this problem.
davidakis 29 Jan, 2010
I built a Registration Form with Chronoforms, enabling CB registration plugin. Here's the link: http://www.ifelceti.it/index.php?option=com_chronocontact&chronoformname=Registrazione

When I click on "Registrati" (Submit button renamed) I get to an error page number 403. The form doesn't fill the CB users' table, nevertheless I assigned the right field name on CB plugin configuration.

Last, but not least: I did exactly the same thing in localhost, and it works! (Except for the emails, obviously)

Any idea about solving this problem?

Thanks a lot.

Davide
GreyHead 29 Jan, 2010
Hi Davide,

Sorry I've no idea.

Does this happen with an ordinary form - try creating a form with one text input and a button to test.

This will help determine if the 403 comes from the from or the plugin.

Bob
davidakis 29 Jan, 2010
Actually I was using this same form with Joomla registration plugin before installing CB and it worked well.

Now I'm trying also in localhost and it doesn't save any data into joomla and CB tables.
Maybe I was wrong when I told in local it worked, perhaps it was working with Joomla Registration Plugin.

Thanks
GreyHead 29 Jan, 2010
Hi Davide,

There are certainly problems reported several times here with the CB Registration plugin and the current release of CB (it was built for the old release). I'm not sure if anyone has found a fix yet.

Bob
davidakis 29 Jan, 2010
:shock: I'll try to remove CB and install an older version which one can you suggest? 1.2? 1.1? Thanks a lot.

Otherwise I need an Admin approval plugin. Do you know about compatibility issues? I'd like to send users a confirmation e-mail when there is the Admin approval (that's why I chose CB...)

Thanks a lot anyway
Davide
GreyHead 29 Jan, 2010
Hi Davide,

I think it was 1.1, I know very little about CB except having done a little work with it for a couple of clients.

Bob
davidakis 01 Feb, 2010
At last I solved my problem by enabling the Joomla Registration Plugin and using Multilanguage Admin Approval plugin. Make sure you choose to send the standard Joomla activation mail (in Joomla Registration Plugin Configuration).

Thanks a lot anyway

Davide
This topic is locked and no more replies can be posted.