ILIAS  trunk Revision v11.0_alpha-3011-gc6b235a2e85
ilWorkspaceAccessGUI Class Reference

ACL access handler GUI. More...

+ Collaboration diagram for ilWorkspaceAccessGUI:

Public Member Functions

 __construct (int $a_node_id, $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
 
 $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,
  $a_access_handler,
bool  $a_is_portfolio = false,
string  $a_footer = "" 
)
Parameters
ilPortfolioAccessHandler | ilWorkspaceAccessHandler$a_access_handler

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

61 {
62 global $DIC;
63
64 $this->tabs = $DIC->tabs();
65 $this->tpl = $DIC->ui()->mainTemplate();
66 $this->toolbar = $DIC->toolbar();
67 $this->user = $DIC->user();
68 $this->settings = $DIC->settings();
69 $ilCtrl = $DIC->ctrl();
70 $lng = $DIC->language();
71
72 $this->ctrl = $ilCtrl;
73 $this->lng = $lng;
74 $this->node_id = $a_node_id;
75 $this->access_handler = $a_access_handler;
76 $this->is_portfolio = $a_is_portfolio;
77 $this->footer = $a_footer;
78 $this->std_request = new StandardGUIRequest(
79 $DIC->http(),
80 $DIC->refinery()
81 );
82 $this->gui = $DIC->personalWorkspace()->internal()->gui();
83 }
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 253 of file class.ilWorkspaceAccessGUI.php.

253 : void
254 {
255 switch ($this->std_request->getAction()) {
256 case "user":
257
258 if (ilUserAccountSettings::getInstance()->isUserAccessRestricted()) {
259 $this->ctrl->redirectByClass("ilsingleusersharegui");
260 } else {
261 $this->ctrl->setParameterByClass("ilmailsearchgui", "ref", "wsp");
262 $this->ctrl->redirectByClass("ilmailsearchgui");
263 }
264 break;
265
266 case "group":
267 $this->ctrl->setParameterByClass("ilmailsearchgroupsgui", "ref", "wsp");
268 $this->ctrl->redirectByClass("ilmailsearchgroupsgui");
269 break;
270
271 case "course":
272 $this->ctrl->setParameterByClass("ilmailsearchcoursesgui", "ref", "wsp");
273 $this->ctrl->redirectByClass("ilmailsearchcoursesgui");
274 break;
275
276 case "registered":
277 $this->getAccessHandler()->addMissingPermissionForObjects($this->node_id, [self::PERMISSION_REGISTERED]);
278 $this->tpl->setOnScreenMessage('success', $this->lng->txt("wsp_share_success"), true);
279 $this->ctrl->redirect($this, "share");
280 break;
281
282 case "password":
283 $this->showPasswordForm();
284 break;
285
286 case "all":
287 $this->getAccessHandler()->addMissingPermissionForObjects($this->node_id, [self::PERMISSION_ALL]);
288 $this->tpl->setOnScreenMessage('success', $this->lng->txt("wsp_permission_all_info"), true);
289 $this->ctrl->redirect($this, "share");
290 }
291 }
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 96 of file class.ilWorkspaceAccessGUI.php.

96 : void
97 {
98 $ilTabs = $this->tabs;
100 $next_class = $this->ctrl->getNextClass($this);
101 $cmd = $this->ctrl->getCmd();
102
103 switch ($next_class) {
104 case "ilmailsearchcoursesgui":
105 $ilTabs->setBackTarget(
106 $this->lng->txt("back"),
107 $this->ctrl->getLinkTarget($this, "share")
108 );
109 $csearch = new ilMailSearchCoursesGUI($this->access_handler, $this->node_id);
110 $this->ctrl->setReturn($this, 'share');
111 $this->ctrl->forwardCommand($csearch);
112
113 $this->setObjectTitle();
114 break;
115
116 case "ilmailsearchgroupsgui":
117 $ilTabs->setBackTarget(
118 $this->lng->txt("back"),
119 $this->ctrl->getLinkTarget($this, "share")
120 );
121 $gsearch = new ilMailSearchGroupsGUI($this->access_handler, $this->node_id);
122 $this->ctrl->setReturn($this, 'share');
123 $this->ctrl->forwardCommand($gsearch);
124
125 $this->setObjectTitle();
126 break;
127
128 case "ilmailsearchgui":
129 $ilTabs->setBackTarget(
130 $this->lng->txt("back"),
131 $this->ctrl->getLinkTarget($this, "share")
132 );
133 $usearch = new ilMailSearchGUI($this->access_handler, $this->node_id);
134 $this->ctrl->setReturn($this, 'share');
135 $this->ctrl->forwardCommand($usearch);
136
137 $this->setObjectTitle();
138 break;
139
140 case "ilsingleusersharegui":
141 $ilTabs->setBackTarget(
142 $this->lng->txt("back"),
143 $this->ctrl->getLinkTarget($this, "share")
144 );
145 $ushare = new ilSingleUserShareGUI($this->access_handler, $this->node_id);
146 $this->ctrl->setReturn($this, 'share');
147 $this->ctrl->forwardCommand($ushare);
148
149 $this->setObjectTitle();
150 break;
151
152 case strtolower(PublicProfileGUI::class):
153 $ilTabs->clearTargets();
154 $ilTabs->setBackTarget(
155 $this->lng->txt("back"),
156 $this->ctrl->getLinkTarget($this, "share")
157 );
158
159 $prof = new PublicProfileGUI(
160 $this->std_request->getUser()
161 );
162 $prof->setBackUrl($this->ctrl->getLinkTarget($this, "share"));
163 $tpl->setContent($prof->getHTML());
164 break;
165
166 default:
167 // $this->prepareOutput();
168 if (!$cmd) {
169 $cmd = "share";
170 }
171 //return $this->$cmd();
172 $this->$cmd();
173 break;
174 }
175 }
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
Returns
ilPortfolioAccessHandler|ilWorkspaceAccessHandler

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

