5 include_once(
"./Services/Object/classes/class.ilObjectAccess.php");
46 $this->
user = $DIC->user();
47 $this->lng = $DIC->language();
48 $this->rbacsystem = $DIC->rbac()->system();
49 $this->access = $DIC->access();
67 public function _checkAccess($a_cmd, $a_permission, $a_ref_id, $a_obj_id, $a_user_id =
"")
74 if ($a_user_id ==
"") {
78 switch ($a_permission) {
81 (!
$rbacsystem->checkAccessOfUser($a_user_id,
'write', $a_ref_id))) {
90 && !
$rbacsystem->checkAccessOfUser($a_user_id,
'write', $a_ref_id)) ||
117 array(
"permission" =>
"read",
"cmd" =>
"view",
"lang_var" =>
"show",
119 array(
"permission" =>
"write",
"cmd" =>
"edit",
"lang_var" =>
"edit_content"),
120 array(
"permission" =>
"write",
"cmd" =>
"properties",
"lang_var" =>
"settings")
137 $ilDB = $DIC->database();
139 if (isset(self::$online[$a_id])) {
140 return self::$online[$a_id];
142 $q =
"SELECT is_online FROM file_based_lm WHERE id = " .
$ilDB->quote($a_id,
"integer");
143 $set =
$ilDB->query($q);
144 $rec =
$ilDB->fetchAssoc($set);
148 return self::$online[$a_id];
158 $ilDB = $DIC->database();
160 if (isset(self::$startfile[$a_id])) {
161 $start_file = self::$startfile[$a_id];
163 $q =
"SELECT startfile FROM file_based_lm WHERE id = " .
$ilDB->quote($a_id,
"integer");
164 $set =
$ilDB->query($q);
165 $rec =
$ilDB->fetchAssoc($set);
166 $start_file = $rec[
"startfile"];
167 self::$startfile[$a_id] = $start_file .
"";
172 if (($start_file !=
"") &&
173 (@is_file($dir .
"/" . $start_file))) {
174 return "./" . $dir .
"/" . $start_file;
175 } elseif (@is_file($dir .
"/index.html")) {
176 return "./" . $dir .
"/index.html";
177 } elseif (@is_file($dir .
"/index.htm")) {
178 return "./" . $dir .
"/index.htm";
191 $ilAccess = $DIC->access();
193 $t_arr = explode(
"_", $a_target);
195 if ($t_arr[0] !=
"htlm" || ((
int) $t_arr[1]) <= 0) {
199 if ($ilAccess->checkAccess(
"visible",
"", $t_arr[1]) ||
200 $ilAccess->checkAccess(
"read",
"", $t_arr[1])) {
214 $lm_dir = $lm_data_dir . DIRECTORY_SEPARATOR .
"lm_" . $a_id;
229 return !self::_lookupOnline($a_obj_id);
241 $ilDB = $DIC->database();
244 $q =
"SELECT id, is_online, startfile FROM file_based_lm WHERE " .
245 $ilDB->in(
"id", $a_obj_ids,
false,
"integer");
249 self::$online[$rec[
"id"]] =
ilUtil::yn2tf($rec[
"is_online"]);
250 self::$startfile[$rec[
"id"]] = $rec[
"startfile"] .
"";
static _lookupDiskUsage($a_id)
Returns the number of bytes used on the harddisk by the learning module with the specified object id...
const IL_NO_OBJECT_ACCESS
_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 _preloadData($a_obj_ids, $a_ref_ids)
Preload data.
static _checkGoto($a_target)
check whether goto script will succeed
Class ilFileBasedLMAccess.
static _lookupOnline($a_id)
check wether learning module is online
static _determineStartUrl($a_id)
check wether learning module is online
Create styles array
The data for the language used.
static dirsize($directory)
get size of a directory or a file.
__construct()
Constructor.
static _getCommands()
get commands
static _isOffline($a_obj_id)
Type-specific implementation of general status.
static yn2tf($a_yn)
convert "y"/"n" to true/false
static getWebspaceDir($mode="filesystem")
get webspace directory