6 include_once(
"./Services/Object/classes/class.ilObjectAccess.php");
34 function _checkAccess($a_cmd, $a_permission, $a_ref_id, $a_obj_id, $a_user_id =
"")
40 $a_user_id = $ilUser->getId();
48 && !$rbacsystem->checkAccessOfUser($a_user_id,
'write',$a_ref_id))
56 if(!$rbacsystem->checkAccessOfUser($a_user_id,
'write',$a_ref_id))
89 $ilAccess->addInfoItem(IL_STATUS_MESSAGE, $lng->txt(
"online"));
95 switch ($a_permission)
100 (!$rbacsystem->checkAccessOfUser($a_user_id,
'write', $a_ref_id)))
125 if (isset(self::$online[$a_id]))
127 return self::$online[$a_id];
130 $q =
"SELECT is_online FROM content_object WHERE id = ".$ilDB->quote($a_id,
"integer");
132 $lm_rec = $ilDB->fetchAssoc(
$lm_set);
148 if ($a_user_id ==
"")
150 $a_user_id = $ilUser->getId();
153 if (isset(self::$lo_access[$a_ref_id]))
155 $acc_rec[
"obj_id"] = self::$lo_access[$a_ref_id];
159 $q =
"SELECT * FROM lo_access WHERE ".
160 "usr_id = ".$ilDB->quote($a_user_id,
"integer").
" AND ".
161 "lm_id = ".$ilDB->quote($a_ref_id,
"integer");
163 $acc_set = $ilDB->query($q);
164 $acc_rec = $ilDB->fetchAssoc($acc_set);
167 if ($acc_rec[
"obj_id"] > 0)
170 $mtree =
new ilTree($lm_id);
171 $mtree->setTableNames(
'lm_tree',
'lm_data');
172 $mtree->setTreeTablePK(
"lm_id");
173 if ($mtree->isInTree($acc_rec[
"obj_id"]))
175 return $acc_rec[
"obj_id"];
189 $t_arr = explode(
"_", $a_target);
191 if (($t_arr[0] !=
"lm" && $t_arr[0] !=
"st" 192 && $t_arr[0] !=
"pg")
193 || ((
int) $t_arr[1]) <= 0)
198 if ($t_arr[0] ==
"lm")
200 if ($ilAccess->checkAccess(
"read",
"", $t_arr[1]) ||
201 $ilAccess->checkAccess(
"visible",
"", $t_arr[1]))
210 $ref_ids =
array($t_arr[2]);
215 include_once(
"./Modules/LearningModule/classes/class.ilLMObject.php");
223 if ($ilAccess->checkAccess(
"read",
"", $ref_id))
243 return !self::_lookupOnline($a_obj_id);
255 $q =
"SELECT id, is_online FROM content_object WHERE ".
256 $ilDB->in(
"id", $a_obj_ids,
false,
"integer");
259 while ($rec = $ilDB->fetchAssoc(
$lm_set))
261 self::$online[$rec[
"id"]] =
ilUtil::yn2tf($rec[
"is_online"]);
264 $q =
"SELECT obj_id, lm_id FROM lo_access WHERE ".
265 "usr_id = ".$ilDB->quote($ilUser->getId(),
"integer").
" AND ".
266 $ilDB->in(
"lm_id", $a_ref_ids,
false,
"integer");;
267 $set = $ilDB->query($q);
268 foreach ($a_ref_ids as
$r)
270 self::$lo_access[
$r] = 0;
272 while ($rec = $ilDB->fetchAssoc($set))
274 self::$lo_access[$rec[
"lm_id"]] = $rec[
"obj_id"];
static _preloadData($a_obj_ids, $a_ref_ids)
Preload data.
const IL_NO_OBJECT_ACCESS
static _lookupContObjID($a_id)
get learning module / digibook id for lm object
static _getAllReferences($a_id)
get all reference ids of object
static _checkGoto($a_target)
check whether goto script will succeed
static _lookupObjId($a_id)
Class ilObjContentObjectAccess.
Tree class data representation in hierachical trees using the Nested Set Model with Gaps by Joe Celco...
Create styles array
The data for the language used.
_checkAccess($a_cmd, $a_permission, $a_ref_id, $a_obj_id, $a_user_id="")
checks wether a user may invoke a command or not (this method is called by ilAccessHandler::checkAcce...
static _isOffline($a_obj_id)
Type-specific implementation of general status.
static yn2tf($a_yn)
convert "y"/"n" to true/false
static _getLastAccessedPage($a_ref_id, $a_user_id="")
get last accessed page
static _lookupOnline($a_id)
check wether learning module is online