ILIAS  release_6 Revision v6.24-5-g0c8bfefb3b8
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
5include_once("./Services/Object/classes/class.ilObjectAccess.php");
6
16{
17 private static $folderSettings;
18
19 private static function getFolderSettings()
20 {
23 }
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");
59 $commands[] = array("permission" => "read", "cmd" => "download", "lang_var" => "download"); // #18805
60 }
61 // BEGIN WebDAV: Mount Webfolder.
62 include_once('Services/WebDAV/classes/class.ilDAVActivationChecker.php');
64 include_once './Services/WebDAV/classes/class.ilWebDAVUtil.php';
65 if (ilWebDAVUtil::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();
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
113 public static function _checkGoto($a_target)
114 {
115 global $DIC;
116
117 $ilAccess = $DIC->access();
118
119 $t_arr = explode("_", $a_target);
120
121 if ($t_arr[0] != "fold" || ((int) $t_arr[1]) <= 0) {
122 return false;
123 }
124
125 if ($ilAccess->checkAccess("read", "", $t_arr[1]) ||
126 $ilAccess->checkAccess("visible", "", $t_arr[1])) {
127 return true;
128 }
129 return false;
130 }
131
132}
$_GET["client_id"]
An exception for terminatinating execution or to throw for unit testing.
static getInstance()
Get singleton instance.
Class ilObjFileAccess.
static _checkGoto($a_target)
check whether goto script will succeed
static hasDownloadAction($ref_id)
static _getCommands()
get commands
Class ilObjectAccess.
ILIAS Setting Class.
static getInstance()
Get singleton instance.
$ilUser
Definition: imgupload.php:18
$DIC
Definition: xapitoken.php:46