private function _callback()
{
phpCAS::traceBegin();
if (preg_match('/PGTIOU-[\\.\\-\\w]/', $_GET['pgtIou'])) {
if (preg_match('/[PT]GT-[\\.\\-\\w]/', $_GET['pgtId'])) {
$this->printHTMLHeader('phpCAS callback');
$pgt_iou = $_GET['pgtIou'];
$pgt = $_GET['pgtId'];
phpCAS::trace('Storing PGT `' . $pgt . '\' (id=`' . $pgt_iou . '\')');
echo '<p>Storing PGT `' . $pgt . '\' (id=`' . $pgt_iou . '\').</p>';
$this->_storePGT($pgt, $pgt_iou);
$this->printHTMLFooter();
phpCAS::traceExit("Successfull Callback");
} else {
phpCAS::error('PGT format invalid' . $_GET['pgtId']);
phpCAS::traceExit('PGT format invalid' . $_GET['pgtId']);
}
} else {
phpCAS::error('PGTiou format invalid' . $_GET['pgtIou']);
phpCAS::traceExit('PGTiou format invalid' . $_GET['pgtIou']);
}
// Flush the buffer to prevent from sending anything other then a 200
// Success Status back to the CAS Server. The Exception would normally
// report as a 500 error.
flush();
throw new CAS_GracefullTerminationException();
}