From bff6f66ca0f76f5486ee7efc7fc6ed4d9157f14e Mon Sep 17 00:00:00 2001 From: steinm Date: Fri, 7 Oct 2011 16:15:08 +0000 Subject: [PATCH] - added function getManagers() --- LetoDMS_Core/Core/inc.ClassGroup.php | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) diff --git a/LetoDMS_Core/Core/inc.ClassGroup.php b/LetoDMS_Core/Core/inc.ClassGroup.php index a7246e356..85d88d12d 100644 --- a/LetoDMS_Core/Core/inc.ClassGroup.php +++ b/LetoDMS_Core/Core/inc.ClassGroup.php @@ -103,6 +103,25 @@ class LetoDMS_Core_Group { return $this->_users; } /* }}} */ + function getManagers() { /* {{{ */ + $db = $this->_dms->getDB(); + + $queryStr = "SELECT `tblUsers`.* FROM `tblUsers` ". + "LEFT JOIN `tblGroupMembers` ON `tblGroupMembers`.`userID`=`tblUsers`.`id` ". + "WHERE `tblGroupMembers`.`groupID` = '". $this->_id ."' AND tblGroupMembers.manager = 1"; + $resArr = $db->getResultArray($queryStr); + if (is_bool($resArr) && $resArr == false) + return false; + + $managers = array(); + + foreach ($resArr as $row) { + $user = new LetoDMS_Core_User($row["id"], $row["login"], $row["pwd"], $row["fullName"], $row["email"], $row["language"], $row["theme"], $row["comment"], $row["role"], $row['hidden']); + array_push($managers, $user); + } + return $managers; + } /* }}} */ + function addUser($user,$asManager=false) { /* {{{ */ $db = $this->_dms->getDB();