ILIAS  release_5-3 Revision v5.3.23-19-g915713cf615
ilWorkspaceAccessGUI Class Reference

ACL access handler GUI. More...

+ Collaboration diagram for ilWorkspaceAccessGUI:

Public Member Functions

 __construct ($a_node_id, $a_access_handler, $a_is_portfolio=false, $a_footer=null)
 
 executeCommand ()
 
 addPermissionHandler ()
 
 removePermission ()
 

Data Fields

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

Protected Member Functions

 setObjectTitle ()
 restore object title More...
 
 getAccessHandler ()
 
 share ()
 
 initPasswordForm ()
 
 showPasswordForm (ilPropertyFormGUI $a_form=null)
 
 savePasswordForm ()
 

Protected Attributes

 $tabs
 
 $tpl
 
 $toolbar
 
 $user
 
 $settings
 
 $ctrl
 
 $lng
 
 $node_id
 
 $access_handler
 
 $footer
 

Detailed Description

Constructor & Destructor Documentation

◆ __construct()

ilWorkspaceAccessGUI::__construct (   $a_node_id,
  $a_access_handler,
  $a_is_portfolio = false,
  $a_footer = null 
)

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

54 {
55 global $DIC;
56
57 $this->tabs = $DIC->tabs();
58 $this->tpl = $DIC["tpl"];
59 $this->toolbar = $DIC->toolbar();
60 $this->user = $DIC->user();
61 $this->settings = $DIC->settings();
62 $ilCtrl = $DIC->ctrl();
63 $lng = $DIC->language();
64
65 $this->ctrl = $ilCtrl;
66 $this->lng = $lng;
67 $this->node_id = $a_node_id;
68 $this->access_handler = $a_access_handler;
69 $this->is_portfolio = (bool) $a_is_portfolio;
70 $this->footer = $a_footer;
71 }
user()
Definition: user.php:4
global $ilCtrl
Definition: ilias.php:18
global $DIC
Definition: saml.php:7
settings()
Definition: settings.php:2

References $DIC, $ilCtrl, $lng, settings(), and user().

+ Here is the call graph for this function:

Member Function Documentation

◆ addPermissionHandler()

ilWorkspaceAccessGUI::addPermissionHandler ( )

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

235 {
236 switch ($_REQUEST["action"]) {
237 case "user":
238
239 include_once './Services/User/classes/class.ilUserAccountSettings.php';
240 if (ilUserAccountSettings::getInstance()->isUserAccessRestricted()) {
241 $this->ctrl->redirectByClass("ilsingleusersharegui");
242 } else {
243 $this->ctrl->setParameterByClass("ilmailsearchgui", "ref", "wsp");
244 $this->ctrl->redirectByClass("ilmailsearchgui");
245 }
246
247 // no break
248 case "group":
249 $this->ctrl->setParameterByClass("ilmailsearchgroupsgui", "ref", "wsp");
250 $this->ctrl->redirectByClass("ilmailsearchgroupsgui");
251
252 // no break
253 case "course":
254 $this->ctrl->setParameterByClass("ilmailsearchcoursesgui", "ref", "wsp");
255 $this->ctrl->redirectByClass("ilmailsearchcoursesgui");
256
257 // no break
258 case "registered":
259 $this->getAccessHandler()->addPermission($this->node_id, self::PERMISSION_REGISTERED);
260 ilUtil::sendSuccess($this->lng->txt("wsp_permission_registered_info"), true);
261 $this->ctrl->redirect($this, "share");
262
263 // no break
264 case "password":
265 $this->showPasswordForm();
266 break;
267
268 case "all":
269 $this->getAccessHandler()->addPermission($this->node_id, self::PERMISSION_ALL);
270 ilUtil::sendSuccess($this->lng->txt("wsp_permission_all_info"), true);
271 $this->ctrl->redirect($this, "share");
272 }
273 }
static getInstance()
Singelton get instance.
static sendSuccess($a_info="", $a_keep=false)
Send Success Message to Screen.
showPasswordForm(ilPropertyFormGUI $a_form=null)

References getAccessHandler(), ilUserAccountSettings\getInstance(), ilUtil\sendSuccess(), and showPasswordForm().

+ Here is the call graph for this function:

◆ executeCommand()

ilWorkspaceAccessGUI::executeCommand ( )

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

