I commented out the flood registration check. Students will be registering from behind a proxy, one per hour won't work...! It would be nice if that were an admin option
First class tomorrow...
You are not logged in. Please login or register.
PunBB Forums → Posts by JohnR
Pages 1
I commented out the flood registration check. Students will be registering from behind a proxy, one per hour won't work...! It would be nice if that were an admin option
First class tomorrow...
Ah, but you have to be able to register with subdomains. eg when it says "uts.edu.au" up there, then 235213@student.uts.edu.au is also a valid email address.
Hi, I thought I might just make a quick note here in case it's useful to anyone. I need to restrict registrations to one of a set of pre-defined email addresses. This is for a site that is being run for University classes.
In config.php, add (for example):
$email_whitelist = array(
"uts.edu.au",
"eecs.berkeley.edu"
);
In lang/English/common.php, add:
'Unlisted e-mail' => 'This email address does not match the list of valid email suffixes. Please post in the login help forum if you believe this is an error.',
In register.php, after:
if (!is_valid_email($email1))
message($lang_common['Invalid e-mail']);
add:
else if (!is_email_whitelisted($email1))
message($lang_common['Unlisted e-mail']);
And in include/email.php, add:
//
// Check if an email address is whitelisted
//
function is_email_whitelisted($email) {
global $email_whitelist;
foreach ($email_whitelist as $p) {
$p1 = ereg_replace('\.', '\\.', $p);
$p2 = '^[^@]+@' . $p1 . '$';
$p3 = '^[^@]+@[^@]+\.' . $p1 . '$';
if (eregi($p2, $email) || eregi($p3, $email))
return true;
}
return false;
}
Only tested quickly but it seems to work. Thanks
JohnR
Pages 1
PunBB Forums → Posts by JohnR
Powered by PunBB, supported by Informer Technologies, Inc.