ILIAS  release_5-1 Revision 5.0.0-5477-g43f3e3fab5f
ilPermission2GUI Class Reference

Class ilPermissionGUI RBAC related output. More...

+ Inheritance diagram for ilPermission2GUI:
+ Collaboration diagram for ilPermission2GUI:

Public Member Functions

 __construct ($a_gui_obj)
 
 owner ()
 
 changeOwner ()
 
 __initSubTabs ($a_cmd)
 
 log ()
 
 applyLogFilter ()
 
 resetLogFilter ()
 

Protected Attributes

 $gui_obj = null
 
 $ilErr = null
 
 $ctrl = null
 
 $lng = null
 

Detailed Description

Class ilPermissionGUI RBAC related output.

Author
Stefan Meyer smeye.nosp@m.r.il.nosp@m.ias@g.nosp@m.mx.d.nosp@m.e
Version
Id
class.ilPermissionGUI.php 20310 2009-06-23 12:57:19Z smeyer

Definition at line 16 of file class.ilPermission2GUI.php.

Constructor & Destructor Documentation

◆ __construct()

ilPermission2GUI::__construct (   $a_gui_obj)

Reimplemented in ilPermissionGUI.

Definition at line 23 of file class.ilPermission2GUI.php.

24 {
25 global $ilias, $objDefinition, $tpl, $tree, $ilCtrl, $ilErr, $lng;
26
27 if (!isset($ilErr))
28 {
29 $ilErr = new ilErrorHandling();
30 $ilErr->setErrorHandling(PEAR_ERROR_CALLBACK,array($ilErr,'errorHandler'));
31 }
32 else
33 {
34 $this->ilErr =& $ilErr;
35 }
36
37 $this->objDefinition =& $objDefinition;
38 $this->tpl =& $tpl;
39 $this->lng =& $lng;
40 $this->lng->loadLanguageModule("rbac");
41
42 $this->ctrl =& $ilCtrl;
43
44 $this->gui_obj = $a_gui_obj;
45
46 $this->roles = array();
47 $this->num_roles = 0;
48 }
const PEAR_ERROR_CALLBACK
Definition: PEAR.php:35
global $tpl
Definition: ilias.php:8
global $ilCtrl
Definition: ilias.php:18

References $ilCtrl, $ilErr, $lng, $tpl, and PEAR_ERROR_CALLBACK.

Member Function Documentation

◆ __initSubTabs()

ilPermission2GUI::__initSubTabs (   $a_cmd)

Definition at line 117 of file class.ilPermission2GUI.php.

118 {
119 global $ilTabs;
120
121 $perm = ($a_cmd == 'perm') ? true : false;
122 $info = ($a_cmd == 'perminfo') ? true : false;
123 $owner = ($a_cmd == 'owner') ? true : false;
124 $log = ($a_cmd == 'log') ? true : false;
125
126 $ilTabs->addSubTabTarget("permission_settings", $this->ctrl->getLinkTarget($this, "perm"),
127 "", "", "", $perm);
128
129 #$ilTabs->addSubTabTarget("permission_settings", $this->ctrl->getLinkTarget($this, "perm2"),
130 # "", "", "", $perm);
131
132 $ilTabs->addSubTabTarget("info_status_info", $this->ctrl->getLinkTargetByClass(array(get_class($this),"ilobjectpermissionstatusgui"), "perminfo"),
133 "", "", "", $info);
134 $ilTabs->addSubTabTarget("owner", $this->ctrl->getLinkTarget($this, "owner"),
135 "", "", "", $owner);
136
137 include_once "Services/AccessControl/classes/class.ilRbacLog.php";
139 {
140 $ilTabs->addSubTabTarget("log", $this->ctrl->getLinkTarget($this, "log"),
141 "", "", "", $log);
142 }
143 }
static isActive()
$info
Definition: example_052.php:80

References $info, $log, and ilRbacLog\isActive().

Referenced by ilPermissionGUI\executeCommand(), log(), owner(), and ilPermissionGUI\perm().

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

◆ applyLogFilter()

ilPermission2GUI::applyLogFilter ( )

Definition at line 160 of file class.ilPermission2GUI.php.

161 {
162 include_once "Services/AccessControl/classes/class.ilRbacLogTableGUI.php";
163 $table = new ilRbacLogTableGUI($this, "log", $this->gui_obj->object->getRefId());
164 $table->resetOffset();
165 $table->writeFilterToSession();
166 $this->log();
167 }
Class ilRbacLogTableGUI.

References log().

+ Here is the call graph for this function:

◆ changeOwner()

ilPermission2GUI::changeOwner ( )

Definition at line 78 of file class.ilPermission2GUI.php.

