ILIAS  release_4-3 Revision
 All Data Structures Namespaces Files Functions Variables Groups Pages
class.ilObjDataCollectionAccess.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.ilObjectAccess.php");
6 
18 {
31  public function _getCommands()
32  {
33  $commands = array
34  (
35  array("permission" => "read", "cmd" => "render", "lang_var" => "show", "default" => true),
36  array("permission" => "write", "cmd" => "listRecords", "lang_var" => "edit_content"),
37  array("permission" => "write", "cmd" => "edit", "lang_var" => "settings")
38  );
39 
40  return $commands;
41  }
42 
46  public function _checkGoto($a_target)
47  {
48  global $ilAccess;
49 
50  $t_arr = explode("_", $a_target);
51 
52  if ($t_arr[0] != "dcl" || ((int) $t_arr[1]) <= 0)
53  {
54  return false;
55  }
56 
57  if ($ilAccess->checkAccess("visible", "", $t_arr[1]))
58  {
59  return true;
60  }
61  return false;
62  }
63 
76  public function _checkAccess($a_cmd, $a_permission, $a_ref_id, $a_obj_id, $a_user_id = "")
77  {
78  global $ilUser, $lng, $rbacsystem, $ilAccess;
79 
80  if ($a_user_id == "")
81  {
82  $a_user_id = $ilUser->getId();
83  }
84 
85  switch ($a_cmd)
86  {
87  case "view":
88 
90  && !$rbacsystem->checkAccessOfUser($a_user_id,'write',$a_ref_id))
91  {
92  $ilAccess->addInfoItem(IL_NO_OBJECT_ACCESS, $lng->txt("offline"));
93  return false;
94  }
95  break;
96 
97  // for permission query feature
98  case "infoScreen":
100  {
101  $ilAccess->addInfoItem(IL_NO_OBJECT_ACCESS, $lng->txt("offline"));
102  }
103  else
104  {
105  $ilAccess->addInfoItem(IL_STATUS_MESSAGE, $lng->txt("online"));
106  }
107  break;
108 
109  }
110  switch($a_permission)
111  {
112  case "read":
113  case "visible":
115  (!$rbacsystem->checkAccessOfUser($a_user_id, 'write', $a_ref_id)))
116  {
117  $ilAccess->addInfoItem(IL_NO_OBJECT_ACCESS, $lng->txt("offline"));
118  return false;
119  }
120  break;
121  }
122 
123  return true;
124  }
125 
131  public function _lookupOnline($a_id)
132  {
133  global $ilDB;
134 
135  $q = "SELECT * FROM il_dcl_data WHERE id = ".
136  $ilDB->quote($a_id, "integer");
137  $dcl_set = $ilDB->query($q);
138  $dcl_rec = $ilDB->fetchAssoc($dcl_set);
139 
140  return $dcl_rec["is_online"];
141  }
142 
143 }
144 
145 ?>