ILIAS  trunk Revision v12.0_alpha-377-g3641b37b9db
ilWorkspaceAccessGUI Class Reference

ACL access handler GUI. More...

+ Collaboration diagram for ilWorkspaceAccessGUI:

Public Member Functions

 __construct (int $a_node_id, ilPortfolioAccessHandler|ilWorkspaceAccessHandler $a_access_handler, bool $a_is_portfolio=false, string $a_footer="")
 
 setBlockingMessage (string $a_val)
 
 getBlockingMessage ()
 
 executeCommand ()
 
 addPermissionHandler ()
 
 removePermission ()
 

Data Fields

const PERMISSION_REGISTERED = -1
 
const PERMISSION_ALL_PASSWORD = -3
 
const PERMISSION_ALL = -5
 

Protected Member Functions

 setObjectTitle ()
 
 getAccessHandler ()
 
 share ()
 
 initPasswordForm ()
 
 showPasswordForm (?ilPropertyFormGUI $a_form=null)
 
 savePasswordForm ()
 

Protected Attributes

ILIAS PersonalWorkspace InternalGUIService $gui
 
bool $is_portfolio
 
ilTabsGUI $tabs
 
ilGlobalTemplateInterface $tpl
 
ilToolbarGUI $toolbar
 
ilObjUser $user
 
ilSetting $settings
 
ilCtrl $ctrl
 
ilLanguage $lng
 
int $node_id
 
ilPortfolioAccessHandler ilWorkspaceAccessHandler $access_handler
 
string $footer = ""
 
string $blocking_message = ""
 
StandardGUIRequest $std_request
 

Detailed Description

ACL access handler GUI.

Author
Jörg Lützenkirchen luetz.nosp@m.enki.nosp@m.rchen.nosp@m.@lei.nosp@m.fos.c.nosp@m.om @ilCtrl_Calls ilWorkspaceAccessGUI: ilMailSearchCoursesGUI, ilMailSearchGroupsGUI @ilCtrl_Calls ilWorkspaceAccessGUI: ilMailSearchGUI, ILIAS\User\Profile\PublicProfileGUI, ilSingleUserShareGUI

Definition at line 29 of file class.ilWorkspaceAccessGUI.php.

Constructor & Destructor Documentation

◆ __construct()

ilWorkspaceAccessGUI::__construct ( int  $a_node_id,
ilPortfolioAccessHandler|ilWorkspaceAccessHandler  $a_access_handler,
bool  $a_is_portfolio = false,
string  $a_footer = "" 
)

Definition at line 50 of file class.ilWorkspaceAccessGUI.php.

55 {
56 global $DIC;
57
58 $this->tabs = $DIC->tabs();
59 $this->tpl = $DIC->ui()->mainTemplate();
60 $this->toolbar = $DIC->toolbar();
61 $this->user = $DIC->user();
62 $this->settings = $DIC->settings();
63 $ilCtrl = $DIC->ctrl();
64 $lng = $DIC->language();
65
66 $this->ctrl = $ilCtrl;
67 $this->lng = $lng;
68 $this->node_id = $a_node_id;
69 $this->access_handler = $a_access_handler;
70 $this->is_portfolio = $a_is_portfolio;
71 $this->footer = $a_footer;
72 $this->std_request = new StandardGUIRequest(
73 $DIC->http(),
74 $DIC->refinery()
75 );
76 $this->gui = $DIC->personalWorkspace()->internal()->gui();
77 }
global $DIC
Definition: shib_login.php:26

References $DIC, $lng, ILIAS\Repository\ctrl(), ILIAS\Repository\lng(), ILIAS\Repository\settings(), ILIAS\Repository\tabs(), ILIAS\Repository\toolbar(), and ILIAS\Repository\user().

+ Here is the call graph for this function:

Member Function Documentation

◆ addPermissionHandler()

ilWorkspaceAccessGUI::addPermissionHandler ( )

