restrict user registration to specific domains Posted by ak 08 Jul 2010 04:07 UTC as above, can I config tiki, such that it allows registering users only from specific domains : i.e. users having emails from gmail.com ?
Posted by Rick Sapir / Tiki for Smarties 08 Jul 2010 17:58 UTC You could try enabling the Use email as username option, then use the Username pattern option to match for whatever domain you want to require. See the Admin: Login page for details. HTH, - Rick | My Tiki Blog | My Tiki UserPage Need more help? Try Tiki for Dummies Smarties. Now in Beta:: Tiki Essentials: What all Smarties need to know about Tiki Wiki CMS Groupware
Posted by ak 09 Jul 2010 03:19 UTC 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 } } }