cvs: pear /Perm_LiveUser/Admin Admin.php
| From: | Lukas Smith | Date: | Mon, 07 Jun 2004 13:53:09 +0000 |
| Subject: | cvs: pear /Perm_LiveUser/Admin Admin.php | ||
| Groups: | php.pear.cvs | ||
| Request: | Send a blank email to pear-cvs+get-20301@lists.php.net to get a copy of this message | ||
lsmith Mon Jun 7 09:53:09 2004 EDT
Modified files:
/pear/Perm_LiveUser/Admin Admin.php
Log:
- fixed bug #1560
- updated custom field handling
http://cvs.php.net/diff.php/pear/Perm_LiveUser/Admin/Admin.php?r1=1.26&r2=1.27&ty=u
Index: pear/Perm_LiveUser/Admin/Admin.php
diff -u pear/Perm_LiveUser/Admin/Admin.php:1.26 pear/Perm_LiveUser/Admin/Admin.php:1.27
--- pear/Perm_LiveUser/Admin/Admin.php:1.26 Sun May 16 12:34:37 2004
+++ pear/Perm_LiveUser/Admin/Admin.php Mon Jun 7 09:53:08 2004
@@ -88,7 +88,7 @@
* @author Lukas Smith
* @author Arnaud Limbourg
* @author Helgi Þormar Þorbjörnsson
- * @version $Id: Admin.php,v 1.26 2004/05/16 16:34:37 dufuz Exp $
+ * @version $Id: Admin.php,v 1.27 2004/06/07 13:53:08 lsmith Exp $
* @package LiveUser
*/
class LiveUser_Admin
@@ -385,8 +385,8 @@
* usage example for addUser:
* <code>
* $custom = array(
- * array('name' => 'name', 'value' =>
'asdf', 'type' => 'text'),
- * array('name' => 'email', 'value' =>
'fleh@example.com', 'type' => 'text')
+ * 'name' => array('value' => 'asdf',
'type' => 'text'),
+ * 'email' => array('value' => 'fleh@example.com',
'type' => 'text')
* );
* $user_id = $admin->addUser('johndoe', 'dummypass', true, null,
null, null, $custom);
* </code>
@@ -415,13 +415,7 @@
return $authId;
}
- $permId = $this->perm->addUser($authId, $this->authContainerName, $type);
-
- if (LiveUser::isError($permId)) {
- return $permId;
- }
-
- return $authId;
+ return $this->perm->addUser($authId, $this->authContainerName, $type);
}
return LiveUser::raiseError(LIVEUSER_ERROR, null, null,
'Perm or Auth container couldn\t be started.');
@@ -436,8 +430,8 @@
* usage example for updateUser:
* <code>
* $custom = array(
- * array('name' => 'name', 'value' =>
'asdfUpdated', 'type' => 'text'),
- * array('name' => 'email', 'value' =>
'fleh@example.comUpdated', 'type' => 'text')
+ * 'name' => array('value' => 'asdfUpdated',
'type' => 'text'),
+ * 'email' => array('value' =>
'fleh@example.comUpdated', 'type' => 'text')
* );
* $admin->updateUser($user_id, 'johndoe', 'dummypass', true, null,
null, $custom);
* </code>
@@ -455,8 +449,8 @@
* @param array Array of custom fields to be updated
* @return mixed error object or true
*/
- function updateUser($permId, $handle, $password, $type = null, $active = true, $owner_user_id =
null,
- $owner_group_id = null, $customFields = array())
+ function updateUser($permId, $handle, $password, $type = null, $active = true
+ , $owner_user_id = null, $owner_group_id = null, $customFields = array())
{
if (is_object($this->auth) && is_object($this->perm)) {
$authData = $this->perm->getAuthUserId($permId);
@@ -468,13 +462,7 @@
return $auth;
}
- $perm = $this->perm->updateUser($permId, $authId, $this->authContainerName,
$type);
-
- if (LiveUser::isError($perm)) {
- return $perm;
- }
-
- return true;
+ return $this->perm->updateUser($permId, $authId, $this->authContainerName,
$type);
}
return LiveUser::raiseError(LIVEUSER_ERROR, null, null,
'Perm or Auth container couldn\t be started.');
@@ -492,25 +480,19 @@
function removeUser($permId)
{
if (is_object($this->auth) && is_object($this->perm)) {
- $result = $this->perm->removeUser($permId);
-
- if (LiveUser::isError($result)) {
- return $result;
- }
-
$authData = $this->perm->getAuthUserId($permId);
- if (LiveUser::isError($result)) {
- return $result;
+ if (LiveUser::isError($authData)) {
+ return $authData;
}
- $result->auth->removeUser($authData['auth_user_id']);
+ $result = $this->auth->removeUser($authData['auth_user_id']);
if (LiveUser::isError($result)) {
return $result;
}
- return true;
+ return $this->perm->removeUser($permId);
}
return LiveUser::raiseError(LIVEUSER_ERROR, null, null,
'Perm or Auth container couldn\t be started.');
@@ -573,8 +555,8 @@
$type = '';
}
- $filters = array($user_auth_id =>
- array('op' => '=', 'value' => $userId,
'cond' => '', 'type' => $type)
+ $filters = array(
+ $user_auth_id => array('op' => '=', 'value'
=> $userId, 'cond' => '', 'type' => $type)
);
$search = $this->auth->getUsers($filters, $customFields);