Extra registration validation gives blank page on success
I'm trying to finish up a module that does extra validation for registration on my website. It's a university club, so we're trying to make sure that only university students are able to sign up on the site. We do that by asking for their university ID, which we then verify with an ldap request-- the university has their ldap server set up so we have to do the ldap query from a site based on campus. We're using the Pear blowfish encryption module to do that and send it off to the site, then read the response off the page. The page works correctly when when the validation doesn't pass, but it gives me a blank page when the validation is successful. I think it may have something to do with the require_once() calls that I'm using, but I'm not sure how to get around the problem-- I have to include those files in order to do the blowfish encryption.
Anybody know if those require_once() calls would be causing this blank page error (and if so how to get around it), or if not, what might be causing the problem?
Thanks for any help.
Code below:
<?php
function netid_auth_user($op, &$edit, &$account, $category = NULL)
{
switch($op)
{
case 'validate':
if($category == 'account' && !$account->uid)
{
if(!netid_auth_check_id($edit['profile_routeYLogin'], $edit['routeYPass']))
form_set_error('Bad RouteY ID', "Your route Y ID and password did not validate or are already in use on the site.");
else
drupal_set_message("Registration successful.", "status", false);
}
break;
}
}
function netid_auth_check_id($username, $password)
{
// Necessary to be able to run blowfish encryption.
$pearPath = "path/to/pear/module";
set_include_path(".:".$pearPath . PATH_SEPARATOR . substr(get_include_path(), 2));
require_once('CBC_functions.php');
require_once('modules/netid_auth/Blowfish.php');
$blowfishKey = "blowfishkey";
$validationUrl = "http://validationpage.com"; // changed for security
$cipher = new Crypt_Blowfish($blowfishKey);
$cryptedUser = urlencode(Eencrypt($cipher, $username));
$cryptedPass = urlencode(Eencrypt($cipher, $password));
$validationUrl = $validationUrl."?user=$cryptedUser&pass=$cryptedPass";
$result = trim(file_get_contents($validationUrl));
if($result == "true")
return true;
else
return false;
}
?>
I think I found the
I think I found the problem-- it seems to have been caused by one of the included files having a space before the opening "<?php" tag-- removing that fixed the blank page loading problem.