Feature #249
restrict allowed email domains on registration
| Status: | New | Start: | 01/26/2010 | |
| Priority: | Normal | Due date: | ||
| Assigned to: | - | % Done: | 0% |
|
| Category: | - | |||
| Target version: | Community-ID 2.1.0 | |||
Description
Admin should be able to restrict registration only to emails from domains on a white-list, so that C-ID can be used only by users from those domains.
History
Updated by Badrulhisham Bahadzor 196 days ago
This is not the most elegant solution but works for me for the time being.
Edited file : $COMMUNITY-ID/modules/users/controllers/RegisterController.php
public function saveAction()
{
$form = new Users_Form_Register(null, $this->view->base);
$formData = $this->_request->getPost();
$form->populate($formData);
if (!$form->isValid($formData)) {
$appSession = Zend_Registry::get('appSession');
$appSession->registerForm = $form;
return $this->_forward('index', null, null);
}
$email_domain = $form->getValue('email');
if (substr($email_domain, -11) != '.domain.com') {
$form->email->addError($this->view->translate('This E-mail is already in use'));
$appSession = Zend_Registry::get('appSession');
$appSession->registerForm = $form;
return $this->_forward('index', null, null);
}
$users = new Users_Model_Users();Updated by Reiner Jung 129 days ago
- Target version set to Community-ID 2.1.0