Loading...
 
Skip to main content

Features / Usability


restrict user registration to specific domains

as above, can I config tiki, such that it allows registering users only from specific domains : i.e. users having emails from gmail.com ?

I did it the other way. I added this to tiki-register.php :




// ak - restrict registration to co's employees, here registration is permitted to users having xxx.edu yyy.com & zzz.com in in their emails
list ($aUsername, $aDomain) = split ("@", $_REQUEST%22email%22);
if (strtolower($aDomain) != "xxx.edu" && strtolower($aDomain) != "yyy.com" && strtolower($aDomain) != "zzz.com" ) {
$smarty->assign('msg', "Registration is restricted ONLY to co's employees");
$smarty->display("error.tpl");
die;
}


just before these lines :

$email_valid = 'y';
if (!validate_email($_REQUEST%22email%22, $prefs'validateEmail')) {
$email_valid = 'n';
} elseif ($prefs'userTracker' == 'y') {
$re = $userlib->get_group_info(isset($_REQUEST'chosenGroup') ? $_REQUEST'chosenGroup' : 'Registered');
if (!empty($re'usersTrackerId') && !empty($re'registrationUsersFieldIds')) {
include_once ('lib/wiki-plugins/wikiplugin_tracker.php');
$_SESSION'in_tracker' = true;
$userTrackerData = wikiplugin_tracker('', array('trackerId' => $re'usersTrackerId', 'fields' => $re'registrationUsersFieldIds', 'showdesc' => 'y', 'showmandatory' => 'y', 'embedded' => 'n'));
$smarty->assign('userTrackerData', $userTrackerData);
if (!isset($_REQUEST'trackit') || 'error') && $_REQUEST'error' 'y'" class="wiki wikinew text-danger tips isset">$_REQUEST'error') && $_REQUEST'error' 'y' {
$email_valid = 'n'; // first pass or error

}
}
}