cvs: pear /Perm_LiveUser/docs/examples/example4 conf.php index.html main.inc.php news_change.php news_new.php news_view.php

From: Date: Wed, 28 Apr 2004 18:58:45 +0000
Subject: cvs: pear /Perm_LiveUser/docs/examples/example4 conf.php index.html main.inc.php news_change.php news_new.php news_view.php
Groups: php.pear.cvs 
Request: Send a blank email to pear-cvs+get-18898@lists.php.net to get a copy of this message
arnaud Wed Apr 28 14:58:45 2004 EDT Added files: /pear/Perm_LiveUser/docs/examples/example4 conf.php Removed files: /pear/Perm_LiveUser/docs/examples/example4 main.inc.php Modified files: /pear/Perm_LiveUser/docs/examples/example4 index.html news_change.php news_new.php news_view.php Log: * for the sake of consistency renaming main.inc.php to conf.php to follow example2

http://cvs.php.net/diff.php/pear/Perm_LiveUser/docs/examples/example4/index.html?r1=1.5&r2=1.6&ty=u Index: pear/Perm_LiveUser/docs/examples/example4/index.html diff -u pear/Perm_LiveUser/docs/examples/example4/index.html:1.5 pear/Perm_LiveUser/docs/examples/example4/index.html:1.6 --- pear/Perm_LiveUser/docs/examples/example4/index.html:1.5 Mon Apr 26 20:33:47 2004 +++ pear/Perm_LiveUser/docs/examples/example4/index.html Wed Apr 28 14:58:45 2004 @@ -37,7 +37,7 @@ <p>To set this up follow these steps:</p> <ol> <li>Copy the files in this directory into your web root.</li> - <li>Configure your DSN and the PEAR path in the main.inc.php.</li> + <li>Configure your DSN and the PEAR path in the conf.php.</li> <li>Set up a test database by importing demodata.sql + perm_db.sql (/misc/schema).</li> </ol> <p>If you want to test this example in your local path with out installing LiveUser in PEAR on @@ -79,4 +79,4 @@ <p>&nbsp;</p> <p>&nbsp;</p> </body> -</html> \ No newline at end of file +</html> http://cvs.php.net/diff.php/pear/Perm_LiveUser/docs/examples/example4/news_change.php?r1=1.5&r2=1.6&ty=u Index: pear/Perm_LiveUser/docs/examples/example4/news_change.php diff -u pear/Perm_LiveUser/docs/examples/example4/news_change.php:1.5 pear/Perm_LiveUser/docs/examples/example4/news_change.php:1.6 --- pear/Perm_LiveUser/docs/examples/example4/news_change.php:1.5 Thu Apr 22 09:18:14 2004 +++ pear/Perm_LiveUser/docs/examples/example4/news_change.php Wed Apr 28 14:58:45 2004 @@ -1,6 +1,6 @@ <?php // CREATING ENVIRONMENT - require_once 'main.inc.php'; + require_once 'conf.php'; // If the user hasn't the right to change news -> access denied. if (!$LU->checkRight(RIGHT_NEWS_CHANGE)) { @@ -185,4 +185,4 @@ include_once 'finish.inc.php'; -?> \ No newline at end of file +?> http://cvs.php.net/diff.php/pear/Perm_LiveUser/docs/examples/example4/news_new.php?r1=1.6&r2=1.7&ty=u Index: pear/Perm_LiveUser/docs/examples/example4/news_new.php diff -u pear/Perm_LiveUser/docs/examples/example4/news_new.php:1.6 pear/Perm_LiveUser/docs/examples/example4/news_new.php:1.7 --- pear/Perm_LiveUser/docs/examples/example4/news_new.php:1.6 Mon Apr 26 20:35:18 2004 +++ pear/Perm_LiveUser/docs/examples/example4/news_new.php Wed Apr 28 14:58:45 2004 @@ -1,6 +1,6 @@ <?php // CREATING ENVIRONMENT - require_once 'main.inc.php'; + require_once 'conf.php'; // If the user hasn't the right to write news -> access denied. if (!$LU->checkRight(RIGHT_NEWS_NEW)) { http://cvs.php.net/diff.php/pear/Perm_LiveUser/docs/examples/example4/news_view.php?r1=1.3&r2=1.4&ty=u Index: pear/Perm_LiveUser/docs/examples/example4/news_view.php diff -u pear/Perm_LiveUser/docs/examples/example4/news_view.php:1.3 pear/Perm_LiveUser/docs/examples/example4/news_view.php:1.4 --- pear/Perm_LiveUser/docs/examples/example4/news_view.php:1.3 Thu Apr 22 09:18:14 2004 +++ pear/Perm_LiveUser/docs/examples/example4/news_view.php Wed Apr 28 14:58:45 2004 @@ -1,6 +1,6 @@ <?php // CREATING ENVIRONMENT -require_once 'main.inc.php'; +require_once 'conf.php'; $tpl->loadTemplatefile('news_view.tpl.php'); @@ -33,4 +33,4 @@ } include_once 'finish.inc.php'; -?> \ No newline at end of file +?> http://cvs.php.net/co.php/pear/Perm_LiveUser/docs/examples/example4/conf.php?r=1.1&p=1 Index: pear/Perm_LiveUser/docs/examples/example4/conf.php +++ pear/Perm_LiveUser/docs/examples/example4/conf.php <?php define('EMAIL_WEBMASTER', 'krausbn@php.net'); // PEAR path //$path_to_liveuser_dir = 'path/to/pear/'.PATH_SEPARATOR; //ini_set('include_path', $path_to_liveuser_dir.ini_get('include_path')); error_reporting(E_ALL ^ E_NOTICE); function php_error_handler($errno, $errstr, $errfile, $errline) { include_once 'HTML/Template/IT.php'; $tpl = new HTML_Template_IT(); $tpl->loadTemplatefile('error-page.tpl.php'); $tpl->setVariable('error_msg', "<b>$errfile ($errline)</b><br />$errstr"); $tpl->show(); exit(); } set_error_handler('php_error_handler'); require_once 'PEAR.php'; function pear_error_handler($err_obj) { $error_string = $err_obj->getMessage() . '<br />' . $err_obj->getUserinfo(); trigger_error($error_string, E_USER_ERROR); } PEAR::setErrorHandling(PEAR_ERROR_CALLBACK, 'pear_error_handler'); function showLoginForm($liveUserObj = false) { include_once 'HTML/Template/IT.php'; $tpl = new HTML_Template_IT(); $tpl->loadTemplatefile('loginform.tpl.php'); $tpl->setVariable('form_action', $_SERVER['PHP_SELF']); if (is_object($liveUserObj)) { if ($liveUserObj->status) { switch ($liveUserObj->status) { case LIVEUSER_STATUS_ISINACTIVE: $tpl->touchBlock('inactive'); break; case LIVEUSER_STATUS_IDLED: $tpl->touchBlock('idled'); break; case LIVEUSER_STATUS_EXPIRED: $tpl->touchBlock('expired'); break; default: $tpl->touchBlock('failure'); break; } } } $tpl->show(); exit(); } require_once 'DB.php'; // Data Source Name (DSN) $myDB = array('host' => 'localhost', 'type' => 'mysql', 'name' => 'pear_test', 'user' => 'user', 'pwd' => 'pass' ); $dsn = $myDB['type'] . '://' . $myDB['user'] . ':' . $myDB['pwd'] . '@' . $myDB['host'] . '/' . $myDB['name']; $db =& DB::connect($dsn, true); $db->setFetchMode(DB_FETCHMODE_ASSOC); require_once 'HTML/Template/IT.php'; $tpl = new HTML_Template_IT(); require_once 'LiveUser.php'; $LUOptions = array('autoInit' => true, 'login' => array('function' => 'showLoginForm', 'force' => true), 'logout' => array( 'trigger' => 'logout', 'redirect' => '', 'destroy' => true, 'method' => 'get', 'function' => '' ), 'authContainers' => array(array('type' => 'DB', 'connection' => $db, 'loginTimeout' => 0, 'expireTime' => 3600, 'idleTime' => 1800, 'allowDuplicateHandles' => 0, 'authTable' => 'liveuser_users', 'authTableCols' => array('user_id' => 'auth_user_id', 'handle' => 'handle', 'passwd' => 'passwd', 'lastlogin' => 'lastlogin', 'is_active' => 'is_active' ) ) ), 'permContainer' => array('type' => 'DB_Complex', 'connection' => $db, 'prefix' => 'liveuser_') ); $LU = LiveUser::factory($LUOptions); define('AREA_NEWS', 1); define('RIGHT_NEWS_NEW', 1); define('RIGHT_NEWS_CHANGE', 2); define('RIGHT_NEWS_DELETE', 3); ?>
« previous php.pear.cvs (#18898) next »