cvs: pear /Perm_LiveUser/Admin/Perm DB_Common.php MDB_Common.php
| From: | Arnaud Limbourg | Date: | Thu, 04 Dec 2003 21:00:56 +0000 |
| Subject: | cvs: pear /Perm_LiveUser/Admin/Perm DB_Common.php MDB_Common.php | ||
| Groups: | php.pear.cvs | ||
| Request: | Send a blank email to pear-cvs+get-14620@lists.php.net to get a copy of this message | ||
arnaud Thu Dec 4 16:00:56 2003 EDT
Modified files:
/pear/Perm_LiveUser/Admin/Perm DB_Common.php MDB_Common.php
Log:
* new method closing #348
Index: pear/Perm_LiveUser/Admin/Perm/DB_Common.php
diff -u pear/Perm_LiveUser/Admin/Perm/DB_Common.php:1.36
pear/Perm_LiveUser/Admin/Perm/DB_Common.php:1.37
--- pear/Perm_LiveUser/Admin/Perm/DB_Common.php:1.36 Thu Dec 4 15:34:30 2003
+++ pear/Perm_LiveUser/Admin/Perm/DB_Common.php Thu Dec 4 16:00:56 2003
@@ -33,7 +33,7 @@
* DB based containers used to maintain
* the permission database.
*
- * @version $Id: DB_Common.php,v 1.36 2003/12/04 20:34:30 arnaud Exp $
+ * @version $Id: DB_Common.php,v 1.37 2003/12/04 21:00:56 arnaud Exp $
* @package LiveUser
*/
class LiveUser_Admin_Perm_DB_Common extends LiveUser_Admin_Perm_Common
@@ -1048,6 +1048,38 @@
}
/**
+ * Updates auth_user_id in the mapping table.
+ *
+ * @access public
+ * @param mixed new Auth user ID of the user that should be updated
+ * @param int perm_user_id of the user
+ * @return mixed true or DB Error object or false if there was an error
+ * to begin with
+ */
+ function updateAuthUserId($authId, $permId)
+ {
+ if (!$this->init_ok) {
+ return false;
+ }
+
+ $query = '
+ UPDATE
+ ' . $this->prefix . 'perm_users
+ SET
+ auth_user_id=' . $this->dbc->quote($authId) . '
+ WHERE
+ perm_user_id=' . $this->dbc->quote($permId);
+
+ $result = $this->dbc->query($query);
+
+ if (DB::isError($result)) {
+ return $result;
+ }
+
+ return true;
+ }
+
+ /**
* Delete user
*
* @access public
Index: pear/Perm_LiveUser/Admin/Perm/MDB_Common.php
diff -u pear/Perm_LiveUser/Admin/Perm/MDB_Common.php:1.21
pear/Perm_LiveUser/Admin/Perm/MDB_Common.php:1.22
--- pear/Perm_LiveUser/Admin/Perm/MDB_Common.php:1.21 Thu Dec 4 15:34:30 2003
+++ pear/Perm_LiveUser/Admin/Perm/MDB_Common.php Thu Dec 4 16:00:56 2003
@@ -33,7 +33,7 @@
* MDB based containers used to maintain
* the permission database.
*
- * @version $Id: MDB_Common.php,v 1.21 2003/12/04 20:34:30 arnaud Exp $
+ * @version $Id: MDB_Common.php,v 1.22 2003/12/04 21:00:56 arnaud Exp $
* @package LiveUser
*/
class LiveUser_Admin_Perm_MDB_Common extends LiveUser_Admin_Perm_Common
@@ -1047,6 +1047,38 @@
}
/**
+ * Updates auth_user_id in the mapping table.
+ *
+ * @access public
+ * @param mixed new Auth user ID of the user that should be updated
+ * @param int perm_user_id of the user
+ * @return mixed true or DB Error object or false if there was an error
+ * to begin with
+ */
+ function updateAuthUserId($authId, $permId)
+ {
+ if (!$this->init_ok) {
+ return false;
+ }
+
+ $query = '
+ UPDATE
+ ' . $this->prefix . 'perm_users
+ SET
+ auth_user_id=' . $this->dbc->getTextValue($authId) . '
+ WHERE
+ perm_user_id=' . $this->dbc->getIntegerValue($permId);
+
+ $result = $this->dbc->query($query);
+
+ if (DB::isError($result)) {
+ return $result;
+ }
+
+ return true;
+ }
+
+ /**
* Delete user
*
* @access public