cvs: pear /Perm_LiveUser/docs/examples/admin_example/MDB2 admin_example_mdb2.php

From: Date: Mon, 07 Jun 2004 13:54:04 +0000
Subject: cvs: pear /Perm_LiveUser/docs/examples/admin_example/MDB2 admin_example_mdb2.php
Groups: php.pear.cvs 
Request: Send a blank email to pear-cvs+get-20302@lists.php.net to get a copy of this message
lsmith Mon Jun 7 09:54:04 2004 EDT Modified files: /pear/Perm_LiveUser/docs/examples/admin_example/MDB2 admin_example_mdb2.php Log: - fixed Admin.php include . added truncate to prevent multiple inserts to break things (due to change in liveuser_users perm key) - updated custom field handling http://cvs.php.net/diff.php/pear/Perm_LiveUser/docs/examples/admin_example/MDB2/admin_example_mdb2.php?r1=1.1&r2=1.2&ty=u Index: pear/Perm_LiveUser/docs/examples/admin_example/MDB2/admin_example_mdb2.php diff -u pear/Perm_LiveUser/docs/examples/admin_example/MDB2/admin_example_mdb2.php:1.1 pear/Perm_LiveUser/docs/examples/admin_example/MDB2/admin_example_mdb2.php:1.2 --- pear/Perm_LiveUser/docs/examples/admin_example/MDB2/admin_example_mdb2.php:1.1 Fri Apr 23 00:27:03 2004 +++ pear/Perm_LiveUser/docs/examples/admin_example/MDB2/admin_example_mdb2.php Mon Jun 7 09:54:04 2004 @@ -1,13 +1,19 @@ <?php require_once 'config_mdb2.inc.php'; -require_once 'LiveUser/Admin/Admin.php'; +require_once 'LiveUser/Admin.php'; $admin = new LiveUser_Admin($conf, 'FR'); + +$admin->perm->dbc->query('TRUNCATE liveuser_perm_users'); +$admin->perm->dbc->query('TRUNCATE liveuser_perm_users_seq'); +$admin->auth->dbc->query('TRUNCATE liveuser_users'); +$admin->auth->dbc->query('TRUNCATE liveuser_users_seq'); + $custom = array( - array('name' => 'name', 'value' => 'asdfMDB22', 'type' => 'text'), - array('name' => 'email', 'value' => 'fleh@example.comMDB23', 'type' => 'text') + 'name' => array('value' => 'asdfMDB22', 'type' => 'text'), + 'email' => array('value' => 'fleh@example.comMDB23', 'type' => 'text') ); -$user_id = $admin->addUser('johndoe', 'dummypass', true, null, null, null, $custom); +$user_id = $admin->addUser('johndoe', 'dummypass', null, true, null, null, null, $custom); echo 'Created User Id ' . $user_id . '<br />'; if ($user_id > 2) { @@ -17,16 +23,16 @@ if ($user_id > 1) { $custom = array( - array('name' => 'name', 'value' => 'asdfMDBUpdated22', 'type' => 'text'), - array('name' => 'email', 'value' => 'fleh@example.comMDBUpdated22', 'type' => 'text') + 'name' => array('value' => 'asdfMDBUpdated22', 'type' => 'text'), + 'email' => array('value' => 'fleh@example.comMDBUpdated22', 'type' => 'text') ); - $admin->updateUser($user_id, 'johndoe', 'dummypass', true, null, null, $custom); + $admin->updateUser($user_id, 'johndoe', 'dummypass', null, true, null, null, $custom); echo 'Updated User Id ' . ($user_id - 1) . '<br />'; } $custom = array( - array('name' => 'name', 'type' => 'text'), - array('name' => 'email', 'type' => 'text') + 'name' => 'text', + 'email' => 'text', ); $foo = $admin->getUser($user_id, $custom); if (empty($foo)) { @@ -37,13 +43,13 @@ echo '<br />'; $cols = array( - array('name' => 'name', 'type' => 'text'), - array('name' => 'email', 'type' => 'text') + 'name' => 'text', + 'email' => 'text', ); $filters = array( 'email' => array('op' => '=', 'value' => 'fleh@example.comMDBUpdated22', 'cond' => 'AND', 'type' => 'text'), - 'name' => array('op' => '=', 'value' => 'asdfMDBUpdated22', 'cond' => '', 'type' => 'text') + 'name' => array('op' => '=', 'value' => 'asdfMDBUpdated22', 'cond' => '', 'type' => 'text') ); $foo1 = $admin->searchUsers($filters, $cols); echo 'These Users were found: <br />';

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