From 091a4ace0719f6e979141406d81253efefa4b14a Mon Sep 17 00:00:00 2001
From: Matthew Turney <mturney@ussa.edu>
Date: Fri, 2 Oct 2009 11:26:03 -0500
Subject: [PATCH] Added logic check to skip pulling user data from LDAP if it's not configured.

---
 auth/cas/auth.php |   2 ++
 1 files changed, 2 insertions(+)

diff --git a/auth/cas/auth.php b/auth/cas/auth.php
index ee3e72a..85f3f4f 100755
--- a/auth/cas/auth.php
+++ b/auth/cas/auth.php

@@ -359,6 +359,8 @@ if ( !is_object($PHPCAS_CLIENT) ) {
      * @return mixed array with no magic quotes or false on error
      */
     function get_userinfo($username) {
+        // this allows cas to work without LDAP configured
+        if (!$this->config->host_url) return false;
         $textlib = textlib_get_instance();
         $extusername = $textlib->convert(stripslashes($username), 'utf-8', $this->config->ldapencoding);
         $ldapconnection = $this->ldap_connect();
1.6.4.3

