-
Please i really need a very fast code or guide on how i can restrict every other members to register on my website. I am developing a Student Based Community website and i want ONLY students with .EDU emails to register. How can i do this, i have tried a lot of whitelist plugins that never worked. So i think i need a CSS Code i need to paste inside a UserPro File to allow ONLY .edu emails to register and restrict every other emails like yahoo, hotmail, gmail with a notification message.
Hello Support, i dont know the code to use, i dont know what to write there, am not a programmer, i just know that is where i could edit it, can you kindly provide some lines of tested and working code that i should use to replace the ’email_exist’ case name.
Please kindly do.
someone kindly help, this is not yet working please!
This is what i have on my email_exist case name of userpro/functions/ajax.php
/* Side validate input */
add_action(‘wp_ajax_nopriv_userpro_side_validate’, ‘userpro_side_validate’);
add_action(‘wp_ajax_userpro_side_validate’, ‘userpro_side_validate’);
function userpro_side_validate(){
global $userpro;if ( $_POST[‘action’] != ‘userpro_side_validate’)
die();extract($_POST);
$output[‘error’] = ”;
switch($ajaxcheck) {case ‘envato_purchase_code’:
if ( !$userpro->verify_purchase($input_value) ) {
$output[‘error’] = __(‘Invalid purchase code or Envato API is down.’,’userpro’);
} else {
$output[‘error’] = ”;
}
break;case ‘display_name_exists’:
if ($userpro->display_name_exists($input_value)) {
$output[‘error’] = __(‘The display name is already in use.’,’userpro’);
}
break;case ‘username_exists’:
if (username_exists($input_value)){
$output[‘error’] = __(‘Username already taken.’,’userpro’);
} else if ( !preg_match(“/^[A-Za-z0-9_]+$/”, $input_value) ) {
$output[‘error’] = __(‘Illegal characters are not allowed in username.’,’userpro’);
}
break;case ’email_exists’:
$getTld = explode(“.”, $user_email);
if (!is_email($input_value)) {
$output[‘error’] = __(‘Please enter a valid email.’,’userpro’);
} else if (email_exists($input_value)) {
$output[‘error’] = __(‘Email is taken. Is that you? Try to login‘,’userpro’);
}
if ($user_email->email_exists){
$getTld[1]!=’edu’;
$output [‘error’]= __( ‘ERROR: This email is not a .edu approved email, please choose another one.’,’userpro’ );}
break;
case ‘validatesecretkey’:
if (strlen($input_value) != 20) {
$output[‘error’] = __(‘The secret key you entered is invalid.’,’userpro’);
} else {
$users = get_users(array(
‘meta_key’ => ‘userpro_secret_key’,
‘meta_value’ => $input_value,
‘meta_compare’ => ‘=’,
));
if (!$users[0]) {
$output[‘error’] = __(‘The secret key is invalid or expired.’,’userpro’);
}
}
break;}
$output=json_encode($output);
if(is_array($output)){ print_r($output); }else{ echo $output; } die;
}Hello, please can someone kindly help out with this, i still dont know how to restrict some people from registering on my domain, i only want .edu emails to register on my website
You must be logged in to reply to this topic.