cvs: pear /Perm_LiveUser/docs/examples/example2 conf.php example.php

From: Date: Sat, 24 Apr 2004 01:00:49 +0000
Subject: cvs: pear /Perm_LiveUser/docs/examples/example2 conf.php example.php
Groups: php.pear.cvs 
Request: Send a blank email to pear-cvs+get-18662@lists.php.net to get a copy of this message
dufuz Fri Apr 23 21:00:49 2004 EDT Modified files: /pear/Perm_LiveUser/docs/examples/example2 conf.php example.php Log: Small update http://cvs.php.net/diff.php/pear/Perm_LiveUser/docs/examples/example2/conf.php?r1=1.3&r2=1.4&ty=u Index: pear/Perm_LiveUser/docs/examples/example2/conf.php diff -u pear/Perm_LiveUser/docs/examples/example2/conf.php:1.3 pear/Perm_LiveUser/docs/examples/example2/conf.php:1.4 --- pear/Perm_LiveUser/docs/examples/example2/conf.php:1.3 Sun Mar 28 14:06:11 2004 +++ pear/Perm_LiveUser/docs/examples/example2/conf.php Fri Apr 23 21:00:49 2004 @@ -14,8 +14,16 @@ //$path_to_liveuser_dir = $_SERVER['DOCUMENT_ROOT'].'/PEAR/'.PATH_SEPARATOR; //ini_set('include_path', $path_to_liveuser_dir.ini_get('include_path')); -if (is_readable('Auth_XML.xml') && is_readable('Perm_XML.xml')) { +if (is_readable('Auth_XML.xml')) { + $xml_is_readable = false; +} +is_writable('Auth_XML.xml')) { + $xml_is_writable = false; +} +if ($xml_is_readable != false && $xml_is_writable != false) { $xml_is_readable = true; + $xml_is_writable = true; + $liveuserConfig = array( 'session' => array('name' => 'PHPSESSID','varname' => 'loginInfo'), 'login' => array('username' => 'handle', 'password' => 'passwd', 'function' => 'testLogin'), @@ -35,7 +43,7 @@ 'file' => 'Perm_XML.xml' ) ); -} else { - $xml_is_readable = false; + // Get LoginManager class definition + require_once 'LiveUser.php'; } ?> \ No newline at end of file http://cvs.php.net/diff.php/pear/Perm_LiveUser/docs/examples/example2/example.php?r1=1.6&r2=1.7&ty=u Index: pear/Perm_LiveUser/docs/examples/example2/example.php diff -u pear/Perm_LiveUser/docs/examples/example2/example.php:1.6 pear/Perm_LiveUser/docs/examples/example2/example.php:1.7 --- pear/Perm_LiveUser/docs/examples/example2/example.php:1.6 Thu Apr 22 09:18:15 2004 +++ pear/Perm_LiveUser/docs/examples/example2/example.php Fri Apr 23 21:00:49 2004 @@ -11,18 +11,16 @@ * This example is intended to be used with the Auth/XML and the Perm/XML_Simple driver. * * @author Björn Kraus <krausbn@php.net> - * @version $Id: example.php,v 1.6 2004/04/22 13:18:15 lsmith Exp $ + * @version $Id: example.php,v 1.7 2004/04/24 01:00:49 dufuz Exp $ **/ error_reporting(E_ALL); // Get LiveUser configuration array require_once 'conf.php'; -if ($xml_is_readable == false) { - die('<p style="color: red; text-align: center;">The XML file isn\'t readable. Add the right permissions to it and then try again.</p>'); +if ($xml_is_readable == false || $xml_is_writable == false) { + die('<p style="color: red; text-align: center;">The XML file isn\'t readable/writable. Add the right permissions to it and then try again.</p>'); } -// Get LoginManager class definition -require_once 'LiveUser.php'; // right definitions define('COOKING', 1); @@ -293,6 +291,10 @@ <p class="center"><a href="example.php?logout=1">Logout</a></p> <?php // Just some more debug output with no further relevance +echo '<hr />Handle:'; +print_r($LU->getProperty('handle')); +echo '<br />User Type:'; +print_r($LU->getProperty('userType')); echo '<hr /><pre>'; print_r($LU); echo '<hr />'; @@ -300,11 +302,6 @@ echo '<hr />'; print_r($_POST); echo '</pre>'; - -echo '<br />Handle:'; -print_r($LU->getProperty('handle')); -echo '<br />User Type:'; -print_r($LU->getProperty('userType')); ?> </body> </html> \ No newline at end of file

« previous php.pear.cvs (#18662) next »