4 include_once
'./Services/Table/classes/class.ilTable2GUI.php';
5 include_once
"Services/AccessControl/classes/class.ilRbacLog.php";
24 public function __construct($a_parent_obj, $a_parent_cmd, $a_ref_id)
30 $ilAccess = $DIC[
'ilAccess'];
33 $this->
setId(
"rbaclog");
34 $this->ref_id = $a_ref_id;
36 parent::__construct($a_parent_obj, $a_parent_cmd);
40 $this->
addColumn($this->lng->txt(
"date"),
"",
"15%");
41 $this->
addColumn($this->lng->txt(
"name"),
"",
"10%");
42 $this->
addColumn($this->lng->txt(
"login"),
"",
"10%");
43 $this->
addColumn($this->lng->txt(
"action"),
"",
"15%");
44 $this->
addColumn($this->lng->txt(
"rbac_changes"),
"",
"50%");
49 $this->
setRowTemplate(
"tpl.rbac_log_row.html",
"Services/AccessControl");
64 $this->
getItems($this->ref_id, $this->filter);
70 $item->setOptions(array(
"" => $this->lng->txt(
"all")) + $this->action_map);
71 $this->filter[
"action"] = $item->getValue();
74 $this->filter[
"date"] = $item->getDate();
77 protected function getItems($a_ref_id, array $a_current_filter = null)
81 $rbacreview = $DIC[
'rbacreview'];
85 foreach ($rbacreview->getOperations() as $op) {
86 $this->operations[$op[
"ops_id"]] = $op[
"operation"];
90 if ($a_ref_id == ROLE_FOLDER_ID) {
91 $a_ref_id = ROOT_FOLDER_ID;
104 $this->tpl->setVariable(
"LASTNAME",
$name[
"lastname"]);
105 $this->tpl->setVariable(
"FIRSTNAME",
$name[
"firstname"]);
106 $this->tpl->setVariable(
"LOGIN",
$name[
"login"]);
107 $this->tpl->setVariable(
"ACTION", $this->action_map[$a_set[
"action"]]);
111 $changes = array(array(
"action" => $this->lng->txt(
"rbac_log_changed_owner"),
"operation" =>
$user));
118 $this->tpl->setCurrentBlock(
"changes");
119 foreach ($changes as $change) {
120 $this->tpl->setVariable(
"CHANGE_ACTION", $change[
"action"]);
121 $this->tpl->setVariable(
"CHANGE_OPERATION", $change[
"operation"]);
122 $this->tpl->parseCurrentBlock();
132 if (isset($raw[
"src"])) {
135 include_once
"./Services/Link/classes/class.ilLink.php";
136 $result[] = array(
"action" => $this->lng->txt(
"rbac_log_source_object"),
141 foreach ($raw[
"ops"] as $role_id => $ops) {
142 foreach ($ops as $op) {
147 } elseif (isset($raw[
"ops"])) {
148 foreach ($raw[
"ops"] as $role_id => $actions) {
149 foreach ($actions as
$action => $ops) {
150 foreach ((array) $ops as $op) {
158 if (isset($raw[
"inht"])) {
159 foreach ($raw[
"inht"] as
$action => $role_ids) {
160 foreach ((array) $role_ids as $role_id) {
172 foreach ($raw as
$type => $actions) {
173 foreach ($actions as
$action => $ops) {
174 foreach ($ops as $op) {
175 $result[] = array(
"action" => sprintf($this->lng->txt(
"rbac_log_operation_" .
$action), $this->lng->txt(
"obj_" .
$type)),
187 if (is_array($a_op)) {
189 foreach ($a_op as $op) {
192 return implode(
", ",
$res);
195 if (is_numeric($a_op) && isset($this->operations[$a_op])) {
196 $op_id = $this->operations[$a_op];
197 if (substr($op_id, 0, 7) !=
"create_") {
201 if ($this->lng->exists(
$a_type .
'_' . $op_id .
'_short')) {
202 $perm = $this->lng->txt(
$a_type .
'_' . $op_id .
'_short');
204 $perm = $this->lng->txt($op_id);
210 $type = substr($op_id, 7, strlen($op_id));
214 $perm = $this->lng->txt(
"rbac_" . $op_id);
231 global $objDefinition;
233 if ($objDefinition->isPlugin(
$type)) {
249 return is_null($perm) || (strpos($perm, $op_id) !==
false);
static _lookupName($a_user_id)
lookup user name
static lookupTxtById($plugin_id, $lang_var)
getOPCaption($a_type, $a_op)
getItems($a_ref_id, array $a_current_filter=null)
static _lookupFullname($a_user_id)
Lookup Full Name.
setExternalSegmentation($a_val)
Set external segmentation.
addFilterItemByMetaType($id, $type=self::FILTER_TEXT, $a_optional=false, $caption=null)
Add filter by standard type.
parseChangesFaPa(array $raw)
static _lookupTitle($a_id)
lookup object title
parseChangesTemplate(array $raw)
static formatDate(ilDateTime $date, $a_skip_day=false, $a_include_wd=false, $include_seconds=false)
Format a date public.
static _lookupObjectId($a_ref_id)
lookup object id
setTitle($a_title, $a_icon=0, $a_icon_alt=0)
Set title and title icon.
setResetCommand($a_val, $a_caption=null)
Set reset filter command.
foreach($_POST as $key=> $value) $res
setRowTemplate($a_template, $a_template_dir="")
Set row template.
static _lookupType($a_id, $a_reference=false)
lookup object type
static getLogItems($a_ref_id, $a_limit, $a_offset, array $a_filter=null)
determineOffsetAndOrder($a_omit_offset=false)
Determine offset and order.
setFormAction($a_form_action, $a_multipart=false)
Set Form action parameter.
addColumn( $a_text, $a_sort_field="", $a_width="", $a_is_checkbox_action_column=false, $a_class="", $a_tooltip="", $a_tooltip_with_html=false)
Add a column to the header.
const EDIT_TEMPLATE_EXISTING
notTranslated($perm, $op_id)
Check the op is translated correctly.
setEnableHeader($a_enableheader)
Set Enable Header.
setMaxCount($a_max_count)
set max.
getTranslationFromPlugin($type, $op_id)
Check the type for plugin and get the translation for op_id.
static _getLink($a_ref_id, $a_type='', $a_params=array(), $append="")
setLimit($a_limit=0, $a_default_limit=0)
__construct($a_parent_obj, $a_parent_cmd, $a_ref_id)
setFilterCommand($a_val, $a_caption=null)
Set filter command.