ILIAS  release_5-2 Revision v5.2.25-18-g3f80b828510
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)

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

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

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
Create styles array
The data for the language used.

Member Function Documentation

◆ __initSubTabs()

ilPermission2GUI::__initSubTabs (   $a_cmd)

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

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

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

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";
138  if(ilRbacLog::isActive())
139  {
140  $ilTabs->addSubTabTarget("log", $this->ctrl->getLinkTarget($this, "log"),
141  "", "", "", $log);
142  }
143  }
static isActive()
$info
Definition: example_052.php:80
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:

◆ applyLogFilter()

ilPermission2GUI::applyLogFilter ( )

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

References log(), and ilTable2GUI\resetOffset().

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  }
resetOffset($a_in_determination=false)
Reset offset.
Class ilRbacLogTableGUI.
+ Here is the call graph for this function:

◆ changeOwner()

ilPermission2GUI::changeOwner ( )

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

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

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 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 145 of file class.ilPermission2GUI.php.

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

Referenced by applyLogFilter(), and resetLogFilter().

146  {
147  include_once "Services/AccessControl/classes/class.ilRbacLog.php";
148  if(!ilRbacLog::isActive())
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  }
static isActive()
Class ilRbacLogTableGUI.
+ 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.

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

Referenced by changeOwner().

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
setDataSource($href, $a_delimiter=null)
set datasource link for js autocomplete
This class represents a property form user interface.
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 169 of file class.ilPermission2GUI.php.

References log(), and ilTable2GUI\resetOffset().

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  }
resetOffset($a_in_determination=false)
Reset offset.
Class ilRbacLogTableGUI.
+ 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: