Skip to content
Snippets Groups Projects
Commit afe9ab06 authored by Eric Rasmussen's avatar Eric Rasmussen
Browse files

Make sure include_path is set at this point

parent dbef8264
No related branches found
No related tags found
No related merge requests found
<?php <?php
require_once 'UNL/Services/Peoplefinder.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 //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 //http://us2.php.net/manual/en/function.unserialize.php
...@@ -35,53 +36,53 @@ ...@@ -35,53 +36,53 @@
public $unlEmailAlias; public $unlEmailAlias;
/** /**
* Takes in a string from the LDAP directory, usually formatted like: * Takes in a string from the LDAP directory, usually formatted like:
* ### ___ UNL 68588-#### * ### ___ UNL 68588-####
* Where ### is the room number, ___ = Building Abbreviation, #### zip extension * Where ### is the room number, ___ = Building Abbreviation, #### zip extension
* *
* @param string * @param string
* @return array Associative array. * @return array Associative array.
*/ */
function formatPostalAddress() { function formatPostalAddress() {
/* this is a faculty postal address /* this is a faculty postal address
Currently of the form: Currently of the form:
### ___ UNL 68588-#### ### ___ UNL 68588-####
Where ### is the room number, ___ = Building Abbreviation, #### zip extension Where ### is the room number, ___ = Building Abbreviation, #### zip extension
*/ */
/** /**
* We assumed that the address format is: ### ___ UNL 68588-####. * We assumed that the address format is: ### ___ UNL 68588-####.
* Some 'fortunate' people have addresses not in this format. * Some 'fortunate' people have addresses not in this format.
*/ */
//RLIM //RLIM
// treat UNL as the delimiter for the streetaddress and zip // treat UNL as the delimiter for the streetaddress and zip
if (strpos($this->postalAddress,'UNL')) { if (strpos($this->postalAddress,'UNL')) {
$addressComponent = explode('UNL', $this->postalAddress); $addressComponent = explode('UNL', $this->postalAddress);
} elseif (strpos($this->postalAddress,'UNO')) { } elseif (strpos($this->postalAddress,'UNO')) {
$addressComponent = explode('UNO', $this->postalAddress); $addressComponent = explode('UNO', $this->postalAddress);
} elseif (strpos($this->postalAddress,'Omaha')) { } elseif (strpos($this->postalAddress,'Omaha')) {
$addressComponent = explode('Omaha', $this->postalAddress); $addressComponent = explode('Omaha', $this->postalAddress);
} else { } else {
$addressComponent = array($this->postalAddress); $addressComponent = array($this->postalAddress);
} }
$address['region'] = 'NE'; $address['region'] = 'NE';
$address['street-address'] = trim($addressComponent[0]); $address['street-address'] = trim($addressComponent[0]);
if (isset($addressComponent[1])) { if (isset($addressComponent[1])) {
$address['postal-code'] = trim($addressComponent[1]); $address['postal-code'] = trim($addressComponent[1]);
} else { } else {
$address['postal-code'] = ''; $address['postal-code'] = '';
} }
switch (substr($address['postal-code'],0,3)) { switch (substr($address['postal-code'],0,3)) {
case '681': case '681':
$address['locality'] = 'Omaha'; $address['locality'] = 'Omaha';
break; break;
case '685': case '685':
default: default:
$address['locality'] = 'Lincoln'; $address['locality'] = 'Lincoln';
break; break;
} }
return $address; return $address;
} }
} }
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment