From c6cf40c84db5aac9497b2765e0aa97af87865e47 Mon Sep 17 00:00:00 2001 From: Adam Franco Date: Wed, 9 Jan 2013 11:28:45 -0500 Subject: [PATCH] CASAuthentication - Fix for a change in the arguments for phpCAS::setPGTStorageFile() phpCAS 1.3+ no longer takes a 'format' argument for phpCAS::setPGTStorageFile(). This change allows proxy-ticket storage to work with all versions of phpCAS. --- lib/Authentication/CASAuthentication.php | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/lib/Authentication/CASAuthentication.php b/lib/Authentication/CASAuthentication.php index 272cf5724..f9d9c7b20 100644 --- a/lib/Authentication/CASAuthentication.php +++ b/lib/Authentication/CASAuthentication.php @@ -96,8 +96,13 @@ public function init($args) } else { phpCAS::proxy($args['CAS_PROTOCOL'], $args['CAS_HOST'], intval($args['CAS_PORT']), $args['CAS_PATH'], false); - if (!empty($args['CAS_PROXY_TICKET_PATH'])) - phpCAS::setPGTStorageFile('', $args['CAS_PROXY_TICKET_PATH']); + if (!empty($args['CAS_PROXY_TICKET_PATH'])) { + if (version_compare(PHPCAS_VERSION, '1.3', '>=')) { + phpCAS::setPGTStorageFile($args['CAS_PROXY_TICKET_PATH']); + } else { + phpCAS::setPGTStorageFile('', $args['CAS_PROXY_TICKET_PATH']); + } + } if (!empty($args['CAS_PROXY_FIXED_CALLBACK_URL'])) phpCAS::setFixedCallbackURL($args['CAS_PROXY_FIXED_CALLBACK_URL']);