diff --git a/plugins/cas_auth_unl/peoplefinder/include.php b/plugins/cas_auth_unl/peoplefinder/include.php index b50f08439874928049fae138a47b777b02cad0d0..d2123641aa51f9289347e2df0dfb87c712e03d3f 100644 --- a/plugins/cas_auth_unl/peoplefinder/include.php +++ b/plugins/cas_auth_unl/peoplefinder/include.php @@ -1,5 +1,6 @@ -<?php - require_once 'UNL/Services/Peoplefinder.php'; +<?php + set_include_path(dirname(dirname(dirname(dirname(dirname(__FILE__))))).'/lib/php'.PATH_SEPARATOR.get_include_path()); + require_once 'UNL/Services/Peoplefinder.php'; //In order to avoid a "__PHP_Incomplete_Class" problem when we unserialize the Peoplefinder data we need to set up the class here //http://us2.php.net/manual/en/function.unserialize.php @@ -35,53 +36,53 @@ public $unlEmailAlias; /** - * Takes in a string from the LDAP directory, usually formatted like: - * ### ___ UNL 68588-#### - * Where ### is the room number, ___ = Building Abbreviation, #### zip extension - * - * @param string - * @return array Associative array. - */ - function formatPostalAddress() { - /* this is a faculty postal address - Currently of the form: - ### ___ UNL 68588-#### - Where ### is the room number, ___ = Building Abbreviation, #### zip extension - */ - /** - * We assumed that the address format is: ### ___ UNL 68588-####. - * Some 'fortunate' people have addresses not in this format. - */ - //RLIM - // treat UNL as the delimiter for the streetaddress and zip - if (strpos($this->postalAddress,'UNL')) { - $addressComponent = explode('UNL', $this->postalAddress); - } elseif (strpos($this->postalAddress,'UNO')) { - $addressComponent = explode('UNO', $this->postalAddress); - } elseif (strpos($this->postalAddress,'Omaha')) { - $addressComponent = explode('Omaha', $this->postalAddress); - } else { - $addressComponent = array($this->postalAddress); - } - $address['region'] = 'NE'; - $address['street-address'] = trim($addressComponent[0]); - if (isset($addressComponent[1])) { - $address['postal-code'] = trim($addressComponent[1]); - } else { - $address['postal-code'] = ''; - } - switch (substr($address['postal-code'],0,3)) { - case '681': - $address['locality'] = 'Omaha'; - break; - case '685': - default: - $address['locality'] = 'Lincoln'; - break; - } - - return $address; - } + * Takes in a string from the LDAP directory, usually formatted like: + * ### ___ UNL 68588-#### + * Where ### is the room number, ___ = Building Abbreviation, #### zip extension + * + * @param string + * @return array Associative array. + */ + function formatPostalAddress() { + /* this is a faculty postal address + Currently of the form: + ### ___ UNL 68588-#### + Where ### is the room number, ___ = Building Abbreviation, #### zip extension + */ + /** + * We assumed that the address format is: ### ___ UNL 68588-####. + * Some 'fortunate' people have addresses not in this format. + */ + //RLIM + // treat UNL as the delimiter for the streetaddress and zip + if (strpos($this->postalAddress,'UNL')) { + $addressComponent = explode('UNL', $this->postalAddress); + } elseif (strpos($this->postalAddress,'UNO')) { + $addressComponent = explode('UNO', $this->postalAddress); + } elseif (strpos($this->postalAddress,'Omaha')) { + $addressComponent = explode('Omaha', $this->postalAddress); + } else { + $addressComponent = array($this->postalAddress); + } + $address['region'] = 'NE'; + $address['street-address'] = trim($addressComponent[0]); + if (isset($addressComponent[1])) { + $address['postal-code'] = trim($addressComponent[1]); + } else { + $address['postal-code'] = ''; + } + switch (substr($address['postal-code'],0,3)) { + case '681': + $address['locality'] = 'Omaha'; + break; + case '685': + default: + $address['locality'] = 'Lincoln'; + break; + } + + return $address; + } }