Definition at line 244 of file class.ilWorkspaceAccessGUI.php.

244 : void
245 {
246 switch ($this->std_request->getAction()) {
247 case "user":
248
249 if (ilUserAccountSettings::getInstance()->isUserAccessRestricted()) {
250 $this->ctrl->redirectByClass("ilsingleusersharegui");
251 } else {
252 $this->ctrl->setParameterByClass("ilmailsearchgui", "ref", "wsp");
253 $this->ctrl->redirectByClass("ilmailsearchgui");
254 }
255 break;
256
257 case "group":
258 $this->ctrl->setParameterByClass("ilmailsearchgroupsgui", "ref", "wsp");
259 $this->ctrl->redirectByClass("ilmailsearchgroupsgui");
260 break;
261
262 case "course":
263 $this->ctrl->setParameterByClass("ilmailsearchcoursesgui", "ref", "wsp");
264 $this->ctrl->redirectByClass("ilmailsearchcoursesgui");
265 break;
266
267 case "registered":
268 $this->getAccessHandler()->addMissingPermissionForObjects($this->node_id, [self::PERMISSION_REGISTERED]);
269 $this->tpl->setOnScreenMessage('success', $this->lng->txt("wsp_share_success"), true);
270 $this->ctrl->redirect($this, "share");
271 break;
272
273 case "password":
274 $this->showPasswordForm();
275 break;
276
277 case "all":
278 $this->getAccessHandler()->addMissingPermissionForObjects($this->node_id, [self::PERMISSION_ALL]);
279 $this->tpl->setOnScreenMessage('success', $this->lng->txt("wsp_permission_all_info"), true);
280 $this->ctrl->redirect($this, "share");
281 }
282 }
showPasswordForm(?ilPropertyFormGUI $a_form=null)

References ILIAS\Repository\ctrl(), getAccessHandler(), ilUserAccountSettings\getInstance(), ILIAS\Repository\lng(), and showPasswordForm().

+ Here is the call graph for this function:

◆ executeCommand()

ilWorkspaceAccessGUI::executeCommand ( )

Definition at line 90 of file class.ilWorkspaceAccessGUI.php.

90 : void
91 {
92 $ilTabs = $this->tabs;
94 $next_class = $this->ctrl->getNextClass($this);
95 $cmd = $this->ctrl->getCmd();
96
97 switch ($next_class) {
98 case "ilmailsearchcoursesgui":
99 $ilTabs->setBackTarget(
100 $this->lng->txt("back"),
101 $this->ctrl->getLinkTarget($this, "share")
102 );
103 $csearch = new ilMailSearchCoursesGUI($this->access_handler, $this->node_id);
104 $this->ctrl->setReturn($this, 'share');
105 $this->ctrl->forwardCommand($csearch);
106
107 $this->setObjectTitle();
108 break;
109
110 case "ilmailsearchgroupsgui":
111 $ilTabs->setBackTarget(
112 $this->lng->txt("back"),
113 $this->ctrl->getLinkTarget($this, "share")
114 );
115 $gsearch = new ilMailSearchGroupsGUI($this->access_handler, $this->node_id);
116 $this->ctrl->setReturn($this, 'share');
117 $this->ctrl->forwardCommand($gsearch);
118
119 $this->setObjectTitle();
120 break;
121
122 case "ilmailsearchgui":
123 $ilTabs->setBackTarget(
124 $this->lng->txt("back"),
125 $this->ctrl->getLinkTarget($this, "share")
126 );
127 $usearch = new ilMailSearchGUI($this->access_handler, $this->node_id);
128 $this->ctrl->setReturn($this, 'share');
129 $this->ctrl->forwardCommand($usearch);
130
131 $this->setObjectTitle();
132 break;
133
134 case "ilsingleusersharegui":
135 $ilTabs->setBackTarget(
136 $this->lng->txt("back"),
137 $this->ctrl->getLinkTarget($this, "share")
138 );
139 $ushare = new ilSingleUserShareGUI($this->access_handler, $this->node_id);
140 $this->ctrl->setReturn($this, 'share');
141 $this->ctrl->forwardCommand($ushare);
142
143 $this->setObjectTitle();
144 break;
145
146 case strtolower(PublicProfileGUI::class):
147 $ilTabs->clearTargets();
148 $ilTabs->setBackTarget(
149 $this->lng->txt("back"),
150 $this->ctrl->getLinkTarget($this, "share")
151 );
152
153 $prof = new PublicProfileGUI(
154 $this->std_request->getUser()
155 );
156 $prof->setBackUrl($this->ctrl->getLinkTarget($this, "share"));
157 $tpl->setContent($prof->getHTML());
158 break;
159
160 default:
161 // $this->prepareOutput();
162 if (!$cmd) {
163 $cmd = "share";
164 }
165 //return $this->$cmd();
166 $this->$cmd();
167 break;
168 }
169 }
GUI class for public user profile presentation.
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
ilGlobalTemplateInterface $tpl
setContent(string $a_html)
Sets content for standard template.

