require_once 'LiveUser/Admin.php'; $increment = time(); $admin = new LiveUser_Admin($conf, 'FR'); $custom = array('name' => 'asdfMDB22', 'email' => 'fleh@example.comMDB23'); $user_id = $admin->addUser('johndoe' . $increment, 'dummypass', null, true, null, null, null, $custom); echo 'Created Perm User Id ' . $user_id . '<br />'; if (MDB2::isError($user_id)) { var_dump($user_id); } if (!MDB2::isError($user_id) && $user_id > 2) { $echo_user_id = $user_id - 2; $admin->removeUser($echo_user_id); echo 'Removed Perm User Id ' . $echo_user_id . '<br />'; } if (!MDB2::isError($user_id) && $user_id > 1) { $custom = array('name' => 'asdfMDBUpdated22', 'email' => 'fleh@example.comMDBUpdated22'); $update_id = $user_id - 1; $admin->updateUser($update_id, 'johndoe' . $increment, 'dummypass', null, true, null, null, $custom); echo 'Updated Perm User Id ' . $update_id . '<br />'; } $foo = $admin->getUser($user_id); if (empty($foo)) { echo 'No user with that Perm ID was found ' . $user_id; } else { print_r($foo); } echo '<br />'; $filters = array('email' => array('name' => 'email', 'op' => '=', 'value' => 'fleh@example.comMDBUpdated22', 'cond' => 'AND', 'type' => 'text'), 'name' => array('name' => 'name', 'op' => '=', 'value' => 'asdfMDBUpdated22', 'cond' => '', 'type' => 'text')); $foo1 = $admin->searchUsers($filters); echo 'These Users were found: <br />'; print_r($foo1);
<?php require_once 'config.inc.php'; require_once 'LiveUser/Admin/Admin.php'; $admin = new LiveUser_Admin($conf, 'FR'); $custom = array(array('name' => 'name', 'value' => 'asdf', 'type' => 'text'), array('name' => 'email', 'value' => '*****@*****.**', 'type' => 'text')); $user_id = $admin->addUser('johndoe', 'dummypass', true, null, null, null, $custom); echo 'Created User Id ' . $user_id . '<br />'; if ($user_id > 2) { $admin->removeUser($user_id - 2); echo 'Removed User Id ' . ($user_id - 2) . '<br />'; } if ($user_id > 1) { $custom = array(array('name' => 'name', 'value' => 'asdfUpdated', 'type' => 'text'), array('name' => 'email', 'value' => '*****@*****.**', 'type' => 'text')); $admin->updateUser($user_id, 'johndoe', 'dummypass', true, null, null, $custom); echo 'Updated User Id ' . ($user_id - 1) . '<br />'; } $custom = array('name', 'email'); $foo = $admin->getUser($user_id, $custom); if (empty($foo)) { echo 'No user with that ID was found'; } else { print_r($foo); } echo '<br />'; $cols = array('name', 'email'); $filters = array('email' => array('op' => '=', 'value' => '*****@*****.**', 'cond' => 'AND'), 'name' => array('op' => '=', 'value' => 'asdfUpdated', 'cond' => '')); $foo1 = $admin->searchUsers($filters, $cols); echo 'These Users were found: <br />'; print_r($foo1);