ILIAS  release_5-4 Revision v5.4.26-12-gabc799a52e6
class.ilGroupLP.php
Go to the documentation of this file.
1 <?php
2 
3 /* Copyright (c) 1998-2009 ILIAS open source, Extended GPL, see docs/LICENSE */
4 
5 include_once "Services/Object/classes/class.ilObjectLP.php";
6 
14 class ilGroupLP extends ilObjectLP
15 {
16  public static function getDefaultModes($a_lp_active)
17  {
18  if (!$a_lp_active) {
19  return array(
21  );
22  } else {
23  return array(
26  );
27  }
28  }
29 
30  public function getDefaultMode()
31  {
33  }
34 
35  public function getValidModes()
36  {
37  return array(
41  );
42  }
43 
44  public function getMembers($a_search = true)
45  {
46  include_once 'Modules/Group/classes/class.ilGroupParticipants.php';
47  $member_obj = ilGroupParticipants::_getInstanceByObjId($this->obj_id);
48  return $member_obj->getMembers();
49  }
50 
51  protected static function isLPMember(array &$a_res, $a_usr_id, $a_obj_ids)
52  {
53  global $DIC;
54 
55  $ilDB = $DIC['ilDB'];
56 
57  // will only find objects with roles for user!
58  // see ilParticipants::_getMembershipByType()
59  $query = " SELECT DISTINCT obd.obj_id, obd.type, obd2.title" .
60  " FROM rbac_ua ua" .
61  " JOIN rbac_fa fa ON (ua.rol_id = fa.rol_id)" .
62  " JOIN object_reference obr ON (fa.parent = obr.ref_id)" .
63  " JOIN object_data obd ON (obr.obj_id = obd.obj_id)" .
64  " JOIN object_data obd2 ON (ua.rol_id = obd2.obj_id)" .
65  " WHERE obd.type = " . $ilDB->quote("grp", "text") .
66  " AND fa.assign = " . $ilDB->quote("y", "text") .
67  " AND ua.usr_id = " . $ilDB->quote($a_usr_id, "integer") .
68  " AND " . $ilDB->in("obd.obj_id", $a_obj_ids, "", "integer");
69  $set = $ilDB->query($query);
70  while ($row = $ilDB->fetchAssoc($set)) {
71  $role = $row["title"];
72  if (!stristr($role, "il_" . $row["type"] . "_admin_") &&
73  !stristr($role, "il_" . $row["type"] . "_tutor_")) {
74  $a_res[$row["obj_id"]] = true;
75  }
76  }
77 
78  return true;
79  }
80 }
global $DIC
Definition: saml.php:7
static isLPMember(array &$a_res, $a_usr_id, $a_obj_ids)
$query
static _getInstanceByObjId($a_obj_id)
Get singleton instance.
$row
global $ilDB
getMembers($a_search=true)
static getDefaultModes($a_lp_active)