References $tabs, $tpl, ILIAS\Repository\ctrl(), ILIAS\Repository\lng(), ILIAS\UICore\GlobalTemplate\setContent(), and setObjectTitle().

+ Here is the call graph for this function:

◆ getAccessHandler()

ilWorkspaceAccessGUI::getAccessHandler ( )
protected

Definition at line 183 of file class.ilWorkspaceAccessGUI.php.

184 {
186 }
Access handler for portfolio NOTE: This file needs to stay in the classes directory,...
ilPortfolioAccessHandler ilWorkspaceAccessHandler $access_handler
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...

References $access_handler.

Referenced by addPermissionHandler(), removePermission(), savePasswordForm(), and share().

+ Here is the caller graph for this function:

◆ getBlockingMessage()

ilWorkspaceAccessGUI::getBlockingMessage ( )

Definition at line 85 of file class.ilWorkspaceAccessGUI.php.

85 : string
86 {
88 }

References $blocking_message.

Referenced by share().

+ Here is the caller graph for this function:

◆ initPasswordForm()

ilWorkspaceAccessGUI::initPasswordForm ( )
protected

Definition at line 295 of file class.ilWorkspaceAccessGUI.php.

296 {
297 $form = new ilPropertyFormGUI();
298 $form->setFormAction($this->ctrl->getFormAction($this));
299 $form->setTitle($this->lng->txt("wsp_set_permission_all_password"));
300
301 $password = new ilPasswordInputGUI($this->lng->txt("password"), "password");
302 $password->setRequired(true);
303 $form->addItem($password);
304
305 $form->addCommandButton('savepasswordform', $this->lng->txt("save"));
306 $form->addCommandButton('share', $this->lng->txt("cancel"));
307
308 return $form;
309 }
This class represents a password property in a property form.
This class represents a property form user interface.

References ILIAS\Repository\ctrl(), and ILIAS\Repository\lng().

Referenced by savePasswordForm(), and showPasswordForm().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ removePermission()

ilWorkspaceAccessGUI::removePermission ( )

Definition at line 284 of file class.ilWorkspaceAccessGUI.php.

284 : void
285 {
286 $obj_id = $this->std_request->getObjId();
287 if ($obj_id !== 0) {
288 $this->getAccessHandler()->removePermission($this->node_id, $obj_id);
289 $this->tpl->setOnScreenMessage('success', $this->lng->txt("wsp_permission_removed"), true);
290 }
291
292 $this->ctrl->redirect($this, "share");
293 }

References ILIAS\Repository\ctrl(), getAccessHandler(), and ILIAS\Repository\lng().

+ Here is the call graph for this function:

◆ savePasswordForm()

ilWorkspaceAccessGUI::savePasswordForm ( )
protected

Definition at line 321 of file class.ilWorkspaceAccessGUI.php.

