cvs: pear /Perm_LiveUser/Admin/Perm/Container DB_Complex.php MDB_Complex.php
| From: | Arnaud Limbourg | Date: | Wed, 10 Dec 2003 13:03:47 +0000 |
| Subject: | cvs: pear /Perm_LiveUser/Admin/Perm/Container DB_Complex.php MDB_Complex.php | ||
| Groups: | php.pear.cvs | ||
| Request: | Send a blank email to pear-cvs+get-14753@lists.php.net to get a copy of this message | ||
arnaud Wed Dec 10 08:03:47 2003 EDT
Modified files:
/pear/Perm_LiveUser/Admin/Perm/Container DB_Complex.php
MDB_Complex.php
Log:
* fix for #384
* catch some more possible database errors
Index: pear/Perm_LiveUser/Admin/Perm/Container/DB_Complex.php
diff -u pear/Perm_LiveUser/Admin/Perm/Container/DB_Complex.php:1.31
pear/Perm_LiveUser/Admin/Perm/Container/DB_Complex.php:1.32
--- pear/Perm_LiveUser/Admin/Perm/Container/DB_Complex.php:1.31 Mon Dec 8 17:17:58 2003
+++ pear/Perm_LiveUser/Admin/Perm/Container/DB_Complex.php Wed Dec 10 08:03:47 2003
@@ -45,7 +45,7 @@
* @author Christian Dickmann <dickmann@php.net>
* @author Markus Wolff <wolff@21st.de>
* @author Matt Scifo <mscifo@php.net>
- * @version $Id: DB_Complex.php,v 1.31 2003/12/08 22:17:58 lsmith Exp $
+ * @version $Id: DB_Complex.php,v 1.32 2003/12/10 13:03:47 arnaud Exp $
* @package LiveUser
*/
class LiveUser_Admin_Perm_Container_DB_Complex extends LiveUser_Admin_Perm_Container_DB_Medium
@@ -307,7 +307,11 @@
};
// Update implied status
- $this->_updateImpliedStatus($right_id);
+ $res = $this->_updateImpliedStatus($right_id);
+
+ if (DB::isError($res)) {
+ return $res;
+ };
// Job done ...
return true;
@@ -335,7 +339,11 @@
};
// Update implied status
- $this->_updateImpliedStatus($right_id);
+ $res = $this->_updateImpliedStatus($right_id);
+
+ if (DB::isError($res)) {
+ return $res;
+ };
// Job done ...
return true;
@@ -382,6 +390,40 @@
}
/**
+ * Override metjod to delete implied rights mapping.
+ *
+ * @access public
+ * @param int right identifier
+ * @return mixed true on success on DB error
+ */
+ function removeRight($right_id)
+ {
+ Parent::removeRight($right_id);
+
+ // delete from implied_rights unimply rights
+ $query = 'DELETE FROM
+ ' . $this->prefix . 'right_implied
+ WHERE
+ right_id = ' . (int)$right_id;
+
+ $result = $this->dbc->query($query);
+
+ if (DB::isError($result)) {
+ return $result;
+ };
+
+ // Update implied status
+ $res = $this->_updateImpliedStatus($right_id);
+
+ if (DB::isError($res)) {
+ return $res;
+ };
+
+ return true;
+ }
+
+
+ /**
* Add User to Group
*
* @access public
Index: pear/Perm_LiveUser/Admin/Perm/Container/MDB_Complex.php
diff -u pear/Perm_LiveUser/Admin/Perm/Container/MDB_Complex.php:1.20
pear/Perm_LiveUser/Admin/Perm/Container/MDB_Complex.php:1.21
--- pear/Perm_LiveUser/Admin/Perm/Container/MDB_Complex.php:1.20 Mon Dec 8 17:17:58 2003
+++ pear/Perm_LiveUser/Admin/Perm/Container/MDB_Complex.php Wed Dec 10 08:03:47 2003
@@ -45,7 +45,7 @@
* @author Christian Dickmann <dickmann@php.net>
* @author Markus Wolff <wolff@21st.de>
* @author Matt Scifo <mscifo@php.net>
- * @version $Id: MDB_Complex.php,v 1.20 2003/12/08 22:17:58 lsmith Exp $
+ * @version $Id: MDB_Complex.php,v 1.21 2003/12/10 13:03:47 arnaud Exp $
* @package LiveUser
*/
class LiveUser_Admin_Perm_Container_MDB_Complex extends LiveUser_Admin_Perm_Container_MDB_Medium
@@ -308,7 +308,11 @@
};
// Update implied status
- $this->_updateImpliedStatus($right_id);
+ $res = $this->_updateImpliedStatus($right_id);
+
+ if (MDB::isError($res)) {
+ return $res;
+ };
// Job done ...
return true;
@@ -336,7 +340,11 @@
};
// Update implied status
- $this->_updateImpliedStatus($right_id);
+ $res = $this->_updateImpliedStatus($right_id);
+
+ if (MDB::isError($res)) {
+ return $res;
+ };
// Job done ...
return true;
@@ -383,6 +391,39 @@
}
/**
+ * Override metjod to delete implied rights mapping.
+ *
+ * @access public
+ * @param int right identifier
+ * @return mixed true on success on DB error
+ */
+ function removeRight($right_id)
+ {
+ Parent::removeRight($right_id);
+
+ // delete from implied_rights unimply rights
+ $query = 'DELETE FROM
+ ' . $this->prefix . 'right_implied
+ WHERE
+ right_id = ' . $this->dbc->getValue('integer', $right_id);
+
+ $result = $this->dbc->query($query);
+
+ if (MDB::isError($result)) {
+ return $result;
+ };
+
+ // Update implied status
+ $res = $this->_updateImpliedStatus($right_id);
+
+ if (MDB::isError($res)) {
+ return $res;
+ };
+
+ return true;
+ }
+
+ /**
* Get list of all groups
*
* This method accepts the following options...