6 include_once(
"classes/class.ilObjectAccess.php");
34 function _checkAccess($a_cmd, $a_permission, $a_ref_id, $a_obj_id, $a_user_id =
"")
36 global $ilUser,
$lng, $rbacsystem, $ilAccess;
40 $a_user_id = $ilUser->getId();
48 && !$rbacsystem->checkAccessOfUser($a_user_id,
'write',$a_ref_id))
58 if ($ilUser->getId() == ANONYMOUS_USER_ID)
65 && !$rbacsystem->checkAccessOfUser($a_user_id,
'write',$a_ref_id))
86 $ilAccess->addInfoItem(IL_STATUS_MESSAGE, $lng->txt(
"online"));
92 switch ($a_permission)
97 (!$rbacsystem->checkAccessOfUser($a_user_id,
'write', $a_ref_id)))
122 if (isset(self::$online[$a_id]))
124 return self::$online[$a_id];
127 $q =
"SELECT is_online FROM content_object WHERE id = ".$ilDB->quote($a_id,
"integer");
128 $lm_set = $ilDB->query($q);
129 $lm_rec = $ilDB->fetchAssoc($lm_set);
143 global
$ilDB, $ilUser;
145 if ($a_user_id ==
"")
147 $a_user_id = $ilUser->getId();
150 if (isset(self::$lo_access[$a_ref_id]))
152 $acc_rec[
"obj_id"] = self::$lo_access[$a_ref_id];
156 $q =
"SELECT * FROM lo_access WHERE ".
157 "usr_id = ".$ilDB->quote($a_user_id,
"integer").
" AND ".
158 "lm_id = ".$ilDB->quote($a_ref_id,
"integer");
160 $acc_set = $ilDB->query($q);
161 $acc_rec = $ilDB->fetchAssoc($acc_set);
164 if ($acc_rec[
"obj_id"] > 0)
167 $mtree =
new ilTree($lm_id);
168 $mtree->setTableNames(
'lm_tree',
'lm_data');
169 $mtree->setTreeTablePK(
"lm_id");
170 if ($mtree->isInTree($acc_rec[
"obj_id"]))
172 return $acc_rec[
"obj_id"];
186 $t_arr = explode(
"_", $a_target);
188 if (($t_arr[0] !=
"lm" && $t_arr[0] !=
"dbk" && $t_arr[0] !=
"st"
189 && $t_arr[0] !=
"pg")
190 || ((
int) $t_arr[1]) <= 0)
195 if ($t_arr[0] ==
"lm" || $t_arr[0] ==
"dbk")
197 if ($ilAccess->checkAccess(
"read",
"", $t_arr[1]) ||
198 $ilAccess->checkAccess(
"visible",
"", $t_arr[1]))
207 $ref_ids = array($t_arr[2]);
212 include_once(
"./Modules/LearningModule/classes/class.ilLMObject.php");
220 if ($ilAccess->checkAccess(
"read",
"", $ref_id))
250 global
$ilDB, $ilUser;
252 $q =
"SELECT id, is_online FROM content_object WHERE ".
253 $ilDB->in(
"id", $a_obj_ids,
false,
"integer");
255 $lm_set = $ilDB->query($q);
256 while ($rec = $ilDB->fetchAssoc($lm_set))
258 self::$online[$rec[
"id"]] =
ilUtil::yn2tf($rec[
"is_online"]);
261 $q =
"SELECT obj_id, lm_id FROM lo_access WHERE ".
262 "usr_id = ".$ilDB->quote($ilUser->getId(),
"integer").
" AND ".
263 $ilDB->in(
"lm_id", $a_ref_ids,
false,
"integer");;
264 $set = $ilDB->query($q);
265 foreach ($a_ref_ids as $r)
267 self::$lo_access[$r] = 0;
269 while ($rec = $ilDB->fetchAssoc($set))
271 self::$lo_access[$rec[
"lm_id"]] = $rec[
"obj_id"];