74 {
75 $ilTabs = $this->tabs;
77
78 $next_class = $this->ctrl->getNextClass($this);
79 $cmd = $this->ctrl->getCmd();
80
81 switch ($next_class) {
82 case "ilmailsearchcoursesgui":
83 $ilTabs->setBackTarget(
84 $this->lng->txt("back"),
85 $this->ctrl->getLinkTarget($this, "share")
86 );
87 include_once('Services/Contact/classes/class.ilMailSearchCoursesGUI.php');
88 $csearch = new ilMailSearchCoursesGUI($this->access_handler, $this->node_id);
89 $this->ctrl->setReturn($this, 'share');
90 $this->ctrl->forwardCommand($csearch);
91
92 $this->setObjectTitle();
93 break;
94
95 case "ilmailsearchgroupsgui":
96 $ilTabs->setBackTarget(
97 $this->lng->txt("back"),
98 $this->ctrl->getLinkTarget($this, "share")
99 );
100 include_once('Services/Contact/classes/class.ilMailSearchGroupsGUI.php');
101 $gsearch = new ilMailSearchGroupsGUI($this->access_handler, $this->node_id);
102 $this->ctrl->setReturn($this, 'share');
103 $this->ctrl->forwardCommand($gsearch);
104
105 $this->setObjectTitle();
106 break;
107
108 case "ilmailsearchgui":
109 $ilTabs->setBackTarget(
110 $this->lng->txt("back"),
111 $this->ctrl->getLinkTarget($this, "share")
112 );
113 include_once('Services/Contact/classes/class.ilMailSearchGUI.php');
114 $usearch = new ilMailSearchGUI($this->access_handler, $this->node_id);
115 $this->ctrl->setReturn($this, 'share');
116 $this->ctrl->forwardCommand($usearch);
117
118 $this->setObjectTitle();
119 break;
120
121 case "ilsingleusersharegui":
122 $ilTabs->setBackTarget(
123 $this->lng->txt("back"),
124 $this->ctrl->getLinkTarget($this, "share")
125 );
126 include_once('Services/PersonalWorkspace/classes/class.ilSingleUserShareGUI.php');
127 $ushare = new ilSingleUserShareGUI($this->access_handler, $this->node_id);
128 $this->ctrl->setReturn($this, 'share');
129 $this->ctrl->forwardCommand($ushare);
130
131 $this->setObjectTitle();
132 break;
133
134 case "ilpublicuserprofilegui":
135 $ilTabs->clearTargets();
136 $ilTabs->setBackTarget(
137 $this->lng->txt("back"),
138 $this->ctrl->getLinkTarget($this, "share")
139 );
140
141 include_once('./Services/User/classes/class.ilPublicUserProfileGUI.php');
142 $prof = new ilPublicUserProfileGUI($_REQUEST["user"]);
143 $prof->setBackUrl($this->ctrl->getLinkTarget($this, "share"));
144 $tpl->setContent($prof->getHTML());
145 break;
146
147 default:
148 // $this->prepareOutput();
149 if (!$cmd) {
150 $cmd = "share";
151 }
152 return $this->$cmd();
153 }
154
155 return true;
156 }
GUI class for public user profile presentation.
setObjectTitle()
restore object title

References $tabs, $tpl, and setObjectTitle().

+ Here is the call graph for this function:

◆ getAccessHandler()

ilWorkspaceAccessGUI::getAccessHandler ( )
protected

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

References $access_handler.

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

+ Here is the caller graph for this function:

◆ initPasswordForm()

ilWorkspaceAccessGUI::initPasswordForm ( )
protected

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

286 {
287 include_once "Services/Form/classes/class.ilPropertyFormGUI.php";
288 $form = new ilPropertyFormGUI();
289 $form->setFormAction($this->ctrl->getFormAction($this));
290 $form->setTitle($this->lng->txt("wsp_set_permission_all_password"));
291
292 $password = new ilPasswordInputGUI($this->lng->txt("password"), "password");
293 $password->setRequired(true);
294 $form->addItem($password);
295
296 $form->addCommandButton('savepasswordform', $this->lng->txt("save"));
297 $form->addCommandButton('share', $this->lng->txt("cancel"));
298
299 return $form;
300 }
This class represents a password property in a property form.
This class represents a property form user interface.
$password
Definition: pwgen.php:17
if(isset($_POST['submit'])) $form

References $form, and $password.

Referenced by savePasswordForm(), and showPasswordForm().

+ Here is the caller graph for this function:

◆ removePermission()

ilWorkspaceAccessGUI::removePermission ( )

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

276 {
277 if ($_REQUEST["obj_id"]) {
278 $this->getAccessHandler()->removePermission($this->node_id, (int) $_REQUEST["obj_id"]);
279 ilUtil::sendSuccess($this->lng->txt("wsp_permission_removed"), true);
280 }
281
282 $this->ctrl->redirect($this, "share");
283 }

References getAccessHandler(), and ilUtil\sendSuccess().

+ Here is the call graph for this function:

◆ savePasswordForm()

ilWorkspaceAccessGUI::savePasswordForm ( )
protected

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

313 {
314 $form = $this->initPasswordForm();
315 if ($form->checkInput()) {
316 $this->getAccessHandler()->addPermission(
317 $this->node_id,
318 self::PERMISSION_ALL_PASSWORD,
319 md5($form->getInput("password"))
320 );
321 ilUtil::sendSuccess($this->lng->txt("wsp_permission_all_pw_info"), true);
322 $this->ctrl->redirect($this, "share");
323 }
324
325 $form->setValuesByPost();
326 $this->showPasswordForm($form);
327 }

