Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
P
PlanetRed
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Model registry
Operate
Environments
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Digital Experience Group
PlanetRed
Commits
afe9ab06
Commit
afe9ab06
authored
14 years ago
by
Eric Rasmussen
Browse files
Options
Downloads
Patches
Plain Diff
Make sure include_path is set at this point
parent
dbef8264
No related branches found
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
plugins/cas_auth_unl/peoplefinder/include.php
+50
-49
50 additions, 49 deletions
plugins/cas_auth_unl/peoplefinder/include.php
with
50 additions
and
49 deletions
plugins/cas_auth_unl/peoplefinder/include.php
+
50
−
49
View file @
afe9ab06
<?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
;
}
}
}
}
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment