ILIAS  release_5-3 Revision v5.3.23-19-g915713cf615
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 $ilCtrl, $ilErr, $lng, $tpl, array, and PEAR_ERROR_CALLBACK.

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

Member Function Documentation

◆ __initSubTabs()

ilPermission2GUI::__initSubTabs (   $a_cmd)

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

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

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

112  {
113  global $ilTabs;
114 
115  $perm = ($a_cmd == 'perm') ? true : false;
116  $perm_positions = ($a_cmd == ilPermissionGUI::CMD_PERM_POSITIONS) ? true : false;
117  $info = ($a_cmd == 'perminfo') ? true : false;
118  $owner = ($a_cmd == 'owner') ? true : false;
119  $log = ($a_cmd == 'log') ? true : false;
120 
121  $ilTabs->addSubTabTarget(
122  "permission_settings",
123  $this->ctrl->getLinkTarget($this, "perm"),
124  "",
125  "",
126  "",
127  $perm
128  );
129 
130  if (ilOrgUnitGlobalSettings::getInstance()->isPositionAccessActiveForObject($this->gui_obj->object->getId())) {
131  $ilTabs->addSubTabTarget(self::TAB_POSITION_PERMISSION_SETTINGS, $this->ctrl->getLinkTarget($this, ilPermissionGUI::CMD_PERM_POSITIONS), "", "", "", $perm_positions);
132  }
133 
134  $ilTabs->addSubTabTarget(
135  "info_status_info",
136  $this->ctrl->getLinkTargetByClass(array(get_class($this),"ilobjectpermissionstatusgui"), "perminfo"),
137  "",
138  "",
139  "",
140  $info
141  );
142  $ilTabs->addSubTabTarget(
143  "owner",
144  $this->ctrl->getLinkTarget($this, "owner"),
145  "",
146  "",
147  "",
148  $owner
149  );
150 
151  include_once "Services/AccessControl/classes/class.ilRbacLog.php";
152  if (ilRbacLog::isActive()) {
153  $ilTabs->addSubTabTarget(
154  "log",
155  $this->ctrl->getLinkTarget($this, "log"),
156  "",
157  "",
158  "",
159  $log
160  );
161  }
162  }
static isActive()
Create styles array
The data for the language used.
$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 178 of file class.ilPermission2GUI.php.

References $table, and log().

179  {
180  include_once "Services/AccessControl/classes/class.ilRbacLogTableGUI.php";
181  $table = new ilRbacLogTableGUI($this, "log", $this->gui_obj->object->getRefId());
182  $table->resetOffset();
183  $table->writeFilterToSession();
184  $this->log();
185  }
Class ilRbacLogTableGUI.
if(empty($password)) $table
Definition: pwgen.php:24
+ Here is the call graph for this function:

◆ changeOwner()

ilPermission2GUI::changeOwner ( )

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

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

78  {
79  global $rbacsystem,$ilObjDataCache;
80 
81  if (!$user_id = ilObjUser::_lookupId($_POST['owner'])) {
82  ilUtil::sendFailure($this->lng->txt('user_not_known'));
83  $this->owner();
84  return true;
85  }
86 
87  // no need to change?
88  if ($user_id != $this->gui_obj->object->getOwner()) {
89  $this->gui_obj->object->setOwner($user_id);
90  $this->gui_obj->object->updateOwner();
91  $ilObjDataCache->deleteCachedEntry($this->gui_obj->object->getId());
92 
93  include_once "Services/AccessControl/classes/class.ilRbacLog.php";
94  if (ilRbacLog::isActive()) {
95  ilRbacLog::add(ilRbacLog::CHANGE_OWNER, $this->gui_obj->object->getRefId(), array($user_id));
96  }
97  }
98 
99  ilUtil::sendSuccess($this->lng->txt('owner_updated'), true);
100 
101  if (!$rbacsystem->checkAccess("edit_permission", $this->gui_obj->object->getRefId())) {
102  $this->ctrl->redirect($this->gui_obj);
103  return true;
104  }
105 
106  $this->ctrl->redirect($this, 'owner');
107  return true;
108  }
static sendSuccess($a_info="", $a_keep=false)
Send Success Message to Screen.
const CHANGE_OWNER
static _lookupId($a_user_str)
Lookup id by login.
static isActive()
Create styles array
The data for the language used.
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 164 of file class.ilPermission2GUI.php.

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

Referenced by applyLogFilter(), and resetLogFilter().

165  {
166  include_once "Services/AccessControl/classes/class.ilRbacLog.php";
167  if (!ilRbacLog::isActive()) {
168  $this->ctrl->redirect($this, "perm");
169  }
170 
171  $this->__initSubTabs("log");
172 
173  include_once "Services/AccessControl/classes/class.ilRbacLogTableGUI.php";
174  $table = new ilRbacLogTableGUI($this, "log", $this->gui_obj->object->getRefId());
175  $this->tpl->setContent($table->getHTML());
176  }
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 54 of file class.ilPermission2GUI.php.

References $form, __initSubTabs(), ilObjUser\_lookupLogin(), array, and ilTextInputGUI\setDataSource().

Referenced by changeOwner().

55  {
56  $this->__initSubTabs("owner");
57 
58  include_once "Services/Form/classes/class.ilPropertyFormGUI.php";
59  $form = new ilPropertyFormGUI();
60  $form->setFormAction($this->ctrl->getFormAction($this, "owner"));
61  $form->setTitle($this->lng->txt("info_owner_of_object"));
62 
63  $login = new ilTextInputGUI($this->lng->txt("login"), "owner");
64  $login->setDataSource($this->ctrl->getLinkTargetByClass(array(get_class($this),
65  'ilRepositorySearchGUI'), 'doUserAutoComplete', '', true));
66  $login->setRequired(true);
67  $login->setSize(50);
68  $login->setInfo($this->lng->txt("chown_warning"));
69  $login->setValue(ilObjUser::_lookupLogin($this->gui_obj->object->getOwner()));
70  $form->addItem($login);
71 
72  $form->addCommandButton("changeOwner", $this->lng->txt("change_owner"));
73 
74  $this->tpl->setContent($form->getHTML());
75  }
static _lookupLogin($a_user_id)
lookup login
setDataSource($href, $a_delimiter=null)
set datasource link for js autocomplete
This class represents a property form user interface.
if(isset($_POST['submit'])) $form
This class represents a text property in a property form.
Create styles array
The data for the language used.
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ resetLogFilter()

ilPermission2GUI::resetLogFilter ( )

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

References $table, and log().

188  {
189  include_once "Services/AccessControl/classes/class.ilRbacLogTableGUI.php";
190  $table = new ilRbacLogTableGUI($this, "log", $this->gui_obj->object->getRefId());
191  $table->resetOffset();
192  $table->resetFilter();
193  $this->log();
194  }
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: