--- cas.original	2009-07-28 09:59:57.000000000 -0600
+++ cas.module	2009-07-28 10:47:35.000000000 -0600
@@ -172,6 +172,23 @@ function cas_login_check() {
           break;
       }
     }
+
+    // using function check for backward compatibility of the cas libraries.
+    // Newer versions of the cas client use authenticateIfNeeded,
+    // but older versions use forceAuthentication
+    if (is_callable(array(phpCAS,'authenticateIfNeeded')))
+    {
+      phpCAS::authenticateIfNeeded();
+    }
+    else
+    {
+      // If Force Renew is checked, add renew parameter to Server Login URL
+      if ($cas_renew != 0) {
+        $ServerLoginUrl = phpCAS::getServerLoginUrl()."&renew=true";
+        phpCAS::setServerLoginUrl($ServerLoginUrl);
+      }
+      phpCAS::forceAuthentication(); 
+    }
     
     // We're going to try phpCAS auth test
     if (!$cas_force_login) {
@@ -502,11 +519,18 @@ function cas_admin_settings() {
   );
   
   $form['server']['cas_debugfile'] = array(
-  	'#type' => 'textfield',
-  	'#title' => t('CAS debugging output filename'),
-  	'#default_value' => variable_get('cas_debugfile', ''),
-  	'#size' => 30,
-  	'#description' => "Leave empty if you don't want debugging output.",
+    '#type' => 'textfield',
+    '#title' => t('CAS debugging output filename'),
+    '#default_value' => variable_get('cas_debugfile', ''),
+    '#size' => 30,
+    '#description' => "Leave empty if you don't want debugging output.",
+  );
+
+  $form['server']['cas_renew'] = array (
+    '#type' => 'checkbox',
+    '#title' => t('Force renew'),
+    '#default_value' => variable_get('cas_renew', 0),
+    '#description' => t('Check this box if you require users to renew their credentials when they login to Drupal using CAS. Or if your CAS server is configured to require the renew=true parameter.'),
   );
   
   
