From 35be168a778bb08bb7af19a74c6a4aaee468c946 Mon Sep 17 00:00:00 2001 From: Brett Bieber <brett.bieber@gmail.com> Date: Wed, 15 Sep 2010 16:33:47 +0000 Subject: [PATCH] Upgrade peoplefinder and add UNL_LDAP libs so retrieving UNL users' info functions correctly. --- lib/.pear2registry | Bin 326656 -> 337920 bytes .../pear.unl.edu/UNL_LDAP/0.4.1-info.xml | 140 +++++ .../UNL_Peoplefinder/0.1.0-info.xml | 75 +-- lib/bin/peoplefinder.php | 27 + lib/data/UNL_LDAP/build.xml | 27 + lib/data/UNL_LDAP/config.sample.php | 19 + .../UNL_Peoplefinder/pear.unl.edu/hr_tree.xml | 346 ++++++++---- .../UNL_LDAP/docs/examples/simpleSearch.php | 41 ++ .../UNL_LDAP/docs/examples/twodirectories.php | 45 ++ .../pear.unl.edu/examples/config.inc.php | 2 +- .../pear.unl.edu/examples/getUID.php | 13 +- lib/php/UNL/LDAP.php | 214 ++++++++ lib/php/UNL/LDAP/Entry.php | 74 +++ lib/php/UNL/LDAP/Entry/Attribute.php | 70 +++ lib/php/UNL/LDAP/Exception.php | 31 ++ lib/php/UNL/LDAP/People.php | 169 ++++++ lib/php/UNL/LDAP/Result.php | 145 +++++ lib/php/UNL/Peoplefinder.php | 134 ++++- lib/php/UNL/Peoplefinder/Department.php | 82 ++- .../UNL/Peoplefinder/Department/Search.php | 11 +- lib/php/UNL/Peoplefinder/Driver/LDAP.php | 74 ++- .../Driver/LDAP/AdvancedFilter.php | 2 +- .../Driver/LDAP/AffiliationFilter.php | 25 + .../Driver/LDAP/StandardFilter.php | 23 +- .../Driver/LDAP/TelephoneFilter.php | 18 +- .../UNL/Peoplefinder/Driver/WebService.php | 74 ++- lib/php/UNL/Peoplefinder/DriverInterface.php | 32 +- lib/php/UNL/Peoplefinder/Record.php | 160 ++++-- lib/php/UNL/Peoplefinder/Renderer/HTML.php | 518 ------------------ lib/php/UNL/Peoplefinder/Renderer/JSON.php | 37 -- .../UNL/Peoplefinder/Renderer/Serialized.php | 37 -- lib/php/UNL/Peoplefinder/Renderer/XML.php | 68 --- lib/php/UNL/Peoplefinder/Renderer/vCard.php | 60 -- .../UNL/Peoplefinder/RendererInterface.php | 10 - lib/tests/UNL_LDAP/tests/UNL_LDAPTest.php | 124 +++++ .../pear.unl.edu/PeoplefinderTest.php | 4 +- lib/www/UNL_Peoplefinder/pear.unl.edu/README | 1 - .../pear.unl.edu/advancedForm.php | 19 - .../pear.unl.edu/config-sample.inc.php | 22 +- .../pear.unl.edu/config.inc.php | 22 +- .../pear.unl.edu/css/images/formFilterBG.png | Bin 0 -> 144 bytes .../pear.unl.edu/css/images/formSearchBG.png | Bin 0 -> 227 bytes .../css/images/formSearchEnds.png | Bin 0 -> 696 bytes .../css/images/iconContactSprite.png | Bin 0 -> 1178 bytes .../pear.unl.edu/css/images/selectedBG.png | Bin 0 -> 643 bytes .../pear.unl.edu/css/peoplefinder_default.css | 288 ++++++++++ .../pear.unl.edu/css/small_devices.css | 215 ++++++++ .../pear.unl.edu/departments/index.php | 117 ++-- .../pear.unl.edu/images/formSearch.png | Bin 0 -> 1734 bytes .../pear.unl.edu/images/organization.png | Bin 0 -> 4712 bytes .../UNL_Peoplefinder/pear.unl.edu/index.php | 155 +----- .../pear.unl.edu/scripts/peoplefinder.js | 259 +++++++++ .../UNL_Peoplefinder/pear.unl.edu/service.php | 126 +---- .../pear.unl.edu/standardForm.php | 16 - 54 files changed, 2801 insertions(+), 1370 deletions(-) create mode 100644 lib/.xmlregistry/packages/pear.unl.edu/UNL_LDAP/0.4.1-info.xml create mode 100755 lib/bin/peoplefinder.php create mode 100644 lib/data/UNL_LDAP/build.xml create mode 100644 lib/data/UNL_LDAP/config.sample.php create mode 100644 lib/docs/UNL_LDAP/docs/examples/simpleSearch.php create mode 100644 lib/docs/UNL_LDAP/docs/examples/twodirectories.php create mode 100644 lib/php/UNL/LDAP.php create mode 100644 lib/php/UNL/LDAP/Entry.php create mode 100644 lib/php/UNL/LDAP/Entry/Attribute.php create mode 100644 lib/php/UNL/LDAP/Exception.php create mode 100644 lib/php/UNL/LDAP/People.php create mode 100644 lib/php/UNL/LDAP/Result.php create mode 100644 lib/php/UNL/Peoplefinder/Driver/LDAP/AffiliationFilter.php create mode 100644 lib/tests/UNL_LDAP/tests/UNL_LDAPTest.php create mode 100644 lib/www/UNL_Peoplefinder/pear.unl.edu/css/images/formFilterBG.png create mode 100644 lib/www/UNL_Peoplefinder/pear.unl.edu/css/images/formSearchBG.png create mode 100644 lib/www/UNL_Peoplefinder/pear.unl.edu/css/images/formSearchEnds.png create mode 100644 lib/www/UNL_Peoplefinder/pear.unl.edu/css/images/iconContactSprite.png create mode 100644 lib/www/UNL_Peoplefinder/pear.unl.edu/css/images/selectedBG.png create mode 100644 lib/www/UNL_Peoplefinder/pear.unl.edu/css/peoplefinder_default.css create mode 100644 lib/www/UNL_Peoplefinder/pear.unl.edu/css/small_devices.css create mode 100644 lib/www/UNL_Peoplefinder/pear.unl.edu/images/formSearch.png create mode 100644 lib/www/UNL_Peoplefinder/pear.unl.edu/images/organization.png create mode 100644 lib/www/UNL_Peoplefinder/pear.unl.edu/scripts/peoplefinder.js diff --git a/lib/.pear2registry b/lib/.pear2registry index f1a18171f6e65c0ce4cc073126812778b1760c3e..4725af4a3c8e5ef360ce2e3221cbd16284336017 100644 GIT binary patch delta 12373 zcmcI~d3+RAwtwBFI|*5#2?>Ef2M8D;NiAL7Rbfk5L_{QrVHL2p4lR&`EQF{Sx-#R+ zD(ZdDd80V1`qTl@v^tK$jN|BYRL1S;_(b&MF3!(!=I6|t`OM7k+^TdoqQ7~6ynL!E z)%Tuz@44rmd(QWqTYLT-+H-2`!3lxUf`BeM6rK++mG2cFvyYIHEb@u~r5BLDlCQ|` z$yxFdd5^qJ-XO0WA6-z5k1r2ihXO!Qm3#P&j9HU%@os@6@XKTd`4#z)Tu1(mEWwZA z-I(Fukz8o90Z$rFOUqG5)3(jqY@?;cF<PtON0noD<d)IO^20}JN`raDbV4~|CqKra z<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eYiqU>N99%uZM_9g8MJL@cHx&2STrq$CEafzJeb13gYY3pTc9Pg%}Va>==Q z|EqXzo_i7cDlXIpA+ZO?%HnTSFadeb8PAs$QjnKX6JjU$e@27YAoL~7%00O`M<~ZM cm<z~PI{`K1LGAyd>B768j}{9yKfufWAHDFSOaK4? diff --git a/lib/.xmlregistry/packages/pear.unl.edu/UNL_LDAP/0.4.1-info.xml b/lib/.xmlregistry/packages/pear.unl.edu/UNL_LDAP/0.4.1-info.xml new file mode 100644 index 00000000..af5a4888 --- /dev/null +++ b/lib/.xmlregistry/packages/pear.unl.edu/UNL_LDAP/0.4.1-info.xml @@ -0,0 +1,140 @@ +<?xml version="1.0" encoding="UTF-8"?> +<package xmlns="http://pear.php.net/dtd/package-2.0" xmlns:tasks="http://pear.php.net/dtd/tasks-1.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" packagerversion="1.9.0" version="2.0" xsi:schemaLocation="http://pear.php.net/dtd/tasks-1.0 http://pear.php.net/dtd/tasks-1.0.xsd http://pear.php.net/dtd/package-2.0 http://pear.php.net/dtd/package-2.0.xsd"> + <name>UNL_LDAP</name> + <channel>pear.unl.edu</channel> + <summary>LDAP directory services for UNL</summary> + <description>This package simplifies connecting to UNL's LDAP directory for searching for data.</description> + <lead> + <name>Brett Bieber</name> + <user>saltybeagle</user> + <email>brett.bieber@gmail.com</email> + <active>yes</active> + </lead> + <date>2010-09-15</date> + <time>11:32:33</time> + <version> + <release>0.4.1</release> + <api>0.4.0</api> + </version> + <stability> + <release>beta</release> + <api>beta</api> + </stability> + <license uri="http://www1.unl.edu/wdn/wiki/Software_License">BSD</license> + <notes> +Bugfix Release: +* Switch to protected attributes instead of private for easier serialization. + </notes> + <contents> + <dir name="/"> + <file name="UNL/LDAP/Result.php" role="php" md5sum="58a0fd030a6b9cc8dd721d3feddb8240"/> + <file name="UNL/LDAP/People.php" role="php" md5sum="89f2d218e91e3fd2413c79df8758e455"/> + <file name="UNL/LDAP/Exception.php" role="php" md5sum="3c3d370c93d9c8fa86039a7650872a2a"/> + <file name="UNL/LDAP/Entry/Attribute.php" role="php" md5sum="0718586648d0db9433f8c983c162269d"/> + <file name="UNL/LDAP/Entry.php" role="php" md5sum="d0fe31664523d1b6f3492db0435d7398"/> + <file name="UNL/LDAP.php" role="php" md5sum="913f674a02c3e4c2c5fbeeaa61dd963f"/> + <file name="tests/UNL_LDAPTest.php" role="test" md5sum="1fa66e7b752de71d29bc1b34d891e139"/> + <file name="docs/examples/twodirectories.php" role="doc" md5sum="4ec63a962bbddbfd1d9b12eafe8148b1"/> + <file name="docs/examples/simpleSearch.php" role="doc" md5sum="2b7c406732936e26f498af7cb4d050a8"/> + <file name="config.sample.php" role="data" md5sum="0218ccc36b1ac31b6a241c43d06bb775"/> + <file name="build.xml" role="data" md5sum="70050811287cb990cdd6e409049e2b5e"/> + </dir> + </contents> + <dependencies> + <required> + <php> + <min>5.1.6</min> + </php> + <pearinstaller> + <min>1.5.4</min> + </pearinstaller> + </required> + </dependencies> + <phprelease> + <changelog> + <release> + <version> + <release>0.1.0</release> + <api>0.1.0</api> + </version> + <stability> + <release>alpha</release> + <api>alpha</api> + </stability> + <date>2008-02-01</date> + <license uri="http://www1.unl.edu/wdn/wiki/Software_License">BSD</license> + <notes> +First release. + </notes> + </release> + <release> + <version> + <release>0.2.0</release> + <api>0.2.0</api> + </version> + <stability> + <release>alpha</release> + <api>alpha</api> + </stability> + <date>2008-03-26</date> + <license uri="http://www1.unl.edu/wdn/wiki/Software_License">BSD</license> + <notes> +API change feature release +* Remove singleton - multiple connections and multiple directories can now be used. +* Add setOptions(), connect(), disconnect(), &getLink() methods. +* Implement destructor which disconnects from the server. + </notes> + </release> + <release> + <version> + <release>0.3.0</release> + <api>0.3.0</api> + </version> + <stability> + <release>beta</release> + <api>beta</api> + </stability> + <date>2008-11-10</date> + <license uri="http://www1.unl.edu/wdn/wiki/Software_License">BSD</license> + <notes> +Feature release: +Issue #8: Throw exception on connection errors. +Bump stability to beta. + </notes> + </release> + <release> + <version> + <release>0.4.0</release> + <api>0.4.0</api> + </version> + <stability> + <release>beta</release> + <api>beta</api> + </stability> + <date>2009-05-11</date> + <license uri="http://www1.unl.edu/wdn/wiki/Software_License">BSD</license> + <notes> +Feature release: +Add backup LDAP server. +Increase PHP dependency to 5.1.6 + </notes> + </release> + <release> + <version> + <release>0.4.1</release> + <api>0.4.0</api> + </version> + <stability> + <release>beta</release> + <api>beta</api> + </stability> + <date>2010-04-23</date> + <license uri="http://www1.unl.edu/wdn/wiki/Software_License">BSD</license> + <notes> +Bugfix Release: +* Switch to protected attributes instead of private for easier serialization. + </notes> + </release> + </changelog> + </phprelease> +</package> diff --git a/lib/.xmlregistry/packages/pear.unl.edu/UNL_Peoplefinder/0.1.0-info.xml b/lib/.xmlregistry/packages/pear.unl.edu/UNL_Peoplefinder/0.1.0-info.xml index 21affbe5..cb1c3507 100644 --- a/lib/.xmlregistry/packages/pear.unl.edu/UNL_Peoplefinder/0.1.0-info.xml +++ b/lib/.xmlregistry/packages/pear.unl.edu/UNL_Peoplefinder/0.1.0-info.xml @@ -15,8 +15,8 @@ directory information and perform searches. <email>brett.bieber@gmail.com</email> <active>yes</active> </lead> - <date>2010-01-27</date> - <time>10:10:32</time> + <date>2010-09-15</date> + <time>11:33:00</time> <version> <release>0.1.0</release> <api>0.1.0</api> @@ -35,49 +35,58 @@ web service, and no LDAP connection info is required. Package UNL_Peoplefinder API release notes for version 0.1.0.</notes> <contents> <dir name="/"> - <file role="www" name="www/standardForm.php" md5sum="0bb606ab21c3e7b7ffe2b1927d0157d8"/> - <file role="www" name="www/small_devices.css" md5sum="671b2a2b7ff388a6c7a0256a27dc57a7"/> - <file role="www" name="www/service.php" md5sum="49caa1e90509e3af7431dd3276b16ed1"/> - <file role="www" name="www/README" md5sum="387849598c64632e513c7eefa2155e12"/> - <file role="www" name="www/peoplefinder_default.css" md5sum="6f1677797f73b1a31fecba23a6ce11b2"/> - <file role="www" name="www/peoplefinder.js" md5sum="bc5c3ec9319cc14f1d3ae22ed731321b"/> - <file role="www" name="www/index.php" md5sum="51f36d605af956784f4ab16047dfc02f"/> + <file role="www" name="www/standardForm.php" md5sum=""/> + <file role="www" name="www/service.php" md5sum="7c51e429ab603bf7129fd6ee69f8c2e2"/> + <file role="www" name="www/scripts/peoplefinder.js" md5sum="a35c15f7554182665f2960f07996bfb9"/> + <file role="www" name="www/README" md5sum="2b888a310056fb2a054dda6b1c5ae552"/> + <file role="www" name="www/index.php" md5sum="f41b9dc3311b71344f65b38d48170309"/> <file role="www" name="www/images/person.gif" md5sum="833a67d6d816e88d0bfe25b2854d2295"/> + <file role="www" name="www/images/organization.png" md5sum="f8667cbb5d7165d8b49b401c0b57a884"/> <file role="www" name="www/images/mobile.gif" md5sum="c5489ea5b5eb1d8814e2b49f6fdb9cdd"/> <file role="www" name="www/images/icon_question.gif" md5sum="e26a423eed7840f8eece890631e246b9"/> <file role="www" name="www/images/home.gif" md5sum="d2c93d8510e7fc077f9ef7765ff20a89"/> - <file role="www" name="www/departments/index.php" md5sum="37bbf184fb9944a5e29c33dd7ce6d323"/> - <file role="www" name="www/config.inc.php" md5sum="49d1a921b7b4edb23b1e2e4bdc766000"/> - <file role="www" name="www/config-sample.inc.php" md5sum="3b75e12039198b0f51c41a6e7c8360eb"/> + <file role="www" name="www/images/formSearch.png" md5sum="e751fdb5eb627b51b7f78c44b6eb4397"/> + <file role="www" name="www/departments/index.php" md5sum="8d5530ad679e9c1ae055e6955d1c17df"/> + <file role="www" name="www/css/small_devices.css" md5sum="f65099d2d6f85185873927e7fe3db72d"/> + <file role="www" name="www/css/peoplefinder_default.css" md5sum="7198d99ca186895f0d71d54361cc0e40"/> + <file role="www" name="www/css/images/selectedBG.png" md5sum="0351aecb36c3ed5650b137298a3858bd"/> + <file role="www" name="www/css/images/iconContactSprite.png" md5sum="ef07bb5f2c644144477b3f30c5394d9f"/> + <file role="www" name="www/css/images/formSearchEnds.png" md5sum="0da0b153ab9ee55b02997f70e6b8f401"/> + <file role="www" name="www/css/images/formSearchBG.png" md5sum="551928d28da5f3d1ef8c865b223a27f8"/> + <file role="www" name="www/css/images/formFilterBG.png" md5sum="af56cd3c9ce245d1e04c17ad7b89a084"/> + <file role="www" name="www/config.inc.php" md5sum="dac1fbcde7d75f4d222cc60bb012b48b"/> + <file role="www" name="www/config-sample.inc.php" md5sum="658348cab33f4ec032d9e34671ed8c2d"/> <file role="www" name="www/apple-touch-icon.png" md5sum="e182bd1eb8858d0f406187e21d03c6fd"/> - <file role="www" name="www/advancedForm.php" md5sum="be5159d40d1cc6f9ed6399089fd748da"/> + <file role="www" name="www/advancedForm.php" md5sum=""/> <file role="test" name="tests/testStudentWithNoLocalAddress.html" md5sum="1636d84da04979ce70d9d46b862f896b"/> - <file role="test" name="tests/PeoplefinderTest.php" md5sum="d4da346cb13ca1357ee89b37b59dba6c"/> + <file role="test" name="tests/PeoplefinderTest.php" md5sum="4401d4a149a94650348b1f6ad2135f47"/> <file role="test" name="tests/OUTest.php" md5sum="e40ef5265dd4213fdcbfeb0735e1b8b0"/> <file role="test" name="tests/BrowserTest.php" md5sum="9cce4b1ffdbab7375b1cf3f60fb4987d"/> - <file role="php" name="src/UNL/Peoplefinder/RendererInterface.php" md5sum="7b52d098c49dd4e9915741ac794d8f4a"/> - <file role="php" name="src/UNL/Peoplefinder/Renderer/XML.php" md5sum="9b612809c71a7af3b22de36ea4988b78"/> - <file role="php" name="src/UNL/Peoplefinder/Renderer/vCard.php" md5sum="7c9aeb7c9a898849c173dd894f0f3a05"/> - <file role="php" name="src/UNL/Peoplefinder/Renderer/Serialized.php" md5sum="b7edf78a1f82cd2e790e879462ae5dd3"/> - <file role="php" name="src/UNL/Peoplefinder/Renderer/JSON.php" md5sum="7fa212209cb5e86cb2aefda0b2fca12d"/> - <file role="php" name="src/UNL/Peoplefinder/Renderer/HTML.php" md5sum="9f2789e9724ce6d8033be663c9ed4131"/> - <file role="php" name="src/UNL/Peoplefinder/Record.php" md5sum="7071048e5e91575c01ccb92019c7cafe"/> - <file role="php" name="src/UNL/Peoplefinder/DriverInterface.php" md5sum="8f211374f1a6609f9609ea90c74afcba"/> - <file role="php" name="src/UNL/Peoplefinder/Driver/WebService.php" md5sum="5abd2c0936d173df09c1a36cbd4ee510"/> + <file role="php" name="src/UNL/Peoplefinder/RendererInterface.php" md5sum=""/> + <file role="php" name="src/UNL/Peoplefinder/Renderer/XML.php" md5sum=""/> + <file role="php" name="src/UNL/Peoplefinder/Renderer/vCard.php" md5sum=""/> + <file role="php" name="src/UNL/Peoplefinder/Renderer/Serialized.php" md5sum=""/> + <file role="php" name="src/UNL/Peoplefinder/Renderer/JSON.php" md5sum=""/> + <file role="php" name="src/UNL/Peoplefinder/Renderer/HTML.php" md5sum=""/> + <file role="php" name="src/UNL/Peoplefinder/Record.php" md5sum="c32a4b093437095661fc2c5ea720c2c0"/> + <file role="php" name="src/UNL/Peoplefinder/DriverInterface.php" md5sum="03bddb8125850770002718a5f6f45e0a"/> + <file role="php" name="src/UNL/Peoplefinder/Driver/WebService.php" md5sum="de01b423492868f91e70ef996e4799ed"/> <file role="php" name="src/UNL/Peoplefinder/Driver/LDAP/Util.php" md5sum="7dc7a0423d62a6e193523d84ad89f4af"/> - <file role="php" name="src/UNL/Peoplefinder/Driver/LDAP/TelephoneFilter.php" md5sum="6cfe4455d67a76d642dc4b8239e367ac"/> - <file role="php" name="src/UNL/Peoplefinder/Driver/LDAP/StandardFilter.php" md5sum="87b019a6a8a57d0bdfe37145800e23d6"/> + <file role="php" name="src/UNL/Peoplefinder/Driver/LDAP/TelephoneFilter.php" md5sum="613b64dfe87494a1bf2005f003de7c3d"/> + <file role="php" name="src/UNL/Peoplefinder/Driver/LDAP/StandardFilter.php" md5sum="b8f01bf21004dc81c3979892cf8ee92a"/> <file role="php" name="src/UNL/Peoplefinder/Driver/LDAP/OUFilter.php" md5sum="7028b5a762580c32c76f70c8ccdd14bc"/> - <file role="php" name="src/UNL/Peoplefinder/Driver/LDAP/AdvancedFilter.php" md5sum="4547ed66c563bd0f8b24d1f07728dbfd"/> - <file role="php" name="src/UNL/Peoplefinder/Driver/LDAP.php" md5sum="5b2d241e70cccdff56d6504691fad864"/> - <file role="php" name="src/UNL/Peoplefinder/Department/Search.php" md5sum="3c3a87e9fc95a53231dd408b45c82d0a"/> - <file role="php" name="src/UNL/Peoplefinder/Department.php" md5sum="763b1e19c28712a251c1552857cf8e7d"/> - <file role="php" name="src/UNL/Peoplefinder.php" md5sum="86236345234234cc5a4dd1e66a2e8393"/> - <file role="doc" name="examples/getUID.php" md5sum="b2e8620bc6e9b9ce921ebea48bab3133"/> + <file role="php" name="src/UNL/Peoplefinder/Driver/LDAP/AffiliationFilter.php" md5sum="04de55c30f2ba6e6cc59cf7064637faa"/> + <file role="php" name="src/UNL/Peoplefinder/Driver/LDAP/AdvancedFilter.php" md5sum="277d3960216fca172340e3e922a41d1f"/> + <file role="php" name="src/UNL/Peoplefinder/Driver/LDAP.php" md5sum="79ca15cea10ea91bdf1663bae8ae5c86"/> + <file role="php" name="src/UNL/Peoplefinder/Department/Search.php" md5sum="2492838aec5517effcba1ec095397b6e"/> + <file role="php" name="src/UNL/Peoplefinder/Department.php" md5sum="5c0353c08b9e48e1153b3af5cb62737f"/> + <file role="php" name="src/UNL/Peoplefinder.php" md5sum="e819399325bb52b207cda328a2dcf023"/> + <file role="script" name="scripts/peoplefinder.php" md5sum="2f8dbe7651b0534dd604e5e5c2f6b4bd"/> + <file role="doc" name="examples/getUID.php" md5sum="354a9851ede9e65a48e85653f47af9d7"/> <file role="doc" name="examples/getLikeMatches.php" md5sum="ff695239f9295eabaa187cf74e056408"/> <file role="doc" name="examples/getExactMatches.php" md5sum="187f8be90f09db8cb49a7aec912be8c4"/> - <file role="doc" name="examples/config.inc.php" md5sum="8aa9afd73dcf4178a8214b98eb2c5771"/> - <file role="data" name="data/hr_tree.xml" md5sum="d9962fcbef0e4e6ed3869f9dc4843899"/> + <file role="doc" name="examples/config.inc.php" md5sum="225033b0a9a0656843bdc5f75e31592a"/> + <file role="data" name="data/hr_tree.xml" md5sum="3f2f7bf61f627264c6c3b977aa0bbcb5"/> </dir> </contents> <dependencies> diff --git a/lib/bin/peoplefinder.php b/lib/bin/peoplefinder.php new file mode 100755 index 00000000..34ab8888 --- /dev/null +++ b/lib/bin/peoplefinder.php @@ -0,0 +1,27 @@ +#!/usr/bin/env php +<?php +ini_set('display_errors', true); +error_reporting(E_ALL|E_STRICT); + +function autoload($class) +{ + $class = str_replace('_', '/', $class); + include $class . '.php'; +} + +spl_autoload_register("autoload"); + +set_include_path(dirname(dirname(__FILE__)).'/src/'.PATH_SEPARATOR.dirname(dirname(__FILE__)).'/lib/php'); +require_once 'UNL/Autoload.php'; + +$options = UNL_Peoplefinder_CLI_Router::route(); +$options['driver'] = new UNL_Peoplefinder_Driver_WebService(); +$peoplefinder = new UNL_Peoplefinder($options); + +Savvy_ClassToTemplateMapper::$classname_replacement = 'UNL_'; +$savvy = new Savvy(); +$savvy->setTemplatePath(dirname(dirname(__FILE__)).'/data/cli'); + +echo $savvy->render($peoplefinder); + +?> \ No newline at end of file diff --git a/lib/data/UNL_LDAP/build.xml b/lib/data/UNL_LDAP/build.xml new file mode 100644 index 00000000..00b85eab --- /dev/null +++ b/lib/data/UNL_LDAP/build.xml @@ -0,0 +1,27 @@ +<?xml version="1.0" encoding="UTF-8"?> +<project name="UNL_LDAP" default="build" basedir="."> + <target name="build" depends="checkphp,php-documentor,php-codesniffer,phpunit"/> + <target name="checkphp"> + <apply executable="php" failonerror="true"> + <arg value="-l" /> + <fileset dir="${basedir}"> + <include name="**/*.php" /> + </fileset> + </apply> + </target> + <target name="php-documentor"> + <exec executable="phpdoc" dir="${basedir}" logerror="on"> + <arg line="-ue on -t ${basedir}/build/api -d ."/> + </exec> + </target> + <target name="php-codesniffer"> + <exec executable="phpcs" dir="${basedir}" output="${basedir}/build/logs/checkstyle.xml"> + <arg line="--report=checkstyle --standard=PEAR ."/> + </exec> + </target> + <target name="phpunit"> + <exec executable="phpunit" dir="${basedir}" failonerror="on"> + <arg line=" --log-xml ${basedir}/build/logs/phpunit.xml --log-pmd ${basedir}/build/logs/phpunit.pmd.xml --log-metrics ${basedir}/build/logs/phpunit.metrics.xml UNL_LDAPTest ${basedir}/tests/UNL_LDAPTest.php"/> + </exec> + </target> +</project> \ No newline at end of file diff --git a/lib/data/UNL_LDAP/config.sample.php b/lib/data/UNL_LDAP/config.sample.php new file mode 100644 index 00000000..bea137cf --- /dev/null +++ b/lib/data/UNL_LDAP/config.sample.php @@ -0,0 +1,19 @@ +<?php +/** + * This is a sample configuration file for the LDAP connection + * + * PHP version 5 + * + * $Id$ + * + * @category Default + * @package UNL_LDAP + * @author Brett Bieber <brett.bieber@gmail.com> + * @copyright 2009 Regents of the University of Nebraska + * @license http://www1.unl.edu/wdn/wiki/Software_License BSD License + * @link http://pear.unl.edu/package/UNL_LDAP + */ +require_once 'UNL/LDAP.php'; + +$options['bind_dn'] = 'uid=youruidhere,ou=service,dc=unl,dc=edu'; +$options['bind_password'] = 'yourpasswordhere'; diff --git a/lib/data/UNL_Peoplefinder/pear.unl.edu/hr_tree.xml b/lib/data/UNL_Peoplefinder/pear.unl.edu/hr_tree.xml index b5ca227e..729b22dd 100644 --- a/lib/data/UNL_Peoplefinder/pear.unl.edu/hr_tree.xml +++ b/lib/data/UNL_Peoplefinder/pear.unl.edu/hr_tree.xml @@ -1,6 +1,6 @@ <?xml version="1.0"?> <!DOCTYPE tree SYSTEM "treeml.dtd"> -<!-- Generated Tue Nov 17 14:04:19 2009 --> +<!-- Generated Wed Sep 1 08:47:38 2010 --> <tree> <declarations> <attributeDecl name="name" type="String" /> @@ -62,6 +62,10 @@ <branch> <attribute name="name" value="Peter Kiewit Institute"/> <attribute name="org_unit" value="50006525"/> + <branch> + <attribute name="name" value="Peter Kiewit Institute - Omaha"/> + <attribute name="org_unit" value="50006950"/> + </branch> </branch> </branch> <branch> @@ -82,17 +86,8 @@ <attribute name="postal_code" value="68583-0742"/> </branch> <branch> - <attribute name="name" value="Audit and Advisory Services"/> - <attribute name="org_unit" value="50000327"/> - <attribute name="building" value="Varner Hall"/> - <attribute name="room" value="207"/> - <attribute name="city" value="Lincoln"/> - <attribute name="state" value="NE"/> - <attribute name="postal_code" value="68583-0742"/> - <branch> - <attribute name="name" value="Administrative Systems Group"/> - <attribute name="org_unit" value="50002325"/> - </branch> + <attribute name="name" value="Administrative Systems Group"/> + <attribute name="org_unit" value="50002325"/> </branch> </branch> <branch> @@ -229,6 +224,23 @@ <attribute name="org_unit" value="50004475"/> </branch> </branch> + <branch> + <attribute name="name" value="Audit and Advisory Services"/> + <attribute name="org_unit" value="50000327"/> + <attribute name="building" value="Varner Hall"/> + <attribute name="room" value="207"/> + <attribute name="city" value="Lincoln"/> + <attribute name="state" value="NE"/> + <attribute name="postal_code" value="68583-0742"/> + </branch> + <branch> + <attribute name="name" value="Nebraska P-16 Initiative"/> + <attribute name="org_unit" value="50007200"/> + </branch> + </branch> + <branch> + <attribute name="name" value="Corporation Secretary"/> + <attribute name="org_unit" value="50007201"/> </branch> </branch> <branch> @@ -307,15 +319,6 @@ <attribute name="state" value="NE"/> <attribute name="postal_code" value="68588-0413"/> </branch> - <branch> - <attribute name="name" value="Academic Conferences"/> - <attribute name="org_unit" value="50001053"/> - <attribute name="building" value="NCCE"/> - <attribute name="room" value="271"/> - <attribute name="city" value="Lincoln"/> - <attribute name="state" value="NE"/> - <attribute name="postal_code" value="68583-9100"/> - </branch> <branch> <attribute name="name" value="Financial Systems"/> <attribute name="org_unit" value="50006425"/> @@ -651,6 +654,15 @@ <attribute name="state" value="NE"/> <attribute name="postal_code" value="68583-9100"/> </branch> + <branch> + <attribute name="name" value="Academic Conferences"/> + <attribute name="org_unit" value="50001053"/> + <attribute name="building" value="NCCE"/> + <attribute name="room" value="271"/> + <attribute name="city" value="Lincoln"/> + <attribute name="state" value="NE"/> + <attribute name="postal_code" value="68583-9100"/> + </branch> <branch> <attribute name="name" value="EE&O Distance Education Srvcs"/> <attribute name="org_unit" value="50003002"/> @@ -846,6 +858,15 @@ <attribute name="state" value="NE"/> <attribute name="postal_code" value="68583-0902"/> </branch> + <branch> + <attribute name="name" value="Graduate Studies"/> + <attribute name="org_unit" value="50000900"/> + <attribute name="building" value="SHE"/> + <attribute name="room" value="1100"/> + <attribute name="city" value="UNL"/> + <attribute name="state" value="NE"/> + <attribute name="postal_code" value="68588-0619"/> + </branch> <branch> <attribute name="name" value="International Affairs"/> <attribute name="org_unit" value="50000901"/> @@ -1046,7 +1067,7 @@ </branch> </branch> <branch> - <attribute name="name" value="Geosciences"/> + <attribute name="name" value="Earth and Atmospheric Sciences"/> <attribute name="org_unit" value="50001086"/> <attribute name="building" value="Bessey Hall"/> <attribute name="room" value="214"/> @@ -1276,7 +1297,7 @@ <attribute name="postal_code" value="68182-0181"/> </branch> <branch> - <attribute name="name" value="School of Architecture & ConstructionUNL"/> + <attribute name="name" value="Durham School Arch Engr & Const"/> <attribute name="org_unit" value="50004975"/> <branch> <attribute name="name" value="Construction Management"/> @@ -1622,15 +1643,6 @@ <attribute name="city" value="UNL"/> <attribute name="state" value="NE"/> <attribute name="postal_code" value="68588-0433"/> - <branch> - <attribute name="name" value="Graduate Studies"/> - <attribute name="org_unit" value="50000900"/> - <attribute name="building" value="SHE"/> - <attribute name="room" value="1100"/> - <attribute name="city" value="UNL"/> - <attribute name="state" value="NE"/> - <attribute name="postal_code" value="68588-0619"/> - </branch> <branch> <attribute name="name" value="Technology Development"/> <attribute name="org_unit" value="50000931"/> @@ -1761,6 +1773,15 @@ <attribute name="city" value="UNL"/> <attribute name="state" value="NE"/> <attribute name="postal_code" value="68583-0705"/> + <branch> + <attribute name="name" value="Greater NE Business Center"/> + <attribute name="org_unit" value="50000888"/> + <attribute name="building" value="ARDC"/> + <attribute name="room" value="1071 County Rd G"/> + <attribute name="city" value="Ithaca"/> + <attribute name="state" value="NE"/> + <attribute name="postal_code" value="68033"/> + </branch> <branch> <attribute name="name" value="Filley Hall Business Center"/> <attribute name="org_unit" value="50000913"/> @@ -2666,6 +2687,18 @@ <branch> <attribute name="name" value="Knoll Center"/> <attribute name="org_unit" value="50006775"/> + <branch> + <attribute name="name" value="Knoll Facilities Operations"/> + <attribute name="org_unit" value="50006776"/> + </branch> + <branch> + <attribute name="name" value="Knoll Snack Bar"/> + <attribute name="org_unit" value="50006778"/> + </branch> + <branch> + <attribute name="name" value="Knoll Residence Life"/> + <attribute name="org_unit" value="50006779"/> + </branch> </branch> </branch> <branch> @@ -2814,6 +2847,15 @@ <attribute name="state" value="NE"/> <attribute name="postal_code" value="68502"/> </branch> + <branch> + <attribute name="name" value="Midwest Archeological Ctr"/> + <attribute name="org_unit" value="50001422"/> + <attribute name="building" value="100 Centennial Mall N"/> + <attribute name="room" value="47"/> + <attribute name="city" value="Lincoln"/> + <attribute name="state" value="NE"/> + <attribute name="postal_code" value="68508"/> + </branch> <branch> <attribute name="name" value="Saratoga Elementary School"/> <attribute name="org_unit" value="50001600"/> @@ -2936,6 +2978,10 @@ <attribute name="state" value="NE"/> <attribute name="postal_code" value="68507"/> </branch> + <branch> + <attribute name="name" value="Friendship Home"/> + <attribute name="org_unit" value="50006926"/> + </branch> </branch> </branch> <branch> @@ -3488,15 +3534,6 @@ <attribute name="city" value="68198-5060"/> <attribute name="state" value="NE"/> <attribute name="postal_code" value="UNMC"/> - <branch> - <attribute name="name" value="Lions Eye Bank"/> - <attribute name="org_unit" value="50001235"/> - <attribute name="building" value="ESMA"/> - <attribute name="room" value="1002"/> - <attribute name="city" value="68198-5541"/> - <attribute name="state" value="NE"/> - <attribute name="postal_code" value="UNMC"/> - </branch> <branch> <attribute name="name" value="Bookstore & Parking Services"/> <attribute name="org_unit" value="50006475"/> @@ -4084,6 +4121,19 @@ <attribute name="city" value="68198-3135"/> <attribute name="state" value="NE"/> <attribute name="postal_code" value="UNMC"/> + <branch> + <attribute name="name" value="Lions Eye Bank"/> + <attribute name="org_unit" value="50001235"/> + <attribute name="building" value="ESMA"/> + <attribute name="room" value="1002"/> + <attribute name="city" value="68198-5541"/> + <attribute name="state" value="NE"/> + <attribute name="postal_code" value="UNMC"/> + </branch> + <branch> + <attribute name="name" value="FACT"/> + <attribute name="org_unit" value="50007025"/> + </branch> </branch> <branch> <attribute name="name" value="Pediatrics"/> @@ -4382,6 +4432,10 @@ <attribute name="name" value="Surgical Oncology"/> <attribute name="org_unit" value="50005675"/> </branch> + <branch> + <attribute name="name" value="Surgery-Pediatric General"/> + <attribute name="org_unit" value="50006378"/> + </branch> </branch> <branch> <attribute name="name" value="Continuing Education"/> @@ -4843,6 +4897,10 @@ <attribute name="name" value="MMI Ctr for Ped Feeding Disord"/> <attribute name="org_unit" value="50006125"/> </branch> + <branch> + <attribute name="name" value="MMI Neurogenetic Comm Disorders Prg"/> + <attribute name="org_unit" value="50007075"/> + </branch> </branch> <branch> <attribute name="name" value="Information Technology Services"/> @@ -5003,6 +5061,15 @@ <attribute name="state" value="NE"/> <attribute name="postal_code" value="68583-0740"/> </branch> + <branch> + <attribute name="name" value="COD-General Research"/> + <attribute name="org_unit" value="50000742"/> + <attribute name="building" value="DENT"/> + <attribute name="room" value="110A"/> + <attribute name="city" value="UNMC"/> + <attribute name="state" value="NE"/> + <attribute name="postal_code" value="68583-0740"/> + </branch> <branch> <attribute name="name" value="COD-University Dental Associates"/> <attribute name="org_unit" value="50000744"/> @@ -5021,6 +5088,15 @@ <attribute name="state" value="NE"/> <attribute name="postal_code" value="68583-0740"/> </branch> + <branch> + <attribute name="name" value="COD-UNMC Adult Dentistry"/> + <attribute name="org_unit" value="50000751"/> + <attribute name="building" value="DCC"/> + <attribute name="room" value="3615B"/> + <attribute name="city" value="UNMC"/> + <attribute name="state" value="NE"/> + <attribute name="postal_code" value="68198-9375"/> + </branch> <branch> <attribute name="name" value="COD-Hospital Dentistry"/> <attribute name="org_unit" value="50000752"/> @@ -5341,6 +5417,10 @@ <attribute name="name" value="COPH Health Disparities"/> <attribute name="org_unit" value="50005429"/> </branch> + <branch> + <attribute name="name" value="COPH Hlth Pol Analys & Rur Hlth Res"/> + <attribute name="org_unit" value="50005430"/> + </branch> <branch> <attribute name="name" value="COPH Hlth Prm, Soc, & Behv Hlth Sci"/> <attribute name="org_unit" value="50005431"/> @@ -5357,6 +5437,10 @@ <attribute name="name" value="COPH Ctr for Humanities, Ethics&Soc"/> <attribute name="org_unit" value="50006379"/> </branch> + <branch> + <attribute name="name" value="COPH Ctr for Global Hlth & Dev"/> + <attribute name="org_unit" value="50007050"/> + </branch> </branch> <branch> <attribute name="name" value="Vice Chancellor for Research"/> @@ -5692,11 +5776,11 @@ <attribute name="postal_code" value="68182"/> </branch> <branch> - <attribute name="name" value="Telecommunications"/> - <attribute name="org_unit" value="50000782"/> + <attribute name="name" value="Parking and Transit Operations"/> + <attribute name="org_unit" value="50006975"/> <attribute name="building" value="EAB"/> - <attribute name="room" value="119"/> - <attribute name="city" value="Omaha"/> + <attribute name="room" value="107"/> + <attribute name="city" value="omaha"/> <attribute name="state" value="NE"/> <attribute name="postal_code" value="68182"/> </branch> @@ -5841,6 +5925,10 @@ <attribute name="state" value="NE"/> <attribute name="postal_code" value="68182"/> </branch> + <branch> + <attribute name="name" value="University Village"/> + <attribute name="org_unit" value="50006927"/> + </branch> </branch> </branch> <branch> @@ -6103,25 +6191,25 @@ <branch> <attribute name="name" value="College of Business Administration"/> <attribute name="org_unit" value="50000176"/> - <attribute name="building" value="RH"/> - <attribute name="room" value="414"/> + <attribute name="building" value="MH"/> + <attribute name="room" value="300"/> <attribute name="city" value="Omaha"/> <attribute name="state" value="NE"/> <attribute name="postal_code" value="68182"/> <branch> <attribute name="name" value="Department of Accounting"/> <attribute name="org_unit" value="50000862"/> - <attribute name="building" value="RH"/> - <attribute name="room" value="408"/> - <attribute name="city" value="Omaha"/> + <attribute name="building" value="MH"/> + <attribute name="room" value="228"/> + <attribute name="city" value="omaha"/> <attribute name="state" value="NE"/> <attribute name="postal_code" value="68182"/> </branch> <branch> <attribute name="name" value="Economics"/> <attribute name="org_unit" value="50000863"/> - <attribute name="building" value="RH"/> - <attribute name="room" value="508"/> + <attribute name="building" value="MH"/> + <attribute name="room" value="332"/> <attribute name="city" value="Omaha"/> <attribute name="state" value="NE"/> <attribute name="postal_code" value="68182"/> @@ -6129,8 +6217,8 @@ <branch> <attribute name="name" value="Finance, Banking and Law"/> <attribute name="org_unit" value="50000864"/> - <attribute name="building" value="RH"/> - <attribute name="room" value="501"/> + <attribute name="building" value="MH"/> + <attribute name="room" value="228"/> <attribute name="city" value="Omaha"/> <attribute name="state" value="NE"/> <attribute name="postal_code" value="68182"/> @@ -6138,8 +6226,8 @@ <branch> <attribute name="name" value="Marketing and Management"/> <attribute name="org_unit" value="50000865"/> - <attribute name="building" value="RH"/> - <attribute name="room" value="503"/> + <attribute name="building" value="MH"/> + <attribute name="room" value="303"/> <attribute name="city" value="Omaha"/> <attribute name="state" value="NE"/> <attribute name="postal_code" value="68182"/> @@ -6147,8 +6235,8 @@ <branch> <attribute name="name" value="Executive MBA Program"/> <attribute name="org_unit" value="50000872"/> - <attribute name="building" value="RH"/> - <attribute name="room" value="414"/> + <attribute name="building" value="MH"/> + <attribute name="room" value="100"/> <attribute name="city" value="Omaha"/> <attribute name="state" value="NE"/> <attribute name="postal_code" value="68182"/> @@ -6156,8 +6244,8 @@ <branch> <attribute name="name" value="Nebraska Business Development Center"/> <attribute name="org_unit" value="50000873"/> - <attribute name="building" value="RH"/> - <attribute name="room" value="415"/> + <attribute name="building" value="MH"/> + <attribute name="room" value="200"/> <attribute name="city" value="Omaha"/> <attribute name="state" value="NE"/> <attribute name="postal_code" value="68182"/> @@ -6360,6 +6448,10 @@ <attribute name="state" value="NE"/> <attribute name="postal_code" value="68182"/> </branch> + <branch> + <attribute name="name" value="School of Interdisciplinary Informat"/> + <attribute name="org_unit" value="50007000"/> + </branch> </branch> <branch> <attribute name="name" value="College of Public Affrs & Comm Svcs"/> @@ -6566,6 +6658,15 @@ </branch> </branch> </branch> + <branch> + <attribute name="name" value="Telecommunications"/> + <attribute name="org_unit" value="50000782"/> + <attribute name="building" value="EAB"/> + <attribute name="room" value="119"/> + <attribute name="city" value="Omaha"/> + <attribute name="state" value="NE"/> + <attribute name="postal_code" value="68182"/> + </branch> <branch> <attribute name="name" value="Multimedia Technology Services"/> <attribute name="org_unit" value="50000967"/> @@ -6583,15 +6684,6 @@ <attribute name="city" value="Omaha"/> <attribute name="state" value="NE"/> <attribute name="postal_code" value="68182"/> - </branch> - <branch> - <attribute name="name" value="Information Tech Infrastructure"/> - <attribute name="org_unit" value="50004951"/> - <attribute name="building" value="EAB"/> - <attribute name="room" value="008"/> - <attribute name="city" value="Omaha"/> - <attribute name="state" value="NE"/> - <attribute name="postal_code" value="68182"/> <branch> <attribute name="name" value="Customer Services"/> <attribute name="org_unit" value="50004952"/> @@ -6602,6 +6694,15 @@ <attribute name="postal_code" value="68182"/> </branch> </branch> + <branch> + <attribute name="name" value="Information Tech Infrastructure"/> + <attribute name="org_unit" value="50004951"/> + <attribute name="building" value="EAB"/> + <attribute name="room" value="008"/> + <attribute name="city" value="Omaha"/> + <attribute name="state" value="NE"/> + <attribute name="postal_code" value="68182"/> + </branch> <branch> <attribute name="name" value="Administrative Information Services"/> <attribute name="org_unit" value="50004953"/> @@ -6710,6 +6811,10 @@ <attribute name="state" value="NE"/> <attribute name="postal_code" value="68182"/> </branch> + <branch> + <attribute name="name" value="Dual Enrollment"/> + <attribute name="org_unit" value="50006875"/> + </branch> </branch> <branch> <attribute name="name" value="Engineering"/> @@ -7034,7 +7139,7 @@ <attribute name="state" value="NE"/> <attribute name="postal_code" value="68849"/> <branch> - <attribute name="name" value="Student Life Division"/> + <attribute name="name" value="Student Affairs"/> <attribute name="org_unit" value="50000106"/> <attribute name="building" value="FNDH"/> <attribute name="room" value="1000"/> @@ -7045,7 +7150,7 @@ <attribute name="name" value="Academic Success"/> <attribute name="org_unit" value="50002775"/> <attribute name="building" value="MSAB"/> - <attribute name="room" value="163"/> + <attribute name="room" value="172"/> <attribute name="city" value="Kearney"/> <attribute name="state" value="NE"/> <attribute name="postal_code" value="68849"/> @@ -7053,7 +7158,7 @@ <attribute name="name" value="Learning Strategies"/> <attribute name="org_unit" value="50000578"/> <attribute name="building" value="MSAB"/> - <attribute name="room" value="163"/> + <attribute name="room" value="172"/> <attribute name="city" value="Kearney"/> <attribute name="state" value="NE"/> <attribute name="postal_code" value="68849"/> @@ -7071,14 +7176,32 @@ <attribute name="name" value="Writing Center"/> <attribute name="org_unit" value="50001504"/> <attribute name="building" value="LIBR"/> - <attribute name="room" value="208"/> + <attribute name="room" value="223"/> + <attribute name="city" value="Kearney"/> + <attribute name="state" value="NE"/> + <attribute name="postal_code" value="68849"/> + </branch> + </branch> + <branch> + <attribute name="name" value="Admissions"/> + <attribute name="org_unit" value="50000617"/> + <attribute name="building" value="MSAB"/> + <attribute name="room" value="112"/> + <attribute name="city" value="Kearney"/> + <attribute name="state" value="NE"/> + <attribute name="postal_code" value="68849"/> + <branch> + <attribute name="name" value="Summer Advising Enrollment"/> + <attribute name="org_unit" value="50000650"/> + <attribute name="building" value="MSAB"/> + <attribute name="room" value="112"/> <attribute name="city" value="Kearney"/> <attribute name="state" value="NE"/> <attribute name="postal_code" value="68849"/> </branch> </branch> <branch> - <attribute name="name" value="Career Services"/> + <attribute name="name" value="Academic and Career Services"/> <attribute name="org_unit" value="50000618"/> <attribute name="building" value="MSAB"/> <attribute name="room" value="140"/> @@ -7113,6 +7236,14 @@ <attribute name="postal_code" value="68849"/> </branch> </branch> + <branch> + <attribute name="name" value="Financial Aid"/> + <attribute name="org_unit" value="50000620"/> + <attribute name="building" value="MSAB"/> + <attribute name="city" value="Kearney"/> + <attribute name="state" value="NE"/> + <attribute name="postal_code" value="68849"/> + </branch> <branch> <attribute name="name" value="Residential and Greek Life"/> <attribute name="org_unit" value="50000621"/> @@ -7270,7 +7401,7 @@ <attribute name="room" value="116"/> <attribute name="city" value="Kearney"/> <attribute name="state" value="NE"/> - <attribute name="postal_code" value="68449"/> + <attribute name="postal_code" value="68849"/> </branch> <branch> <attribute name="name" value="Health Science Programs"/> @@ -7285,7 +7416,7 @@ <attribute name="name" value="History"/> <attribute name="org_unit" value="50000551"/> <attribute name="building" value="COPH"/> - <attribute name="room" value="103N"/> + <attribute name="room" value="130N"/> <attribute name="city" value="Kearney"/> <attribute name="state" value="NE"/> <attribute name="postal_code" value="68849"/> @@ -7596,6 +7727,15 @@ <attribute name="state" value="NE"/> <attribute name="postal_code" value="68849"/> </branch> + <branch> + <attribute name="name" value="Thompson Scholar Lrng Comm"/> + <attribute name="org_unit" value="50007125"/> + <attribute name="building" value="MANH"/> + <attribute name="room" value="107"/> + <attribute name="city" value="Kearney"/> + <attribute name="state" value="NE"/> + <attribute name="postal_code" value="68849"/> + </branch> </branch> <branch> <attribute name="name" value="Library"/> @@ -7658,41 +7798,6 @@ <attribute name="state" value="NE"/> <attribute name="postal_code" value="68849"/> </branch> - <branch> - <attribute name="name" value="Academic Advising"/> - <attribute name="org_unit" value="50000616"/> - <attribute name="building" value="MSAB"/> - <attribute name="room" value="180"/> - <attribute name="city" value="Kearney"/> - <attribute name="state" value="NE"/> - <attribute name="postal_code" value="68849"/> - </branch> - <branch> - <attribute name="name" value="Admissions"/> - <attribute name="org_unit" value="50000617"/> - <attribute name="building" value="MSAB"/> - <attribute name="room" value="112"/> - <attribute name="city" value="Kearney"/> - <attribute name="state" value="NE"/> - <attribute name="postal_code" value="68849"/> - <branch> - <attribute name="name" value="Summer Advising Enrollment"/> - <attribute name="org_unit" value="50000650"/> - <attribute name="building" value="MSAB"/> - <attribute name="room" value="112"/> - <attribute name="city" value="Kearney"/> - <attribute name="state" value="NE"/> - <attribute name="postal_code" value="68849"/> - </branch> - </branch> - <branch> - <attribute name="name" value="Financial Aid"/> - <attribute name="org_unit" value="50000620"/> - <attribute name="building" value="MSAB"/> - <attribute name="city" value="Kearney"/> - <attribute name="state" value="NE"/> - <attribute name="postal_code" value="68849"/> - </branch> <branch> <attribute name="name" value="Student Records"/> <attribute name="org_unit" value="50000624"/> @@ -7780,6 +7885,15 @@ <attribute name="city" value="Kearney"/> <attribute name="state" value="NE"/> <attribute name="postal_code" value="68849"/> + <branch> + <attribute name="name" value="Ombudsperson"/> + <attribute name="org_unit" value="50000657"/> + <attribute name="building" value="FNDH"/> + <attribute name="room" value="1200"/> + <attribute name="city" value="Kearney"/> + <attribute name="state" value="NE"/> + <attribute name="postal_code" value="68849"/> + </branch> <branch> <attribute name="name" value="Retirees"/> <attribute name="org_unit" value="50001354"/> @@ -7832,7 +7946,7 @@ <attribute name="room" value="1203"/> <attribute name="city" value="Kearney"/> <attribute name="state" value="NE"/> - <attribute name="postal_code" value="68449"/> + <attribute name="postal_code" value="68849"/> <branch> <attribute name="name" value="Budget Adjustments"/> <attribute name="org_unit" value="50002025"/> @@ -7932,10 +8046,10 @@ <attribute name="postal_code" value="68849"/> </branch> <branch> - <attribute name="name" value="EO/Affirmative Action"/> + <attribute name="name" value="EO/ Affirmative Action"/> <attribute name="org_unit" value="50000480"/> <attribute name="building" value="FNDH"/> - <attribute name="room" value="1203"/> + <attribute name="room" value="1200"/> <attribute name="city" value="Kearney"/> <attribute name="state" value="NE"/> <attribute name="postal_code" value="68849"/> @@ -7944,8 +8058,4 @@ </branch> </branch> </branch> -<branch> - <attribute name="name" value="Enrollment Mgmt & Student Affrs PSC"/> - <attribute name="org_unit" value="50006625"/> -</branch> </tree> diff --git a/lib/docs/UNL_LDAP/docs/examples/simpleSearch.php b/lib/docs/UNL_LDAP/docs/examples/simpleSearch.php new file mode 100644 index 00000000..0ad47282 --- /dev/null +++ b/lib/docs/UNL_LDAP/docs/examples/simpleSearch.php @@ -0,0 +1,41 @@ +<?php +/** + * This file conducts a simple ldap search + * + * PHP version 5 + * + * $Id$ + * + * @category Default + * @package UNL_LDAP + * @author Brett Bieber <brett.bieber@gmail.com> + * @copyright 2009 Regents of the University of Nebraska + * @license http://www1.unl.edu/wdn/wiki/Software_License BSD License + * @link http://pear.unl.edu/package/UNL_LDAP + */ +chdir(dirname(__FILE__).'/../../'); +require_once 'UNL/LDAP.php'; +require_once 'config.inc.php'; + +$ldap = UNL_LDAP::getConnection($options); +$results = $ldap->search('dc=unl,dc=edu', '(|(sn=ryan lim)(cn=ryan lim)(&(| (givenname=ryan) (sn=ryan) (mail=ryan) (unlemailnickname=ryan) (unlemailalias=ryan))(| (givenname=lim) (sn=lim) (mail=lim) (unlemailnickname=lim) (unlemailalias=lim))))'); + +$results->sort('uid'); + +echo count($results).' results found.'.PHP_EOL; + +foreach ($results as $entry) { + echo '<pre>'; + print_r($entry); + + echo $entry->givenName.' '.$entry->sn.' is '.$entry->uid.PHP_EOL; + echo $entry->cn; + if (count($entry->objectClass)) { + echo $entry->givenName.' is a member of:'; + foreach ($entry->objectClass as $class) { + echo $class.','; + } + echo PHP_EOL.'<br>'; + } +} +highlight_file(__FILE__); \ No newline at end of file diff --git a/lib/docs/UNL_LDAP/docs/examples/twodirectories.php b/lib/docs/UNL_LDAP/docs/examples/twodirectories.php new file mode 100644 index 00000000..9b10de99 --- /dev/null +++ b/lib/docs/UNL_LDAP/docs/examples/twodirectories.php @@ -0,0 +1,45 @@ +<?php + +chdir(dirname(__FILE__).'/../../'); +require_once 'UNL/LDAP.php'; +require_once 'config.inc.php'; +echo '<pre>'; +$ldap1 = UNL_LDAP::getConnection($options); + +$result = $ldap1->search('dc=unl,dc=edu', '(|(sn=ryan lim)(cn=ryan lim)(&(| (givenname=ryan) (sn=ryan) (mail=ryan) (unlemailnickname=ryan) (unlemailalias=ryan))(| (givenname=lim) (sn=lim) (mail=lim) (unlemailnickname=lim) (unlemailalias=lim))))'); + +$result->sort('uid'); + +echo $result->count().' results found.'.PHP_EOL; + +foreach ($result as $entry) { + echo $entry->givenName.' '.$entry->sn.' is '.$entry->uid.PHP_EOL; + if (count($entry->objectClass)) { + echo $entry->givenName.' is a member of:'; + foreach ($entry->objectClass as $class) { + echo $class.','; + } + echo PHP_EOL; + } +} +echo '<br />'; + +$ldap2 = UNL_LDAP::getConnection($ldap2_options); +$result = $ldap2->search('dc=unl,dc=edu', '(|(sn=ryan lim)(cn=ryan lim)(&(| (givenname=ryan) (sn=ryan) (mail=ryan) (unlemailnickname=ryan) (unlemailalias=ryan))(| (givenname=lim) (sn=lim) (mail=lim) (unlemailnickname=lim) (unlemailalias=lim))))'); + +$result->sort('uid'); + +echo $result->count().' results found.'.PHP_EOL; + +foreach ($result as $entry) { + echo $entry->givenName.' '.$entry->sn.' is '.$entry->uid.PHP_EOL; + if (count($entry->objectClass)) { + echo $entry->givenName.' is a member of:'; + foreach ($entry->objectClass as $class) { + echo $class.','; + } + echo PHP_EOL; + } +} + +?> \ No newline at end of file diff --git a/lib/docs/UNL_Peoplefinder/pear.unl.edu/examples/config.inc.php b/lib/docs/UNL_Peoplefinder/pear.unl.edu/examples/config.inc.php index eecf1ba0..446b1237 100644 --- a/lib/docs/UNL_Peoplefinder/pear.unl.edu/examples/config.inc.php +++ b/lib/docs/UNL_Peoplefinder/pear.unl.edu/examples/config.inc.php @@ -1,4 +1,4 @@ <?php require_once 'UNL/Autoload.php'; -set_include_path(dirname(__FILE__).'/../src'.PATH_SEPARATOR.get_include_path()); \ No newline at end of file +set_include_path(dirname(dirname(__FILE__)).'/src/'.PATH_SEPARATOR.dirname(dirname(__FILE__)).'/lib/php'.PATH_SEPARATOR.get_include_path()); diff --git a/lib/docs/UNL_Peoplefinder/pear.unl.edu/examples/getUID.php b/lib/docs/UNL_Peoplefinder/pear.unl.edu/examples/getUID.php index e54d6f11..c0876270 100644 --- a/lib/docs/UNL_Peoplefinder/pear.unl.edu/examples/getUID.php +++ b/lib/docs/UNL_Peoplefinder/pear.unl.edu/examples/getUID.php @@ -1,7 +1,14 @@ <?php require_once 'config.inc.php'; -$pf = new UNL_Peoplefinder(); +$pf = new UNL_Peoplefinder($driver); + $uid = $pf->getUID('bbieber2'); -echo 'uid:' . $uid->uid; -echo ' cn:' . $uid->cn; \ No newline at end of file + +echo 'uid:' . $uid->uid; +echo ' cn:' . $uid->cn; +echo ' mail:' . $uid->mail; +echo ' department:' . $uid->unlHRPrimaryDepartment; +foreach ($uid->eduPersonAffiliation as $affiliation) { + echo ' affiliation:' . $affiliation; +} \ No newline at end of file diff --git a/lib/php/UNL/LDAP.php b/lib/php/UNL/LDAP.php new file mode 100644 index 00000000..f35111f2 --- /dev/null +++ b/lib/php/UNL/LDAP.php @@ -0,0 +1,214 @@ +<?php +/** + * This file contains a class for operating with the UNL LDAP directory. + * + * PHP version 5 + * + * $Id$ + * + * @category Default + * @package UNL_LDAP + * @author Brett Bieber <brett.bieber@gmail.com> + * @copyright 2009 Regents of the University of Nebraska + * @license http://www1.unl.edu/wdn/wiki/Software_License BSD License + * @link http://pear.unl.edu/package/UNL_LDAP + */ + +require_once 'UNL/LDAP/Exception.php'; + +/** + * This class is a singleton class for operating with the UNL LDAP directory. + * + * <code> + * $options['bind_dn'] = 'uid=youruseridhere,ou=service,dc=unl,dc=edu'; + * $options['bind_password'] = 'passwordhere'; + * echo UNL_LDAP::getConnection($options)->getFirstAttribute('bbieber2', 'sn'); + * </code> + * + * @category Default + * @package UNL_LDAP + * @author Brett Bieber <brett.bieber@gmail.com> + * @copyright 2009 Regents of the University of Nebraska + * @license http://www1.unl.edu/wdn/wiki/Software_License BSD License + * @link http://pear.unl.edu/package/UNL_LDAP + */ +class UNL_LDAP +{ + + /** + * The actual ldap connection link id. + * + * @var link + */ + private $_ldap = false; + + /** + * @var array + */ + public $options = array('uri' => 'ldap://ldap.unl.edu/ ldap://ldap-backup.unl.edu/', + 'base' => 'dc=unl,dc=edu', + 'suffix' => 'ou=People,dc=unl,dc=edu', + 'bind_dn' => 'get this from the identity management team', + 'bind_password' => 'get this from the identity management team'); + + /** + * <code> + * UNL_LDAP::getConnection($options)->getAttribute('bbieber','cn'); + * </code> + * + * @param array $options Associative array of options. + */ + public function __construct(array $options = null) + { + $this->setOptions($options); + } + + /** + * Set options for the ldap connection. + * + * @param array $options Associative array of options to set. + * + * @return void + */ + public function setOptions(array $options = null) + { + if (count($options)) { + foreach ($options as $attr=>$value) { + $this->options[$attr] = $value; + } + } + } + + /** + * Connect & bind to the directory. + * + * @return UNL_LDAP + */ + public function connect() + { + if ($this->_ldap !== false) { + return $this; + } + if ($this->_ldap = ldap_connect($this->options['uri'])) { + if (ldap_bind($this->_ldap, $this->options['bind_dn'], $this->options['bind_password'])) { + return $this; + } + throw new UNL_LDAP_Exception('Connection failure: ldap_bind() returned false for the server.'); + } + throw new UNL_LDAP_Exception('Could not connect to the LDAP server.'); + } + + /** + * Get the LDAP connection + * + * <code> + * $conn = UNL_LDAP::getConnection($options); + * </code> + * + * @param array $options Associative array of options to set. + * + * @return UNL_LDAP + */ + public static function getConnection(array $options = null) + { + $ldap = new self($options); + return $ldap->connect(); + } + + /** + * Get an attribute from LDAP given the LDAP-uid and attribute name. + * + * @param string $uid The LDAP-uid of the user we are looking for. + * @param string $attribute The attribute name we are interested in. + * + * @return array The array of attribute values. + */ + public function getAttribute($uid, $attribute) + { + $uid = addslashes($uid); + $result = ldap_search($this->_ldap, $this->options['suffix'], "uid=$uid"); + $info = ldap_get_entries($this->_ldap, $result); + + if (count($info) == 0) { + return false; + } else { + if (isset($info[0][$attribute])) { + return $info[0][$attribute]; + } else { + return false; + } + } + } + + /** + * Return the first attribute of an entry + * + * @param string $uid The LDAP uid of the user we are looking for. + * @param string $attribute The attribute name we are interested in. + * + * @return string | false + */ + public function getFirstAttribute($uid, $attribute) + { + if ($ret = $this->getAttribute($uid, $attribute)) { + return $ret[0]; + } else { + return false; + } + } + + /** + * Search the directory for matching entries. + * + * @param string $base Search base + * @param string $filter LDAP filter to use + * @param array $params Optional parameters to add to the LDAP query + * + * @return UNL_LDAP_Result + */ + public function search($base = null, $filter = null, array $params = array()) + { + include_once 'UNL/LDAP/Result.php'; + /* setting searchparameters */ + (isset($params['sizelimit'])) ? $sizelimit = $params['sizelimit'] : $sizelimit = 0; + (isset($params['timelimit'])) ? $timelimit = $params['timelimit'] : $timelimit = 0; + (isset($params['attrsonly'])) ? $attrsonly = $params['attrsonly'] : $attrsonly = 0; + (isset($params['attributes'])) ? $attributes = $params['attributes'] : $attributes = array(); + + $sr = ldap_search($this->_ldap, $base, $filter, $attributes, $attrsonly, $sizelimit, $timelimit); + if ($sr === false) { + throw new UNL_LDAP_Exception('Search failed'); + } + return new UNL_LDAP_Result($this->_ldap, $sr); + } + + /** + * returns the ldap connection resource link + * + * @return resource + */ + public function &getLink() + { + return $this->_ldap; + } + + /** + * unbinds from the ldap directory. + * + * @return void + */ + function disconnect() + { + return ldap_unbind($this->_ldap); + } + + /** + * destroy the object + * + * @return void + */ + function __destruct() + { + $this->disconnect(); + } +} diff --git a/lib/php/UNL/LDAP/Entry.php b/lib/php/UNL/LDAP/Entry.php new file mode 100644 index 00000000..afbd21a2 --- /dev/null +++ b/lib/php/UNL/LDAP/Entry.php @@ -0,0 +1,74 @@ +<?php +/** + * LDAP entry class. + * + * PHP version 5 + * + * $Id$ + * + * @category Default + * @package UNL_LDAP + * @author Brett Bieber <brett.bieber@gmail.com> + * @copyright 2009 Regents of the University of Nebraska + * @license http://www1.unl.edu/wdn/wiki/Software_License BSD License + * @link http://pear.unl.edu/package/UNL_LDAP + */ + +require_once 'UNL/LDAP/Entry/Attribute.php'; + +/** + * Class for handling an ldap entry + * + * @category Default + * @package UNL_LDAP + * @author Brett Bieber <brett.bieber@gmail.com> + * @copyright 2009 Regents of the University of Nebraska + * @license http://www1.unl.edu/wdn/wiki/Software_License BSD License + * @link http://pear.unl.edu/package/UNL_LDAP + */ +class UNL_LDAP_Entry +{ + + protected $_attributes; + + /** + * Construct an LDAP entry object + * + * @param resource &$link LDAP connection + * @param resource $entry Entry resource from ldap_next_entry + */ + function __construct(&$link, $entry) + { + $this->_attributes = ldap_get_attributes($link, $entry); + } + + /** + * Determines if a specific attribute is set + * + * @param string $name Attribute name to check + * + * @return bool + */ + function __isset($name) + { + if (isset($this->_attributes[$name])) { + return true; + } else { + return false; + } + } + + /** + * Retrieve the requested attribute + * + * @param string $name Attribute to get + * + * @return UNL_LDAP_Entry_Attribute + */ + function __get($name) + { + if (isset($this->_attributes[$name])) { + return new UNL_LDAP_Entry_Attribute($this->_attributes[$name]); + } + } +} diff --git a/lib/php/UNL/LDAP/Entry/Attribute.php b/lib/php/UNL/LDAP/Entry/Attribute.php new file mode 100644 index 00000000..f3bd288a --- /dev/null +++ b/lib/php/UNL/LDAP/Entry/Attribute.php @@ -0,0 +1,70 @@ +<?php +/** + * LDAP attribute object + * + * PHP version 5 + * + * $Id$ + * + * @category Default + * @package UNL_LDAP + * @author Brett Bieber <brett.bieber@gmail.com> + * @copyright 2009 Regents of the University of Nebraska + * @license http://www1.unl.edu/wdn/wiki/Software_License BSD License + * @link http://pear.unl.edu/package/UNL_LDAP + */ + +/** + * Class representing an LDAP entry's attribute + * + * @category Default + * @package UNL_LDAP + * @author Brett Bieber <brett.bieber@gmail.com> + * @copyright 2009 Regents of the University of Nebraska + * @license http://www1.unl.edu/wdn/wiki/Software_License BSD License + * @link http://pear.unl.edu/package/UNL_LDAP + */ +class UNL_LDAP_Entry_Attribute extends ArrayIterator +{ + public $count; + + /** + * construct an ldap attribute object + * + * @param array $attribute Array returned from ldap_next_attribute + */ + public function __construct(array $attribute) + { + $this->count = $attribute['count']; + unset($attribute['count']); + parent::__construct($attribute); + } + + /** + * Return the total number of attributes + * + * @return int + */ + public function count() + { + return $this->count; + } + + public function __wakeup() + { + if (isset($this->storage)) { + parent::__construct($this->storage); + } + $this->rewind(); + } + + /** + * Returns the first attribute entry + * + * @return string + */ + public function __toString() + { + return (string)$this->current(); + } +} \ No newline at end of file diff --git a/lib/php/UNL/LDAP/Exception.php b/lib/php/UNL/LDAP/Exception.php new file mode 100644 index 00000000..7f35d283 --- /dev/null +++ b/lib/php/UNL/LDAP/Exception.php @@ -0,0 +1,31 @@ +<?php +/** + * This file contains a class for handling UNL_LDAP exceptions + * + * PHP version 5 + * + * $Id$ + * + * @category Default + * @package UNL_LDAP + * @author Brett Bieber <brett.bieber@gmail.com> + * @copyright 2009 Regents of the University of Nebraska + * @license http://www1.unl.edu/wdn/wiki/Software_License BSD License + * @link http://pear.unl.edu/package/UNL_LDAP + */ + +/** + * Class for exception handling + * + * @category Default + * @package UNL_LDAP + * @author Brett Bieber <brett.bieber@gmail.com> + * @copyright 2009 Regents of the University of Nebraska + * @license http://www1.unl.edu/wdn/wiki/Software_License BSD License + * @link http://pear.unl.edu/package/UNL_LDAP + */ +class UNL_LDAP_Exception extends Exception +{ + +} +?> \ No newline at end of file diff --git a/lib/php/UNL/LDAP/People.php b/lib/php/UNL/LDAP/People.php new file mode 100644 index 00000000..1d784ffc --- /dev/null +++ b/lib/php/UNL/LDAP/People.php @@ -0,0 +1,169 @@ +<?php +/** + * A class for obtaining info about People from the LDAP directory. + * + * <code> + * include_once 'UNL/LDAP.php' + * include_once 'UNL/LDAP/People.php'; + * + * echo UNL_LDAP_People::getCommonName('bbieber2'); + * </code> + * + * PHP version 5 + * + * $Id$ + * + * @category Default + * @package UNL_LDAP + * @author Brett Bieber <brett.bieber@gmail.com> + * @copyright 2009 Regents of the University of Nebraska + * @license http://www1.unl.edu/wdn/wiki/Software_License BSD License + * @link http://pear.unl.edu/package/UNL_LDAP + */ + +/** + * Class for managing records for people. + * + * @category Default + * @package UNL_LDAP + * @author Brett Bieber <brett.bieber@gmail.com> + * @copyright 2009 Regents of the University of Nebraska + * @license http://www1.unl.edu/wdn/wiki/Software_License BSD License + * @link http://pear.unl.edu/package/UNL_LDAP + */ +class UNL_LDAP_People +{ + /** + * Returns the 'sn' LDAP attribute of the user. + * + * @param string $uid Unique ID for the user + * + * @return string The user's lastname. + */ + function getLastName($uid) + { + return UNL_LDAP::getConnection()->getFirstAttribute($uid, 'sn'); + } + + /** + * Returns the 'cn' LDAP attribute of the user. + * + * @param string $uid Unique ID for the user + * + * @return string The user's common name (typically givenname + cn). + */ + function getCommonName($uid) + { + return UNL_LDAP::getConnection()->getFirstAttribute($uid, 'cn'); + } + + /** + * Returns the 'givenname' LDAP attribute of the user. + * + * @param string $uid Unique ID for the user + * + * @return string The user's first name. + */ + function getFirstName($uid) + { + return UNL_LDAP::getConnection()->getFirstAttribute($uid, 'givenname'); + } + + /** + * Returns the 'telephonenumber' LDAP attribute of the user. + * + * @param string $uid Unique ID for the user + * + * @return string The user's telephone number. + */ + function getTelephone($uid) + { + return UNL_LDAP::getConnection()->getFirstAttribute($uid, 'telephonenumber'); + } + + /** + * Returns the 'facsimiletelephonenumber' LDAP attribute of the user. + * + * @param string $uid Unique ID for the user + * + * @return string The user's fax number. + */ + function getFax($uid) + { + return UNL_LDAP::getConnection()->getFirstAttribute($uid, 'fascimiletelephonenumber'); + } + + /** + * Returns the 'street' LDAP attribute of the user. + * + * @param string $uid Unique ID for the user + * + * @return string The user's street address. + */ + function getStreet($uid) + { + return UNL_LDAP::getConnection()->getFirstAttribute($uid, 'street'); + } + + /** + * Returns the 'l' (locality) LDAP attribute of the user. + * + * @param string $uid Unique ID for the user + * + * @return string The user's city. + */ + function getCity($uid) + { + return UNL_LDAP::getConnection()->getFirstAttribute($uid, 'l'); + } + + /** + * Returns the 'st' LDAP attribute of the user. + * + * @param string $uid Unique ID for the user + * + * @return string The user's state. + */ + function getState($uid) + { + return UNL_LDAP::getConnection()->getFirstAttribute($uid, 'st'); + } + + /** + * Returns the 'postalcode' LDAP attribute of the user. + * + * @param string $uid Unique ID for the user + * + * @return string The user's zipcode. + */ + function getZip($uid) + { + return UNL_LDAP::getConnection()->getFirstAttribute($uid, 'postalcode'); + } + + /** + * Returns the 'country' LDAP attribute of the user. + * + * @param string $uid Unique ID for the user + * + * @return string The user's zipcode. + */ + function getCountry($uid) + { + return UNL_LDAP::getConnection()->getFirstAttribute($uid, 'c'); + } + + /** + * Returns the 'mail' LDAP attribute of the user. + * + * @param string $uid Unique ID for the user + * + * @return string The user's email address. + */ + function getEmail($uid) + { + return UNL_LDAP::getConnection()->getFirstAttribute($uid, 'mail'); + } +} + +?> \ No newline at end of file diff --git a/lib/php/UNL/LDAP/Result.php b/lib/php/UNL/LDAP/Result.php new file mode 100644 index 00000000..ba451ba7 --- /dev/null +++ b/lib/php/UNL/LDAP/Result.php @@ -0,0 +1,145 @@ +<?php +/** + * LDAP result record + * + * PHP version 5 + * + * $Id$ + * + * @category Default + * @package UNL_LDAP + * @author Brett Bieber <brett.bieber@gmail.com> + * @copyright 2009 Regents of the University of Nebraska + * @license http://www1.unl.edu/wdn/wiki/Software_License BSD License + * @link http://pear.unl.edu/package/UNL_LDAP + */ +require_once 'UNL/LDAP/Entry.php'; + +/** + * LDAP result record + * + * @category Default + * @package UNL_LDAP + * @author Brett Bieber <brett.bieber@gmail.com> + * @copyright 2009 Regents of the University of Nebraska + * @license http://www1.unl.edu/wdn/wiki/Software_License BSD License + * @link http://pear.unl.edu/package/UNL_LDAP + */ +class UNL_LDAP_Result implements Countable, Iterator +{ + private $_link; + + private $_result; + + private $_valid = false; + + private $_currentEntry = false; + + /** + * Resets the iterator to the first entry in the result set. + * + * @return void + */ + function rewind() + { + $this->_currentEntry = ldap_first_entry($this->_link, $this->_result); + } + + /** + * returns the current entry in the result iteration + * + * @return UNL_LDAP_Entry + */ + function current() + { + return new UNL_LDAP_Entry($this->_link, $this->_currentEntry); + } + + /** + * Advances the iterator to the next entry + * + * @return UNL_LDAP_Entry | false + */ + function next() + { + if ($this->_currentEntry !== false + && $this->_currentEntry = ldap_next_entry($this->_link, + $this->_currentEntry)) { + return $this->current(); + } else { + $this->_valid = false; + return false; + } + } + + /** + * returns a key for this entry within the array + * + * @return unknown + */ + function key() + { + //FIXME + return $this->_currentEntry; + } + + /** + * returns whether this result is valid or not + * + * @return bool + */ + function valid() + { + return $this->_valid; + } + + /** + * returns the size of the result + * + * @return int + */ + public function count() + { + return ldap_count_entries($this->_link, $this->_result); + } + + /** + * Construct an LDAP Result object + * + * @param resource &$link Connected ldap link + * @param resource &$result Identifier for the result + */ + public function __construct(&$link, &$result) + { + $this->_link = $link; + $this->_result = $result; + $this->_valid = true; + + $this->_currentEntry = ldap_first_entry($this->_link, $this->_result); + } + + /** + * frees the ldap result set + * + * @return void + */ + function __destruct() + { + unset($this->_currentEntry); + @ldap_free_result($this->_result); + } + + /** + * Sort the returned results by a specific attribute + * + * @param string $attr Attribute to sort by + * + * @return void + */ + public function sort($attr) + { + if (!ldap_sort($this->_link, $this->_result, $attr)) { + throw new Exception('Failed to sort by '.$attr); + } + } +} diff --git a/lib/php/UNL/Peoplefinder.php b/lib/php/UNL/Peoplefinder.php index fd48eed6..3956caa5 100644 --- a/lib/php/UNL/Peoplefinder.php +++ b/lib/php/UNL/Peoplefinder.php @@ -31,6 +31,15 @@ class UNL_Peoplefinder static public $resultLimit = UNL_PF_RESULT_LIMIT; static public $displayResultLimit = UNL_PF_DISPLAY_LIMIT; + static public $url = ''; + + /** + * Options for this use. + */ + public $options = array('view' => 'instructions', + 'format' => 'html', + 'mobile' => false); + /** * Driver for data retrieval * @@ -38,20 +47,137 @@ class UNL_Peoplefinder */ public $driver; + /** + * The results of the search + * + * @var mixed + */ + public $output; + + public $view_map = array('instructions' => 'UNL_Peoplefinder_Instructions', + 'search' => 'UNL_Peoplefinder_SearchController', + 'record' => 'UNL_Peoplefinder_Record'); + /** * Constructor for the object. + * + * @param array $options Options, format, driver, mobile etc. */ - function __construct(UNL_Peoplefinder_DriverInterface $driver = null) + function __construct($options = array()) + { + if (!isset($options['driver'])) { + $options['driver'] = new UNL_Peoplefinder_Driver_WebService(); + } + + $this->driver = $options['driver']; + + $this->options = $options + $this->options; + + if (isset($_SERVER['HTTP_ACCEPT']) + && $this->options['format'] == 'html' && ( + ($this->options['mobile'] !== false && $this->options['mobile'] != 'no') + || (preg_match('/text\/vnd\.wap\.wml|application\/vnd\.wap\.xhtml\+xml/', $_SERVER['HTTP_ACCEPT'])) + || preg_match('/sony|symbian|nokia|samsung|mobile|windows ce|epoc|opera/', $_SERVER['HTTP_USER_AGENT']) + || preg_match('/mini|nitro|j2me|midp-|cldc-|netfront|mot|up\.browser|up\.link|audiovox/', $_SERVER['HTTP_USER_AGENT']) + || preg_match('/blackberry|ericsson,|panasonic|philips|sanyo|sharp|sie-/', $_SERVER['HTTP_USER_AGENT']) + || preg_match('/portalmmm|blazer|avantgo|danger|palm|series60|palmsource|pocketpc/', $_SERVER['HTTP_USER_AGENT']) + || preg_match('/smartphone|rover|ipaq|au-mic,|alcatel|ericy|vodafone\/|wap1\.|wap2\.|iPhone|Android/', $_SERVER['HTTP_USER_AGENT']) + )) { + $this->options['mobile'] = true; + } + + try { + $this->run(); + } catch(Exception $e) { + $this->output[] = $e; + } + } + + public static function getURL($mixed = null, $additional_params = array()) { - if (!$driver) { - $driver = new UNL_Peoplefinder_Driver_WebService(); + + $url = self::$url; + + if (is_object($mixed)) { + switch (get_class($mixed)) { + default: + + } } - $this->driver = $driver; + + return self::addURLParams($url, $additional_params); } + public static function addURLParams($url, $additional_params = array()) + { + $params = array(); + $params = array_merge($params, $additional_params); + + $url .= '?'; + + foreach ($params as $option=>$value) { + if ($option == 'driver') { + continue; + } + if ($option == 'format' + && $value = 'html') { + continue; + } + if (!empty($value)) { + $url .= "&$option=$value"; + } + } + $url = str_replace('?&', '?', $url); + return trim($url, '?;='); + } + + public function determineView() + { + switch(true) { + case isset($this->options['q']): + case isset($this->options['sn']): + case isset($this->options['cn']): + $this->options['view'] = 'search'; + return; + case isset($this->options['uid']): + $this->options['view'] = 'record'; + return; + } + + } + + function run() + { + $this->determineView(); + if (isset($this->view_map[$this->options['view']])) { + if ($this->view_map[$this->options['view']] == 'UNL_Peoplefinder_Record') { + $this->output[] = $this->getUID($this->options['uid']); + return; + } + $this->options['peoplefinder'] =& $this; + $this->output[] = new $this->view_map[$this->options['view']]($this->options); + } else { + throw new Exception('Un-registered view', 404); + } + } + + /** + * Pass through calls to the driver. + * + * @method UNL_Peoplefinder_Record getUID() getUID(string $uid) get a record + * + * @param string $method The method to call + * @param mixed $args Arguments + * + * @return mixed + */ function __call($method, $args) { return call_user_func_array(array($this->driver, $method), $args); } + public static function getDataDir() + { + return dirname(__FILE__).'/../../data'; + } } diff --git a/lib/php/UNL/Peoplefinder/Department.php b/lib/php/UNL/Peoplefinder/Department.php index 4400e63a..7fde8f7b 100644 --- a/lib/php/UNL/Peoplefinder/Department.php +++ b/lib/php/UNL/Peoplefinder/Department.php @@ -65,24 +65,42 @@ class UNL_Peoplefinder_Department implements Countable, Iterator protected $_xml; + public $options = array(); + /** * construct a department * * @param string $name Name of the department */ - function __construct($name) + function __construct($options = array()) { - $this->name = $name; - $this->_xml = new SimpleXMLElement(file_get_contents(dirname(__FILE__).'/../../data/hr_tree.xml')); - $results = $this->_xml->xpath('//attribute[@name="org_unit"][@value="50000003"]/..//attribute[@name="name"][@value="'.$this->name.'"]/..'); - if (isset($results[0])) { - foreach ($results[0] as $attribute) { - if (isset($attribute['name'])) { - $this->{$attribute['name']} = (string)$attribute['value']; - } - } + if (!(isset($options['d']) || isset($options['org_unit']))) { + throw new Exception('No department name or org_unit! Pass as the d or org_unit value.'); + } + $this->options = $options + $this->options; + + $this->_xml = new SimpleXMLElement(file_get_contents(UNL_Peoplefinder::getDataDir().'/hr_tree.xml')); + + if (isset($options['org_unit'])) { + $this->org_unit = $options['org_unit']; + $xpath = '//attribute[@name="org_unit"][@value="50000003"]/..//attribute[@name="org_unit"][@value="'.$this->org_unit.'"]/..'; } else { - throw new Exception('Invalid department name.'); + $this->name = $options['d']; + $quoted = preg_replace('/([\'\"\?])/', '\\$1', $this->name); + + $xpath = '//attribute[@name="org_unit"][@value="50000003"]/..//attribute[@name="name"][@value="'.$quoted.'"]/..'; + } + + $results = $this->_xml->xpath($xpath); + + if (!isset($results[0])) { + throw new Exception('Invalid department name "'.$this->name.'"', 404); + } + + foreach ($results[0] as $attribute) { + if (isset($attribute['name'])) { + $this->{$attribute['name']} = (string)$attribute['value']; + } } } @@ -94,17 +112,9 @@ class UNL_Peoplefinder_Department implements Countable, Iterator function getLDAPResults() { if (!isset($this->_results)) { - $options = array( - 'bind_dn' => UNL_Peoplefinder_Driver_LDAP::$bindDN, - 'bind_password' => UNL_Peoplefinder_Driver_LDAP::$bindPW, - ); - - $this->_ldap = UNL_LDAP::getConnection($options); - $name = str_replace(array('(',')','*','\'','"'), '', $this->name); - $this->_results = $this->_ldap->search('dc=unl,dc=edu', - '(unlHRPrimaryDepartment='.$name.')'); - $this->_results->sort('cn'); - $this->_results->sort('sn'); + UNL_Peoplefinder::$resultLimit = 500; + $pf = new UNL_Peoplefinder($this->options); + $this->_results = new ArrayIterator($pf->getHRPrimaryDepartmentMatches($this->name)); } return $this->_results; } @@ -131,7 +141,7 @@ class UNL_Peoplefinder_Department implements Countable, Iterator */ function current() { - return UNL_Peoplefinder_Record::fromUNLLDAPEntry($this->getLDAPResults()->current()); + return $this->getLDAPResults()->current(); } function key() @@ -151,24 +161,40 @@ class UNL_Peoplefinder_Department implements Countable, Iterator function hasChildren() { - $results = $this->_xml->xpath('//attribute[@name="org_unit"][@value="50000003"]/..//attribute[@name="name"][@value="'.$this->name.'"]/../branch'); + $results = $this->_xml->xpath('//attribute[@name="org_unit"][@value="50000003"]/..//attribute[@name="org_unit"][@value="'.$this->org_unit.'"]/../branch'); return count($results)?true:false; } function getChildren() { $children = array(); - $results = $this->_xml->xpath('//attribute[@name="org_unit"][@value="50000003"]/..//attribute[@name="name"][@value="'.$this->name.'"]/../branch'); + $results = $this->_xml->xpath('//attribute[@name="org_unit"][@value="50000003"]/..//attribute[@name="org_unit"][@value="'.$this->org_unit.'"]/../branch'); foreach ($results as $result) { foreach ($result[0] as $attribute) { if (isset($attribute['name']) - && $attribute['name']=='name') { - $children[] = (string)$attribute['value']; + && $attribute['name']=='org_unit') { + $children[] = self::getById((string)$attribute['value']); break; } } } - asort($children); + return $children; } + + /** + * Retrieve an official SAP Org entry by ID + * + * @param int $id ID, such as 5000XXXX + */ + public static function getById($id, $options = array()) + { + $xml = new SimpleXMLElement(file_get_contents(UNL_Peoplefinder::getDataDir().'/hr_tree.xml')); + $results = $xml->xpath('//attribute[@name="org_unit"][@value="50000003"]/..//attribute[@name="org_unit"][@value='.$id.']/..'); + if (!$results) { + return false; + } + $options['org_unit'] = $id; + return new self($options); + } } diff --git a/lib/php/UNL/Peoplefinder/Department/Search.php b/lib/php/UNL/Peoplefinder/Department/Search.php index 58648ae9..c6e889d8 100644 --- a/lib/php/UNL/Peoplefinder/Department/Search.php +++ b/lib/php/UNL/Peoplefinder/Department/Search.php @@ -1,6 +1,8 @@ <?php class UNL_Peoplefinder_Department_Search implements Countable, Iterator { + public $options = array('q' => ''); + public $q; /** @@ -14,16 +16,17 @@ class UNL_Peoplefinder_Department_Search implements Countable, Iterator protected $current = 0; - function __construct($q) + function __construct($options = array()) { - $q = strtolower(str_replace('"', '', $q)); - $this->xml = new SimpleXMLElement(file_get_contents(dirname(__FILE__).'/../../../data/hr_tree.xml')); + $this->options = $options + $this->options; + $q = strtolower(str_replace('"', '', $this->options['q'])); + $this->xml = new SimpleXMLElement(file_get_contents(UNL_Peoplefinder::getDataDir().'/hr_tree.xml')); $this->results = $this->xml->xpath('//attribute[@name="org_unit"][@value="50000003"]/..//attribute[@name="name"][contains(translate(@value,"ABCDEFGHIJKLMNOPQRSTUVWXYZ", "abcdefghijklmnopqrstuvwxyz"),"'.$q.'")]'); } function current() { - return new UNL_Peoplefinder_Department($this->results[$this->current]['value']); + return new UNL_Peoplefinder_Department(array('d'=>$this->results[$this->current]['value'])); } function next() diff --git a/lib/php/UNL/Peoplefinder/Driver/LDAP.php b/lib/php/UNL/Peoplefinder/Driver/LDAP.php index fc5928f7..4b75f9f2 100644 --- a/lib/php/UNL/Peoplefinder/Driver/LDAP.php +++ b/lib/php/UNL/Peoplefinder/Driver/LDAP.php @@ -6,7 +6,7 @@ class UNL_Peoplefinder_Driver_LDAP implements UNL_Peoplefinder_DriverInterface * * @param string */ - static public $ldapServer = 'ldap.unl.edu ldap-backup.unl.edu'; + static public $ldapServer = 'ldap-test.unl.edu'; /** * LDAP Connection bind distinguised name @@ -40,6 +40,7 @@ class UNL_Peoplefinder_Driver_LDAP implements UNL_Peoplefinder_DriverInterface public $listAttributes = array( 'cn', 'eduPersonNickname', + 'eduPersonAffiliation', 'eduPersonPrimaryAffiliation', 'givenName', 'sn', @@ -54,6 +55,7 @@ class UNL_Peoplefinder_Driver_LDAP implements UNL_Peoplefinder_DriverInterface public $detailAttributes = array( 'ou', 'cn', + 'eduPersonAffiliation', 'eduPersonNickname', 'eduPersonPrimaryAffiliation', 'givenName', @@ -112,7 +114,7 @@ class UNL_Peoplefinder_Driver_LDAP implements UNL_Peoplefinder_DriverInterface return $this->connected; } } - throw new Exception('Cound not connect to LDAP directory.'); + throw new Exception('Cound not connect to LDAP directory.', 500); } /** @@ -178,13 +180,18 @@ class UNL_Peoplefinder_Driver_LDAP implements UNL_Peoplefinder_DriverInterface /** * Get records which match the query exactly. * - * @param string $q Search string. + * @param string $query Search string. + * @param string $affiliation eduPersonAffiliation, eg staff/faculty/student * * @return array(UNL_Peoplefinder_Record) */ - public function getExactMatches($q) + public function getExactMatches($query, $affiliation = null) { - $filter = new UNL_Peoplefinder_Driver_LDAP_StandardFilter($q, '&', false); + if ($affiliation) { + $filter = new UNL_Peoplefinder_Driver_LDAP_AffiliationFilter($query, $affiliation, '&', false); + } else { + $filter = new UNL_Peoplefinder_Driver_LDAP_StandardFilter($query, '&', false); + } $this->query($filter->__toString(), $this->detailAttributes); return $this->getRecordsFromResults(); } @@ -200,7 +207,7 @@ class UNL_Peoplefinder_Driver_LDAP implements UNL_Peoplefinder_DriverInterface $r = array(); if ($this->lastResultCount > 0) { for ($i = 0; $i < $this->lastResultCount; $i++) { - $r[] = UNL_Peoplefinder_Record::fromLDAPEntry($this->lastResult[$i]); + $r[] = self::recordFromLDAPEntry($this->lastResult[$i]); } } return $r; @@ -215,9 +222,9 @@ class UNL_Peoplefinder_Driver_LDAP implements UNL_Peoplefinder_DriverInterface * * @return array(UNL_Peoplefinder_Record) */ - public function getAdvancedSearchMatches($sn, $cn, $eppa) + public function getAdvancedSearchMatches($query, $affiliation = null) { - $filter = new UNL_Peoplefinder_Driver_LDAP_AdvancedFilter($sn, $cn, $eppa, '&', true); + $filter = new UNL_Peoplefinder_Driver_LDAP_AdvancedFilter($query['sn'], $query['cn'], $affiliation, '&', true); $this->query($filter->__toString(), $this->detailAttributes); return $this->getRecordsFromResults(); } @@ -225,15 +232,20 @@ class UNL_Peoplefinder_Driver_LDAP implements UNL_Peoplefinder_DriverInterface /** * Find matches similar to the query given * - * @param string $q Search query + * @param string $query Search query + * @param string $affiliation eduPersonAffiliation, eg staff/faculty/student * @param array $excluded_records Array of records to exclude. * * @return array(UNL_Peoplefinder_Record) */ - public function getLikeMatches($q, $excluded_records = array()) + public function getLikeMatches($query, $affiliation = null, $excluded_records = array()) { - // Build filter excluding those displayed above - $filter = new UNL_Peoplefinder_Driver_LDAP_StandardFilter($q, '&', true); + if ($affiliation) { + $filter = new UNL_Peoplefinder_Driver_LDAP_AffiliationFilter($query, $affiliation, '&', true); + } else { + $filter = new UNL_Peoplefinder_Driver_LDAP_StandardFilter($query, '&', true); + } + // Exclude those displayed above $filter->excludeRecords($excluded_records); $this->query($filter->__toString(), $this->detailAttributes); return $this->getRecordsFromResults(); @@ -242,13 +254,14 @@ class UNL_Peoplefinder_Driver_LDAP implements UNL_Peoplefinder_DriverInterface /** * Get an array of records which matche by the phone number. * - * @param string $q EG: 472-1598 + * @param string $q EG: 472-1598 + * @param string $affiliation eduPersonAffiliation, eg staff/faculty/student * * @return array(UNL_Peoplefinder_Record) */ - public function getPhoneMatches($q) + public function getPhoneMatches($query, $affiliation = null) { - $filter = new UNL_Peoplefinder_Driver_LDAP_TelephoneFilter($q); + $filter = new UNL_Peoplefinder_Driver_LDAP_TelephoneFilter($query, $affiliation); $this->query($filter->__toString(), $this->detailAttributes); return $this->getRecordsFromResults(); } @@ -264,12 +277,39 @@ class UNL_Peoplefinder_Driver_LDAP implements UNL_Peoplefinder_DriverInterface { $r = $this->query("(&(uid=$uid))", $this->detailAttributes, false); if (isset($r[0])) { - return UNL_Peoplefinder_Record::fromLDAPEntry($r[0]); + return self::recordFromLDAPEntry($r[0]); } else { header('HTTP/1.0 404 Not Found'); - throw new Exception('Cannot find that UID.'); + throw new Exception('Cannot find that UID.', 404); } } + public static function recordFromLDAPEntry(array $entry) + { + $r = new UNL_Peoplefinder_Record(); + foreach (get_object_vars($r) as $var=>$val) { + if (isset($entry[strtolower($var)], $entry[strtolower($var)][0])) { + $r->$var = new UNL_LDAP_Entry_Attribute($entry[strtolower($var)]); + } + } + $r->imageURL = $r->getImageURL(); + return $r; + } + public static function recordFromUNLLDAPEntry(UNL_LDAP_Entry $entry) + { + $r = new UNL_Peoplefinder_Record(); + foreach (get_object_vars($r) as $var=>$val) { + $r->$var = $entry->$var; + } + $r->imageURL = $r->getImageURL(); + return $r; + } + + public function getHRPrimaryDepartmentMatches($query, $affiliation = null) + { + $filter = new UNL_Peoplefinder_Driver_LDAP_HRPrimaryDepartmentFilter($query); + $this->query($filter->__toString(), $this->detailAttributes); + return $this->getRecordsFromResults(); + } } diff --git a/lib/php/UNL/Peoplefinder/Driver/LDAP/AdvancedFilter.php b/lib/php/UNL/Peoplefinder/Driver/LDAP/AdvancedFilter.php index 45e6e82b..231112af 100644 --- a/lib/php/UNL/Peoplefinder/Driver/LDAP/AdvancedFilter.php +++ b/lib/php/UNL/Peoplefinder/Driver/LDAP/AdvancedFilter.php @@ -72,7 +72,7 @@ class UNL_Peoplefinder_Driver_LDAP_AdvancedFilter function __toString() { - $this->_filter = '(&'.$this->_filter.'(!(eduPersonPrimaryAffiliation=guest)))'; + $this->_filter = '(&'.$this->_filter.'(!(|(ou=org)(eduPersonPrimaryAffiliation=guest))))'; return $this->_filter; } diff --git a/lib/php/UNL/Peoplefinder/Driver/LDAP/AffiliationFilter.php b/lib/php/UNL/Peoplefinder/Driver/LDAP/AffiliationFilter.php new file mode 100644 index 00000000..6eb338ca --- /dev/null +++ b/lib/php/UNL/Peoplefinder/Driver/LDAP/AffiliationFilter.php @@ -0,0 +1,25 @@ +<?php +class UNL_Peoplefinder_Driver_LDAP_AffiliationFilter extends UNL_Peoplefinder_Driver_LDAP_StandardFilter +{ + protected $affiliation = 'staff'; + + function __construct($query, $affiliation, $operator = '&', $wild = false) + { + switch($affiliation) { + case 'student': + case 'faculty': + case 'staff': + case 'guest': + $this->affiliation = $affiliation; + break; + } + parent::__construct($query, $operator, $wild); + } + + function __toString() + { + $this->addExcludedRecords(); + $this->_filter = '(&'.$this->_filter.'(eduPersonAffiliation='.$this->affiliation.'))'; + return $this->_filter; + } +} \ No newline at end of file diff --git a/lib/php/UNL/Peoplefinder/Driver/LDAP/StandardFilter.php b/lib/php/UNL/Peoplefinder/Driver/LDAP/StandardFilter.php index b6d51957..ed7439ec 100644 --- a/lib/php/UNL/Peoplefinder/Driver/LDAP/StandardFilter.php +++ b/lib/php/UNL/Peoplefinder/Driver/LDAP/StandardFilter.php @@ -21,9 +21,9 @@ */ class UNL_Peoplefinder_Driver_LDAP_StandardFilter { - private $_filter; + protected $_filter; - private $_excludeRecords = array(); + protected $_excludeRecords = array(); /** * Construct a standard filter. @@ -44,7 +44,9 @@ class UNL_Peoplefinder_Driver_LDAP_StandardFilter //put the query into an array of words $query = preg_split('/\s+/', $inquery, 4); - if ($operator!='&') $operator = '|'; + if ($operator != '&') { + $operator = '|'; + } //create our filter //search for the string parts @@ -87,10 +89,14 @@ class UNL_Peoplefinder_Driver_LDAP_StandardFilter */ function excludeRecords($records = array()) { - $this->_excludeRecords = array_merge($this->_excludeRecords, $records); + if (count($this->_excludeRecords)) { + $this->_excludeRecords = array_merge($this->_excludeRecords, $records); + } else { + $this->_excludeRecords = $records; + } } - function __toString() + protected function addExcludedRecords() { if (count($this->_excludeRecords)) { $excludeFilter = ''; @@ -99,7 +105,12 @@ class UNL_Peoplefinder_Driver_LDAP_StandardFilter } $this->_filter = '(&'.$this->_filter.'(!(|'.$excludeFilter.')))'; } - $this->_filter = '(&'.$this->_filter.'(!(eduPersonPrimaryAffiliation=guest)))'; + } + + function __toString() + { + $this->addExcludedRecords(); + $this->_filter = '(&'.$this->_filter.'(!(|(ou=org)(eduPersonPrimaryAffiliation=guest))))'; return $this->_filter; } } diff --git a/lib/php/UNL/Peoplefinder/Driver/LDAP/TelephoneFilter.php b/lib/php/UNL/Peoplefinder/Driver/LDAP/TelephoneFilter.php index 7015152d..f41be751 100644 --- a/lib/php/UNL/Peoplefinder/Driver/LDAP/TelephoneFilter.php +++ b/lib/php/UNL/Peoplefinder/Driver/LDAP/TelephoneFilter.php @@ -15,16 +15,30 @@ class UNL_Peoplefinder_Driver_LDAP_TelephoneFilter { private $_filter; - function __construct($q) + protected $affiliation; + + function __construct($q, $affiliation = null) { if (!empty($q)) { $this->_filter = '(telephoneNumber=*'.str_replace('-','*',$q).')'; } + + switch ($affiliation) { + case 'faculty': + case 'staff': + case 'student': + $this->affiliation = $affiliation; + break; + } } function __toString() { - $this->_filter = '(&'.$this->_filter.'(!(eduPersonPrimaryAffiliation=guest)))'; + $this->_filter = '(&'.$this->_filter.'(!(|(ou=org)(eduPersonPrimaryAffiliation=guest)))'; + if ($this->affiliation) { + $this->_filter .= '(eduPersonAffiliation='.$this->affiliation.')'; + } + $this->_filter .= ')'; return $this->_filter; } } diff --git a/lib/php/UNL/Peoplefinder/Driver/WebService.php b/lib/php/UNL/Peoplefinder/Driver/WebService.php index 17e1d714..79d86c6f 100644 --- a/lib/php/UNL/Peoplefinder/Driver/WebService.php +++ b/lib/php/UNL/Peoplefinder/Driver/WebService.php @@ -1,40 +1,90 @@ <?php class UNL_Peoplefinder_Driver_WebService implements UNL_Peoplefinder_DriverInterface { + /** + * The address to the webservice + * + * @var string + */ public $service_url = 'http://peoplefinder.unl.edu/service.php'; + + function __construct($options = array()) + { + if (isset($options['service_url'])) { + $this->service_url = $options['service_url']; + } + } - function getExactMatches($query) + function getExactMatches($query, $affiliation = null) { - $results = file_get_contents($this->service_url.'?q='.urlencode($query).'&format=php&method=getExactMatches'); + $results = file_get_contents($this->service_url.'?q='.urlencode($query).'&format=php&affiliation='.urlencode($affiliation).'&method=getExactMatches'); if ($results) { $results = unserialize($results); } return $results; } - function getAdvancedSearchMatches($sn, $cn, $eppa) + function getAdvancedSearchMatches($query, $affliation = null) { - throw new Exception('Not implemented yet'); + if (empty($affiliation)) { + $affiliation = ''; + } + $results = file_get_contents($this->service_url.'?sn='.urlencode($query['sn']).'&cn='.urlencode($query['cn']).'&format=php&affiliation='.urlencode($affiliation).'&method=getAdvancedSearchMatches'); + if ($results) { + $results = unserialize($results); + } + return $results; } - function getLikeMatches($query) + function getLikeMatches($query, $affiliation = null, $excluded_records = array()) { - $results = file_get_contents($this->service_url.'?q='.urlencode($query).'&format=php&method=getLikeMatches'); + $results = file_get_contents($this->service_url.'?q='.urlencode($query).'&format=php&affiliation='.urlencode($affiliation).'&method=getLikeMatches'); if ($results) { $results = unserialize($results); } return $results; } - function getPhoneMatches($query) + + /** + * Get matches for a phone search + * + * @param string $query Numerical search query + * @param string $affiliation eduPersonAffiliation, eg, student, staff, faculty + * + * @return UNL_Peoplefinder_SearchResults + */ + function getPhoneMatches($query, $affiliation = null) { - throw new Exception('Not implemented yet'); + $results = file_get_contents($this->service_url.'?q='.urlencode($query).'&format=php&affiliation='.urlencode($affiliation).'&method=getPhoneMatches'); + if ($results) { + $results = unserialize($results); + } + return $results; } - + + /** + * Get an individual's record within the directory. + * + * @param string $uid Unique ID for the user, eg: bbieber2 + * + * @return UNL_Peoplefinder_Record + */ function getUID($uid) { $record = file_get_contents($this->service_url.'?uid='.urlencode($uid).'&format=php'); - if ($record) { - $record = unserialize($record); + + if (false === $record) { + throw new Exception('Could not find that user!', 404); } - return $record; + + return unserialize($record); + } + + function getHRPrimaryDepartmentMatches($query, $affiliation = null) + { + $results = file_get_contents($this->service_url.'?q=d:'.urlencode($query).'&format=php&affiliation='.urlencode($affiliation).'&method=getHRPrimaryDepartmentMatches'); + if ($results) { + $results = unserialize($results); + } + return $results; } } ?> \ No newline at end of file diff --git a/lib/php/UNL/Peoplefinder/DriverInterface.php b/lib/php/UNL/Peoplefinder/DriverInterface.php index 7a1a0dfe..51889fb5 100644 --- a/lib/php/UNL/Peoplefinder/DriverInterface.php +++ b/lib/php/UNL/Peoplefinder/DriverInterface.php @@ -10,33 +10,43 @@ interface UNL_Peoplefinder_DriverInterface /** * Return an array of records exactly matching the query. * - * @param string $query A general query + * @param string $query A general query + * @param string $affiliation eduPersonAffiliation, eg staff/faculty/student */ - function getExactMatches($query); + function getExactMatches($query, $affiliation = null); /** * perform a detailed search * - * @param string $sn surname, eg bieber - * @param string $cn common name, eg brett - * @param string $eppa eduPersonPrimaryAffiliation, eg staff/faculty/student + * @param array(cn,sn) Where cn = common name, sn surname, eg bieber + * @param string $affiliation eduPersonAffiliation, eg staff/faculty/student */ - function getAdvancedSearchMatches($sn, $cn, $eppa); + function getAdvancedSearchMatches($query, $affiliation = null); /** * Return an array of records somewhat matching the query * - * @param string $query A general query + * @param string $query A general query + * @param string $affiliation eduPersonAffiliation, eg staff/faculty/student */ - function getLikeMatches($query); + function getLikeMatches($query, $affiliation = null); /** * return matches for a phone number search * - * @param string $query Phone number eg: 472-1598 + * @param string $query Phone number eg: 472-1598 + * @param string $affiliation eduPersonAffiliation, eg staff/faculty/student */ - function getPhoneMatches($query); - + function getPhoneMatches($query, $affiliation = null); + + /** + * Get results by organization + * + * @param string $query The organization name, eg: University Communications + * @param string $affiliation eduPersonAffiliation, eg staff/faculty/student + */ + function getHRPrimaryDepartmentMatches($query, $affiliation = null); + /** * get a UNL_Peoplefinder_Record for the user * diff --git a/lib/php/UNL/Peoplefinder/Record.php b/lib/php/UNL/Peoplefinder/Record.php index 83d346a2..2116b688 100644 --- a/lib/php/UNL/Peoplefinder/Record.php +++ b/lib/php/UNL/Peoplefinder/Record.php @@ -14,6 +14,7 @@ class UNL_Peoplefinder_Record { public $cn; public $ou; + public $eduPersonAffiliation; public $eduPersonNickname; public $eduPersonPrimaryAffiliation; public $givenName; @@ -42,26 +43,15 @@ class UNL_Peoplefinder_Record public $unlSISMajor; public $unlEmailAlias; - - static function fromLDAPEntry(array $entry) + function __construct($options = array()) { - $r = new self(); - foreach (get_object_vars($r) as $var=>$val) { - if (isset($entry[strtolower($var)], $entry[strtolower($var)][0])) { - $r->$var = $entry[strtolower($var)][0]; - } + if (isset($options['uid']) + && $options['peoplefinder']) { + return $options['peoplefinder']->getUID($options['uid']); } - return $r; } - static function fromUNLLDAPEntry(UNL_LDAP_Entry $entry) - { - $r = new self(); - foreach (get_object_vars($r) as $var=>$val) { - $r->$var = $entry->$var; - } - return $r; - } + /** * Takes in a string from the LDAP directory, usually formatted like: @@ -73,50 +63,128 @@ class UNL_Peoplefinder_Record */ 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); - } + $parts = explode(',', $this->postalAddress); + + // Set up defaults: + $address = array(); + $address['street-address'] = trim($parts[0]); + $address['locality'] = ''; $address['region'] = 'NE'; - $address['street-address'] = trim($addressComponent[0]); - if (isset($addressComponent[1])) { - $address['postal-code'] = trim($addressComponent[1]); - } else { - $address['postal-code'] = ''; + $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)) { + // Found a zip-code + $address['postal-code'] = trim($part); + } } - switch (substr($address['postal-code'],0,3)) { + + switch (substr($address['postal-code'], 0, 3)) { case '681': $address['locality'] = 'Omaha'; - break; + break; case '685': - default: $address['locality'] = 'Lincoln'; - break; + 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) + { + + $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); + } else { + $c->extendLife(); + $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'; + case 'PBAC': + return 'Non-Degree Post-Baccalaureate'; + default: + 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) + { + include_once 'UNL/Common/Colleges.php'; + $colleges = new UNL_Common_Colleges(); + if (isset($colleges->colleges[$college])) { + return htmlentities($colleges->colleges[$college]); + } + + return $college; + } + + function getImageURL($size = 'medium') + { + + if ($this->ou == 'org') { + return UNL_Peoplefinder::getURL().'images/organization.png'; + } + + switch ($size) { + case 'large': + case 'medium': + case 'tiny': + case 'topbar': + break; + default: + $size = 'medium'; + } + + return 'http://planetred.unl.edu/pg/icon/unl_'.str_replace('-', '_', $this->uid).'/'.$size.'/'; + } + function __wakeup() + { + foreach ($this as $var=>$val) { + if ($val instanceof UNL_LDAP_Entry_Attribute) { + $this->$var->__wakeup(); + } + } + } + function __toString() { return $this->uid; } } -?> \ No newline at end of file diff --git a/lib/php/UNL/Peoplefinder/Renderer/HTML.php b/lib/php/UNL/Peoplefinder/Renderer/HTML.php index 121f83de..e69de29b 100644 --- a/lib/php/UNL/Peoplefinder/Renderer/HTML.php +++ b/lib/php/UNL/Peoplefinder/Renderer/HTML.php @@ -1,518 +0,0 @@ -<?php -/** - * Peoplefinder HTML Renderer - * - * PHP version 5 - * - * @package UNL_Peoplefinder - * @author Brett Bieber <brett.bieber@gmail.com> - * @copyright 2007 Regents of the University of Nebraska - * @license http://www1.unl.edu/wdn/wiki/Software_License BSD License - * @link http://peoplefinder.unl.edu/ - */ - -/** - * Determines if a network in the form of 192.168.17.1/16 or - * 127.0.0.1/255.255.255.255 or 10.0.0.1 matches a given ip - * @param $network The network and mask - * @param $ip The ip to check - * @return bool true or false - */ -function net_match($network, $ip) { - $ip_arr = explode('/', $network); - $network_long = ip2long($ip_arr[0]); - $x = ip2long($ip_arr[1]); - $mask = long2ip($x) == $ip_arr[1] ? $x : 0xffffffff << (32 - $ip_arr[1]); - $ip_long = ip2long($ip); - return ($ip_long & $mask) == ($network_long & $mask); -} - -/** - * Class to render html output for results - * - * PHP version 5 - * - * @package UNL_Peoplefinder - * @author Brett Bieber <brett.bieber@gmail.com> - * @copyright 2007 Regents of the University of Nebraska - * @license http://www1.unl.edu/wdn/wiki/Software_License BSD License - * @link http://peoplefinder.unl.edu/ - */ -class UNL_Peoplefinder_Renderer_HTML -{ - - protected $trustedIP = false; - public $uri; - - public $displayLimit; - - /** This can be set to a javascript function name to send the UID to when clicking a uid */ - public $uid_onclick; - /** This defines a mode in which the directory is searched to return one user. */ - public $choose_uid = false; - public $page_onclick; - - function __construct(array $options = null) - { - if (isset($_SERVER['REMOTE_ADDR'])) { - $validIPs = array('129.93.0.0/16','65.123.32.0/19','64.39.240.0/20','216.128.208.0/20'); - foreach ($validIPs as $range) { - if (net_match($range, $_SERVER['REMOTE_ADDR'])) { - $this->trustedIP = true; - break; - } - } - } - $this->displayLimit = UNL_Peoplefinder::$displayResultLimit; - $this->uri = $_SERVER['SCRIPT_NAME']; - if (isset($options)) { - $this->setOptions($options); - } - } - - /** - * This function sets parameters for this class. - * - * @param array $options an associative array of options to set. - */ - function setOptions(array $options) - { - foreach ($options as $option=>$val) { - if (property_exists($this,$option)) { - $this->$option = $val; - } else { - echo 'Warning: Trying to set unkown option ['.$option.'] for object '.get_class($this)."\n"; - } - } - } - - /** - * Renders a peoplefinder record object - * - * @param UNL_Peoplefinder_Record $r record to render - */ - public function renderRecord(UNL_Peoplefinder_Record $r) - { - echo "<div class='vcard {$r->eduPersonPrimaryAffiliation}'>\n"; - if (isset($r->mail) - && ($r->eduPersonPrimaryAffiliation != 'student' || $this->displayStudentEmail==true)) { - $displayEmail = true; - } else { - $displayEmail = false; - } - if ($displayEmail && isset($r->unlEmailAlias)) echo "<a class='email' href='mailto:{$r->unlEmailAlias}@unl.edu'>"; - if ($r->ou == 'org') { - echo '<span class="cn">'.$r->cn.'</span>'.PHP_EOL; - } else { - echo '<span class="fn">'.$r->displayName.'</span>'.PHP_EOL; - if (isset($r->eduPersonNickname)) echo '<span class="nickname">'.$r->eduPersonNickname.'</span>'.PHP_EOL; - } - if ($displayEmail && isset($r->unlEmailAlias)) echo "</a>\n"; - if (!empty($r->eduPersonPrimaryAffiliation)) echo '<span class="eppa">('.$r->eduPersonPrimaryAffiliation.')</span>'.PHP_EOL; - echo '<div class="vcardInfo">'.PHP_EOL; - echo '<a class="planetred_profile" href="http://planetred.unl.edu/pg/profile/unl_'.$r->uid.'" title="Planet Red Profile for '.$r->cn.'"><img class="photo frame" src="http://planetred.unl.edu/mod/profile/icondirect.php?username=unl_'.$r->uid.'&size=medium" alt="Photo of '.$r->displayName.'" /></a>'; - if (isset($r->unlSISClassLevel)) { - switch ($r->unlSISClassLevel) { - case 'FR': - $class = 'Freshman,'; - break; - case 'SR': - $class = 'Senior,'; - break; - case 'SO': - $class = 'Sophomore,'; - break; - case 'JR': - $class = 'Junior,'; - break; - case 'GR': - $class = 'Graduate Student,'; - break; - default: - $class = $r->unlSISClassLevel; - } - echo '<span class="title">'.$class." ".$this->formatMajor($r->unlSISMajor).'–'.$this->formatCollege($r->unlSISCollege).'</span>'; - } - -// if (isset($r->unlSISLocalAddr1)) { -// $localaddr = array($r->unlSISLocalAddr1, $r->unlSISLocalAddr2, $r->unlSISLocalCity, $r->unlSISLocalState, $r->unlSISLocalZip); -// $this->renderAddress($localaddr, 'Local', 'workAdr'); -// } -// -// if (isset($r->unlSISPermAddr1)) { -// $permaddr = array($r->unlSISPermAddr1, $r->unlSISPermAddr2, $r->unlSISPermCity, $r->unlSISPermState, $r->unlSISPermZip); -// $this->renderAddress($permaddr, 'Home', 'homeAdr'); -// } - - if (isset($r->title)) { - echo "<span class='title'>{$r->title}</span>\n"; - } - - if (isset($r->unlHRPrimaryDepartment)) { - $org_name = 'University of Nebraska–Lincoln'; - if ($r->unlHRPrimaryDepartment == 'Office of the President') { - $org_name = 'University of Nebraska'; - } - $dept_url = UNL_PEOPLEFINDER_URI.'departments/?d='.urlencode($r->unlHRPrimaryDepartment); - echo "<span class='org'>\n\t<span class='organization-unit'><a href='{$dept_url}'>{$r->unlHRPrimaryDepartment}</a></span>\n\t<span class='organization-name'>$org_name</span></span>\n"; - } - - if (isset($r->postalAddress)) { - if (strpos($r->postalAddress,'UNL')!= -1 || strpos($r->postalAddress,'UNO')!= -1) { - $address = $r->formatpostalAddress(); - - if( strpos($address['postal-code'],'68588') == 0 ) - { - $address['street-address'] = $this->replaceBuildingCode($address['street-address']); - } - - echo '<div class="adr workAdr"> - <span class="type">Work</span> - <span class="street-address">'. $address['street-address'] . '</span> - <span class="locality">' . $address['locality'] . '</span> - <span class="region">' . $address['region'] . '</span> - <span class="postal-code">' . $address['postal-code'] . '</span> - <div class="country-name">USA</div> - </div>'.PHP_EOL; - } else { - echo "<span class='adr'>{$r->postalAddress}</span>\n"; - } - } - - if (strpos($_SERVER['HTTP_USER_AGENT'], "iPhone") === false) { - $href = "wtai://wp/mc;"; - $isIPhone = false; - } else { - $href = "tel:"; - $isIPhone = true; - } - if (isset($r->telephoneNumber)) { - - echo '<div class="tel workTel"> - <span class="type">Work</span> - <span class="value">'.$this->formatPhone($r->telephoneNumber).'</span> - </div>'.PHP_EOL; - } - - if (isset($r->unlSISLocalPhone)) { - echo '<div class="tel homeTel"> - <span class="type">Phone</span> - <span class="value">'.$this->formatPhone($r->unlSISLocalPhone).'</span> - </div>'.PHP_EOL; - } - - if ($displayEmail) { - if ($r->unlEmailAlias != 'president') { - $email = $r->unlEmailAlias.'@unl.edu'; - } else { - $email = $r->unlEmailAlias.'@nebraska.edu'; - } - echo "<span class='email'><a class='email' href='mailto:$email'>$email</a></span>\n"; - if ($this->trustedIP===true) echo "<span class='email delivery'>Delivery Address: {$r->mail}</span>\n"; - } - $linktext = '<img src="/ucomm/templatedependents/templatecss/images/mimetypes/text-vcard.gif" alt="vCard" /> <span class="caption">vCard</span>'.PHP_EOL; - echo $this->getVCardLink($r->uid, $linktext, null, 'Download V-Card for '.$r->givenName.' '.$r->sn); - echo '</div>'.PHP_EOL.'</div>'.PHP_EOL; - } - - public function renderAddress($address, $type, $class = null) - { - if (!isset($class)) { - $class = ''; - } - $addr = ' - <div class="adr '.$class.'"> - <span class="type">'.$type.'</span> - <span class="street-address">'.$address[0].'</span> - <span class="locality">'.$address[2].'</span> - <span class="region">'.$address[3].'</span> - <span class="postal-code">'.$address[4].'</span>'; - if (isset($address[5])) { - $addr .= '<div class="country-name">'.$address[5].'</div>'; - } - $addr .= '</div>'; - echo $addr; - } - - /** - * Takes in a street address of a staff or faculty member, a building - * code in a string with a link to the building in the virtual tour - * - * @param string $streetaddress Street Address of a staff or faculty member - * - * @return string - */ - private function replaceBuildingCode($streetaddress) - { - require_once 'UNL/Common/Building.php'; - $regex = "/([A-Za-z0-9].) ([A-Z0-9\&]{2,4})/" ; //& is for M&N Building - - if (preg_match($regex, $streetaddress, $matches)) { - $bldgs = new UNL_Common_Building(); - - if ($bldgs->buildingExists($matches[2])) { - - $replace = '${1} <a class="location mapurl" href="http://www1.unl.edu/tour/${2}">${2}</a>'; - return preg_replace($regex, $replace, $streetaddress); - } - } - - return $streetaddress; - } - - /** - * This function takes in a string representing a phone number - * and formats it to be rendered as a clickable calling link - * - * @param string $phone A telephone number - * @return string - */ - public function formatPhone($phone) - { - $link = '<a href="'; - if (strpos($_SERVER['HTTP_USER_AGENT'], "iPhone") === false) { - $link .= "wtai://wp/mc;".str_replace(array("(", ")", "-"), "", $phone); - } else { - $link .= "tel:".$phone; - } - $link .= '">'.$phone.'</a>'; - return $link; - } - - /** - * This function takes in an array of address information and formats it - * - * @param array $addressArray Address information - * <code> - * $addressArray[0] = Address line 1 - * $addressArray[1] = Address line 2 - * $addressArray[2] = City - * $addressArray[3] = State - * $addressArray[4] = Zip - * $addressArray[5] = Country - * </code> - * - * @return string - */ - public function formatAddress($addressArray) - { - if (isset($addressArray[0])) { - $address = $addressArray[0]."<br />"; - if (isset($addressArray[1])) $address .= $addressArray[1]."<br />"; - $address .= $addressArray[2].", ".$addressArray[3]." ".$addressArray[4]; - if (isset($addressArray[5])) $address .= "<br />".$addressArray[4]; - } else { - $address = 'Unlisted'; - } - return $address; - } - - public function displayPageLinks($num_records, $start, $end) - { - //Display Page information - $page = (isset($_GET['p']))?$_GET['p']:0; - $next = $page + 1; - if ($page>=1) $prevLink = '<a class="previous" href="'.$this->uri.'?'.preg_replace('/[&]?p=\d/','',$_SERVER['QUERY_STRING']).'&p='.($page-1).'"><< </a>'; - else $prevLink = '<< '; - if ($end < $num_records) $nextLink = "<a class='next' href='".$this->uri."?".preg_replace("/[&]?p=\d/","",$_SERVER['QUERY_STRING'])."&p=$next'> >></a>"; - else $nextLink = ' >>'; - return '<div class="cNav">'.$prevLink.$nextLink.'</div>'; - } - - public function renderListRecord(UNL_Peoplefinder_Record $r) - { - if ($r->ou == 'org') { - $linktext = $r->cn; - } else { - $linktext = $r->sn . ', '. $r->givenName; - if (isset($r->eduPersonNickname)) { - $linktext .= ' "'.$r->eduPersonNickname.'"'; - } - } - - echo '<div class="fn">'.$this->getUIDLink($r->uid, $linktext, $this->uid_onclick).'</div>'.PHP_EOL; - if (isset($r->eduPersonPrimaryAffiliation)) echo '<div class="eppa">('.$r->eduPersonPrimaryAffiliation.')</div>'.PHP_EOL; - if (isset($r->unlHRPrimaryDepartment)) echo '<div class="organization-unit">'.$r->unlHRPrimaryDepartment.'</div>'.PHP_EOL; - if (isset($r->title)) echo '<div class="title">'.$r->title.'</div>'.PHP_EOL; - if (isset($r->telephoneNumber)) echo '<div class="tel">'.$this->formatPhone($r->telephoneNumber).'</div>'.PHP_EOL; - - echo $this->getUIDLink($r->uid, 'contact info', $this->uid_onclick, 'cInfo'); - if ($this->choose_uid) { - echo '<div class="pfchooser"><a href="#" onclick="return pfCatchUID(\''.$r->uid.'\');">Choose this person</a></div>'.PHP_EOL; - } - } - - public function renderSearchResults(array $records, $start=0, $num_rows=UNL_PF_DISPLAY_LIMIT) - { - if (($start+$num_rows)>count($records)) { - $end = count($records); - } else { - $end = $start+$num_rows; - } - if ($start > 0 || $end < count($records)) { - $navlinks = $this->displayPageLinks(count($records), $start, $end); - } else { - $navlinks = ''; - } - echo "<div class='result_head'>Results ".($start+1)." - $end out of ".count($records).':'.$navlinks.'</div>'.PHP_EOL; - echo '<ul>'; - for ($i = $start; $i<$end; $i++) { - $even_odd = ($i % 2) ? '' : 'alt'; - if ($records[$i]->ou == 'org') { - $class = 'org_Sresult'; - } else { - $class = 'ppl_Sresult'; - } - $class .= ' '.$records[$i]->eduPersonPrimaryAffiliation; - echo '<li class="'.$class.' '.$even_odd.'">'; - $this->renderListRecord($records[$i]); - echo '</li>'.PHP_EOL; - } - echo '</ul>'; - echo "<div class='result_head'>$navlinks</div>"; - } - - public function getUIDLink($uid, $linktext = null, $onclick = null, $class = null) - { - $uri = $this->uri.'?uid='.$uid; - if (isset($linktext)) { - $link = '<a href="'.$uri.'"'; - if (isset($onclick)) { - $link .= ' onclick="return '.$this->uid_onclick.'(\''.$uid.'\');"'; - } - if (isset($class)) { - $link .= ' class="'.$class.'"'; - } - $link .= '>'.$linktext.'</a>'; - return $link; - } else { - return $uri; - } - } - - /** - * 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) - { - - include_once 'Cache/Lite.php'; - $c = new 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); - } else { - $c->extendLife(); - $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'; - case 'PBAC': - return 'Non-Degree Post-Baccalaureate'; - default: - 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) - { - include_once 'UNL/Common/Colleges.php'; - $colleges = new UNL_Common_Colleges(); - if (isset($colleges->colleges[$college])) { - return htmlentities($colleges->colleges[$college]); - } - - return $college; - } - - public function getVCardLink($uid, $linktext = null,$onclick = null,$title = null) - { - - $uri = $this->uri.'vcards/'.$uid; - if (isset($linktext)) { - $link = '<a href="'.$uri.'"'; - if (isset($onclick)) { - $link .= ' onclick="return '.$onclick.'(\''.$uid.'\');"'; - } - if (isset($title)) { - $link .= ' title="'.$title.'"'; - } - $link .= ' class="vcf">'.$linktext.'</a>'; - return $link; - } else { - return $uri; - } - } - - - - public function renderError() - { - echo "<p>Please enter more information or <a href='".$_SERVER['PHP_SELF']."?adv=y' title='Click here to perform a detailed Peoplefinder search'>try a Detailed Search.</a></p>"; - } - - /** - * Displays the instructions for using peoplefinder. - * - * @param bool $adv Show advanced instructions or default instructions. - * - * @return void - */ - function displayInstructions($adv=false) - { - echo '<div style="padding-top:10px;width:270px;" id="instructions">'; - if ($adv) { - echo 'Enter in as much of the first and/or last name you know, ' . - 'you can also select a primary affiliation to refine your search.'; - } else { - echo 'Enter in as much of the name as you know, first and/or last '. - 'name in any order.<br /><br />Reverse telephone number lookup: '. - 'enter last three or more digits.'; - } - echo '</div>'; - } - - /** - * Display the standard search form. - * - * @return void - */ - function displayStandardForm() - { - include 'standardForm.php'; - } - - /** - * Display the advanced form. - * - * @return void - */ - function displayAdvancedForm() - { - include 'advancedForm.php'; - } -} - -?> \ No newline at end of file diff --git a/lib/php/UNL/Peoplefinder/Renderer/JSON.php b/lib/php/UNL/Peoplefinder/Renderer/JSON.php index 773e333f..e69de29b 100644 --- a/lib/php/UNL/Peoplefinder/Renderer/JSON.php +++ b/lib/php/UNL/Peoplefinder/Renderer/JSON.php @@ -1,37 +0,0 @@ -<?php -/** - * Peoplefinder JSON renderer - * - * PHP version 5 - * - * @package UNL_Peoplefinder - * @author Brett Bieber <brett.bieber@gmail.com> - * @copyright 2007 Regents of the University of Nebraska - * @license http://www1.unl.edu/wdn/wiki/Software_License BSD License - * @link http://peoplefinder.unl.edu/ - */ - -class UNL_Peoplefinder_Renderer_JSON -{ - function __construct(array $options = null) - { - - } - - /** - * Renders a peoplefinder record object - * - * @param UNL_Peoplefinder_Record $r record to render - */ - public function renderRecord(UNL_Peoplefinder_Record $r) - { - echo json_encode($r); - } - - public function renderSearchResults(array $records, $start=0, $num_rows=UNL_PF_DISPLAY_LIMIT) - { - echo json_encode($records); - } -} - -?> \ No newline at end of file diff --git a/lib/php/UNL/Peoplefinder/Renderer/Serialized.php b/lib/php/UNL/Peoplefinder/Renderer/Serialized.php index a5e0997a..e69de29b 100644 --- a/lib/php/UNL/Peoplefinder/Renderer/Serialized.php +++ b/lib/php/UNL/Peoplefinder/Renderer/Serialized.php @@ -1,37 +0,0 @@ -<?php -/** - * Peoplefinder serialized renderer - * - * PHP version 5 - * - * @package UNL_Peoplefinder - * @author Brett Bieber <brett.bieber@gmail.com> - * @copyright 2007 Regents of the University of Nebraska - * @license http://www1.unl.edu/wdn/wiki/Software_License BSD License - * @link http://peoplefinder.unl.edu/ - */ - -class UNL_Peoplefinder_Renderer_Serialized -{ - function __construct(array $options = null) - { - - } - - /** - * Renders a peoplefinder record object - * - * @param UNL_Peoplefinder_Record $r record to render - */ - public function renderRecord(UNL_Peoplefinder_Record $r) - { - echo serialize($r); - } - - public function renderSearchResults(array $records, $start=0, $num_rows=UNL_PF_DISPLAY_LIMIT) - { - echo serialize($records); - } -} - -?> \ No newline at end of file diff --git a/lib/php/UNL/Peoplefinder/Renderer/XML.php b/lib/php/UNL/Peoplefinder/Renderer/XML.php index 50bcf8fe..e69de29b 100644 --- a/lib/php/UNL/Peoplefinder/Renderer/XML.php +++ b/lib/php/UNL/Peoplefinder/Renderer/XML.php @@ -1,68 +0,0 @@ -<?php -class UNL_Peoplefinder_Renderer_XML -{ - - protected $trustedIP = false; - protected $displayStudentTelephone = false; - - protected $sent_headers = false; - - /** - * Sends the headers and XML preamble. - * - * @return void - */ - function sendHeaders() - { - if ($this->sent_headers) { - return; - } - header('Content-type: text/xml'); - echo '<?xml version="1.0" encoding="utf-8"?> -<unl xmlns="http://wdn.unl.edu/xml">'.PHP_EOL; - $this->sent_headers = true; - } - - /** - * Render an individual record - * - * @param UNL_Peoplefinder_Record $r - */ - public function renderRecord(UNL_Peoplefinder_Record $r) - { - $this->sendHeaders(); - echo '<person>'; - foreach (get_object_vars($r) as $key=>$val) { - $val = htmlspecialchars($val); - echo "<$key>{$val}</$key>\n"; - } - echo '</person>'.PHP_EOL; - } - - public function renderSearchResults(array $records, $start=0, $num_rows=UNL_PF_DISPLAY_LIMIT) - { - $this->sendHeaders(); - foreach ($records as $record) { - $this->renderRecord($record); - } - } - - public function renderError() - { - $this->sendHeaders(); - echo '<error>Please enter more information</error>'; - } - - function __destruct() - { - if ($this->sent_headers) { - $this->sendFooter(); - } - } - - function sendFooter() - { - echo '</unl>'; - } -} -?> \ No newline at end of file diff --git a/lib/php/UNL/Peoplefinder/Renderer/vCard.php b/lib/php/UNL/Peoplefinder/Renderer/vCard.php index 1afab90c..e69de29b 100644 --- a/lib/php/UNL/Peoplefinder/Renderer/vCard.php +++ b/lib/php/UNL/Peoplefinder/Renderer/vCard.php @@ -1,60 +0,0 @@ -<?php -/** - * Peoplefinder vcard renderer - * - * PHP version 5 - * - * @package UNL_Peoplefinder - * @author Brett Bieber <brett.bieber@gmail.com> - * @copyright 2007 Regents of the University of Nebraska - * @license http://www1.unl.edu/wdn/wiki/Software_License BSD License - * @link http://peoplefinder.unl.edu/ - */ - -class UNL_Peoplefinder_Renderer_vCard -{ - - protected $displayStudentTelephone = false; - - public function renderRecord(UNL_Peoplefinder_Record $r) - { - header('Content-Type: text/x-vcard'); - header('Content-Disposition: attachment; filename="'.$r->sn.', '.$r->givenName.'.vcf"'); - //connect, taking in UID - echo "BEGIN:VCARD\n"; - echo "VERSION:3.0\n"; - echo "N:".$r->sn.";".$r->givenName.";;;\n"; - echo "FN:".$r->givenName." ".$r->sn."\n"; - if(isset($r->unlHRPrimaryDepartment)) echo "ORG:University of Nebraska-Lincoln;".$r->unlHRPrimaryDepartment."\n"; - if (isset($r->unlEmailAlias)) { - if (($r->eduPersonPrimaryAffiliation != 'student') && isset($r->unlEmailAlias)) echo "EMAIL;type=INTERNET;type=WORK;type=pref:".$r->unlEmailAlias."@unl.edu\n"; - } - if ($r->eduPersonPrimaryAffiliation != "student" || $this->displayStudentTelephone==true) echo "TEL;type=WORK;type=pref:".$r->telephoneNumber."\n"; - //echo "TEL;type=CELL:(402) 555-1111\n"; - if (isset($r->unlSISLocalPhone)) { - echo "TEL;type=HOME:{$r->unlSISLocalPhone}\n"; - } - if (isset($r->unlSISLocalAddr1)) { - echo "item1.ADR;type=WORK;type=pref:;;".$r->unlSISLocalAddr1; - if (isset($r->unlSISLocalAddr2)) echo "\\n".$r->unlSISLocalAddr2; - echo ";".$r->unlSISLocalCity.";".$r->unlSISLocalState.";".$r->unlSISLocalZip.";\n"; - echo "item1.X-ABLabel:local\n"; - } - if (isset($r->unlSISPermaddr1)) { - echo "item2.ADR;type=HOME;type=pref:;;".$r->unlSISPermAddr1; - if(isset($r->unlSISPermAddr2)) echo "\\n".$r->unlSISPermAddr2; - echo ";".@$r->unlSISPermCity.";".@$r->unlSISPermState.";".@$r->unlSISPermZip.";\n"; - echo "item2.X-ABLabel:permanent\n"; - } - //echo "item1.X-ABADR:us\n"; - //echo "item2.X-ABADR:us\n"; - //echo "URL:http://www.unl.edu/\n"; - //echo "LOGO;VALUE=uri:http://www.unl.edu/unlpub/2004sharedgraphics/smcolor_wordmark.gif"; - if (isset($r->title)) { - echo "item3.X-ABRELATEDNAMES;type=pref:".$r->title."\n"; - echo "item3.X-ABLabel:title\n"; - } - echo "END:VCARD\n"; - } -} -?> \ No newline at end of file diff --git a/lib/php/UNL/Peoplefinder/RendererInterface.php b/lib/php/UNL/Peoplefinder/RendererInterface.php index aa853202..e69de29b 100644 --- a/lib/php/UNL/Peoplefinder/RendererInterface.php +++ b/lib/php/UNL/Peoplefinder/RendererInterface.php @@ -1,10 +0,0 @@ -<?php -interface UNL_Peoplefinder_RendererInterface -{ - function renderRecord(UNL_Peoplefinder_Record $r); - function renderListRecord(UNL_Peoplefinder_Record $r); - function renderSearchResults(array $records, $start=0, $num_rows=UNL_PF_DISPLAY_LIMIT); - function renderError($message = null); - function displayInstructions(); -} -?> \ No newline at end of file diff --git a/lib/tests/UNL_LDAP/tests/UNL_LDAPTest.php b/lib/tests/UNL_LDAP/tests/UNL_LDAPTest.php new file mode 100644 index 00000000..5961299c --- /dev/null +++ b/lib/tests/UNL_LDAP/tests/UNL_LDAPTest.php @@ -0,0 +1,124 @@ +<?php +/** + * Test the LDAP class + * + * PHP version 5 + * + * $Id$ + * + * @category Default + * @package UNL_LDAP + * @author Brett Bieber <brett.bieber@gmail.com> + * @copyright 2009 Regents of the University of Nebraska + * @license http://www1.unl.edu/wdn/wiki/Software_License BSD License + * @link http://pear.unl.edu/package/UNL_LDAP + */ +ini_set('display_errors', true); +error_reporting(E_ALL); +// Call UNL_LDAPTest::main() if this source file is executed directly. +if (!defined('PHPUNIT_MAIN_METHOD')) { + define('PHPUNIT_MAIN_METHOD', 'UNL_LDAPTest::main'); +} + +require_once 'PHPUnit/Framework.php'; + +chdir(dirname(__FILE__).'/../'); + +require_once 'UNL/LDAP.php'; +require_once 'config.inc.php'; + +/** + * Test class for UNL_LDAP. + * + * $Id$ + * + * @category Default + * @package UNL_LDAP + * @author Brett Bieber <brett.bieber@gmail.com> + * @copyright 2009 Regents of the University of Nebraska + * @license http://www1.unl.edu/wdn/wiki/Software_License BSD License + * @link http://pear.unl.edu/package/UNL_LDAP + */ +class UNL_LDAPTest extends PHPUnit_Framework_TestCase +{ + /** + * @var UNL_LDAP + * @access protected + */ + protected $object; + + /** + * Runs the test methods of this class. + * + * @access public + * @static + * @return void + */ + public static function main() + { + include_once 'PHPUnit/TextUI/TestRunner.php'; + + $suite = new PHPUnit_Framework_TestSuite('UNL_LDAPTest'); + $result = PHPUnit_TextUI_TestRunner::run($suite); + } + + /** + * Sets up the fixture, for example, opens a network connection. + * This method is called before a test is executed. + * + * @access protected + * @return void + */ + protected function setUp() + { + global $options; + $this->object = UNL_LDAP::getConnection($options); + } + + /** + * Tears down the fixture, for example, closes a network connection. + * This method is called after a test is executed. + * + * @access protected + * @return void + */ + protected function tearDown() + { + } + + /** + * Just tests that you can get a connection to the server. + * + * @return void + */ + public function testGetConnection() + { + $this->assertEquals('UNL_LDAP', get_class($this->object)); + } + + /** + * Test get attribute function + * + * @return void + */ + public function testGetAttribute() + { + $this->assertEquals(array('count'=>1, 'Bieber'), $this->object->getAttribute('bbieber2', 'sn')); + } + + /** + * test getFirstAttribute + * + * @return void + */ + public function testGetFirstAttribute() + { + $this->assertEquals('Bieber', $this->object->getFirstAttribute('bbieber2', 'sn')); + } +} + +// Call UNL_LDAPTest::main() if this source file is executed directly. +if (PHPUNIT_MAIN_METHOD == 'UNL_LDAPTest::main') { + UNL_LDAPTest::main(); +} +?> diff --git a/lib/tests/UNL_Peoplefinder/pear.unl.edu/PeoplefinderTest.php b/lib/tests/UNL_Peoplefinder/pear.unl.edu/PeoplefinderTest.php index 11f81305..80e0317e 100644 --- a/lib/tests/UNL_Peoplefinder/pear.unl.edu/PeoplefinderTest.php +++ b/lib/tests/UNL_Peoplefinder/pear.unl.edu/PeoplefinderTest.php @@ -117,9 +117,9 @@ class PeoplefinderTest extends PHPUnit_Framework_TestCase { $p = new UNL_Peoplefinder(); $r = $p->getLikeMatches('bieber'); $this->assertEquals(7, sizeof($r)); - $r = $p->getLikeMatches('bieber', array($r[0]), 'Testing exclusion of records did not work.'); + $r = $p->getLikeMatches('bieber', null, array($r[0]), 'Testing exclusion of records did not work.'); $this->assertEquals(5, sizeof($r)); - $r = $p->getLikeMatches('bieber', $r, 'Testing exclusion of records did not work.'); + $r = $p->getLikeMatches('bieber', null, $r, 'Testing exclusion of records did not work.'); $this->assertEquals(1, sizeof($r)); } diff --git a/lib/www/UNL_Peoplefinder/pear.unl.edu/README b/lib/www/UNL_Peoplefinder/pear.unl.edu/README index 93776137..e997733c 100644 --- a/lib/www/UNL_Peoplefinder/pear.unl.edu/README +++ b/lib/www/UNL_Peoplefinder/pear.unl.edu/README @@ -11,7 +11,6 @@ username and password. Then browse to http://localhost/peoplefinder/ and try it TODO: Move LDAP connection into a singleton class UNL_LDAP -Change renderers to work like Savant/Zend_View Change UNL_Peoplefinder_Record to use overloading with __get/__set for all attributes LICENSE diff --git a/lib/www/UNL_Peoplefinder/pear.unl.edu/advancedForm.php b/lib/www/UNL_Peoplefinder/pear.unl.edu/advancedForm.php index c599c875..e69de29b 100644 --- a/lib/www/UNL_Peoplefinder/pear.unl.edu/advancedForm.php +++ b/lib/www/UNL_Peoplefinder/pear.unl.edu/advancedForm.php @@ -1,19 +0,0 @@ -<form method="get" id="form1" action="<?php echo htmlentities(str_replace('index.php', '', $_SERVER['PHP_SELF']), ENT_QUOTES); ?>"> - <label for="sn">Last Name: </label> - <input type="text" name="sn" value="<?php echo htmlentities(@$_GET['sn'], ENT_QUOTES); ?>" id="sn" /> - <br /> - <label for="cn">First Name: </label> - <input type="text" name="cn" value="<?php echo htmlentities(@$_GET['cn'], ENT_QUOTES); ?>" id="cn" /> - <?php if (isset($_GET['chooser'])) { - echo '<input type="hidden" name="chooser" value="true" />'; - } ?> - <input type="hidden" name="adv" value="y" /> - <br /> - <label for="eppa">Affiliation: </label> - <select id="eppa" name="eppa"> - <option value="any" <?php if(@$_GET['eppa'] == 'any') echo "selected='selected'"; ?>>Any</option> - <option value="fs" <?php if(@$_GET['eppa'] == 'fs') echo "selected='selected'"; ?>>Faculty/Staff</option> - <option value="stu" <?php if(@$_GET['eppa'] == 'stu') echo "selected='selected'"; ?>>Student</option> - </select> - <input style="margin-bottom:-7px;" name="submitbutton" type="image" src="/ucomm/templatedependents/templatecss/images/go.gif" value="Submit" id="submitbutton" /> -</form> \ No newline at end of file diff --git a/lib/www/UNL_Peoplefinder/pear.unl.edu/config-sample.inc.php b/lib/www/UNL_Peoplefinder/pear.unl.edu/config-sample.inc.php index 860e8f7c..35ef5fef 100644 --- a/lib/www/UNL_Peoplefinder/pear.unl.edu/config-sample.inc.php +++ b/lib/www/UNL_Peoplefinder/pear.unl.edu/config-sample.inc.php @@ -1,7 +1,17 @@ <?php ini_set('display_errors', true); error_reporting(E_ALL|E_STRICT); -set_include_path(dirname(__FILE__).'/../src/'.PATH_SEPARATOR.get_include_path()); + +function autoload($class) +{ + $class = str_replace('_', '/', $class); + include $class . '.php'; +} + +spl_autoload_register("autoload"); + + +set_include_path(dirname(dirname(__FILE__)).'/src/'.PATH_SEPARATOR.dirname(dirname(__FILE__)).'/lib/php'); require_once 'UNL/Autoload.php'; define('DOCUMENT_ROOT', $_SERVER['DOCUMENT_ROOT']); @@ -9,10 +19,16 @@ define('DOCUMENT_ROOT', $_SERVER['DOCUMENT_ROOT']); UNL_Peoplefinder_Driver_LDAP::$bindDN = 'uid=giggidy,ou=service,dc=unl,dc=edu'; UNL_Peoplefinder_Driver_LDAP::$bindPW = 'flibbertygibberty'; -define('UNL_PEOPLEFINDER_URI', 'http://peoplefinder.unl.edu/'); +UNL_Peoplefinder::$url = 'http://peoplefinder.unl.edu/'; set_time_limit(5); // If you have LDAP access credentials, best to use this driver $driver = new UNL_Peoplefinder_Driver_LDAP(); // Otherwise, use the webservice driver -$driver = new UNL_Peoplefinder_Driver_WebService(); +$driver = new UNL_Peoplefinder_Driver_WebService(array('service_url'=>'http://ucommbieber.unl.edu/workspace/peoplefinder/www/service.php')); + +/* +//database connection info +UNL_Officefinder::$db_user = ''; +UNL_Officefinder::$db_pass = ''; +*/ \ No newline at end of file diff --git a/lib/www/UNL_Peoplefinder/pear.unl.edu/config.inc.php b/lib/www/UNL_Peoplefinder/pear.unl.edu/config.inc.php index 0d46c1a9..eccbac4c 100644 --- a/lib/www/UNL_Peoplefinder/pear.unl.edu/config.inc.php +++ b/lib/www/UNL_Peoplefinder/pear.unl.edu/config.inc.php @@ -1,7 +1,17 @@ <?php ini_set('display_errors', true); error_reporting(E_ALL); -set_include_path(dirname(__FILE__).'/../src/'.PATH_SEPARATOR.get_include_path()); + +function autoload($class) +{ + $class = str_replace('_', '/', $class); + include $class . '.php'; +} + +spl_autoload_register("autoload"); + + +set_include_path(dirname(dirname(__FILE__)).'/src/'.PATH_SEPARATOR.dirname(dirname(__FILE__)).'/lib/php'); require_once 'UNL/Autoload.php'; define('DOCUMENT_ROOT', $_SERVER['DOCUMENT_ROOT']); @@ -9,7 +19,11 @@ define('DOCUMENT_ROOT', $_SERVER['DOCUMENT_ROOT']); UNL_Peoplefinder_Driver_LDAP::$bindDN = 'uid=unlwebsearch,ou=service,dc=unl,dc=edu'; UNL_Peoplefinder_Driver_LDAP::$bindPW = 'gagfawki'; -define('UNL_PEOPLEFINDER_URI', 'http://ucommbieber.unl.edu/workspace/peoplefinder/www/'); -set_time_limit(5); +UNL_Peoplefinder::$url = 'http://ucommbieber.unl.edu/workspace/peoplefinder/www/'; + +UNL_Officefinder::$admins = array('bbieber2'); + +set_time_limit(0); + //$driver = new UNL_Peoplefinder_Driver_WebService(); -$driver = new UNL_Peoplefinder_Driver_LDAP(); \ No newline at end of file +$driver = new UNL_Peoplefinder_Driver_LDAP(); diff --git a/lib/www/UNL_Peoplefinder/pear.unl.edu/css/images/formFilterBG.png b/lib/www/UNL_Peoplefinder/pear.unl.edu/css/images/formFilterBG.png new file mode 100644 index 0000000000000000000000000000000000000000..eb67c28fdde6bd7ca29429bb5aac8fb1d01b90b2 GIT binary patch literal 144 zcmeAS@N?(olHy`uVBq!ia0vp^j6f{O!2~4hKV8-UaY|exN`mv#O3D+9QW+dm@{>{( zJaZG%Q-e|yQz{EjrrH1%8F{)mhE&{2s{8)RN?2IfSST$eDIp;xDJ6yB(*K$N{<mM? o;o))kR&OD##Gd^4C<7xKL*GokFTuuaCP3W`p00i_>zopr00mMjo&W#< literal 0 HcmV?d00001 diff --git a/lib/www/UNL_Peoplefinder/pear.unl.edu/css/images/formSearchBG.png b/lib/www/UNL_Peoplefinder/pear.unl.edu/css/images/formSearchBG.png new file mode 100644 index 0000000000000000000000000000000000000000..84526c9ec3d7174bf41c5c11669ae563393e0211 GIT binary patch literal 227 zcmeAS@N?(olHy`uVBq!ia0vp^Y(Q+u!2~2{HJwcdQk(@Ik;M!Q+`=Ht$S`Y;1W-^R z*(1o8fgyJW14D5i1H)rO28Q-*28N2A3=C&A7#NI!ie-(D?K}Acs5aBn#WAGf)|*L& zTn!Ea%*P+!d*5EuVK1PY!y<j~$gSJj+cp_Josh!$X2V(KeBSFjO;*UgW^rJ22zXWd zws*C_m&N@7Q|A;kGH;4{;uqjo;yJf_VO-gwdxjlG&AYyq7aZ+9w({n$c)kac4DLy~ VY*p<xB|u9VJYD@<);T3K0RZ;HO%(tD literal 0 HcmV?d00001 diff --git a/lib/www/UNL_Peoplefinder/pear.unl.edu/css/images/formSearchEnds.png b/lib/www/UNL_Peoplefinder/pear.unl.edu/css/images/formSearchEnds.png new file mode 100644 index 0000000000000000000000000000000000000000..fc6ae61b3331814e3b1aec5edf6ec3ba86dcb4ef GIT binary patch literal 696 zcmV;p0!RIcP)<h;3K|Lk000e1NJLTq000I60046c1^@s6yCZWt00009a7bBm000XU z000XU0RWnu7ytkOAY({UO#lFGm;eBCjsO7TF#rIEYXAUvxc~soC;$L66951mGseEj z_y7O`K1oDDRCwB~mA!5hK@fz$-JLt*vyHK(gTR6S2|<L2iAeo&yaX>mOaeRt5fTzY z1P1#K9Wu7@{dG0L-k#61JJ@S^!Yy@Gcg=KdcJ%qRvp9LNM(55RTlZg)P0xOKo@Y$X zzVUbT3E4SCw@>!#>l@GWjLzm`)_RZlbNC*c4hc3LV!&)Xz%~Y~Z$IU9I3#D~%*KZl z-MgjUDj*w^XPr6#Ah%{<*?RqxQh>Lla<!*QROt4o(tsMNlpat?DsSDc%8Lq;*G!Z= zJx8cGFG>t>Le<5^F>n#Q=C0#FAQG46Apehs6!+vv5LS&_Z~-F7qX9AGUKhu#6!(Zq zG8_?N2{2HTC92wu#N|tIi)^2RjG%@)7Z9A7%5j?JkX0r&+y`p4ILQa+Eg#$sHcHk~ zT<MUZtp?EDd_Y+JkmVhEyHDsp+$VGQMvb7!v7Zb+FdH8rn_K|D58h(a5qZ|7*MCWG z=LI$%5o|i5==Qm{x6k>>7fyb@V?H@9#n*S9aeDNT$=~mn=P1H9v&o=7V4fAo&acYd z6+n2xtJ+Fm?QXInq2X#<k<`%bQKbQSOG}ibO1o<f?@Er#i4%L#)x2H-zE~EI0M{~| zF9E(V(Q8!lWw6vVgw-{qa=`dX0tm@!4u>ky;?PWsJ3?Njb5v2~V3Q?kYS+s-8pI8^ z8F6BV^8aGB%MH~Gj$hkEEz`MSKm7WyBwr24>#xBL7DsKxm5z)y8<ll7psC%?)^qZ; eU7)xG{2Kth(2Zf>IV~ap0000<MNUMnLSTXgv^E?7 literal 0 HcmV?d00001 diff --git a/lib/www/UNL_Peoplefinder/pear.unl.edu/css/images/iconContactSprite.png b/lib/www/UNL_Peoplefinder/pear.unl.edu/css/images/iconContactSprite.png new file mode 100644 index 0000000000000000000000000000000000000000..c6118ce2723aafeb75651c982ec9ec5f161b9b8d GIT binary patch literal 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^$!PtYHSkaP2Am6= zNEu9C(fQl%i3#bYXU~t@AU%4#B|d2Gs)s;Qh-JNp3q6bBrIV`+k!4t@ha*>Zs_JLv zP-0U_sR_i0@U^K(jgk@9U6C5c+`<LciqwWh??JJv%(~=&ufgz2?K`Hbs3{|*EPpPn ze`p(Ojq#+EB2s#Ipy)AJQ~j!;N-9I7sFJc{!IKV>R?^<n*N>U6q?}0T5T<1ee7<@k z_=m1x?RR$4N{Z8~q{!-wy}^BKUepRQekk+YS=mqunP~~2Eot+0rX=8;HHA+8?WG5> z9JXbb561$v{}NorCLmF1-fU>7T9=Xj4G|vyW52pY?>#=){8c0T8@-vmV}E+>Ahe!; zS<TuMG0)6z&OTB;`F)>CM)<z(3|t-ThQ@j8)q}~3kjk=TmpF1|he}4Imb^K1^>nIM s#^uS?f-0$K^4}`C>Wbwe^`8I(0F<E5WZRppe*gdg07*qoM6N<$f+a*UB>(^b literal 0 HcmV?d00001 diff --git a/lib/www/UNL_Peoplefinder/pear.unl.edu/css/images/selectedBG.png b/lib/www/UNL_Peoplefinder/pear.unl.edu/css/images/selectedBG.png new file mode 100644 index 0000000000000000000000000000000000000000..abd62f37a85332d03e01e916875bceba290c5caf GIT binary patch literal 643 zcmeAS@N?(olHy`uVBq!ia0y~yV7vol+i<V}$ukqU4+AO564!{5;QX|b^2DN42FH~A zq*MjZ+{E<Mpwz^a%EFVWHVh0*s-7;6Ar-gY+`a1+5-4-*p{;3PQ@}-b!7q-UY>B1j zcT>$Tq?+7}3=4BxA}S`^ajV{tRjAQ;_uoGC^UV4dkL+enmgi23S)49y?Qg}9Am*Q4 zT`MPZ-LLXLLxS4st)BDQkBTv*mG3X}D_~T3?en(r0h7Z$uiQu=Z}ryCiMc8}7$%gi zE^`F(-+#1O9&?bjp>EyPbsTyOI?tw92Ya)MGyK{evRe<R?7H2?nkbMdHE*|pOo=kz zJKq7w&sbR&4y4xq?SHztiJKu(ciU<pRr&VUK2@M;YrcJ5U<#!7Sl|7!+6gG(xVV09 z5zyGS^2KE!XS@$AfAY%?sG?`}-7j4BK!z(=zDVy{9+w`&ldZ3R9|IYCdaEeNm}-#O z(IA1}TRVZyxaRhDIgmQ%_%`)7$QRE`-|hzS6LbHb=LVU&eQPX`S|jcr5A+mI{^oDK zKvmhFzU#99-SBnax6lH{goDeYfoc+KSG)zPnRDP}7*NbYKKnM%8ugN0qA?5-$Clqp z2P*mV@>>8<d;0J1oZE$C7*15y-2o|n@W1BeviW{?(||VrDAC@*a3Ov-Z$|btd$AaX z7t3pneuBa&efzh(dF()24}oo~TYmd&rMyrK!;JG)x$z*EyTA3F&khWkL(6Zc#oYe< jkMV#{+}GL<(;1i<D&1`_ncWCj#{dMLu6{1-oD!M<t_2Hz literal 0 HcmV?d00001 diff --git a/lib/www/UNL_Peoplefinder/pear.unl.edu/css/peoplefinder_default.css b/lib/www/UNL_Peoplefinder/pear.unl.edu/css/peoplefinder_default.css new file mode 100644 index 00000000..fe3eda0b --- /dev/null +++ b/lib/www/UNL_Peoplefinder/pear.unl.edu/css/peoplefinder_default.css @@ -0,0 +1,288 @@ +/* +*************************************************** + + Result List Listings + +*************************************************** +*/ +#maincontent #results {min-height: 300px;} +#maincontent ul.pfResult { + padding:0px; + list-style:none; + border-bottom: 1px solid #e6e6e6; + border-top: 1px solid #d0cece; + margin-top:20px; +} +#maincontent ul.pfResult li { + border-bottom: 1px solid #d0cece; + border-top: 1px solid #e6e6e6; + width:100%; + padding: 5px 0px; + display:block; +} +#maincontent ul.pfResult li div.overflow { + min-height:47px; + padding: 7px 5px; + cursor:pointer; +} +#maincontent ul.pfResult li.selected div.overflow {opacity:0.4;filter:alpha(opacity=40);} +#maincontent ul.pfResult li:hover, #maincontent ul.pfResult li.selected { + background:#ecf4f9; +} +#maincontent ul.pfResult li.selected .vcard {display:none;} +.eppa, .organization-unit, .tel, .type {display:none;} +#maincontent ul.pfResult .tel {display:block;} + +.planetred_profile, .recordDetails {float:left;} +.loading { + background:url('images/loading.gif') no-repeat top left; + height:40px; + width:40px; + float:left; + position:absolute; + right:250px; + display:none; +} +.recordDetails { + margin-left:20px; +} +.fn a, .fn { + font-size:18px; + font-weight:bold; + color:#464545 !important; + max-width:530px; + max-height:35px; + min-height:18px; + overflow:hidden; +} +.departments .fn, .departments .fn a {height:42px;max-height:42px;line-height:20px;} +.cInfo {float:right;} + +#maincontent .results {margin-top:15px;} +#maincontent .likeResults ul.pfResult {margin-top:0px;} + +#maincontent .result_head {color:#989898;font-size:10px;} +/* Headings */ + + +#maincontent .results h2, #maincontent .likeResults h3, #maincontent #orgChart h2 { + font-variant:small-caps; + font-weight:bold; +} +#maincontent .results h2, #maincontent #orgChart h2 {border-bottom:2px dotted #E6E6E6;padding-bottom:0;} + +#maincontent .likeResults h3 { + font-size:1em; +} +#maincontent #pfShowRecord .wdn_tabs, #maincontent #pfShowRecord .wdn_tabs_content {display:none;} + +/* +*************************************************** + + Individual Peoplefinder Records + +*************************************************** +*/ +.vcard { + background:#fff; + border:1px solid #ccd2d5; + border-radius:5px; + -moz-border-radius:5px; + -webkit-border-radius:5px; + padding:15px; + min-height:150px; + position:relative; + width:425px; + z-index:9; + margin:0 auto; +} +.vcard > a.email { + +} +.vcard .eppa, .vcard .epa, .vcard .organization-unit, .vcard .tel, .vcf, .title {display:block;} +.vcard a.planetred_profile { + float:left; + margin-right:15px; + min-width:114px; +} +.vcard .eppa, .vcard .epa {font-style:italic;font-size:0.8em;} +.vcardInfo {margin-left:129px;} +.vcard .adr, .departmentInfo .adr { + border-left:2px solid #b7b7b7; + padding-left:5px; + margin:5px 0; +} +.vcard .tel, .vcard span.email, .vcard span.url, .departmentInfo .tel, .departmentInfo span.email, .departmentInfo span.url { + background:url('images/iconContactSprite.png') no-repeat; + padding-left:25px; + height:20px; +} +.vcard span.email, .vcard span.url, .departmentInfo span.email, .departmentInfo span.url { + background-position:0 -21px; + display:block; + margin-top:5px; + margin-bottom:3px; +} +.vcard span.url, .departmentInfo span.url { + background-position:0 -42px; +} +a.email {background:none;} +a.text-vcard{padding-left:24px;padding-right:0;background-position:left -2px;margin:121px 0 0 -122px;float:left;} +a.img-qrcode{padding-left:24px;padding-right:0;background: url(images/qrcode.png) no-repeat 0 0;margin:141px 0 0 -122px;float:left;} + +/* +*************************************************** + + Search form + +*************************************************** +*/ +.directorySearch { + width:940px; + background:url('images/formSearchBG.png') repeat-x top; + margin:15px 0 10px 0; +} +.directorySearch legend {display:none;} +#maincontent form.directorySearch ol{ + list-style:none; + display:block; + margin:0px; + background:url('images/formSearchEnds.png') no-repeat 0 -58px; + position:relative; +} +.directorySearch ol li:first-child{ + background:url('images/formSearchEnds.png') no-repeat top right; + height:46px; + padding:0px; + margin-left:-13px; + margin-bottom:11px; +} +.directorySearch > fieldset > ol > li > label { + position:absolute; + top:-11px; + left:23px; + font-size:1.5em; + color:#5c5c5c; + cursor:text; + background:#fff; + padding:5px; +} +.directorySearch > fieldset > ol > li > label.sn{ + left:253px; +} +.directorySearch ol li:first-child input[type=text] { + width:440px; + height:31px; + border:1px solid #8a7c47; + font-size:1.5em; + color:#5c5c5c; + padding:5px 0 0 8px; + margin-top:10px; +} +.directorySearch ol li:first-child input.n[type=text] { + width:210px; + margin-right:10px; +} +.directorySearch ol li:first-child input.s[type=text]{ + margin-right:0; +} + +.directorySearch ol li:first-child input[type=image] { + margin-bottom:-7px; + padding-left:5px; +} +#maincontent #advancedSearch { + background:#8a7c47; + color:#fff; + font-weight:bold; + font-size:0.8em; + padding:5px; + border-radius:3px; + -moz-border-radius:3px; + -webkit-border-radius:3px; + line-height:auto; + text-shadow:1px 1px 3px #888888; + border:1px solid #d7c47f; +} +#maincontent #advancedSearch:focus, #maincontent #advancedSearch:hover{color:#fff !important;border-color:#c0af70;} +#maincontent #advancedSearch:active{text-shadow:none;} +#maincontent #searchNotice { + display:none; + border-top:1px solid; + border-bottom:1px solid; + border-color:#d7d88d; + background:#FEFFCE; + padding:5px 15px; + color:#5d2401; + font-size:0.9em; +} +#maincontent #searchNotice span { + font-weight:bold; + padding:2px; + color:#000; + background:#e6e4b1; +} +#directoryHelp{ + background:url('/wdn/templates_3.0/css/content/images/notice/information.png') no-repeat 0 0; + position:absolute; + right:0; + width:80px; + height:65px; + top:0; + text-indent:-99999px; + +} +/* +*************************************************** + + Intro Page + +*************************************************** +*/ +#maincontent .intro, #maincontent .intro{ + background-image:-webkit-gradient( + linear, + left bottom, + left top, + color-stop(0.10, rgba(255,255,255, .3)), + color-stop(1, rgba(237,237,237, .8)) +); +background-image:-moz-linear-gradient( + center bottom, + rgba(255,255,255, .3) 10%, + rgba(237,237,237, .8) 100% +); +padding:10px; + -moz-border-radius:5px; + -webkit-border-radius:5px; + border-radius:5px; +} +#maincontent .right .intro {opacity:0.3;filter:alpha(opacity=30);zoom:1;} +.intro img.profile_pic{float:left;} +h6.recordDetails {margin-top:15px;} +h6.recordDetails span { + font-size:3.6em; + font-weith:bold; + display:block; + margin-top:-6px; +} +.intro_support { + height:150px; + padding:25px 200px 0 0; +} +#maincontent .left .intro_support { + background:url('images/samplePeople.png') no-repeat bottom right; + padding-top:10px; +} +#maincontent h5.coming { + font-size:2.5em; + background:url('images/comingSoon.png') 0 0 no-repeat; + display:block; + text-indent:-999999px; + position:absolute; + top:100px; + right:108px; + width:243px; + height:124px; + opacity:0.8; +} \ No newline at end of file diff --git a/lib/www/UNL_Peoplefinder/pear.unl.edu/css/small_devices.css b/lib/www/UNL_Peoplefinder/pear.unl.edu/css/small_devices.css new file mode 100644 index 00000000..dc1cf82a --- /dev/null +++ b/lib/www/UNL_Peoplefinder/pear.unl.edu/css/small_devices.css @@ -0,0 +1,215 @@ +@CHARSET "UTF-8"; +/* +*************************************************** + + Search form + +*************************************************** +*/ +.directorySearch { + width:100%; + margin:0px 0 10px 0; + background:#d7c47f; + background-image:-webkit-gradient( + linear, + left top, + left bottom, + color-stop(0.53, rgb(235,222,170)), + color-stop(0.88, rgb(215,196,127)) + ); + -webkit-border-radius:3px; + +} +.directorySearch legend {display:none;} +#maincontent form.directorySearch ol{ + list-style:none; + display:block; + margin:0px; + position:relative; +} +.directorySearch ol li:first-child{ + height:46px; + padding:0px; + margin-left:-13px; + margin-bottom:0px; +} +.directorySearch label { + display:block; + padding-top:5px; + color:#69581a; + font-weight:bold; + font-size:1.0em; +} +.advanced label { + display:inline-block; +} +.directorySearch input[type=text]{ + width:80%; + border:1px solid #d7c47f; +} +.directorySearch ol li:first-child input.n[type=text] { + width:53%; + margin-right:10px; +} +.directorySearch ol li:first-child input.s[type=text]{ + margin-right:0; +} +.directorySearch input[type=image]{ + width:20px; +} +#maincontent #advancedSearch { + background:#d7c47f; + color:#fff; + font-weight:bold; + font-size:0.8em; + padding:5px; + border-radius:3px; + -moz-border-radius:3px; + -webkit-border-radius:3px; + line-height:auto; + text-shadow:1px 1px 3px #888888; + border:1px solid #d7c47f; +} +#maincontent #advancedSearch:focus, #maincontent #advancedSearch:hover{color:#fff !important;border-color:#c0af70;} +#maincontent #advancedSearch:active{text-shadow:none;} +/* +*************************************************** + + Intro Page + +*************************************************** +*/ +#filters{display:none;} +#maincontent .two_col {width:46%;} +#maincontent .three_col{width:72%;} +#maincontent h6.recordDetails { + font-size:1.6em; + margin-left:0 !important; +} + +/* +*************************************************** + + Results List + +*************************************************** +*/ +#results{width:320px;} +/* +*************************************************** + + Result List Listings + +*************************************************** +*/ +#maincontent #results {min-height: 300px;} +#maincontent ul.pfResult { + padding:0px; + list-style:none; + border-bottom: 1px solid #e6e6e6; + border-top: 1px solid #d0cece; + margin-top:20px; +} +#maincontent ul.pfResult li { + border-bottom: 1px solid #d0cece; + border-top: 1px solid #e6e6e6; + width:100%; + padding: 5px 0px; + display:block; +} +#maincontent ul.pfResult li div.overflow { + min-height:45px; + padding: 7px 5px; + cursor:pointer; +} +#maincontent ul.pfResult li.selected div.overflow {opacity:0.4;filter:alpha(opacity=40);} +#maincontent ul.pfResult li:hover, #maincontent ul.pfResult li.selected { + background:#ecf4f9; +} +#maincontent ul.pfResult li.selected .vcard {display:none;} +.eppa, .organization-unit, .tel, .type {display:none;} +#maincontent ul.pfResult .tel {display:block;} +a.cInfo { + display:none; +} + +.planetred_profile, .recordDetails {float:left;} +.recordDetails { + margin-left:20px; +} +.fn a, .fn { + font-size:18px; + font-weight:bold; + color:#464545 !important; + max-width:530px; + max-height:35px; + min-height:20px; + overflow:hidden; +} +.departments .fn, .departments .fn a {height:42px;max-height:42px;line-height:20px;} +.cInfo {float:right;} + +#maincontent .results {margin-top:15px;} +#maincontent .likeResults ul.pfResult {margin-top:0px;} + +#maincontent .result_head {color:#989898;font-size:10px;} +/* Headings */ + + +#maincontent .results h2, #maincontent .likeResults h3, #maincontent #orgChart h2 { + font-variant:small-caps; + font-weight:bold; +} +#maincontent .results h2, #maincontent #orgChart h2 {border-bottom:2px dotted #E6E6E6;padding-bottom:0;} + +#maincontent .likeResults h3 { + font-size:1em; +} +#maincontent #pfShowRecord .wdn_tabs, #maincontent #pfShowRecord .wdn_tabs_content {display:none;} +/* +*************************************************** + + Individual Peoplefinder Records + +*************************************************** +*/ +.vcard { + padding:15px; + min-height:130px; + position:relative; + z-index:9; + margin:0 auto; +} +.vcard > a.email { + +} +.vcard .eppa, .vcard .epa, .vcard .organization-unit, .vcard .tel, .vcf, .title {display:block;} +.vcard a.planetred_profile { + margin-right:15px; + min-width:114px; + display:block; + float:none; +} +.vcard .eppa, .vcard .epa {font-style:italic;font-size:0.8em;} +.vcard .adr, .departmentInfo .adr { + border-left:2px solid #b7b7b7; + padding-left:5px; + margin:5px 0; +} +.vcard .tel, .vcard span.email, .vcard span.url, .departmentInfo .tel, .departmentInfo span.email, .departmentInfo span.url { + background:url('images/iconContactSprite.png') no-repeat; + padding-left:25px; + height:20px; +} +.vcard span.email, .vcard span.url, .departmentInfo span.email, .departmentInfo span.url { + background-position:0 -21px; + display:block; + margin-top:5px; + margin-bottom:3px; +} +.vcard span.url, .departmentInfo span.url { + background-position:0 -42px; +} +a.email {background:none;} +a.text-vcard{padding-left:24px;padding-right:0;background-position:left -2px;margin:0;display:block;} +a.img-qrcode{padding-left:24px;padding-right:0;background: url(images/qrcode.png) no-repeat 0 0;margin:141px 0 0 -122px;float:left;} diff --git a/lib/www/UNL_Peoplefinder/pear.unl.edu/departments/index.php b/lib/www/UNL_Peoplefinder/pear.unl.edu/departments/index.php index 9370b293..00139b20 100644 --- a/lib/www/UNL_Peoplefinder/pear.unl.edu/departments/index.php +++ b/lib/www/UNL_Peoplefinder/pear.unl.edu/departments/index.php @@ -1,89 +1,44 @@ <?php -require_once '../config.inc.php'; +require_once dirname(__FILE__).'/../config.inc.php'; -UNL_Templates::$options['version'] = 3; -$page = UNL_Templates::factory('Document'); -$page->doctitle = '<title>UNL | Officefinder</title>'; -$page->titlegraphic = '<h1>Officefinder</h1>'; -$page->addStylesheet('../peoplefinder_default.css'); -$page->head .= <<<META -<meta name="description" content="UNL Officefinder is the searchable department directory for the University. Information obtained from this directory may not be used to provide addresses for mailings to students, faculty or staff. Any solicitation of business, information, contributions or other response from individuals listed in this publication by mail, telephone or other means is forbidden." /> -<meta name="keywords" content="university of nebraska-lincoln student faculty staff directory vcard" /> -<meta name="author" content="Brett Bieber, UNL Office of University Communications" /> -<meta name="viewport" content="width = 320" /> -<link media="only screen and (max-device-width: 480px)" href="../small_devices.css" type="text/css" rel="stylesheet" /> -META; - -if(isset($_GET['q'])) { - $page->head .= '<meta name="robots" content="NOINDEX, NOFOLLOW" />'; +if (isset($_COOKIE['unl_sso'])) { + // The user was logged in before, might as well get the CAS auth info. + UNL_Officefinder::getUser(true); } -$q = ''; -if (!empty($_GET['q'])) { - $q = $_GET['q']; - $departments = new UNL_Peoplefinder_Department_Search($q); -} -if (!empty($_GET['d'])) { - $q = $_GET['d']; - $department = new UNL_Peoplefinder_Department($q); - $q = htmlentities($q, ENT_QUOTES); -} -$page->maincontentarea = <<<FORM -<p>Search for UNL departments:</p> -<form method="get" action="?"> - <div> - <label for="q">Search: </label> - <input style="width:18em;" type="text" value="$q" id="q" name="q" /> - <input style="margin-bottom:-7px;" name="submitbutton" type="image" src="/ucomm/templatedependents/templatecss/images/go.gif" value="Submit" id="submitbutton" /> - </div> -</form> +$options = $_GET; +$options['driver'] = $driver; +$peoplefinder = new UNL_Officefinder($options); -FORM; -if (isset($department)) { - if (count($department)) { - $renderer_options = array('uri'=>UNL_PEOPLEFINDER_URI); - $renderer = new UNL_Peoplefinder_Renderer_HTML($renderer_options); - $page->maincontentarea .= count($department).' results.'; - $page->maincontentarea .= '<h2>'.htmlentities($department->name).'</h2>'; - if (isset($department->building)) { - $bldgs = new UNL_Common_Building(); - if ($bldgs->buildingExists($department->building)) { - $sd = new UNL_Geography_SpatialData_Campus(); - $department->building = '<a href="'.$sd->getMapUrl($department->building).'">'.htmlentities($bldgs->codes[$department->building]).'</a>'; - } - } - $page->maincontentarea .= "<p>{$department->room} <span class='location'>{$department->building}</span><br />{$department->city}, {$department->state} {$department->postal_code}</p>"; - if ($department->hasChildren()) { - $page->maincontentarea .= 'Sub-departments:<ul>'; - foreach ($department->getChildren() as $child) { - $page->maincontentarea .= '<li><a href="'.UNL_PEOPLEFINDER_URI.'departments/?d='.urlencode($child).'">'.htmlentities($child).'</a></li>'; - } - $page->maincontentarea .= '</ul>'; - } - $page->maincontentarea .= '<ul class="department">'; - ob_start(); - foreach ($department as $employee) { - echo '<li class="ppl_Sresult">'; - $renderer->renderListRecord($employee); - echo '</li>'; - } - $page->maincontentarea .= ob_get_clean().'</ul>'; - } else { - $page->maincontentarea .= 'No results could be found.'; - } -} -if (isset($departments)) { - if (count($departments)) { - $page->maincontentarea .= '<h2>Search results for '.$q.'</h2><ul class="departments">'; - foreach($departments as $department) { - $page->maincontentarea .= '<li class="ppl_Sresult"><a href="'.UNL_PEOPLEFINDER_URI.'departments/?d='.urlencode($department->name).'">'.$department->name.'</a></li>'; - } - $page->maincontentarea .= '</ul>'; - } else { - $page->maincontentarea .= 'No results could be found.'; - } +Savvy_ClassToTemplateMapper::$classname_replacement = 'UNL_'; +$savvy = new Savvy(); +$savvy->setTemplatePath(dirname(dirname(__FILE__)).'/templates/html'); + +switch($peoplefinder->options['format']) { + case 'json': + case 'php': + case 'vcard': + case 'xml': + $savvy->addTemplatePath(dirname(dirname(__FILE__)).'/templates/'.$peoplefinder->options['format']); + break; + case 'editing': + $savvy->setEscape('htmlentities'); + $savvy->addTemplatePath(dirname(dirname(__FILE__)).'/templates/'.$peoplefinder->options['format']); + break; + case 'hcard': + case 'partial': + Savvy_ClassToTemplateMapper::$output_template['UNL_Officefinder'] = 'Peoplefinder-partial'; + // intentional no break + default: + $savvy->setEscape('htmlentities'); + break; + case array('editing', 'partial'): + case array('partial', 'editing'): + $savvy->setEscape('htmlentities'); + $savvy->addTemplatePath(dirname(dirname(__FILE__)).'/templates/editing'); + Savvy_ClassToTemplateMapper::$output_template['UNL_Officefinder'] = 'Peoplefinder-partial'; + break; } -echo $page; -?> \ No newline at end of file +echo $savvy->render($peoplefinder); \ No newline at end of file diff --git a/lib/www/UNL_Peoplefinder/pear.unl.edu/images/formSearch.png b/lib/www/UNL_Peoplefinder/pear.unl.edu/images/formSearch.png new file mode 100644 index 0000000000000000000000000000000000000000..45916676cd4bde1085f19a13f33291d14975622d GIT binary patch literal 1734 zcmV;%208hOP)<h;3K|Lk000e1NJLTq0015U0018d1^@s6@N9ht0000PbVXQnQ*UN; zcVTj606}DLVr3vnZDD6+Qe|Oed2z{QJOBU&Xh}ptRCwC7R!dA&XB0m7&YkyznW1H% z;6OoTK%r>SN;MdQCUt3I<FamOo4Dx4G;!CY?z(W{+NLC}Nz;`y#hQjjsck9(^#w?f zw+u5phI!w4-+t$M#}K0qM!d<#{Rf8s`_DPw`OYs;iAS&3)2UOZXk}%^h9`0L>Q#ld z;SpZ+OOwe&hYlTjzq7ORvvfM$v3KuYM|pX<d1hutURYQNOOiCy+uQr&($dltZP!y< zTkE)R;lejJZrq6Z{eI;|&;0zna_!o+NKa4CcXf4j?l+Fu=kx72ckW#8kt0XCcJ10l z;c%EhLeXfHGMO|PjV5wBodhy9E3>n+G%z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@F?X2R3P0Sz)0G#mj}eZ<6S68%uz#`%douQ<m6;EQtshlP+woKPNBx#yVW)O zH;>DkH*aPyU%osIyL8^ZeOtM5<%-hO)Fhrfd6Gc-VI&gqB8Yyh^QGo7udP50(28qL zH)`JA+S=;HKrmwbi6AUM3o;^|9UL4S#W0y^Z*Tt;R(k;H6?km6wYAaV!-whCty^^G z&Yd6NdSBuY=~7o8R=EYJ1iU~s-~sH|*o4%ju$F-+YZ59iATi&<*K63zS@rCGJSw}p zy9t@#%zQsLH}}Q!<MMfjQ8bTDYL>?Y8^9{k7SPnX2CM^oFPaAFIM8XcSuJ{4tq}tS zz5wM%c-*q+_90X6;ZT2|dvY%$E<U+Uk%cv)RUioPy!C7ERgA(#yaSkWA46DXQ54jh z3X}6ip|P=%TXBCV6oO=||6vd%sD!5$qvr!8v_mi=09&IB<H(}U1t0_st(r{6gKoFW z#4g5t&r^#>EssoS!;5+k;i9m>7X{rGuSkk^t0+RXM4s79%!5Cbk^|{<CWvScI2?8p zw=o|88BwE0n)4uii0|{IFr#~utFT6_6ib86gR-0oqV^x5=0+Zsxm-@2<w$WD#DAl` z=2$=5L0rrTlcz9j0`P-XMB4&|o0$~fNr3oQL_ex&C9++_o5^L6FM~LbcNWBcd}kQM z{~`k{PVSDFK->R_n~bO)DA)XgML7-3bE@A4@n&+5cKH)E;-L1<zb)b-xj}=Vjmc-T c`hNii0K~a$3YI~`0ssI207*qoM6N<$f@2s(&j0`b literal 0 HcmV?d00001 diff --git a/lib/www/UNL_Peoplefinder/pear.unl.edu/images/organization.png b/lib/www/UNL_Peoplefinder/pear.unl.edu/images/organization.png new file mode 100644 index 0000000000000000000000000000000000000000..31d0f695ec8d31416de1cf97133ca3d478f89b1b GIT binary patch literal 4712 zcmV-u5|{0XP)<h;3K|Lk000e1NJLTq003kF003kN0ssI2|9}Dm0000PbVXQnQ*UN; zcVTj606}DLVr3vnZDD6+Qe|Oed2z{QJOBU^3Q0skRCwC#UF&aD#})VPVtZ|Dz+k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^brR zhFS+g*?~cTMo=n7O2^%9%8WokCu<$J0$iAhj5kdaWr36?Y8~{4H?U5GcHATxa;v}p z)QJ<t#l`$jKG4EGFviA)hSn=rXze?Fcez~CTv;yCl8St!B^ANw21(1Cc1@+MqM{;T zA^(gToDLKL$OXTHRQO#7zuzC8>Tjr+`HpObpyo|?jb}Z)dGjM%w(xPcy}kY9@#9z( zuUfV0vF+PyxcU=Z!O4>+v6ckV?S17H;m5|lYHE7_;K7XW9W`&dYdj0KgP_ajaOahl zQfmT`2|pbUgF??#4B;-c9Pz9usXOMC1vk|6e3k&%A+pK(E#wCo<XNfy4-3<ejqyBF zCYr7-6@wStilgc2a&&d8t*!md-n{~Y|Mkl+n|uEL_16VUd1v3g7UhG`nQAJ_iV<I< zzqmkubRiNBPgY-(A4udyiCTv#J+d=REQ@BK5}9}s#S5KIx7$tAflv^_-$-fcWVLc( z;n?VCq8^!G*70M<ijC2FL|tM!4U~1hvGKg*@v<(`WCzNAWXYV?m_GTeY`1vUHjm@E z=ULfq1^M}jUuPl@2n$t2v<W}Ll{5<Hk)Jl8J?T((vPqc>H*`9kkMG!#Z8gzy<I;Ka zXbmc6=<|C2vVXrJs}qk4_3O0#?a(2IaqBlxdqH~Ap+F4LVcoiQ)usmt(`t)Nzb#># q{r?R!Lmg(@tg>d6m6P^=0R{jTvV5Xz^qPMF0000<MNUMnLSTZAD;?he literal 0 HcmV?d00001 diff --git a/lib/www/UNL_Peoplefinder/pear.unl.edu/index.php b/lib/www/UNL_Peoplefinder/pear.unl.edu/index.php index b4ab8b69..024540c5 100644 --- a/lib/www/UNL_Peoplefinder/pear.unl.edu/index.php +++ b/lib/www/UNL_Peoplefinder/pear.unl.edu/index.php @@ -1,141 +1,38 @@ <?php require_once 'config.inc.php'; -session_start(); -session_cache_expire(5); +$options = $_GET; +$options['driver'] = $driver; +$peoplefinder = new UNL_Peoplefinder($options); -$renderer_options = array('uri'=>UNL_PEOPLEFINDER_URI); -$peepObj = new UNL_Peoplefinder($driver); -$renderer = new UNL_Peoplefinder_Renderer_HTML($renderer_options); +Savvy_ClassToTemplateMapper::$classname_replacement = 'UNL_'; +$savvy = new Savvy(); +$savvy->setTemplatePath(dirname(__FILE__).'/templates/html'); -$myself = htmlentities(str_replace('index.php', '', $_SERVER['PHP_SELF']), ENT_QUOTES); -UNL_Templates::$options['version'] = 3; -$page = UNL_Templates::factory('Document'); -$page->doctitle = '<title>UNL | Peoplefinder</title>'; - -$page->head .= ' -<meta name="description" content="UNL Peoplefinder is the Faculty, Staff and Student online directory for the University. Information obtained from this directory may not be used to provide addresses for mailings to students, faculty or staff. Any solicitation of business, information, contributions or other response from individuals listed in this publication by mail, telephone or other means is forbidden." /> -<meta name="keywords" content="university of nebraska-lincoln student faculty staff directory vcard" /> -<meta name="author" content="Brett Bieber, UNL Office of University Communications" /> -<meta name="viewport" content="width = 320" /> -<link rel="stylesheet" type="text/css" media="screen" href="peoplefinder_default.css" /> -<link media="only screen and (max-device-width: 480px)" href="small_devices.css" type="text/css" rel="stylesheet" /> -<script type="text/javascript" src="'.UNL_PEOPLEFINDER_URI.'peoplefinder.js"></script> -'; - -if (isset($_GET['q']) - || isset($_GET['uid']) - || isset($_GET['cn']) - || isset($_GET['sn'])) { - $page->head .= '<meta name="robots" content="NOINDEX, NOFOLLOW" />'; -} - -$page->breadcrumbs = ' -<ul> - <li><a href="http://www.unl.edu/" title="University of Nebraska�Lincoln">UNL</a></li> - <li>Peoplefinder</li> -</ul>'; - -$page->titlegraphic = '<h1>UNL Peoplefinder</h1>'; - -ob_start(); - -if (isset($_GET['uid'])) { - try { - $renderer->renderRecord($peepObj->getUID($_GET['uid'])); - } catch (Exception $e) { - header('HTTP/1.0 404 Not Found'); - echo '<p><br />Sorry, no one with that name could be found!</p>'; - } -} else { - // Display form - (@$_GET['adv'] == 'y')?$renderer->displayAdvancedForm():$renderer->displayStandardForm(); - if (isset($_GET['p'])) { - // Display the next page - if ($_SESSION['lastResultCount'] > 0) { - // Old results have been set. - $renderer->renderSearchResults($_SESSION['lastResult'], $_GET['p']*$_SESSION['lastResultDisplayed']); - } else { - echo 'Your session has expired, please search again.'; +switch($peoplefinder->options['format']) { + case 'vcard': + header('Content-Type: text/x-vcard'); + if ($peoplefinder->output[0] instanceof UNL_Peoplefinder_Record) { + header('Content-Disposition: attachment; filename="'.$peoplefinder->output[0]->sn.', '.$peoplefinder->output[0]->givenName.'.vcf"'); } - } else { - if (isset($_GET['q']) && !empty($_GET['q'])) { - // Basic query, build filter and display results - if (strlen($_GET['q']) > 3) { - if (is_numeric(str_replace(array('-', '(', ')'), - array('', '', ''), - $_GET['q']))) { - $records = $peepObj->getPhoneMatches($_GET['q']); - $renderer->renderSearchResults($records); - } else { - $records = $peepObj->getExactMatches($_GET['q']); - if (count($records)) { - echo '<div class="cMatch">Exact matches:'; - if (count($records) >= UNL_Peoplefinder::$resultLimit) { - echo "<p>Your search could only return a subset of the results. "; - if (@$_GET['adv'] != 'y') echo "Would you like to <a href='".$renderer->uri."?adv=y' title='Click here to perform a detailed Peoplefinder search'>try a Detailed Search?</a>\n"; - else echo 'Try refining your search.'; - echo '</p>'; - } - echo '</div>'; - $renderer->renderSearchResults($records); - } else { - echo '<p>Sorry, I couldn\'t find anyone matching '.htmlentities($_GET['q']).'.</p>'; - } - if (count($records) < UNL_Peoplefinder::$displayResultLimit) { - // More room to display LIKE results - UNL_Peoplefinder::$displayResultLimit = UNL_Peoplefinder::$displayResultLimit - count($records); - $records = $peepObj->getLikeMatches($_GET['q'], $records); - if (count($records) > 0) { - echo '<div class="cMatch">Possible matches:'; - if (count($records) >= UNL_Peoplefinder::$resultLimit) { - echo "<p>Your search could only return a subset of the results. "; - if (@$_GET['adv'] != 'y') echo "Would you like to <a href='".$renderer->uri."?adv=y' title='Click here to perform a detailed Peoplefinder search'>try a Detailed Search?</a>\n"; - else echo 'Try refining your search.'; - echo '</p>'; - } - echo '</div>'; - $renderer->renderSearchResults($records); - } - } - } - } else { - echo "<p>Please enter more information or <a href='".$_SERVER['PHP_SELF']."?adv=y' title='Click here to perform a detailed Peoplefinder search'>try a Detailed Search.</a></p>"; - } - } elseif (isset($_GET['sn']) || isset($_GET['cn'])) { - // Advanced search - $records = $peepObj->getAdvancedSearchMatches($_GET['sn'],$_GET['cn'],$_GET['eppa']); - $renderer->renderSearchResults($records); - } - if (isset($records)) { - // Prepare for sleep - $_SESSION['lastResult'] = $records; - $_SESSION['lastResultCount'] = count($records); - $_SESSION['lastResultDisplayed'] = UNL_Peoplefinder::$displayResultLimit; - } - } -} - -//show instructions if no results are showing -if (!isset($_GET['uid']) && !isset($records)) { - echo '<div class="two_col left" id="results">'; - $renderer->displayInstructions((@$_GET['adv'] == 'y')?true:false); - echo '</div> - <div class="two_col right" id="pfShowRecord"></div>'; -} - -if (!isset($_GET['uid'])) { ?> - <div class="clear"> - <a href="<?php echo $myself; ?>" title="Click here to run a basic Peoplefinder search">Basic</a> | <a href="<?php echo $myself; ?>?adv=y" title="Click here to perform a detailed Peoplefinder search">Detailed</a> - </div> -<?php + //intentional no break + case 'json': + case 'php': + case 'xml': + $savvy->addTemplatePath(dirname(__FILE__).'/templates/'.$peoplefinder->options['format']); + break; + case 'partial': + case 'hcard': + Savvy_ClassToTemplateMapper::$output_template['UNL_Peoplefinder'] = 'Peoplefinder-partial'; + // intentional no break + case 'html': + default: + $savvy->setEscape('htmlentities'); } -$page->maincontentarea = ob_get_clean(); +$savvy->setEscape('htmlentities'); -$page->footercontent = 'UNL | Office of University Communications | <a href="http://www1.unl.edu/wdn/wiki/About_Peoplefinder" onclick="window.open(this.href); return false;">About Peoplefinder</a><br /><br />'; -$page->footercontent .= 'Information obtained from this directory may not be used to provide addresses for mailings to students, faculty or staff.<br />Any solicitation of business, information, contributions or other response from individuals listed in this publication by mail, telephone or other means is forbidden.<br />'; +echo $savvy->render($peoplefinder); -echo $page; diff --git a/lib/www/UNL_Peoplefinder/pear.unl.edu/scripts/peoplefinder.js b/lib/www/UNL_Peoplefinder/pear.unl.edu/scripts/peoplefinder.js new file mode 100644 index 00000000..c5ae8e8b --- /dev/null +++ b/lib/www/UNL_Peoplefinder/pear.unl.edu/scripts/peoplefinder.js @@ -0,0 +1,259 @@ +var service_peoplefinder = function() { + return { + updatePeopleFinderResults : function(){ //function called when the list has been rendered + if (WDN.jQuery("#results:contains('Sorry, no results could be found.')").length > 0 && attempts < 3) { + if (splitName == false && originalSearch.indexOf(' ') > 0) { //user did a simple search with a space, so try an advanced search + WDN.jQuery("#results").empty(); + splitQuery = originalSearch.split(' ',2); + service_peoplefinder.anotherAttempt(splitQuery[0] ,splitQuery[1].substring(0,1)); + } + if (splitName == true) { //user did an adavanced search, let's try first letter first name, whole last name + if (attempts == 2) { //on our second attempt + splitQuery = originalSearch.split(' ',2); + service_peoplefinder.anotherAttempt(splitQuery[0].substring(0,1) ,splitQuery[1]); + } else { //user did first search from advanced search + splitQuery = originalSearch.split(' ',2); + service_peoplefinder.anotherAttempt(splitQuery[0] ,splitQuery[1].substring(0,1)); + } + } + + return false; + } else if (attempts > 1){ + //we finally have results, or else we've abandonded the search options + directory.showSearchNotice(); + } + WDN.loadJS('scripts/filters.js', function(){ + filters.initialize(); + }); + WDN.jQuery('ul.pfResult li').each(function(){ + //onClick = WDN.jQuery(this).find('.cInfo').attr('onclick'); + WDN.jQuery(this).find('.cInfo, .fn a').removeAttr('onclick'); + }); + WDN.jQuery('ul.pfResult:not(.departments) li .overflow').click(function(){ + service_peoplefinder.showIndividualPeopleFinderRecord(WDN.jQuery(this)); + return false; + } + ); + WDN.jQuery('ul.pfResult.departments li .overflow').click(function(){ + window.location = WDN.jQuery(this + '.fn a').attr('href'); + } + ); + }, + + anotherAttempt : function(firstName, lastName) { + window.location.hash = '#q/' + firstName + '/' +lastName; + directory.buildSearchNotice(originalSearch, firstName, lastName); + attempts++; + }, + + updatePeopleFinderRecord : function(data, textStatus){ //function called when a record has been rendered + if (textStatus == 'success') { + WDN.jQuery('li.current').append(data); + WDN.jQuery('li.current .vcard a.planetred_profile').fadeIn(400); + WDN.jQuery('li.current .vcard').slideDown(); + WDN.jQuery('li.selected .loading').hide(); + } else { + + } + }, + + presentPeopleFinderResults : function(){ + WDN.jQuery('#filters').css({'opacity' : '0.4'}); + WDN.jQuery('#q').siblings('label').hide(); + WDN.jQuery('#maincontent div.two_col').remove(); + if (!splitName) { + WDN.toolbar_peoplefinder.queuePFRequest(query, 'results'); + } else { + WDN.toolbar_peoplefinder.queuePFRequest('', 'results', '', cn, sn); + query = cn +" "+ sn; + } + document.title = 'UNL | Directory | Search for ' + query; + WDN.jQuery("#breadcrumbs ul li:last").remove(); + WDN.jQuery('#breadcrumbs ul').append('<li>Search for '+WDN.jQuery('<div/>').text(query).html()+'</li>'); + }, + + showIndividualPeopleFinderRecord : function(liRecord) { + if (liRecord.parent().hasClass('selected')) { + liRecord.siblings('.vcard').children('a.planetred_profile').fadeOut(400); + liRecord.siblings('.vcard').slideUp(function(){ + WDN.jQuery(this).remove(); + + }); + liRecord.parent().removeClass('selected'); + } else { + liRecord.children('.loading').show(); + WDN.jQuery('li.current').removeClass('current'); + liRecord.parent('li').addClass('selected current'); + var href = liRecord.find('a.cInfo').attr('href'); + href = href.split('?uid='); + var url = WDN.toolbar_peoplefinder.serviceURL + 'service.php?view=hcard&uid=' + href[1]; + WDN.get(url, null, service_peoplefinder.updatePeopleFinderRecord); + } + return false; + } + }; +}(); + +var directory = function() { + return { + initializeSearchBoxes : function() { + WDN.jQuery('#peoplefinder').submit(function(eventObject) { //on submit of the search form + WDN.jQuery("#searchNotice").slideUp(); + if (WDN.jQuery('#'+this.id+' input.q').val().length || WDN.jQuery('#'+this.id+' input.q:gt(0)').val().length) { + if((WDN.jQuery('#cn').length > 0) || (WDN.jQuery('#sn').length > 0)){ + window.location.hash = '#q/' + WDN.jQuery('#cn').val() + '/' + WDN.jQuery('#sn').val(); + originalSearch = WDN.jQuery('#cn').val() + ' ' + WDN.jQuery('#sn').val(); + WDN.jQuery('#cn').focus().select(); + } else { + window.location.hash = '#q/' + WDN.jQuery('#'+this.id+' input.q').val(); //triggering a hash change will run through the searching function + WDN.jQuery('#q').focus().select(); + originalSearch = WDN.jQuery('#'+this.id+' input.q').val(); + } + } + eventObject.preventDefault(); + eventObject.stopPropagation(); + return false; + }); + directory.fixLabel(); + }, + + fixLabel : function() { //called to reposition the label over the input and hide + WDN.jQuery('.directorySearch > fieldset > ol > li > label').css({'top' : '16px'}).focus(function(){ + WDN.jQuery(this).hide().siblings('input[type=text]').next().focus(); + }); + WDN.jQuery('.directorySearch input').bind({ + focus : function(){ + WDN.jQuery(this).siblings('label[for='+this.id+']').hide(); + }, + blur : function(){ + if (WDN.jQuery(this).val() === "") { + WDN.jQuery(this).siblings('label[for='+this.id+']').show(); + } + } + }); + }, + + splitSearchBoxes : function(cn, sn) { //function called to prepare the advanced search boxes + if (WDN.jQuery('#q').length){ + WDN.jQuery("#queryString, #q").remove(); + WDN.jQuery('#peoplefinder li').prepend('<label for="cn" class="cn">First Name</label><input type="text" value="" id="cn" name="cn" class="n q" /><label for="sn" class="sn">Last Name</label><input type="text" value="" id="sn" name="sn" class="s n q" />'); + } + WDN.jQuery('#cn, #sn').focus(function(){ + WDN.jQuery(this).prev('label').hide(); + }); + WDN.jQuery('#advancedSearch').unbind('click').removeClass('advanced').addClass('simple').text('Simple Search').bind({ + focus : function(){ + WDN.jQuery("#queryString").remove(); + }, + click : function(eventObject){ + directory.combineSearchBoxes(); + eventObject.preventDefault(); + eventObject.stopPropagation(); + return false; + } + }); + WDN.jQuery('#cn').val(cn); + WDN.jQuery('#sn').val(sn); + if(cn.length){ + WDN.jQuery('label[for=cn]').hide(); + } + if(sn.length){ + WDN.jQuery('label[for=sn]').hide(); + } + directory.fixLabel(); + }, + + combineSearchBoxes : function() { //function called to prepare the simple search box + WDN.jQuery('#sn, #cn, label.cn, label.sn').remove(); + WDN.jQuery('#advancedSearch').unbind('click').removeClass('simple').addClass('advanced').text('Advanced Search').bind({ + focus : function(){ + WDN.jQuery("#peoplefinder label").remove(); + }, + click : function(eventObject){ + directory.splitSearchBoxes('',''); + eventObject.preventDefault(); + eventObject.stopPropagation(); + return false; + } + }); + WDN.jQuery('#peoplefinder li').prepend('<label for="q" id="queryString">Enter a name to begin your search</label><input type="text" value="" id="q" name="q" class="q" />'); + directory.fixLabel(); + }, + + buildSearchNotice : function(originalSearch, firstName, lastName) { + WDN.jQuery("#searchNotice").remove(); + WDN.jQuery("#peoplefinder").after('<p id="searchNotice">Your original search for <span>'+originalSearch+'</span> did not return any results. So we tried a few more advanced searches and below is what we found for <span>First Name: '+firstName+' AND Last Name: '+lastName+'</span>.'); + }, + + showSearchNotice : function() { + WDN.jQuery("#searchNotice").slideDown(500); + attempts = 1; + } + }; +}(); + +WDN.jQuery(document).ready(function() { + WDN.loadJS('wdn/templates_3.0/scripts/plugins/hashchange/jQuery.hashchange.1-3.min.js', function() { + attempts = 1; // var used to control how many attempts the automatic search guessing goes through + WDN.jQuery(window).bind('hashchange', function(eventObject){ + hash = location.hash; + if (hash.match(/^#q\//)) { + hash = hash.split('/'); //hash[1] + splitName = false; + if(hash.length >= 3){ // if 3, then we're looking for first and last name individually. + splitName = true; + cn = unescape(hash[1]); + sn = unescape(hash[2]); + directory.splitSearchBoxes(cn, sn); + } else { // it's all one search term. + query = unescape(hash[1]); + if (WDN.jQuery('#cn').length){ + directory.combineSearchBoxes(); + } + WDN.jQuery('#q').val(query); + } + + service_peoplefinder.presentPeopleFinderResults(); + + eventObject.preventDefault(); + eventObject.stopPropagation(); + return false; + } + if (!hash) { + // Load the default instructions + WDN.jQuery('#maincontent').load('?format=partial', function(){ + directory.initializeSearchBoxes(); + }); + } + }); + }); + WDN.loadJS('wdn/templates_3.0/scripts/toolbar_peoplefinder.js', function(){ + //WDN.toolbar_peoplefinder.serviceURL = window.location.protocol + '//' + window.location.host + window.location.pathname; + WDN.toolbar_peoplefinder.serviceURL = PF_URL; + WDN.toolbar_peoplefinder.configuedWebService = true; + if (window.location.hash) { + WDN.jQuery(window).trigger('hashchange'); + } + }); + directory.initializeSearchBoxes(); + WDN.jQuery('#advancedSearch').bind({ + focus : function(){ + WDN.jQuery("#queryString").remove(); + }, + click : function(){ + directory.splitSearchBoxes('',''); + return false; + } + }); + WDN.jQuery('a.img-qrcode').live('click', function() { + WDN.jQuery(this).colorbox({open:true}); + return false; + }); +}); +WDN.jQuery(window).keydown(function(event) { + if (event.which == '191') { + WDN.jQuery('#q').focus().select(); + event.preventDefault(); + event.stopPropagation(); + } +}); \ No newline at end of file diff --git a/lib/www/UNL_Peoplefinder/pear.unl.edu/service.php b/lib/www/UNL_Peoplefinder/pear.unl.edu/service.php index 9745d382..c23b479a 100644 --- a/lib/www/UNL_Peoplefinder/pear.unl.edu/service.php +++ b/lib/www/UNL_Peoplefinder/pear.unl.edu/service.php @@ -16,8 +16,8 @@ header('Access-Control-Allow-Methods: GET, OPTIONS'); // The X-Requested-With header allows jQuery requests to go through header('Access-Control-Allow-Headers: X-Requested-With'); -// Set the ages for the access-control header to 20 days to improve speed/caching. -header('Access-Control-Max-Age: 1728000'); +// Set the ages for the access-control header to 24 hours to improve speed/caching. +header('Access-Control-Max-Age: 86400'); // Set expires header for 24 hours to improve speed caching. header('Expires: '.date('r', strtotime('tomorrow'))); @@ -26,108 +26,36 @@ header('Expires: '.date('r', strtotime('tomorrow'))); if (strtolower($_SERVER['REQUEST_METHOD']) == 'options') { exit(); } +$options = array('format'=>'partial', 'onclick'=>'pf_getUID'); +$options = $_GET + $options; +$options['driver'] = $driver; +$peoplefinder = new UNL_Peoplefinder($options); -$peepObj = new UNL_Peoplefinder(); -$format = 'html'; +Savvy_ClassToTemplateMapper::$classname_replacement = 'UNL_'; +$savvy = new Savvy(); +$savvy->setTemplatePath(dirname(__FILE__).'/templates/html'); -$renderer_options = array('uid_onclick' => 'pf_getUID', - 'uri' => UNL_PEOPLEFINDER_URI); -if (isset($_GET['chooser'])) { - $renderer_options['choose_uid'] = true; -} - -if (isset($_GET['renderer']) || isset($_GET['format'])) { - $format = isset($_GET['renderer'])?$_GET['renderer']:$_GET['format']; -} -switch($format) { -case 'vcard': - $renderer_class = 'vCard'; - break; -case 'serialized': -case 'php': - $renderer_class = 'Serialized'; - break; -case 'xml': - $renderer_class = 'XML'; - break; -case 'json': - $renderer_class = 'JSON'; - break; -default: -case 'hcard': -case 'html': - $renderer_class = 'HTML'; - break; -} -$method = false; -if (isset($_GET['method'])) { - switch ($_GET['method']) { - case 'getLikeMatches': - case 'getExactMatches': - case 'getPhoneMatches': - $method = $_GET['method']; +switch($peoplefinder->options['format']) { + case 'vcard': + header('Content-Type: text/x-vcard'); + if ($peoplefinder->output[0] instanceof UNL_Peoplefinder_Record) { + header('Content-Disposition: attachment; filename="'.$peoplefinder->output[0]->sn.', '.$peoplefinder->output[0]->givenName.'.vcf"'); + } + //intentional no break + case 'json': + case 'php': + case 'xml': + $savvy->addTemplatePath(dirname(__FILE__).'/templates/'.$peoplefinder->options['format']); break; - } + case 'partial': + case 'html': + case 'hcard': + default: + Savvy_ClassToTemplateMapper::$output_template['UNL_Peoplefinder'] = 'Peoplefinder-partial'; + $savvy->setEscape('htmlentities'); } -$renderer_class = 'UNL_Peoplefinder_Renderer_'.$renderer_class; -$renderer = new $renderer_class($renderer_options); -if (isset($_GET['q']) && !empty($_GET['q'])) { - // Basic query, build filter and display results - if (strlen($_GET['q']) > 3) { - if (is_numeric(str_replace('-','',str_replace('(','',str_replace(')','',$_GET['q']))))) { - $records = $peepObj->getPhoneMatches($_GET['q']); - $renderer->renderSearchResults($records); - } else { - if ($method) { - $records = $peepObj->$method($_GET['q']); - if (count($records) > 0) { - $renderer->renderSearchResults($records); - } else { - $renderer->renderError(); - } - } else { - $records = $peepObj->getExactMatches($_GET['q']); - if (count($records) > 0) { - if ($renderer instanceof UNL_Peoplefinder_Renderer_HTML) { - echo "<div class='cMatch'>Exact matches:</div>\n"; - } - $renderer->renderSearchResults($records); - } else { - if ($renderer instanceof UNL_Peoplefinder_Renderer_HTML) { - echo 'No exact matches found.'; - } - } - if (count($records) < UNL_Peoplefinder::$displayResultLimit) { - // More room to display LIKE results - UNL_Peoplefinder::$displayResultLimit = UNL_Peoplefinder::$displayResultLimit-$peepObj->lastResultCount; - $records = $peepObj->getLikeMatches($_GET['q'], $records); - if (count($records) > 0) { - if ($renderer instanceof UNL_Peoplefinder_Renderer_HTML) { - echo "<div class='cMatch'>Possible matches:</div>\n"; - } - $renderer->renderSearchResults($records); - } - } - } - } - } else { - $renderer->renderError(); - } -} elseif (isset($_GET['uid']) && !empty($_GET['uid'])) { - $renderer->renderRecord($peepObj->getUID($_GET['uid'])); -} elseif (isset($_GET['d'])) { - try { - $department = new UNL_Peoplefinder_Department($_GET['d']); - foreach ($department as $employee) { - $renderer->renderRecord($employee); - } - } catch(Exception $e) { - $renderer->renderError($e->getMessage()); - } -} else { - $renderer->renderError(); -} +echo $savvy->render($peoplefinder); diff --git a/lib/www/UNL_Peoplefinder/pear.unl.edu/standardForm.php b/lib/www/UNL_Peoplefinder/pear.unl.edu/standardForm.php index cd6a2fde..e69de29b 100644 --- a/lib/www/UNL_Peoplefinder/pear.unl.edu/standardForm.php +++ b/lib/www/UNL_Peoplefinder/pear.unl.edu/standardForm.php @@ -1,16 +0,0 @@ -<form method="get" id="form1" action="<?php echo htmlentities(str_replace('index.php', '', $_SERVER['PHP_SELF']), ENT_QUOTES); ?>"> - <div> - <label for="q">Search People: </label> - <?php if (isset($_GET['chooser'])) { - echo '<input type="hidden" name="chooser" value="true" />'; - } - if (isset($_GET['q'])) { - $default = htmlentities($_GET['q'], ENT_QUOTES); - } else { - $default = ''; - } - ?> - <input style="width:18ex;" type="text" value="<?php echo $default; ?>" id="q" name="q" /> - <input style="margin-bottom:-7px;" name="submitbutton" type="image" src="/ucomm/templatedependents/templatecss/images/go.gif" value="Submit" id="submitbutton" /> - </div> -</form> \ No newline at end of file -- GitLab