Hi All,
I have a script that registers users ,email address being one of the required fields that needs to be entered, what i would like to do is have the script check for certain domains and not allow them.Does anybody know if this is possible and if so how?The current code in the script is as follows:
# Check errors
&error("username is missing") if (!$in{'username'});
&error("username is taken") if ($users{$in{'username'}});
@reserved=split(/,/,$config{'reserved_names'});
foreach $line (@reserved) { &error("username has been reserved") if ($in{'username'} eq $line); }
&error("illegal characters in username") unless ($in{'username'} =~ /^[a-z0-9\-\_]*$/);
&error("username needs to be atleast $config{'min_username'} in length") if (length($in{'username'}) < $config{'min_username'});
&error("username needs to be less then $config{'max_username'} in length") if (length($in{'username'}) > $config{'max_username'});
&error("password is missing") if (!$in{'password'});
&error("illegal characters in password") unless ($in{'password'} =~ /^[a-z0-9\-\_]*$/i);
&error("password needs to be atleast $config{'min_password'} in length") if (length($in{'password'}) < $config{'min_password'});
&error("password needs to be less then $config{'max_password'} in length") if (length($in{'password'}) > $config{'max_password'});
&error("missing email address") if (!$in{'email'});
&error("invalid email address") if ($in{'email'} !~ /\@/);
If anyone has any suggestions I'd appreciate it.
Thanks in advance
Denis
I have a script that registers users ,email address being one of the required fields that needs to be entered, what i would like to do is have the script check for certain domains and not allow them.Does anybody know if this is possible and if so how?The current code in the script is as follows:
# Check errors
&error("username is missing") if (!$in{'username'});
&error("username is taken") if ($users{$in{'username'}});
@reserved=split(/,/,$config{'reserved_names'});
foreach $line (@reserved) { &error("username has been reserved") if ($in{'username'} eq $line); }
&error("illegal characters in username") unless ($in{'username'} =~ /^[a-z0-9\-\_]*$/);
&error("username needs to be atleast $config{'min_username'} in length") if (length($in{'username'}) < $config{'min_username'});
&error("username needs to be less then $config{'max_username'} in length") if (length($in{'username'}) > $config{'max_username'});
&error("password is missing") if (!$in{'password'});
&error("illegal characters in password") unless ($in{'password'} =~ /^[a-z0-9\-\_]*$/i);
&error("password needs to be atleast $config{'min_password'} in length") if (length($in{'password'}) < $config{'min_password'});
&error("password needs to be less then $config{'max_password'} in length") if (length($in{'password'}) > $config{'max_password'});
&error("missing email address") if (!$in{'email'});
&error("invalid email address") if ($in{'email'} !~ /\@/);
If anyone has any suggestions I'd appreciate it.
Thanks in advance
Denis