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

Add UNL_Auth and SimpleCAS packages to lib

parent 375a0b6d
No related branches found
No related tags found
No related merge requests found
Showing
with 6005 additions and 0 deletions
<?xml version="1.0"?>
<pearconfig version="1.0"><php_dir>/Library/WebServer/Documents/workspace/UCOMM_Webforms/lib/php</php_dir><ext_dir>/usr/lib/php/extensions/no-debug-non-zts-20090626</ext_dir><cfg_dir>/Library/WebServer/Documents/workspace/UCOMM_Webforms/lib/cfg</cfg_dir><doc_dir>/Library/WebServer/Documents/workspace/UCOMM_Webforms/lib/docs</doc_dir><bin_dir>/usr/bin</bin_dir><data_dir>/Library/WebServer/Documents/workspace/UCOMM_Webforms/lib/data</data_dir><www_dir>/Library/WebServer/Documents/workspace/UCOMM_Webforms/lib/www</www_dir><test_dir>/Library/WebServer/Documents/workspace/UCOMM_Webforms/lib/tests</test_dir><src_dir>/Library/WebServer/Documents/workspace/UCOMM_Webforms/lib/src</src_dir><php_bin>/usr/bin/php</php_bin><php_ini>/private/etc/php.ini</php_ini><php_prefix></php_prefix><php_suffix></php_suffix></pearconfig>
No preview for this file type
<?xml version="1.0" encoding="UTF-8"?>
<channel version="1.0" xmlns="http://pear.php.net/channel-1.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://pear.php.net/channel-1.0http://pear.php.net/dtd/channel-1.0.xsd">
<name>simplecas.googlecode.com/svn</name>
<suggestedalias>simplecas</suggestedalias>
<summary>simplecas</summary>
<servers>
<primary>
<rest>
<baseurl type="REST1.0">http://simplecas.googlecode.com/svn/rest/</baseurl>
<baseurl type="REST1.1">http://simplecas.googlecode.com/svn/rest/</baseurl>
<baseurl type="REST1.3">http://simplecas.googlecode.com/svn/rest/</baseurl>
</rest>
</primary>
</servers>
</channel>
simplecas.googlecode.com/svn
\ No newline at end of file
This diff is collapsed.
<?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.7.1" 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>Net_URL2</name>
<channel>pear.php.net</channel>
<summary>Class for parsing and handling URL.</summary>
<description>Provides parsing of URLs into their constituent parts (scheme, host, path etc.), URL generation, and resolving of relative URLs.</description>
<lead>
<name>David Coallier</name>
<user>davidc</user>
<email>davidc@php.net</email>
<active>yes</active>
</lead>
<lead>
<name>Christian Schmidt</name>
<user>schmidt</user>
<email>schmidt@php.net</email>
<active>yes</active>
</lead>
<date>2011-04-27</date>
<time>13:58:16</time>
<version>
<release>0.3.1</release>
<api>0.3.0</api>
</version>
<stability>
<release>beta</release>
<api>beta</api>
</stability>
<license uri="http://www.opensource.org/licenses/bsd-license.php">BSD</license>
<notes>* BC break: Removed setOption() to avoid undefined behaviour (bug #16674)
* Fixed Bug #16854: Invalid package.xml making it impossible to install with Pyrus
* Fixed Bug #16651: Port may be an empty string
* Fixed Bug #16653: Don't make OPTION_SEPARATOR_(IN|OUT)PUT default to arg_separator.(in|out)put</notes>
<contents>
<dir name="/">
<file baseinstalldir="Net" md5sum="f0a637e921da7a47373e2b065107c7a0" name="URL2.php" role="php"/>
<file baseinstalldir="Net" md5sum="587a224d39fbffa47cacb9fb67b51da1" name="docs/example.php" role="doc"/>
<file baseinstalldir="Net" md5sum="ea8b73061588566519fd0e55a230f2a6" name="docs/6470.php" role="doc"/>
</dir>
</contents>
<dependencies>
<required>
<php>
<min>5.0</min>
</php>
<pearinstaller>
<min>1.4.0b1</min>
</pearinstaller>
</required>
</dependencies>
<phprelease>
<changelog>
<release>
<version>
<release>0.3.0</release>
<api>0.3.0</api>
</version>
<stability>
<release>beta</release>
<api>beta</api>
</stability>
<date>2009-09-05</date>
<license>BSD</license>
<notes>* Fixed #14399 (Errors in URL parsing (items #1 and #3))
* Fixed #14735 (Encode query string values)
* Fixed #15546 (Add adding __toString())
* Fixed #15367 (Use RFC 3986-compliant version of rawurlencode() in PHP &lt; 5.2)
* Fixed #14289 (Add __get() and __set())</notes>
</release>
<release>
<version>
<release>0.2.0</release>
<api>0.2.0</api>
</version>
<stability>
<release>beta</release>
<api>beta</api>
</stability>
<date>2008-06-18</date>
<license>BSD</license>
<notes>Major rewrite to comply with RFC3986 (bug 11574).
Much better support for resolving relative URLs.
WARNING: Method and property names has changed to reflect the terminology used in the RFC - THIS RELEASE IS NOT BACKWARDS COMPATIBLE WITH VERSION 0.1.0.</notes>
</release>
<release>
<version>
<release>0.1.0</release>
<api>0.1.0</api>
</version>
<stability>
<release>beta</release>
<api>beta</api>
</stability>
<date>2007-05-08</date>
<license>BSD</license>
<notes>Convert to PHP5 only. PHP4 users should continue with version 1.0.15</notes>
</release>
</changelog>
</phprelease>
</package>
<?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_Auth</name>
<channel>pear.unl.edu</channel>
<summary>An authentication framework for PHP Applications at UNL</summary>
<description>This package provides an authentication framework for web
applications developed at UNL.</description>
<lead>
<name>Brett Bieber</name>
<user>saltybeagle</user>
<email>brett.bieber@gmail.com</email>
<active>yes</active>
</lead>
<date>2011-04-27</date>
<time>13:54:20</time>
<version>
<release>0.4.0</release>
<api>0.4.0</api>
</version>
<stability>
<release>alpha</release>
<api>alpha</api>
</stability>
<license uri="http://www1.unl.edu/wdn/wiki/Software_License">BSD License</license>
<notes>
* Fix E_STRICT warning about static methods.
</notes>
<contents>
<dir name="/">
<file baseinstalldir="/" md5sum="b7a35f1bfe174ef2725733df1539f212" name="UNL/Auth/SimpleCAS/ZendAuth.php" role="php"/>
<file baseinstalldir="/" md5sum="6def037a77fd9fa49bcc5e752cbb8170" name="UNL/Auth/SimpleCAS.php" role="php"/>
<file baseinstalldir="/" md5sum="ada4bb738641430ba2420da94ec3e749" name="UNL/Auth/CAS/PEARAuth.php" role="php"/>
<file baseinstalldir="/" md5sum="76deaf815ba781ca6f7f6bbcc7095912" name="UNL/Auth/CAS.php" role="php"/>
<file baseinstalldir="/" md5sum="f0bb48dadf42f6511b718032203f9c28" name="UNL/Auth.php" role="php"/>
<file baseinstalldir="/" md5sum="c4ee1094cd276ff40fbd2b16d66068fe" name="docs/examples/Zend_SimpleCAS_example.php" role="doc"/>
<file baseinstalldir="/" md5sum="3a80ba084e5bc5f8b17d188b15e6a7aa" name="docs/examples/SimpleCAS_example.php" role="doc"/>
<file baseinstalldir="/" md5sum="3759e0e8f63d4161653c158b08cdd0ed" name="docs/examples/CAS_example.php" role="doc"/>
<file baseinstalldir="/" md5sum="e89e49dca8497ec59459d17140c6e63a" name="docs/examples/CASPEARAuth_example.php" role="doc"/>
</dir>
</contents>
<dependencies>
<required>
<php>
<min>5.2.0</min>
</php>
<pearinstaller>
<min>1.4.3</min>
</pearinstaller>
</required>
<optional>
<package>
<name>Auth</name>
<channel>pear.php.net</channel>
<min>1.0</min>
</package>
<package>
<name>CAS</name>
<channel>pear.unl.edu</channel>
<min>1.0.0</min>
</package>
<package>
<name>SimpleCAS</name>
<channel>simplecas.googlecode.com/svn</channel>
<min>0.3.0</min>
</package>
</optional>
</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>2007-12-17</date>
<license uri="http://www1.unl.edu/wdn/wiki/Software_License">BSD License</license>
<notes>
First Release - only CAS is available.
</notes>
</release>
<release>
<version>
<release>0.1.1</release>
<api>0.1.1</api>
</version>
<stability>
<release>alpha</release>
<api>alpha</api>
</stability>
<date>2008-05-20</date>
<license uri="http://www1.unl.edu/wdn/wiki/Software_License">BSD License</license>
<notes>
* Check if session is already started - kabel
* Improve PHP docs and fix example. - bbieber
</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-08-22</date>
<license uri="http://www1.unl.edu/wdn/wiki/Software_License">BSD License</license>
<notes>
* Upgrade CAS driver dependency to 1.0.0
</notes>
</release>
<release>
<version>
<release>0.3.0</release>
<api>0.3.0</api>
</version>
<stability>
<release>alpha</release>
<api>alpha</api>
</stability>
<date>2008-12-09</date>
<license uri="http://www1.unl.edu/wdn/wiki/Software_License">BSD License</license>
<notes>
* Enable SimpleCAS support. http://code.google.com/p/simplecas/
</notes>
</release>
<release>
<version>
<release>0.3.1</release>
<api>0.3.0</api>
</version>
<stability>
<release>alpha</release>
<api>alpha</api>
</stability>
<date>2009-02-12</date>
<license uri="http://www1.unl.edu/wdn/wiki/Software_License">BSD License</license>
<notes>
* Increase SimpleCAS dependency of 0.2.0 to take advantage of getRequest() so we can ignore the ssl peer verification.
</notes>
</release>
<release>
<version>
<release>0.3.2</release>
<api>0.3.0</api>
</version>
<stability>
<release>alpha</release>
<api>alpha</api>
</stability>
<date>2009-03-03</date>
<license uri="http://www1.unl.edu/wdn/wiki/Software_License">BSD License</license>
<notes>
* Increase SimpleCAS dependency of 0.3.0 to use new object names and array options for the constructor.
</notes>
</release>
<release>
<version>
<release>0.4.0</release>
<api>0.4.0</api>
</version>
<stability>
<release>alpha</release>
<api>alpha</api>
</stability>
<date>2009-11-18</date>
<license uri="http://www1.unl.edu/wdn/wiki/Software_License">BSD License</license>
<notes>
* Fix E_STRICT warning about static methods.
</notes>
</release>
</changelog>
</phprelease>
</package>
<?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.1" 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>SimpleCAS</name>
<channel>simplecas.googlecode.com/svn</channel>
<summary>A PHP5 library for CAS Authentication.</summary>
<description>This package is a PHP5 only library for identifying users
in a JA-SIG CAS secured environment.</description>
<lead>
<name>Brett Bieber</name>
<user>saltybeagle</user>
<email>brett.bieber@gmail.com</email>
<active>yes</active>
</lead>
<helper>
<name>John Thiltges</name>
<user>jthiltges</user>
<email>jthiltges@gmail.com</email>
<active>yes</active>
</helper>
<helper>
<name>Kevin Abel</name>
<user>kevin.abel.0</user>
<email>kevin.abel.0@gmail.com</email>
<active>yes</active>
</helper>
<helper>
<name>Eric Rasmussen</name>
<user>ericrasmussen1</user>
<email>ericrasmussen1@gmail.com</email>
<active>yes</active>
</helper>
<date>2011-04-27</date>
<time>13:58:16</time>
<version>
<release>0.5.0</release>
<api>0.5.0</api>
</version>
<stability>
<release>beta</release>
<api>beta</api>
</stability>
<license uri="http://www1.unl.edu/wdn/wiki/Software_License">BSD License</license>
<notes>
* Allow service url to be customized with SimpleCAS::setURL($url); [ericrasmussen1]
</notes>
<contents>
<dir name="/">
<file baseinstalldir="/" md5sum="ad9c06f186ce8fa739d6e716f6c9b48d" name="SimpleCAS/SingleSignOut.php" role="php"/>
<file baseinstalldir="/" md5sum="7a49aa1c67563ed628202c3e9244dcdc" name="SimpleCAS/ProxyGranting/Storage/File.php" role="php"/>
<file baseinstalldir="/" md5sum="26b6d753c3f9098be6493c818aabd959" name="SimpleCAS/ProxyGranting/Storage.php" role="php"/>
<file baseinstalldir="/" md5sum="e96b4c13218c39664fdeb8dc8d4e7541" name="SimpleCAS/ProxyGranting.php" role="php"/>
<file baseinstalldir="/" md5sum="46feaaf938c6eb0f7f260125a646b3fb" name="SimpleCAS/Protocol/Version2/ValidationResponse.php" role="php"/>
<file baseinstalldir="/" md5sum="f4ed06c8ae5918cfb9790ca72c6256d0" name="SimpleCAS/Protocol/Version2.php" role="php"/>
<file baseinstalldir="/" md5sum="80862315b001dcfa1fde9348341ff432" name="SimpleCAS/Protocol/Version1.php" role="php"/>
<file baseinstalldir="/" md5sum="daf05e7a073e2ac47ddb0c7ea6a83e33" name="SimpleCAS/Protocol.php" role="php"/>
<file baseinstalldir="/" md5sum="d93480efa786598948935145b06352a6" name="SimpleCAS/Autoload.php" role="php"/>
<file baseinstalldir="/" md5sum="a9d96c7d2032b5432306ffba5438d0f1" name="SimpleCAS.php" role="php"/>
<file baseinstalldir="/" md5sum="9d686c3553b6c8be0af988ddfb363f0c" name="docs/examples/Zend_Auth_Adapter_SimpleCAS.php" role="doc"/>
<file baseinstalldir="/" md5sum="2254593f10efc23cd0eadab309506e15" name="docs/examples/simple.php" role="doc"/>
</dir>
</contents>
<dependencies>
<required>
<php>
<min>5.2.5</min>
</php>
<pearinstaller>
<min>1.5.4</min>
</pearinstaller>
<package>
<name>HTTP_Request2</name>
<channel>pear.php.net</channel>
<min>0.1.0</min>
</package>
</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-12-08</date>
<license uri="http://www1.unl.edu/wdn/wiki/Software_License">BSD License</license>
<notes>
First Release.
</notes>
</release>
<release>
<version>
<release>0.1.1</release>
<api>0.1.1</api>
</version>
<stability>
<release>alpha</release>
<api>alpha</api>
</stability>
<date>2008-12-08</date>
<license uri="http://www1.unl.edu/wdn/wiki/Software_License">BSD License</license>
<notes>
* Fix Notice: Trying to get property of non-object in SimpleCAS/Server/Version2/ValidationResponse.php on line 23
* Change PHP dependency to 5.2.5
</notes>
</release>
<release>
<version>
<release>0.1.2</release>
<api>0.1.1</api>
</version>
<stability>
<release>alpha</release>
<api>alpha</api>
</stability>
<date>2009-02-05</date>
<license uri="http://www1.unl.edu/wdn/wiki/Software_License">BSD License</license>
<notes>
* Update PEAR dependency to 1.5.4
* Match case for variables (jthiltges)
* In CAS v2 validateTicket, typecast successful return value to string (jthiltges)
</notes>
</release>
<release>
<version>
<release>0.2.0</release>
<api>0.2.0</api>
</version>
<stability>
<release>alpha</release>
<api>alpha</api>
</stability>
<date>2009-02-11</date>
<license uri="http://www1.unl.edu/wdn/wiki/Software_License">BSD License</license>
<notes>
* Allow setting HTTP_Request2 object so configuration can be set.
$server-&gt;getRequest()-&gt;setConfig('ssl_verify_peer', false);
* Add $server-&gt;getRequest(), $server-&gt;setRequest(HTTP_Request2 $http_request)
Change interface for server to abstract class.
</notes>
</release>
<release>
<version>
<release>0.2.1</release>
<api>0.2.0</api>
</version>
<stability>
<release>alpha</release>
<api>alpha</api>
</stability>
<date>2009-02-12</date>
<license uri="http://www1.unl.edu/wdn/wiki/Software_License">BSD License</license>
<notes>
* Explicitly call __toString() for PHP 5.1 compatibility. [jthiltges]
* Add Zend_Auth_Adapter_SimpleCAS to the examples. [jthiltges]
</notes>
</release>
<release>
<version>
<release>0.3.0</release>
<api>0.3.0</api>
</version>
<stability>
<release>alpha</release>
<api>alpha</api>
</stability>
<date>2009-03-03</date>
<license uri="http://www1.unl.edu/wdn/wiki/Software_License">BSD License</license>
<notes>
* Issue 1: Rename SimpleCAS_Server to SimpleCAS_Protocol [saltybeagle]
* Issue 2: Switch to arrays for the protocol constructors. [saltybeagle]
* Exit immediately after re-direct.
</notes>
</release>
<release>
<version>
<release>0.3.1</release>
<api>0.3.1</api>
</version>
<stability>
<release>alpha</release>
<api>alpha</api>
</stability>
<date>2009-04-06</date>
<license uri="http://www1.unl.edu/wdn/wiki/Software_License">BSD License</license>
<notes>
* Prefix session variables with __SIMPLECAS [saltybeagle]
</notes>
</release>
<release>
<version>
<release>0.4.0</release>
<api>0.4.0</api>
</version>
<stability>
<release>beta</release>
<api>beta</api>
</stability>
<date>2010-01-08</date>
<license uri="http://www1.unl.edu/wdn/wiki/Software_License">BSD License</license>
<notes>
* Allow request adapter to be customized. [Kevin]
</notes>
</release>
<release>
<version>
<release>0.5.0</release>
<api>0.5.0</api>
</version>
<stability>
<release>beta</release>
<api>beta</api>
</stability>
<date>2010-01-27</date>
<license uri="http://www1.unl.edu/wdn/wiki/Software_License">BSD License</license>
<notes>
* Allow service url to be customized with SimpleCAS::setURL($url); [ericrasmussen1]
</notes>
</release>
</changelog>
</phprelease>
</package>
<?php
/**
* Helper file for downloading Public Suffix List and converting it to PHP array
*
* You can run this script to update PSL to the current version instead of
* waiting for a new release of HTTP_Request2.
*
* @version SVN: $Id: generate-list.php 308480 2011-02-19 11:27:13Z avb $
*/
/** URL to download Public Suffix List from */
define('LIST_URL', 'http://mxr.mozilla.org/mozilla-central/source/netwerk/dns/effective_tld_names.dat?raw=1');
/** Name of PHP file to write */
define('OUTPUT_FILE', dirname(__FILE__) . '/public-suffix-list.php');
require_once 'HTTP/Request2.php';
function buildSubdomain(&$node, $tldParts)
{
$part = trim(array_pop($tldParts));
if (!array_key_exists($part, $node)) {
$node[$part] = array();
}
if (0 < count($tldParts)) {
buildSubdomain($node[$part], $tldParts);
}
}
function writeNode($fp, $valueTree, $key = null, $indent = 0)
{
if (is_null($key)) {
fwrite($fp, "return ");
} else {
fwrite($fp, str_repeat(' ', $indent) . "'$key' => ");
}
if (0 == ($count = count($valueTree))) {
fwrite($fp, 'true');
} else {
fwrite($fp, "array(\n");
for ($keys = array_keys($valueTree), $i = 0; $i < $count; $i++) {
writeNode($fp, $valueTree[$keys[$i]], $keys[$i], $indent + 1);
if ($i + 1 != $count) {
fwrite($fp, ",\n");
} else {
fwrite($fp, "\n");
}
}
fwrite($fp, str_repeat(' ', $indent) . ")");
}
}
try {
$request = new HTTP_Request2(LIST_URL);
$response = $request->send();
if (200 != $response->getStatus()) {
throw new Exception("List download URL returned status: " .
$response->getStatus() . ' ' . $response->getReasonPhrase());
}
$list = $response->getBody();
if (false === strpos($list, 'The Original Code is the Public Suffix List.')) {
throw new Exception("List download URL does not contain expected phrase");
}
if (!($fp = @fopen(OUTPUT_FILE, 'wt'))) {
throw new Exception("Unable to open " . OUTPUT_FILE);
}
} catch (Exception $e) {
die($e->getMessage());
}
$tldTree = array();
$license = true;
fwrite($fp, "<?php\n");
foreach (array_filter(array_map('trim', explode("\n", $list))) as $line) {
if ('//' != substr($line, 0, 2)) {
buildSubdomain($tldTree, explode('.', $line));
} elseif ($license) {
fwrite($fp, $line . "\n");
if (0 === strpos($line, "// ***** END LICENSE BLOCK")) {
$license = false;
fwrite($fp, "\n");
}
}
}
writeNode($fp, $tldTree);
fwrite($fp, ";\n?>");
fclose($fp);
?>
\ No newline at end of file
This diff is collapsed.
<?php
/**
* Usage example for HTTP_Request2 package: uploading a file to rapidshare.com
*
* Inspired by Perl usage example: http://images.rapidshare.com/software/rsapi.pl
* Rapidshare API description: http://rapidshare.com/dev.html
*
* $Id: upload-rapidshare.php 287307 2009-08-14 15:40:22Z avb $
*/
require_once 'HTTP/Request2.php';
// You'll probably want to change this
$filename = '/etc/passwd';
try {
// First step: get an available upload server
$request = new HTTP_Request2(
'http://rapidshare.com/cgi-bin/rsapi.cgi?sub=nextuploadserver_v1'
);
$server = $request->send()->getBody();
if (!preg_match('/^(\\d+)$/', $server)) {
throw new Exception("Invalid upload server: {$server}");
}
// Calculate file hash, we'll use it later to check upload
if (false === ($hash = @md5_file($filename))) {
throw new Exception("Cannot calculate MD5 hash of '{$filename}'");
}
// Second step: upload a file to the available server
$uploader = new HTTP_Request2(
"http://rs{$server}l3.rapidshare.com/cgi-bin/upload.cgi",
HTTP_Request2::METHOD_POST
);
// Adding the file
$uploader->addUpload('filecontent', $filename);
// This will tell server to return program-friendly output
$uploader->addPostParameter('rsapi_v1', '1');
$response = $uploader->send()->getBody();
if (!preg_match_all('/^(File[^=]+)=(.+)$/m', $response, $m, PREG_SET_ORDER)) {
throw new Exception("Invalid response: {$response}");
}
$rspAry = array();
foreach ($m as $item) {
$rspAry[$item[1]] = $item[2];
}
// Check that uploaded file has the same hash
if (empty($rspAry['File1.4'])) {
throw new Exception("MD5 hash data not found in response");
} elseif ($hash != strtolower($rspAry['File1.4'])) {
throw new Exception("Upload failed, local MD5 is {$hash}, uploaded MD5 is {$rspAry['File1.4']}");
}
echo "Upload succeeded\nDownload link: {$rspAry['File1.1']}\nDelete link: {$rspAry['File1.2']}\n";
} catch (Exception $e) {
echo "Error: " . $e->getMessage();
}
?>
<?php
// +-----------------------------------------------------------------------+
// | Copyright (c) 2002-2003, Richard Heyes |
// | All rights reserved. |
// | |
// | Redistribution and use in source and binary forms, with or without |
// | modification, are permitted provided that the following conditions |
// | are met: |
// | |
// | o Redistributions of source code must retain the above copyright |
// | notice, this list of conditions and the following disclaimer. |
// | o Redistributions in binary form must reproduce the above copyright |
// | notice, this list of conditions and the following disclaimer in the |
// | documentation and/or other materials provided with the distribution.|
// | o The names of the authors may not be used to endorse or promote |
// | products derived from this software without specific prior written |
// | permission. |
// | |
// | THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS |
// | "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT |
// | LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR |
// | A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT |
// | OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, |
// | SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT |
// | LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, |
// | DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY |
// | THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT |
// | (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE |
// | OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. |
// | |
// +-----------------------------------------------------------------------+
// | Author: Richard Heyes <richard at php net> |
// +-----------------------------------------------------------------------+
// $Id: 6470.php 235190 2007-05-08 00:04:54Z davidc $
/**
* This example will decode the url given and display its
* constituent parts.
*/
error_reporting(E_ALL | E_STRICT);
require_once 'Net/URL2.php';
//$url = &new Net_URL2('https://www.example.com/foo/bar/index.php?foo=bar');
Net_URL2::setOption('encode_query_keys', true);
$url = new Net_URL2;
?>
<html>
<body>
<pre>
Protocol...: <?php echo $url->protocol; ?>
Username...: <?php echo $url->user; ?>
Password...: <?php echo $url->pass; ?>
Server.....: <?php echo $url->host; ?>
Port.......: <?php $url->port; ?>
File/path..: <?php $url->path; ?>
Querystring: <?php print_r($url->querystring); ?>
Anchor.....: <?php echo $url->anchor;?>
Full URL...: <?php echo $url->getUrl(); ?>
Resolve path (/.././/foo/bar/joe/./././../jabba): <b><?php Net_URL2::resolvePath('/.././/foo/bar/joe/./././../jabba'); ?></b>
</pre>
</body>
</html>
<?php
// +-----------------------------------------------------------------------+
// | Copyright (c) 2002-2003, Richard Heyes |
// | All rights reserved. |
// | |
// | Redistribution and use in source and binary forms, with or without |
// | modification, are permitted provided that the following conditions |
// | are met: |
// | |
// | o Redistributions of source code must retain the above copyright |
// | notice, this list of conditions and the following disclaimer. |
// | o Redistributions in binary form must reproduce the above copyright |
// | notice, this list of conditions and the following disclaimer in the |
// | documentation and/or other materials provided with the distribution.|
// | o The names of the authors may not be used to endorse or promote |
// | products derived from this software without specific prior written |
// | permission. |
// | |
// | THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS |
// | "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT |
// | LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR |
// | A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT |
// | OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, |
// | SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT |
// | LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, |
// | DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY |
// | THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT |
// | (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE |
// | OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. |
// | |
// +-----------------------------------------------------------------------+
// | Author: Richard Heyes <richard at php net> |
// +-----------------------------------------------------------------------+
// $Id: example.php 235190 2007-05-08 00:04:54Z davidc $
/**
* This example will decode the url given and display its
* constituent parts.
*/
error_reporting(E_ALL | E_STRICT);
//include('../URL2.php');
include('Net/URL2.php');
//$url = &new Net_URL2('https://www.example.com/foo/bar/index.php?foo=bar');
$url = new Net_URL2('https://example.com/pls/portal30/PORTAL30.wwpob_page.changetabs?p_back_url=http%3A%2F%2Fexample.com%2Fservlet%2Fpage%3F_pageid%3D360%2C366%2C368%2C382%26_dad%3Dportal30%26_schema%3DPORTAL30&foo=bar');
?>
<html>
<body>
<pre>
Protocol...: <?php echo $url->protocol; ?>
Username...: <?php echo $url->user; ?>
Password...: <?php echo $url->pass; ?>
Server.....: <?php echo $url->host; ?>
Port.......: <?php $url->port; ?>
File/path..: <?php $url->path; ?>
Querystring: <?php print_r($url->querystring); ?>
Anchor.....: <?php echo $url->anchor;?>
Full URL...: <?php echo $url->getUrl(); ?>
Resolve path (/.././/foo/bar/joe/./././../jabba): <b><?php Net_URL2::resolvePath('/.././/foo/bar/joe/./././../jabba'); ?></b>
</pre>
</body>
</html>
<?php
/**
* This is a Zend_Auth adapter library for CAS.
* It uses SimpleCAS.
*
* <code>
* public function casAction()
* {
* $auth = Zend_Auth::getInstance();
* $authAdapter = new UNL_CasZendAuthAdapter(
* Zend_Registry::get('config')->auth->cas
* );
*
* # User has not been identified, and there's a ticket in the URL
* if (!$auth->hasIdentity() && isset($_GET['ticket'])) {
* $authAdapter->setTicket($_GET['ticket']);
* $result = $auth->authenticate($authAdapter);
*
* if ($result->isValid()) {
* Zend_Session::regenerateId();
* }
* }
*
* # No ticket or ticket was invalid. Redirect to CAS.
* if (!$auth->hasIdentity()) {
* $this->_redirect($authAdapter->getLoginURL());
* }
* }
* </code>
*/
/**
* @see Zend_Auth_Adapter_Interface
*/
require_once 'Zend/Auth/Adapter/Interface.php';
require_once('SimpleCAS/Server/Version2.php');
class Zend_Auth_Adapter_SimpleCAS implements Zend_Auth_Adapter_Interface
{
/**
* CAS client
*/
private $_protocol;
/**
* Service ticket
*/
private $_ticket;
/**
* Constructor
*
* @param string $server_hostname
* @param string $server_port
* @param string $server_uri
* @return void
*/
public function __construct($options)
{
$this->_protocol = new SimpleCAS_Protocol_Version2($options);
}
public function setTicket($ticket)
{
$this->_ticket = $ticket;
return $this;
}
/**
* Authenticates ticket
*
* The ticket is provided with setTicket
*
* @param return boolean
*/
public function authenticate()
{
if ($id = $this->_protocol->validateTicket($this->_ticket, self::getURL())) {
return new Zend_Auth_Result(
Zend_Auth_Result::SUCCESS,
$id,
array("Authentication successful"));
} else {
return new Zend_Auth_Result(
Zend_Auth_Result::FAILURE,
null,
array("Authentication failed"));
}
}
/**
* Returns the current URL without CAS affecting parameters.
* Copied directly from SimpleCAS.php 0.1.0
*
* @return string url
*/
static public function getURL()
{
if (isset($_SERVER['HTTPS'])
&& !empty($_SERVER['HTTPS'])
&& $_SERVER['HTTPS'] == 'on') {
$protocol = 'https';
} else {
$protocol = 'http';
}
$url = $protocol.'://'.$_SERVER['SERVER_NAME'].$_SERVER['REQUEST_URI'];
$replacements = array('/\?logout/' => '',
'/&ticket=[^&]*/' => '',
'/\?ticket=[^&;]*/' => '?',
'/\?%26/' => '?',
'/\?&/' => '?',
'/\?$/' => '');
$url = preg_replace(array_keys($replacements),
array_values($replacements), $url);
return $url;
}
/**
* Returns the URL to login form on the CAS server.
*
* @return string
*/
public function getLoginURL()
{
return $this->_protocol->getLoginURL(self::getURL());
}
}
<?php
ini_set('display_errors', true);
chdir(dirname(dirname(dirname(__FILE__))));
require_once 'SimpleCAS/Autoload.php';
require_once 'HTTP/Request2.php';
$options = array('hostname' =>'login.unl.edu',
'port' => 443,
'uri' => 'cas');
$protocol = new SimpleCAS_Protocol_Version2($options);
$protocol->getRequest()->setConfig('ssl_verify_peer', false);
$client = SimpleCAS::client($protocol);
$client->forceAuthentication();
if (isset($_GET['logout'])) {
$client->logout();
}
if ($client->isAuthenticated()) {
echo '<h1>Authentication Successful!</h1>';
echo '<p>The user\'s login is '.$client->getUsername().'</p>';
}
?>
<a href="?logout">Logout</a>
\ No newline at end of file
<?php
ini_set('display_errors', true);
error_reporting(E_ALL);
chdir(dirname(__FILE__).'/../../');
require_once 'UNL/Auth.php';
//$auth = UNL_Auth::PEARFactory('CAS', $options=null, $loginfunction=null, false);
$auth = UNL_Auth::PEARFactory('CAS');
$auth->start();
if (isset($_GET['logout']) && $auth->checkAuth()) {
$auth->logout();
$auth->start();
}
if ($auth->checkAuth()) {
/*
* The output of your site goes here.
*/
echo 'You are authenticated, '.$auth->getUsername().'<br />';
echo '<a href="?logout">Logout</a>';
} else {
echo 'You need to log in bro!';
}
?>
\ No newline at end of file
<?php
ini_set('display_errors', true);
error_reporting(E_ALL);
chdir(dirname(__FILE__).'/../../');
require_once 'UNL/Auth.php';
$auth = UNL_Auth::factory('CAS');
if (isset($_GET['login'])) {
$auth->login();
} elseif (isset($_GET['logout'])) {
$auth->logout();
}
if (!$auth->isLoggedIn()) {
// Could call $auth->login() here to get the party started.
echo "You are not logged in.\n<br />\n";
echo '<a href="?login=true">Click here to log in!</a>';
} else {
echo "You are logged in as {$auth->getUser()}<br />";
echo "<a href='?logout'>logout</a>";
}
<?php
ini_set('display_errors', true);
error_reporting(E_ALL);
chdir(dirname(__FILE__).'/../../');
require_once 'UNL/Auth.php';
$auth = UNL_Auth::factory('SimpleCAS');
if (isset($_GET['login'])) {
$auth->login();
} elseif (isset($_GET['logout'])) {
$auth->logout();
}
if (!$auth->isLoggedIn()) {
// Could call $auth->login() here to get the party started.
echo "You are not logged in.\n<br />\n";
echo '<a href="?login=true">Click here to log in!</a>';
} else {
echo "You are logged in as {$auth->getUser()}<br />";
echo "<a href='?logout'>logout</a>";
}
\ No newline at end of file
<?php
ini_set('display_errors', true);
error_reporting(E_ALL);
chdir(dirname(__FILE__).'/../../');
require_once 'UNL/Auth.php';
require_once 'Zend/Auth.php';
$auth = Zend_Auth::getInstance();
$authAdapter = UNL_Auth::ZendFactory('SimpleCAS');
if (!$auth->hasIdentity()) {
$result = $auth->authenticate($authAdapter);
if (!$result->isValid()) {
// Authentication failed; print the reasons why
foreach ($result->getMessages() as $message) {
echo "$message\n";
}
} else {
// Authentication succeeded; the identity ($username) is stored
// in the session
// $result->getIdentity() === $auth->getIdentity()
echo 'Hello '.$result->getIdentity();
}
} else {
echo 'Hello@';
}
File added
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment