ILIAS  Release_4_4_x_branch Revision 61816
 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("read", "", $t_arr[1])) {
58  return true;
59  }
60  return false;
61  }
62 
75  public function _checkAccess($a_cmd, $a_permission, $a_ref_id, $a_obj_id, $a_user_id = "")
76  {
77  global $ilUser, $lng, $rbacsystem, $ilAccess;
78 
79  if ($a_user_id == "")
80  {
81  $a_user_id = $ilUser->getId();
82  }
83  switch ($a_cmd)
84  {
85  case "view":
86 
88  && !$rbacsystem->checkAccessOfUser($a_user_id,'write',$a_ref_id))
89  {
90  $ilAccess->addInfoItem(IL_NO_OBJECT_ACCESS, $lng->txt("offline"));
91  return false;
92  }
93  break;
94 
95  // for permission query feature
96  case "infoScreen":
98  {
99  $ilAccess->addInfoItem(IL_NO_OBJECT_ACCESS, $lng->txt("offline"));
100  }
101  else
102  {
103  $ilAccess->addInfoItem(IL_STATUS_MESSAGE, $lng->txt("online"));
104  }
105  break;
106 
107  }
108  switch($a_permission)
109  {
110  case "read":
111  case "visible":
113  (!$rbacsystem->checkAccessOfUser($a_user_id, 'write', $a_ref_id)))
114  {
115  $ilAccess->addInfoItem(IL_NO_OBJECT_ACCESS, $lng->txt("offline"));
116  return false;
117  }
118  break;
119  }
120 
121  return true;
122  }
123 
129  public function _lookupOnline($a_id)
130  {
131  global $ilDB;
132 
133  $q = "SELECT * FROM il_dcl_data WHERE id = ".
134  $ilDB->quote($a_id, "integer");
135  $dcl_set = $ilDB->query($q);
136  $dcl_rec = $ilDB->fetchAssoc($dcl_set);
137 
138  return $dcl_rec["is_online"];
139  }
140 
141 }
142 
143 ?>