ILIAS  release_5-4 Revision v5.4.26-12-gabc799a52e6
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 ()
 

Data Fields

const TAB_POSITION_PERMISSION_SETTINGS = "position_permission_settings"
 

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)

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

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

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

Member Function Documentation

◆ __initSubTabs()

ilPermission2GUI::__initSubTabs (   $a_cmd)

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

References $DIC, $info, $log, ilPermissionGUI\CMD_PERM_POSITIONS, ilOrgUnitGlobalSettings\getInstance(), and ilRbacLog\isActive().

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

123  {
124  global $DIC;
125 
126  $ilTabs = $DIC['ilTabs'];
127 
128  $perm = ($a_cmd == 'perm') ? true : false;
129  $perm_positions = ($a_cmd == ilPermissionGUI::CMD_PERM_POSITIONS) ? true : false;
130  $info = ($a_cmd == 'perminfo') ? true : false;
131  $owner = ($a_cmd == 'owner') ? true : false;
132  $log = ($a_cmd == 'log') ? true : false;
133 
134  $ilTabs->addSubTabTarget(
135  "permission_settings",
136  $this->ctrl->getLinkTarget($this, "perm"),
137  "",
138  "",
139  "",
140  $perm
141  );
142 
143  if (ilOrgUnitGlobalSettings::getInstance()->isPositionAccessActiveForObject($this->gui_obj->object->getId())) {
144  $ilTabs->addSubTabTarget(self::TAB_POSITION_PERMISSION_SETTINGS, $this->ctrl->getLinkTarget($this, ilPermissionGUI::CMD_PERM_POSITIONS), "", "", "", $perm_positions);
145  }
146 
147  $ilTabs->addSubTabTarget(
148  "info_status_info",
149  $this->ctrl->getLinkTargetByClass(array(get_class($this),"ilobjectpermissionstatusgui"), "perminfo"),
150  "",
151  "",
152  "",
153  $info
154  );
155  $ilTabs->addSubTabTarget(
156  "owner",
157  $this->ctrl->getLinkTarget($this, "owner"),
158  "",
159  "",
160  "",
161  $owner
162  );
163 
164  include_once "Services/AccessControl/classes/class.ilRbacLog.php";
165  if (ilRbacLog::isActive()) {
166  $ilTabs->addSubTabTarget(
167  "log",
168  $this->ctrl->getLinkTarget($this, "log"),
169  "",
170  "",
171  "",
172  $log
173  );
174  }
175  }
global $DIC
Definition: saml.php:7
static isActive()
$log
Definition: sabredav.php:21
$info
Definition: index.php:5
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ applyLogFilter()

ilPermission2GUI::applyLogFilter ( )

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

References $table, and log().

192  {
193  include_once "Services/AccessControl/classes/class.ilRbacLogTableGUI.php";
194  $table = new ilRbacLogTableGUI($this, "log", $this->gui_obj->object->getRefId());
195  $table->resetOffset();
196  $table->writeFilterToSession();
197  $this->log();
198  }
Class ilRbacLogTableGUI.
if(empty($password)) $table
Definition: pwgen.php:24
+ Here is the call graph for this function:

◆ changeOwner()

ilPermission2GUI::changeOwner ( )

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

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

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

◆ log()

ilPermission2GUI::log ( )

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

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

Referenced by applyLogFilter(), and resetLogFilter().

178  {
179  include_once "Services/AccessControl/classes/class.ilRbacLog.php";
180  if (!ilRbacLog::isActive()) {
181  $this->ctrl->redirect($this, "perm");
182  }
183 
184  $this->__initSubTabs("log");
185 
186  include_once "Services/AccessControl/classes/class.ilRbacLogTableGUI.php";
187  $table = new ilRbacLogTableGUI($this, "log", $this->gui_obj->object->getRefId());
188  $this->tpl->setContent($table->getHTML());
189  }
static isActive()
Class ilRbacLogTableGUI.
if(empty($password)) $table
Definition: pwgen.php:24
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ owner()

ilPermission2GUI::owner ( )

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

References $form, $login, __initSubTabs(), and ilObjUser\_lookupLogin().

Referenced by changeOwner().

63  {
64  $this->__initSubTabs("owner");
65 
66  include_once "Services/Form/classes/class.ilPropertyFormGUI.php";
67  $form = new ilPropertyFormGUI();
68  $form->setFormAction($this->ctrl->getFormAction($this, "owner"));
69  $form->setTitle($this->lng->txt("info_owner_of_object"));
70 
71  $login = new ilTextInputGUI($this->lng->txt("login"), "owner");
72  $login->setDataSource($this->ctrl->getLinkTargetByClass(array(get_class($this),
73  'ilRepositorySearchGUI'), 'doUserAutoComplete', '', true));
74  $login->setRequired(true);
75  $login->setSize(50);
76  $login->setInfo($this->lng->txt("chown_warning"));
77  $login->setValue(ilObjUser::_lookupLogin($this->gui_obj->object->getOwner()));
78  $form->addItem($login);
79 
80  $form->addCommandButton("changeOwner", $this->lng->txt("change_owner"));
81 
82  $this->tpl->setContent($form->getHTML());
83  }
static _lookupLogin($a_user_id)
lookup login
This class represents a property form user interface.
if(isset($_POST['submit'])) $form
This class represents a text property in a property form.
$login
Definition: cron.php:13
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ resetLogFilter()

ilPermission2GUI::resetLogFilter ( )

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

References $table, and log().

201  {
202  include_once "Services/AccessControl/classes/class.ilRbacLogTableGUI.php";
203  $table = new ilRbacLogTableGUI($this, "log", $this->gui_obj->object->getRefId());
204  $table->resetOffset();
205  $table->resetFilter();
206  $this->log();
207  }
Class ilRbacLogTableGUI.
if(empty($password)) $table
Definition: pwgen.php:24
+ 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().

◆ TAB_POSITION_PERMISSION_SETTINGS

const ilPermission2GUI::TAB_POSITION_PERMISSION_SETTINGS = "position_permission_settings"

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


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