ILIAS  release_5-0 Revision 5.0.0-1144-gc4397b1f870
All Data Structures Namespaces Files Functions Variables Modules Pages
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
Sascha Hofmann sasch.nosp@m.ahof.nosp@m.mann@.nosp@m.gmx..nosp@m.de
Version
Id
class.ilPermissionGUI.php 20310 2009-06-23 12:57:19Z smeyer

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

Constructor & Destructor Documentation

◆ __construct()

ilPermission2GUI::__construct (   $a_gui_obj)

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

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

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

Member Function Documentation

◆ __initSubTabs()

ilPermission2GUI::__initSubTabs (   $a_cmd)

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

References $log, and ilRbacLog\isActive().

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

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

◆ applyLogFilter()

ilPermission2GUI::applyLogFilter ( )

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

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

162  {
163  include_once "Services/AccessControl/classes/class.ilRbacLogTableGUI.php";
164  $table = new ilRbacLogTableGUI($this, "log", $this->gui_obj->object->getRefId());
165  $table->resetOffset();
166  $table->writeFilterToSession();
167  $this->log();
168  }
resetOffset($a_in_determination=false)
Reset offset.
Class ilRbacLogTableGUI.
+ Here is the call graph for this function:

◆ changeOwner()

ilPermission2GUI::changeOwner ( )

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

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

80  {
81  global $rbacsystem,$ilObjDataCache;
82 
83  if(!$user_id = ilObjUser::_lookupId($_POST['owner']))
84  {
85  ilUtil::sendFailure($this->lng->txt('user_not_known'));
86  $this->owner();
87  return true;
88  }
89 
90  // no need to change?
91  if($user_id != $this->gui_obj->object->getOwner())
92  {
93  $this->gui_obj->object->setOwner($user_id);
94  $this->gui_obj->object->updateOwner();
95  $ilObjDataCache->deleteCachedEntry($this->gui_obj->object->getId());
96 
97  include_once "Services/AccessControl/classes/class.ilRbacLog.php";
99  {
100  ilRbacLog::add(ilRbacLog::CHANGE_OWNER, $this->gui_obj->object->getRefId(), array($user_id));
101  }
102  }
103 
104  ilUtil::sendSuccess($this->lng->txt('owner_updated'),true);
105 
106  if (!$rbacsystem->checkAccess("edit_permission",$this->gui_obj->object->getRefId()))
107  {
108  $this->ctrl->redirect($this->gui_obj);
109  return true;
110  }
111 
112  $this->ctrl->redirect($this,'owner');
113  return true;
114 
115  }
static sendSuccess($a_info="", $a_keep=false)
Send Success Message to Screen.
$_POST['username']
Definition: cron.php:12
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)
+ Here is the call graph for this function:

◆ log()

ilPermission2GUI::log ( )

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

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

Referenced by applyLogFilter(), and resetLogFilter().

147  {
148  include_once "Services/AccessControl/classes/class.ilRbacLog.php";
149  if(!ilRbacLog::isActive())
150  {
151  $this->ctrl->redirect($this, "perm");
152  }
153 
154  $this->__initSubTabs("log");
155 
156  include_once "Services/AccessControl/classes/class.ilRbacLogTableGUI.php";
157  $table = new ilRbacLogTableGUI($this, "log", $this->gui_obj->object->getRefId());
158  $this->tpl->setContent($table->getHTML());
159  }
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 56 of file class.ilPermission2GUI.php.

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

Referenced by changeOwner().

57  {
58  $this->__initSubTabs("owner");
59 
60  include_once "Services/Form/classes/class.ilPropertyFormGUI.php";
61  $form = new ilPropertyFormGUI();
62  $form->setFormAction($this->ctrl->getFormAction($this, "owner"));
63  $form->setTitle($this->lng->txt("info_owner_of_object"));
64 
65  $login = new ilTextInputGUI($this->lng->txt("login"), "owner");
66  $login->setDataSource($this->ctrl->getLinkTargetByClass(array(get_class($this),
67  'ilRepositorySearchGUI'), 'doUserAutoComplete', '', true));
68  $login->setRequired(true);
69  $login->setSize(50);
70  $login->setInfo($this->lng->txt("chown_warning"));
71  $login->setValue(ilObjUser::_lookupLogin($this->gui_obj->object->getOwner()));
72  $form->addItem($login);
73 
74  $form->addCommandButton("changeOwner", $this->lng->txt("change_owner"));
75 
76  $this->tpl->setContent($form->getHTML());
77  }
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.
_lookupLogin($a_user_id)
lookup login
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ resetLogFilter()

ilPermission2GUI::resetLogFilter ( )

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

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

171  {
172  include_once "Services/AccessControl/classes/class.ilRbacLogTableGUI.php";
173  $table = new ilRbacLogTableGUI($this, "log", $this->gui_obj->object->getRefId());
174  $table->resetOffset();
175  $table->resetFilter();
176  $this->log();
177  }
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 21 of file class.ilPermission2GUI.php.

◆ $gui_obj

ilPermission2GUI::$gui_obj = null
protected

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

◆ $ilErr

ilPermission2GUI::$ilErr = null
protected

◆ $lng

ilPermission2GUI::$lng = null
protected

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

Referenced by __construct().


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