cvs: pear /LiveUser/docs/examples/example4 conf.php
| From: | Lukas Smith | Date: | Mon, 14 Mar 2005 16:25:53 +0000 |
| Subject: | cvs: pear /LiveUser/docs/examples/example4 conf.php | ||
| Groups: | php.pear.cvs | ||
| Request: | Send a blank email to pear-cvs+get-30275@lists.php.net to get a copy of this message | ||
lsmith Mon Mar 14 11:25:53 2005 EDT
Modified files:
/pear/LiveUser/docs/examples/example4 conf.php
Log:
- fixed auth container field names to match defaults in install.php
- updated observer code to Event_Dispatch
http://cvs.php.net/diff.php/pear/LiveUser/docs/examples/example4/conf.php?r1=1.11&r2=1.12&ty=u
Index: pear/LiveUser/docs/examples/example4/conf.php
diff -u pear/LiveUser/docs/examples/example4/conf.php:1.11
pear/LiveUser/docs/examples/example4/conf.php:1.12
--- pear/LiveUser/docs/examples/example4/conf.php:1.11 Wed Feb 16 07:32:06 2005
+++ pear/LiveUser/docs/examples/example4/conf.php Mon Mar 14 11:25:52 2005
@@ -62,13 +62,13 @@
'authTable' => 'liveuser_users',
'authTableCols' => array(
'required' => array(
- 'auth_user_id' => array('name' =>
'auth_user_id', 'type' => 'text'),
+ 'auth_user_id' => array('name' =>
'authUserId', 'type' => 'text'),
'handle' => array('name' =>
'handle', 'type' => 'text'),
'passwd' => array('name' =>
'passwd', 'type' => 'text'),
),
'optional' => array(
- 'lastlogin' => array('name' =>
'lastlogin', 'type' => 'timestamp'),
- 'is_active' => array('name' =>
'is_active', 'type' => 'boolean')
+ 'lastlogin' => array('name' =>
'lastLogin', 'type' => 'timestamp'),
+ 'is_active' => array('name' =>
'isActive', 'type' => 'boolean')
),
),
),
@@ -90,16 +90,17 @@
require_once 'LiveUser.php';
-function showLoginForm(&$liveUserObj)
+function showLoginForm(&$notification)
{
$tpl = new HTML_Template_IT();
$tpl->loadTemplatefile('loginform.tpl.php');
$tpl->setVariable('form_action', $_SERVER['PHP_SELF']);
+ $liveUserObj =& $notification->getNotificationObject();
if (is_object($liveUserObj)) {
- if ($liveUserObj->status) {
- switch ($liveUserObj->status) {
+ if ($liveUserObj->getStatus()) {
+ switch ($liveUserObj->getStatus()) {
case LIVEUSER_STATUS_ISINACTIVE:
$tpl->touchBlock('inactive');
break;
@@ -123,8 +124,7 @@
// Create new LiveUser (LiveUser) object.
// We´ll only use the auth container, permissions are not used.
$LU =& LiveUser::factory($LUOptions);
-$function = 'showLoginForm';
-$LU->attachObserver($function, 'forceLogin');
+$LU->dispatcher->addObserver('showLoginForm', 'forceLogin');
$username = (isset($_REQUEST['username'])) ? $_REQUEST['username'] : null;
$password = (isset($_REQUEST['password'])) ? $_REQUEST['password'] : null;