Joomla vetting new signups
A few sites that we have been working on wanted an extra step with the signup process on their website that requires an additional level of vetting by the site administrator when a new user submits the online form. To achieve this we made some minor changes to the core code.
The following change removes the activation link from the email issued to the user and sends them an email notification that their application has been received.
From the root of your Joomla site, go to /components/com_user/controller.php (approx line 367) and add:
$mailfrom = $mainframe->getCfg(’mailfrom’);
$fromname = $mainframe->getCfg(’fromname’);
$email = $euser->email;
$siteURL = JURI::base();
$subject = “Vetting Accepted for [sitename]“;
$message2 = sprintf(JText::_(’REG_ACTIVATE_COMPLETE_USER’),$siteURL);
JUtility::sendMail($mailfrom, $fromname, $email, $subject, $message2);
// *** END Email the user that they have been vetted
We also need to change…
to:
The next bit of code emails the account activation link and details through to the site administrator, who gets to decide if the application is successful.
From the root of your Joomla site, go to /components/com_user/controller.php (approx line 524) and change to:
if ( $useractivation == 1 ){
// $message = sprintf ( JText::_( ‘SEND_MSG_ACTIVATE’ ), $name, $sitename, $siteURL.”index.php?option=com_user&task=activate&activation=”.$user->get(’activation’), $siteURL, $username, $password);
$message = sprintf ( JText::_( ‘SEND_MSG_ACTIVATE’ ), $name, $sitename, $siteURL.”index.php?option=com_user&task=activate&activation=”.$user->get(’activation’));
$message2 = sprintf ( JText::_( ‘SEND_MSG_USER’ ), $name, $sitename, $siteURL, $username, $password);
} else {
$message = sprintf ( JText::_( ‘SEND_MSG’ ), $name, $sitename, $siteURL);
$message2 = ”;
}
// *** END Added Site Admin activation link
We then need to pass both user and admin notifications through to the script that generates and sends emails.
From the root of your Joomla site, go to /components/com_user/controller.php (approx line 548) Added:
JUtility::sendMail($mailfrom, $fromname, $mailfrom, $subject, $message);
JUtility::sendMail($mailfrom, $fromname, $email, $subject, $message2);
// JUtility::sendMail($mailfrom, $fromname, $email, $subject, $message); // old line
// *** END Added send User AND Admin notification
Joomla now issues 2 emails when the signup form is submitted, rather than the usual one.
Some final changes are needed to the language files on the site, so that the email notifications make sense. Make the following changes. From the root of your Joomla site, go to
/language/en-GB/en-GB.com_user.ini (approx line 84) and change:
/language/en-GB/en-GB.com_user.ini (approx line 85) and change:
/language/en-GB/en-GB.com_user.ini (approx line 92) and change:
/language/en-GB/en-GB.com_user.ini (approx line 120) and change:
Finally, the User() helper function needs to be updated so that the activation confirmation email is sent to the user in question rather than the user currently logged into joomla (eg site administrator): To do that, go to:
// *** Added send confirmation to user not admin
// return true;
return $user;
// *** END Added send confirmation to user not admin


September 21st, 2009 at 7:11 pm
now that you’ve edited core, how will you upgrade?? will you be merging in changes, resolving conflicts every time there’s a new release?
or are you going to get these changes back into joomla upstream?
September 24th, 2009 at 3:57 pm
Hi br3nda,
Yeah hacking the core is not the best idea but sometimes deadlines force ones hand. I will endeavour to get the concept of vetting back upstream into joomla but in a more ‘choose it as an option’ kind of way.
So I am thinking of adding a whitepaper outlining why/how joomla would need vetting of signups as a process so that others can discuss their ideas as well.