79 {
80 global $rbacsystem,$ilObjDataCache;
81
82 if(!$user_id = ilObjUser::_lookupId($_POST['owner']))
83 {
84 ilUtil::sendFailure($this->lng->txt('user_not_known'));
85 $this->owner();
86 return true;
87 }
88
89 // no need to change?
90 if($user_id != $this->gui_obj->object->getOwner())
91 {
92 $this->gui_obj->object->setOwner($user_id);
93 $this->gui_obj->object->updateOwner();
94 $ilObjDataCache->deleteCachedEntry($this->gui_obj->object->getId());
95
96 include_once "Services/AccessControl/classes/class.ilRbacLog.php";
98 {
99 ilRbacLog::add(ilRbacLog::CHANGE_OWNER, $this->gui_obj->object->getRefId(), array($user_id));
100 }
101 }
102
103 ilUtil::sendSuccess($this->lng->txt('owner_updated'),true);
104
105 if (!$rbacsystem->checkAccess("edit_permission",$this->gui_obj->object->getRefId()))
106 {
107 $this->ctrl->redirect($this->gui_obj);
108 return true;
109 }
110
111 $this->ctrl->redirect($this,'owner');
112 return true;
113
114 }
static _lookupId($a_user_str)
Lookup id by login.
static add($a_action, $a_ref_id, array $a_diff, $a_source_ref_id=false)
const CHANGE_OWNER
static sendSuccess($a_info="", $a_keep=false)
Send Success Message to Screen.
static sendFailure($a_info="", $a_keep=false)
Send Failure Message to Screen.
$_POST['username']
Definition: cron.php:12

References $_POST, ilObjUser\_lookupId(), ilRbacLog\add(), ilRbacLog\CHANGE_OWNER, ilRbacLog\isActive(), owner(), ilUtil\sendFailure(), and ilUtil\sendSuccess().

+ Here is the call graph for this function:

◆ log()

ilPermission2GUI::log ( )

Definition at line 145 of file class.ilPermission2GUI.php.

146 {
147 include_once "Services/AccessControl/classes/class.ilRbacLog.php";
149 {
150 $this->ctrl->redirect($this, "perm");
151 }
152
153 $this->__initSubTabs("log");
154
155 include_once "Services/AccessControl/classes/class.ilRbacLogTableGUI.php";
156 $table = new ilRbacLogTableGUI($this, "log", $this->gui_obj->object->getRefId());
157 $this->tpl->setContent($table->getHTML());
158 }

References __initSubTabs(), and ilRbacLog\isActive().

Referenced by applyLogFilter(), and resetLogFilter().

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

◆ owner()

ilPermission2GUI::owner ( )

Definition at line 55 of file class.ilPermission2GUI.php.

56 {
57 $this->__initSubTabs("owner");
58
59 include_once "Services/Form/classes/class.ilPropertyFormGUI.php";
60 $form = new ilPropertyFormGUI();
61 $form->setFormAction($this->ctrl->getFormAction($this, "owner"));
62 $form->setTitle($this->lng->txt("info_owner_of_object"));
63
64 $login = new ilTextInputGUI($this->lng->txt("login"), "owner");
65 $login->setDataSource($this->ctrl->getLinkTargetByClass(array(get_class($this),
66 'ilRepositorySearchGUI'), 'doUserAutoComplete', '', true));
67 $login->setRequired(true);
68 $login->setSize(50);
69 $login->setInfo($this->lng->txt("chown_warning"));
70 $login->setValue(ilObjUser::_lookupLogin($this->gui_obj->object->getOwner()));
71 $form->addItem($login);
72
73 $form->addCommandButton("changeOwner", $this->lng->txt("change_owner"));
74
75 $this->tpl->setContent($form->getHTML());
76 }
static _lookupLogin($a_user_id)
lookup login
This class represents a property form user interface.
This class represents a text property in a property form.

References __initSubTabs(), and ilObjUser\_lookupLogin().

Referenced by changeOwner().

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

◆ resetLogFilter()

ilPermission2GUI::resetLogFilter ( )

Definition at line 169 of file class.ilPermission2GUI.php.

170 {
171 include_once "Services/AccessControl/classes/class.ilRbacLogTableGUI.php";
172 $table = new ilRbacLogTableGUI($this, "log", $this->gui_obj->object->getRefId());
173 $table->resetOffset();
174 $table->resetFilter();
175 $this->log();
176 }

References log().

+ Here is the call graph for this function:

Field Documentation

◆ $ctrl

ilPermission2GUI::$ctrl = null
protected

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

◆ $gui_obj

ilPermission2GUI::$gui_obj = null
protected

Definition at line 18 of file class.ilPermission2GUI.php.

◆ $ilErr

ilPermission2GUI::$ilErr = null
protected

◆ $lng

ilPermission2GUI::$lng = null
protected

Definition at line 21 of file class.ilPermission2GUI.php.

Referenced by __construct().


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