321 : void
322 {
323 $form = $this->initPasswordForm();
324 if ($form->checkInput()) {
325 $this->getAccessHandler()->addPermission(
326 $this->node_id,
327 self::PERMISSION_ALL_PASSWORD,
328 md5($form->getInput("password"))
329 );
330 $this->tpl->setOnScreenMessage('success', $this->lng->txt("wsp_permission_all_pw_info"), true);
331 $this->ctrl->redirect($this, "share");
332 }
333
334 $form->setValuesByPost();
335 $this->showPasswordForm($form);
336 }

References ILIAS\Repository\ctrl(), getAccessHandler(), initPasswordForm(), ILIAS\Repository\lng(), and showPasswordForm().

+ Here is the call graph for this function:

◆ setBlockingMessage()

ilWorkspaceAccessGUI::setBlockingMessage ( string  $a_val)

Definition at line 80 of file class.ilWorkspaceAccessGUI.php.

80 : void
81 {
82 $this->blocking_message = $a_val;
83 }

◆ setObjectTitle()

ilWorkspaceAccessGUI::setObjectTitle ( )
protected

Definition at line 171 of file class.ilWorkspaceAccessGUI.php.

171 : void
172 {
174
175 if (!$this->is_portfolio) {
176 $obj_id = $this->access_handler->getTree()->lookupObjectId($this->node_id);
177 } else {
178 $obj_id = $this->node_id;
179 }
181 }
static _lookupTitle(int $obj_id)
setTitle(string $a_title, bool $hidden=false)
Sets title in standard template.

References $node_id, $tpl, ilObject\_lookupTitle(), and ILIAS\UICore\GlobalTemplate\setTitle().

Referenced by executeCommand().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ share()

ilWorkspaceAccessGUI::share ( )
protected

Definition at line 188 of file class.ilWorkspaceAccessGUI.php.

188 : void
189 {
190 $ilToolbar = $this->toolbar;
192 $ilUser = $this->user;
194
195
196 // blocking message
197 if ($this->getBlockingMessage() != "") {
199 return;
200 }
201
202 $options = array();
203 $options["user"] = $this->lng->txt("wsp_set_permission_single_user");
204
205 $grp_ids = ilGroupParticipants::_getMembershipByType($ilUser->getId(), ['grp']);
206 if (sizeof($grp_ids)) {
207 $options["group"] = $this->lng->txt("wsp_set_permission_group");
208 }
209
210 $crs_ids = ilCourseParticipants::_getMembershipByType($ilUser->getId(), ['crs']);
211 if (sizeof($crs_ids)) {
212 $options["course"] = $this->lng->txt("wsp_set_permission_course");
213 }
214
215 if (!$this->getAccessHandler()->hasRegisteredPermission($this->node_id)) {
216 $options["registered"] = $this->lng->txt("wsp_set_permission_registered");
217 }
218
219 if ($ilSetting->get("enable_global_profiles")) {
220 if (!$this->getAccessHandler()->hasGlobalPasswordPermission($this->node_id)) {
221 $options["password"] = $this->lng->txt("wsp_set_permission_all_password");
222 }
223
224 if (!$this->getAccessHandler()->hasGlobalPermission($this->node_id)) {
225 $options["all"] = $this->lng->txt("wsp_set_permission_all");
226 }
227 }
228
229 $actions = new ilSelectInputGUI("", "action");
230 $actions->setOptions($options);
231 $ilToolbar->addStickyItem($actions);
232
233 $ilToolbar->setFormAction($this->ctrl->getFormAction($this));
234
235 $this->gui->button(
236 $this->lng->txt("add"),
237 "addpermissionhandler"
238 )->submit()->toToolbar(true);
239
240 $table = new ilWorkspaceAccessTableGUI($this, "share", $this->node_id, $this->getAccessHandler());
241 $tpl->setContent($table->getHTML() . $this->footer);
242 }
static _getMembershipByType(int $a_usr_id, array $a_type, bool $a_only_member_role=false)
get membership by type Get course or group membership
This class represents a selection list property in a property form.
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
global $ilSetting
Definition: privfeed.php:31