References $form, getAccessHandler(), initPasswordForm(), ilUtil\sendSuccess(), and showPasswordForm().

+ Here is the call graph for this function:

◆ setObjectTitle()

ilWorkspaceAccessGUI::setObjectTitle ( )
protected

restore object title

Returns
string

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

164 {
166
167 if (!$this->is_portfolio) {
168 $obj_id = $this->access_handler->getTree()->lookupObjectId($this->node_id);
169 } else {
170 $obj_id = $this->node_id;
171 }
172 $tpl->setTitle(ilObject::_lookupTitle($obj_id));
173 }
static _lookupTitle($a_id)
lookup object title

References $node_id, $tpl, and ilObject\_lookupTitle().

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

181 {
182 $ilToolbar = $this->toolbar;
186
187 $options = array();
188 $options["user"] = $this->lng->txt("wsp_set_permission_single_user");
189
190 include_once 'Modules/Group/classes/class.ilGroupParticipants.php';
191 $grp_ids = ilGroupParticipants::_getMembershipByType($ilUser->getId(), 'grp');
192 if (sizeof($grp_ids)) {
193 $options["group"] = $this->lng->txt("wsp_set_permission_group");
194 }
195
196 include_once 'Modules/Course/classes/class.ilCourseParticipants.php';
197 $crs_ids = ilCourseParticipants::_getMembershipByType($ilUser->getId(), 'crs');
198 if (sizeof($crs_ids)) {
199 $options["course"] = $this->lng->txt("wsp_set_permission_course");
200 }
201
202 if (!$this->getAccessHandler()->hasRegisteredPermission($this->node_id)) {
203 $options["registered"] = $this->lng->txt("wsp_set_permission_registered");
204 }
205
206 if ($ilSetting->get("enable_global_profiles")) {
207 if (!$this->getAccessHandler()->hasGlobalPasswordPermission($this->node_id)) {
208 $options["password"] = $this->lng->txt("wsp_set_permission_all_password");
209 }
210
211 if (!$this->getAccessHandler()->hasGlobalPermission($this->node_id)) {
212 $options["all"] = $this->lng->txt("wsp_set_permission_all");
213 }
214 }
215
216 include_once "Services/Form/classes/class.ilPropertyFormGUI.php";
217 $actions = new ilSelectInputGUI("", "action");
218 $actions->setOptions($options);
219 $ilToolbar->addStickyItem($actions);
220
221 $ilToolbar->setFormAction($this->ctrl->getFormAction($this));
222
223 include_once "Services/UIComponent/Button/classes/class.ilSubmitButton.php";
224 $button = ilSubmitButton::getInstance();
225 $button->setCaption("add");
226 $button->setCommand("addpermissionhandler");
227 $ilToolbar->addStickyItem($button);
228
229 include_once "Services/PersonalWorkspace/classes/class.ilWorkspaceAccessTableGUI.php";
230 $table = new ilWorkspaceAccessTableGUI($this, "share", $this->node_id, $this->getAccessHandler());
231 $tpl->setContent($table->getHTML() . $this->footer);
232 }
if(!isset( $_REQUEST[ 'ReturnTo'])) if(!isset($_REQUEST['AuthId'])) $options
Definition: as_login.php:20
static _getMembershipByType($a_usr_id, $a_type, $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.
static getInstance()
Factory.
Workspace access handler table GUI class.
global $ilSetting
Definition: privfeed.php:17
if(empty($password)) $table
Definition: pwgen.php:24
$ilUser
Definition: imgupload.php:18

References $ilSetting, $ilUser, $options, $settings, $table, $toolbar, $tpl, $user, ilParticipants\_getMembershipByType(), getAccessHandler(), and ilSubmitButton\getInstance().

+ Here is the call graph for this function:

◆ showPasswordForm()

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

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

303 {
305
306 if (!$a_form) {
307 $a_form = $this->initPasswordForm();
308 }
309 $tpl->setContent($a_form->getHTML());
310 }

References $tpl, and initPasswordForm().

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

Referenced by getAccessHandler().

◆ $ctrl

ilWorkspaceAccessGUI::$ctrl
protected

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

◆ $footer

ilWorkspaceAccessGUI::$footer
protected

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

◆ $lng

ilWorkspaceAccessGUI::$lng
protected

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

Referenced by __construct().

◆ $node_id

ilWorkspaceAccessGUI::$node_id
protected

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

Referenced by setObjectTitle().

◆ $settings

ilWorkspaceAccessGUI::$settings
protected

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

Referenced by share().

◆ $tabs

ilWorkspaceAccessGUI::$tabs
protected

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

Referenced by executeCommand().

◆ $toolbar

ilWorkspaceAccessGUI::$toolbar
protected

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

Referenced by share().

◆ $tpl

ilWorkspaceAccessGUI::$tpl
protected

◆ $user

ilWorkspaceAccessGUI::$user
protected

Definition at line 35 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: