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
ae200756
Commit
ae200756
authored
14 years ago
by
Brett Bieber
Browse files
Options
Downloads
Patches
Plain Diff
But wakeup doesn't exist any more! Fix call to undefined function.
parent
72a14e3c
No related branches found
Branches containing commit
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
lib/php/UNL/Peoplefinder/Record.php
+22
-24
22 additions, 24 deletions
lib/php/UNL/Peoplefinder/Record.php
with
22 additions
and
24 deletions
lib/php/UNL/Peoplefinder/Record.php
+
22
−
24
View file @
ae200756
...
...
@@ -12,6 +12,7 @@
*/
class
UNL_Peoplefinder_Record
{
public
$dn
;
// distinguished name
public
$cn
;
public
$ou
;
public
$eduPersonAffiliation
;
...
...
@@ -25,6 +26,7 @@ class UNL_Peoplefinder_Record
public
$telephoneNumber
;
public
$title
;
public
$uid
;
public
$unlHROrgUnitNumber
;
public
$unlHRPrimaryDepartment
;
public
$unlHRAddress
;
public
$unlSISClassLevel
;
...
...
@@ -42,7 +44,7 @@ class UNL_Peoplefinder_Record
// public $unlSISPermZip;
public
$unlSISMajor
;
public
$unlEmailAlias
;
function
__construct
(
$options
=
array
())
{
if
(
isset
(
$options
[
'uid'
])
...
...
@@ -50,9 +52,9 @@ class UNL_Peoplefinder_Record
return
$options
[
'peoplefinder'
]
->
getUID
(
$options
[
'uid'
]);
}
}
/**
* Takes in a string from the LDAP directory, usually formatted like:
* ### ___ UNL 68588-####
...
...
@@ -71,12 +73,12 @@ class UNL_Peoplefinder_Record
$address
[
'locality'
]
=
''
;
$address
[
'region'
]
=
'NE'
;
$address
[
'postal-code'
]
=
''
;
if
(
count
(
$parts
)
==
3
)
{
// Assume we have a street address, city, zip.
$address
[
'locality'
]
=
trim
(
$parts
[
1
]);
}
// Now lets find some important bits.
foreach
(
$parts
as
$part
)
{
if
(
preg_match
(
'/([\d]{5})(\-[\d]{4})?/'
,
$part
))
{
...
...
@@ -84,7 +86,7 @@ class UNL_Peoplefinder_Record
$address
[
'postal-code'
]
=
trim
(
$part
);
}
}
switch
(
substr
(
$address
[
'postal-code'
],
0
,
3
))
{
case
'681'
:
$address
[
'locality'
]
=
'Omaha'
;
...
...
@@ -93,15 +95,15 @@ class UNL_Peoplefinder_Record
$address
[
'locality'
]
=
'Lincoln'
;
break
;
}
return
$address
;
}
/**
/**
* Formats a major subject code into a text description.
*
* @param string $subject Subject code for the major eg: MSYM
*
*
* @return string
*/
public
function
formatMajor
(
$subject
)
...
...
@@ -109,7 +111,7 @@ class UNL_Peoplefinder_Record
$c
=
new
UNL_Cache_Lite
();
if
(
$subject_xml
=
$c
->
get
(
'catalog subjects'
))
{
}
else
{
if
(
$subject_xml
=
file_get_contents
(
'http://bulletin.unl.edu/?view=subjects&format=xml'
))
{
$c
->
save
(
$subject_xml
);
...
...
@@ -118,13 +120,13 @@ class UNL_Peoplefinder_Record
$c
->
get
(
'catalog subjects'
);
}
}
$d
=
new
DOMDocument
();
$d
->
loadXML
(
$subject_xml
);
if
(
$subject_el
=
$d
->
getElementById
(
$subject
))
{
return
$subject_el
->
textContent
;
}
switch
(
$subject
)
{
case
'UNDL'
:
return
'Undeclared'
;
...
...
@@ -134,12 +136,12 @@ class UNL_Peoplefinder_Record
return
$subject
;
}
}
/**
* Format a three letter college abbreviation into the full college name.
*
* @param string $college College abbreviation = FPA
*
*
* @return string College of Fine & Performing Arts
*/
public
function
formatCollege
(
$college
)
...
...
@@ -149,7 +151,7 @@ class UNL_Peoplefinder_Record
if
(
isset
(
$colleges
->
colleges
[
$college
]))
{
return
htmlentities
(
$colleges
->
colleges
[
$college
]);
}
return
$college
;
}
...
...
@@ -172,19 +174,15 @@ class UNL_Peoplefinder_Record
return
'http://planetred.unl.edu/pg/icon/unl_'
.
str_replace
(
'-'
,
'_'
,
$this
->
uid
)
.
'/'
.
$size
.
'/'
;
}
function
__wakeup
()
function
getRoles
()
{
foreach
(
$this
as
$var
=>
$val
)
{
if
(
$val
instanceof
UNL_LDAP_Entry_Attribute
)
{
$this
->
$var
->
__wakeup
();
}
}
return
new
UNL_Peoplefinder_Person_Roles
(
array
(
'dn'
=>
$this
->
dn
));
}
function
__toString
()
{
return
$this
->
uid
;
return
(
string
)
$this
->
uid
;
}
}
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