References $ilSetting, ILIAS\UI\Implementation\Component\Input\Field\$options, $settings, $toolbar, $tpl, $user, ilParticipants\_getMembershipByType(), ILIAS\Repository\ctrl(), getAccessHandler(), getBlockingMessage(), ILIAS\Repository\lng(), and ILIAS\UICore\GlobalTemplate\setContent().

+ Here is the call graph for this function:

◆ showPasswordForm()

ilWorkspaceAccessGUI::showPasswordForm ( ?ilPropertyFormGUI  $a_form = null)
protected

Definition at line 311 of file class.ilWorkspaceAccessGUI.php.

311 : void
312 {
314
315 if (!$a_form) {
316 $a_form = $this->initPasswordForm();
317 }
318 $tpl->setContent($a_form->getHTML());
319 }

References $tpl, initPasswordForm(), and ILIAS\UICore\GlobalTemplate\setContent().

Referenced by addPermissionHandler(), and savePasswordForm().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

Field Documentation

◆ $access_handler

ilPortfolioAccessHandler ilWorkspaceAccessHandler ilWorkspaceAccessGUI::$access_handler
protected

Definition at line 44 of file class.ilWorkspaceAccessGUI.php.

Referenced by getAccessHandler().

◆ $blocking_message

string ilWorkspaceAccessGUI::$blocking_message = ""
protected

Definition at line 47 of file class.ilWorkspaceAccessGUI.php.

Referenced by getBlockingMessage().

◆ $ctrl

ilCtrl ilWorkspaceAccessGUI::$ctrl
protected

Definition at line 41 of file class.ilWorkspaceAccessGUI.php.

◆ $footer

string ilWorkspaceAccessGUI::$footer = ""
protected

Definition at line 45 of file class.ilWorkspaceAccessGUI.php.

◆ $gui

ILIAS PersonalWorkspace InternalGUIService ilWorkspaceAccessGUI::$gui
protected

Definition at line 34 of file class.ilWorkspaceAccessGUI.php.

◆ $is_portfolio

bool ilWorkspaceAccessGUI::$is_portfolio
protected

Definition at line 35 of file class.ilWorkspaceAccessGUI.php.

◆ $lng

ilLanguage ilWorkspaceAccessGUI::$lng
protected

Definition at line 42 of file class.ilWorkspaceAccessGUI.php.

Referenced by __construct().

◆ $node_id

int ilWorkspaceAccessGUI::$node_id
protected

Definition at line 43 of file class.ilWorkspaceAccessGUI.php.

Referenced by setObjectTitle().

◆ $settings

ilSetting ilWorkspaceAccessGUI::$settings
protected

Definition at line 40 of file class.ilWorkspaceAccessGUI.php.

Referenced by share().

◆ $std_request

StandardGUIRequest ilWorkspaceAccessGUI::$std_request
protected

Definition at line 48 of file class.ilWorkspaceAccessGUI.php.

◆ $tabs

ilTabsGUI ilWorkspaceAccessGUI::$tabs
protected

Definition at line 36 of file class.ilWorkspaceAccessGUI.php.

Referenced by executeCommand().

◆ $toolbar

ilToolbarGUI ilWorkspaceAccessGUI::$toolbar
protected

Definition at line 38 of file class.ilWorkspaceAccessGUI.php.

Referenced by share().

◆ $tpl

ilGlobalTemplateInterface ilWorkspaceAccessGUI::$tpl
protected

◆ $user

ilObjUser ilWorkspaceAccessGUI::$user
protected

Definition at line 39 of file class.ilWorkspaceAccessGUI.php.

Referenced by share().

◆ PERMISSION_ALL

◆ PERMISSION_ALL_PASSWORD

◆ PERMISSION_REGISTERED


The documentation for this class was generated from the following file: