function authCAS($config)
{
require_once dirname(__FILE__) . '/CAS/CAS.php';
// get module configuration
$cas_validate = true;
$cas_version = CAS_VERSION_2_0;
$cas_language = 'english';
// phpCAS::setDebug();
phpCAS::client($cas_version, $config->cashostname, (int) $config->casport, $config->casbaseuri, false);
phpCAS::setLang($cas_language);
error_log("CAS: Entering");
$check = phpCAS::isSessionAuthenticated();
phpCAS::forceAuthentication();
$NetUsername = phpCAS::getUser();
//this stores their network user id
error_log("CAS: Exiting {$NetUsername}");
return $NetUsername;
}