Commit 40d9b7e260b887933686dc0c1d02f3daa2cac7d6
1 parent
e9055722
Use KTUtil::getId to handle either ID or object being passed in.
git-svn-id: https://kt-dms.svn.sourceforge.net/svnroot/kt-dms/trunk@3872 c91229c3-7414-0410-bfa2-8a42b809f60b
Showing
1 changed file
with
2 additions
and
1 deletions
lib/groups/Group.inc
| ... | ... | @@ -233,10 +233,11 @@ class Group extends KTEntity { |
| 233 | 233 | // {{{ hasMember |
| 234 | 234 | function hasMember($oUser) { |
| 235 | 235 | global $default; |
| 236 | + $iUserId = KTUtil::getId($oUser); | |
| 236 | 237 | |
| 237 | 238 | $sQuery = "SELECT COUNT(*) AS number_of_entries FROM $default->users_groups_table |
| 238 | 239 | WHERE group_id = ? AND user_id = ?"; |
| 239 | - $aParams = array($this->getID(), $oUser->getID()); | |
| 240 | + $aParams = array($this->getID(), $iUserId); | |
| 240 | 241 | $res = (int)DBUtil::getOneResultKey(array($sQuery, $aParams), "number_of_entries"); |
| 241 | 242 | if (PEAR::isError($res)) { |
| 242 | 243 | return $res; | ... | ... |