ILIAS
release_5-3 Revision v5.3.23-19-g915713cf615
◀ ilDoc Overview
class.ilObjFolderAccess.php
Go to the documentation of this file.
1
<?
php
2
3
/* Copyright (c) 1998-2012 ILIAS open source, Extended GPL, see docs/LICENSE */
4
5
include_once(
"./Services/Object/classes/class.ilObjectAccess.php"
);
6
15
class
ilObjFolderAccess
extends
ilObjectAccess
16
{
17
private
static
$folderSettings
;
18
19
private
static
function
getFolderSettings
()
20
{
21
if
(is_null(
ilObjFolderAccess::$folderSettings
)) {
22
ilObjFolderAccess::$folderSettings
=
new
ilSetting
(
'fold'
);
23
}
24
return
ilObjFolderAccess::$folderSettings
;
25
}
26
27
40
public
static
function
_getCommands
()
41
{
42
$commands = array();
43
$commands[] = array(
"permission"
=>
"read"
,
"cmd"
=>
"view"
,
"lang_var"
=>
"show"
,
"default"
=>
true
);
44
45
include_once
'./Services/WebServices/FileManager/classes/class.ilFMSettings.php'
;
46
if
(
ilFMSettings::getInstance
()->isEnabled()) {
47
$commands[] = array(
48
'permission'
=>
'read'
,
49
'cmd'
=>
'fileManagerLaunch'
,
50
'lang_var'
=>
'fm_start'
,
51
'enable_anonymous'
=>
false
52
);
53
}
54
55
// why here, why read permission? it just needs info_screen_enabled = true in ilObjCategoryListGUI (alex, 30.7.2008)
56
// this is not consistent, with all other objects...
57
//$commands[] = array("permission" => "read", "cmd" => "showSummary", "lang_var" => "info_short", "enable_anonymous" => "false");
58
if
(
ilObjFolderAccess::hasDownloadAction
(
$_GET
[
"ref_id"
])) {
59
$commands[] = array(
"permission"
=>
"read"
,
"cmd"
=>
"downloadFolder"
,
"lang_var"
=>
"download"
);
// #18805
60
}
61
// BEGIN WebDAV: Mount Webfolder.
62
include_once(
'Services/WebDAV/classes/class.ilDAVActivationChecker.php'
);
63
if
(
ilDAVActivationChecker::_isActive
()) {
64
include_once
'./Services/WebDAV/classes/class.ilDAVUtils.php'
;
65
if
(
ilDAVUtils::getInstance
()->isLocalPasswordInstructionRequired()) {
66
$commands[] = array(
'permission'
=>
'read'
,
'cmd'
=>
'showPasswordInstruction'
,
'lang_var'
=>
'mount_webfolder'
,
'enable_anonymous'
=>
'false'
);
67
}
else
{
68
$commands[] = array(
"permission"
=>
"read"
,
"cmd"
=>
"mount_webfolder"
,
"lang_var"
=>
"mount_webfolder"
,
"enable_anonymous"
=>
"false"
);
69
}
70
}
71
$commands[] = array(
"permission"
=>
"write"
,
"cmd"
=>
"enableAdministrationPanel"
,
"lang_var"
=>
"edit_content"
);
72
$commands[] = array(
"permission"
=>
"write"
,
"cmd"
=>
"edit"
,
"lang_var"
=>
"settings"
);
73
74
return
$commands;
75
}
76
77
78
private
static
function
hasDownloadAction
($ref_id)
79
{
80
global
$DIC
;
81
82
$tree =
$DIC
->repositoryTree();
83
$ilUser
=
$DIC
->user();
84
$settings =
ilObjFolderAccess::getFolderSettings
();
85
// default value should reflect previous behaviour (-> 0)
86
if
($settings->get(
"enable_download_folder"
, 0) != 1) {
87
return
false
;
88
}
89
90
/*
91
* deactivated check for now, because wrong ref_id here!
92
93
*
94
$children = $tree->getChildsByTypeFilter($ref_id, array("file","fold"));
95
96
// no children at all, so no download button
97
if (count ($children) == 0)
98
return false;
99
// check if at least one of the children has a read permission
100
foreach ($children as $child)
101
{
102
if ($rbacsystem->checkAccessOfUser($ilUser->getId(), "read", $child["ref_id"]))
103
return true;
104
}
105
return false;
106
*/
107
return
true
;
108
}
109
}
$_GET
$_GET["client_id"]
Definition:
cfg.phpunit.template.php:12
php
An exception for terminatinating execution or to throw for unit testing.
ilDAVActivationChecker\_isActive
static _isActive()
Static getter.
Definition:
class.ilDAVActivationChecker.php:17
ilDAVUtils\getInstance
static getInstance()
Get singleton instance.
Definition:
class.ilDAVUtils.php:31
ilFMSettings\getInstance
static getInstance()
Get singleton instance.
Definition:
class.ilFMSettings.php:31
ilObjFolderAccess
Class ilObjFileAccess.
Definition:
class.ilObjFolderAccess.php:16
ilObjFolderAccess\getFolderSettings
static getFolderSettings()
Definition:
class.ilObjFolderAccess.php:19
ilObjFolderAccess\hasDownloadAction
static hasDownloadAction($ref_id)
Definition:
class.ilObjFolderAccess.php:78
ilObjFolderAccess\_getCommands
static _getCommands()
get commands
Definition:
class.ilObjFolderAccess.php:40
ilObjFolderAccess\$folderSettings
static $folderSettings
Definition:
class.ilObjFolderAccess.php:17
ilObjectAccess
Class ilObjectAccess.
Definition:
class.ilObjectAccess.php:17
ilSetting
ILIAS Setting Class.
Definition:
class.ilSetting.php:33
$DIC
global $DIC
Definition:
saml.php:7
$ilUser
$ilUser
Definition:
imgupload.php:18
Modules
Folder
classes
class.ilObjFolderAccess.php
Generated on Tue Sep 30 2025 19:01:02 for ILIAS by
1.9.4 (using
Doxyfile
)