References $access_handler.

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

+ Here is the caller graph for this function:

◆ getBlockingMessage()

ilWorkspaceAccessGUI::getBlockingMessage ( )

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

91 : string
92 {
94 }

References $blocking_message.

Referenced by share().

+ Here is the caller graph for this function:

◆ initPasswordForm()

ilWorkspaceAccessGUI::initPasswordForm ( )
protected

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

305 {
306 $form = new ilPropertyFormGUI();
307 $form->setFormAction($this->ctrl->getFormAction($this));
308 $form->setTitle($this->lng->txt("wsp_set_permission_all_password"));
309
310 $password = new ilPasswordInputGUI($this->lng->txt("password"), "password");
311 $password->setRequired(true);
312 $form->addItem($password);
313
314 $form->addCommandButton('savepasswordform', $this->lng->txt("save"));
315 $form->addCommandButton('share', $this->lng->txt("cancel"));
316
317 return $form;
318 }
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 293 of file class.ilWorkspaceAccessGUI.php.

293 : void
294 {
295 $obj_id = $this->std_request->getObjId();
296 if ($obj_id !== 0) {
297 $this->getAccessHandler()->removePermission($this->node_id, $obj_id);
298 $this->tpl->setOnScreenMessage('success', $this->lng->txt("wsp_permission_removed"), true);
299 }
300
301 $this->ctrl->redirect($this, "share");
302 }

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

+ Here is the call graph for this function:

◆ savePasswordForm()

ilWorkspaceAccessGUI::savePasswordForm ( )
protected

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

330 : void
331 {
332 $form = $this->initPasswordForm();
333 if ($form->checkInput()) {
334 $this->getAccessHandler()->addPermission(
335 $this->node_id,
336 self::PERMISSION_ALL_PASSWORD,
337 md5($form->getInput("password"))
338 );
339 $this->tpl->setOnScreenMessage('success', $this->lng->txt("wsp_permission_all_pw_info"), true);
340 $this->ctrl->redirect($this, "share");
341 }
342
343 $form->setValuesByPost();
344 $this->showPasswordForm($form);
345 }

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 86 of file class.ilWorkspaceAccessGUI.php.

86 : void
87 {
88 $this->blocking_message = $a_val;
89 }

◆ setObjectTitle()

ilWorkspaceAccessGUI::setObjectTitle ( )
protected

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

177 : void
178 {
180
181 if (!$this->is_portfolio) {
182 $obj_id = $this->access_handler->getTree()->lookupObjectId($this->node_id);
183 } else {
184 $obj_id = $this->node_id;
185 }
187 }
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 197 of file class.ilWorkspaceAccessGUI.php.

197 : void
198 {
199 $ilToolbar = $this->toolbar;
201 $ilUser = $this->user;
203
204
205 // blocking message
206 if ($this->getBlockingMessage() != "") {
208 return;
209 }
210
211 $options = array();
212 $options["user"] = $this->lng->txt("wsp_set_permission_single_user");
213
214 $grp_ids = ilGroupParticipants::_getMembershipByType($ilUser->getId(), ['grp']);
215 if (sizeof($grp_ids)) {
216 $options["group"] = $this->lng->txt("wsp_set_permission_group");
217 }
218
219 $crs_ids = ilCourseParticipants::_getMembershipByType($ilUser->getId(), ['crs']);
220 if (sizeof($crs_ids)) {
221 $options["course"] = $this->lng->txt("wsp_set_permission_course");
222 }
223
224 if (!$this->getAccessHandler()->hasRegisteredPermission($this->node_id)) {
225 $options["registered"] = $this->lng->txt("wsp_set_permission_registered");
226 }
227
228 if ($ilSetting->get("enable_global_profiles")) {
229 if (!$this->getAccessHandler()->hasGlobalPasswordPermission($this->node_id)) {
230 $options["password"] = $this->lng->txt("wsp_set_permission_all_password");
231 }
232
233 if (!$this->getAccessHandler()->hasGlobalPermission($this->node_id)) {
234 $options["all"] = $this->lng->txt("wsp_set_permission_all");
235 }
236 }
237
238 $actions = new ilSelectInputGUI("", "action");
239 $actions->setOptions($options);
240 $ilToolbar->addStickyItem($actions);
241
242 $ilToolbar->setFormAction($this->ctrl->getFormAction($this));
243
244 $this->gui->button(
245 $this->lng->txt("add"),
246 "addpermissionhandler"
247 )->submit()->toToolbar(true);
248
249 $table = new ilWorkspaceAccessTableGUI($this, "share", $this->node_id, $this->getAccessHandler());
250 $tpl->setContent($table->getHTML() . $this->footer);
251 }
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, $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 320 of file class.ilWorkspaceAccessGUI.php.

320 : void
321 {
323
324 if (!$a_form) {
325 $a_form = $this->initPasswordForm();
326 }
327 $tpl->setContent($a_form->getHTML());
328 }

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

ilWorkspaceAccessGUI::$access_handler
protected

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

Referenced by getAccessHandler().

◆ $blocking_message

string ilWorkspaceAccessGUI::$blocking_message = ""
protected

Definition at line 50 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 48 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 51 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: