34 $this->
object =& $a_obj;
36 $this->tpl =
new ilTemplate(
"tpl.info_layout.html",
false,
false,
37 "Services/AccessControl");
38 $this->tpl->setVariable(
"INFO_REMARK_INTERRUPTED",$lng->txt(
'info_remark_interrupted'));
40 if (empty(
$_POST[
'Fuserid']))
46 if (
$_POST[
'Fselect_type'] ==
"id")
48 $this->user = $ilias->obj_factory->getInstanceByObjId(
$_POST[
'Fuserid'],
false);
52 include_once(
'Services/User/classes/class.ilObjUser.php');
54 $this->user = $ilias->obj_factory->getInstanceByObjId($user_id,
false);
57 if ($this->user ===
false or $this->user->getType() !=
'usr')
69 $this->user_roles = $rbacreview->assignedRoles($this->user->getId());
70 $this->global_roles = $rbacreview->getGlobalRoles();
71 $this->valid_roles = $rbacreview->getParentRoleIds($this->object->getRefId());
87 $next_class = $this->ctrl->getNextClass($this);
88 $this->ctrl->setCmd(
"");
93 include_once
"./Services/Table/classes/class.ilTableGUI.php";
102 $tbl->disable(
'footer');
103 $tbl->disable(
'linkbar');
104 $tbl->disable(
'hits');
105 $tbl->disable(
'sort');
108 $tbl->setData($result_set);
116 $tpl =& $tbl->getTemplateObject();
119 $tbl->setTitle($lng->txt(
"info_access_permissions"),
"icon_perm.png",$lng->txt(
"info_access_permissions"));
122 $tbl->setHeaderNames(array(
"",$lng->txt(
"operation"),$lng->txt(
"info_from_role")));
124 $tbl->setHeaderVars(array(
"",
"operation",
"role"),
"");
125 $tbl->setColumnWidth(array(
"1%",
"39%",
"60%"));
129 $tbl->setStyle(
'table',
'std');
131 $this->tpl->setVariable(
'INFO_PERMISSIONS',$tbl->tpl->get());
133 return $tbl->tpl->get();
141 $tpl =& $tbl->getTemplateObject();
144 $tbl->setTitle($lng->txt(
"info_available_roles"),
"icon_rolf.png",$lng->txt(
"info_available_roles"));
146 $tbl->setHeaderNames(array(
"",$lng->txt(
"role"),str_replace(
" ",
" ",$lng->txt(
"info_permission_source")),str_replace(
" ",
" ",$lng->txt(
"info_permission_origin"))));
147 $tbl->setColumnWidth(array(
"1%",
"19%",
"40%",
"40%"));
149 $tbl->setStyle(
'table',
'std');
151 $this->tpl->setVariable(
'INFO_ROLES',$tbl->tpl->get());
153 return $tbl->tpl->get();
161 $tpl =& $tbl->getTemplateObject();
163 $tpl->setCurrentBlock(
"tbl_form_header");
164 $tpl->setVariable(
"FORMACTION",$this->ctrl->getFormActionByClass(
"ilpermissiongui",
"info"));
165 $tpl->parseCurrentBlock();
167 $tpl->setCurrentBlock(
"tbl_action_row");
169 $tpl->setCurrentBlock(
"plain_button");
170 $tpl->setVariable(
"PBTN_NAME",
"info");
171 $tpl->setVariable(
"PBTN_VALUE",$lng->txt(
"info_change_user_view"));
172 $tpl->parseCurrentBlock();
173 $tpl->setCurrentBlock(
"plain_buttons");
174 $tpl->parseCurrentBlock();
176 $tpl->setVariable(
"COLUMN_COUNTS",7);
179 $tpl->setVariable(
"TPLPATH",$this->tpl->tplPath);
182 $tbl->setTitle($lng->txt(
"info_access_and_status_info"));
185 $tbl->setHeaderNames(array(
" ",$lng->txt(
"info_enter_login_or_id")));
187 $tbl->setHeaderVars(array(
"",
""),
"");
188 $tbl->setColumnWidth(array(
"15%",
"85%"));
194 $this->tpl->setVariable(
'INFO_SUMMARY',$tbl->tpl->get());
196 return $tbl->tpl->get();
201 return $this->tpl->get();
208 include_once (
'./Services/AccessControl/classes/class.ilObjRole.php');
209 $assigned_valid_roles = array();
211 foreach ($this->valid_roles as $role)
213 if (in_array($role[
'obj_id'],$this->user_roles))
215 if ($role[
"obj_id"] == SYSTEM_ROLE_ID)
220 foreach ($ops_list as $ops_data)
222 $ops[] = (int) $ops_data[
'ops_id'];
229 $role[
'ops'] = $rbacreview->getRoleOperationsOnObject($role[
"obj_id"],$this->object->getRefId());
232 include_once(
'./Services/AccessControl/classes/class.ilObjRole.php');
234 $assigned_valid_roles[] = $role;
238 return $assigned_valid_roles;
243 global $ilAccess,
$lng,$rbacreview,
$ilUser,$ilObjDataCache,$objDefinition;
246 $icon_ok =
"<img src=\"".ilUtil::getImagePath(
"icon_ok.png").
"\" alt=\"".$lng->txt(
"info_assigned").
"\" title=\"".$lng->txt(
"info_assigned").
"\" border=\"0\" vspace=\"0\"/>";
247 $icon_not_ok =
"<img src=\"".ilUtil::getImagePath(
"icon_not_ok.png").
"\" alt=\"".$lng->txt(
"info_not_assigned").
"\" title=\"".$lng->txt(
"info_not_assigned").
"\" border=\"0\" vspace=\"0\"/>";
255 foreach ($ops_list as $ops)
257 $access = $ilAccess->doRBACCheck($ops[
'operation'],
"info",$this->object->getRefId(),$this->user->getId(),$this->
object->getType());
259 $result_set[$counter][] = $access ? $icon_ok : $icon_not_ok;
261 if (substr($ops[
'operation'], 0, 7) ==
"create_" &&
262 $objDefinition->isPlugin(substr($ops[
'operation'], 7)))
265 #$this->object->getType().
"_".$ops[
'operation']);
266 'rbac_'.$ops[
'operation']);
268 else if ($objDefinition->isPlugin($this->object->getType()))
271 $this->
object->getType().
"_".$ops[
'operation']);
273 elseif(substr($ops[
'operation'],0,7) ==
'create_')
275 $result_set[$counter][] = $lng->txt(
'rbac_'.$ops[
'operation']);
279 $result_set[$counter][] = $lng->txt($this->object->getType().
"_".$ops[
'operation']);
285 if($this->user->getId() == $ilObjDataCache->lookupOwner($this->object->getId()))
288 (substr($ops[
'operation'],0,7) !=
'create_') and
289 ($ops[
'operation'] !=
'edit_permission') and
290 ($ops[
'operation'] !=
'edit_leanring_progress')
293 $list_role[] = $lng->txt(
'info_owner_of_object');
297 foreach ($this->assigned_valid_roles as $role)
299 if (in_array($ops[
'ops_id'],$role[
'ops']))
301 $list_role[] = $role[
'translation'];
305 if (empty($list_role))
307 $roles_formatted = $lng->txt(
'none');
311 $roles_formatted = implode(
"<br/>",$list_role);
314 $result_set[$counter][] = $roles_formatted;
326 include_once(
'./Services/AccessControl/classes/class.ilObjRole.php');
329 $icon_ok =
"<img src=\"".ilUtil::getImagePath(
"icon_ok.png").
"\" alt=\"".$lng->txt(
"info_assigned").
"\" title=\"".$lng->txt(
"info_assigned").
"\" border=\"0\" vspace=\"0\"/>";
330 $icon_not_ok =
"<img src=\"".ilUtil::getImagePath(
"icon_not_ok.png").
"\" alt=\"".$lng->txt(
"info_not_assigned").
"\" title=\"".$lng->txt(
"info_not_assigned").
"\" border=\"0\" vspace=\"0\"/>";
332 $path = array_reverse($tree->getPathId($this->object->getRefId()));
334 include_once (
'./Services/AccessControl/classes/class.ilObjRole.php');
336 foreach ($this->valid_roles as $role)
338 $result_set[$counter][] = in_array($role[
'obj_id'],$this->user_roles) ? $icon_ok : $icon_not_ok;
341 if ($role[
'role_type'] !=
"linked")
343 $result_set[$counter][] =
"";
347 $rolfs = $rbacreview->getFoldersAssignedToRole($role[
"obj_id"]);
350 foreach (
$path as $node)
357 $rolf = $rbacreview->getRoleFolderOfObject($node);
359 if (in_array($rolf[
'ref_id'],$rolfs))
361 $nodedata = $tree->getNodeData($node);
362 $result_set[$counter][] = $nodedata[
"title"];
368 if (in_array($role[
'obj_id'],$this->global_roles))
370 $result_set[$counter][] = $lng->txt(
"global");
374 $rolf = $rbacreview->getFoldersAssignedToRole($role[
"obj_id"],
true);
375 $parent_node = $tree->getParentNodeData($rolf[0]);
376 $result_set[$counter][] = $parent_node[
"title"];
390 $input_field =
"<input class=\"std\" type=\"input\" name=\"Fuserid\" value=\"".$this->user->getLogin().
"\"/>";
391 $input_radio_login =
"<input class=\"std\" id=\"select_type_login\" type=\"radio\" name=\"Fselect_type\" value=\"login\" checked=\"checked\" />";
392 $input_radio_id =
"<input class=\"std\" id=\"select_type_id\" type=\"radio\" name=\"Fselect_type\" value=\"id\" />";
394 $result_set[0][] =
" ";
395 $result_set[0][] = $input_field.
" ".$input_radio_login.
"<label for=\"select_type_login\">".$lng->txt(
'login').
"</label>".$input_radio_id.
"<label for=\"select_type_id\">".$lng->txt(
'id').
"</label>";
397 $result_set[1][] =
"<b>".$lng->txt(
"info_view_of_user").
"</b>";
398 $result_set[1][] = $this->user->getFullname().
" (#".$this->user->getId().
")";
400 $assigned_valid_roles = array();
402 foreach ($this->assigned_valid_roles as $role)
404 $assigned_valid_roles[] = $role[
"translation"];
407 $roles_str = implode(
", ",$assigned_valid_roles);
409 $result_set[2][] =
"<b>".$lng->txt(
"roles").
"</b>";
410 $result_set[2][] = $roles_str;
412 $result_set[4][] =
"<b>".$lng->txt(
"status").
"</b>";
429 $ilAccess->checkAccessOfUser(
430 $this->user->getId(),
433 $this->
object->getRefId(),
434 $this->
object->getType(),
435 $this->
object->getId()
438 $infos = array_merge($infos,$ilAccess->getInfo());
440 $cmds = $this->
getCommands($this->object->getType());
442 foreach ($cmds as
$cmd)
445 $ilAccess->doStatusCheck($cmd[
'permission'],$cmd[
'cmd'],$this->object->getRefId(),$this->user->getId(),$this->
object->getId(),$this->
object->getType());
446 $infos = array_merge($infos,$ilAccess->getInfo());
449 $alert =
"il_ItemAlertProperty";
450 $okay =
"il_ItemOkayProperty";
454 $text =
"<span class=\"".$okay.
"\">".$lng->txt(
"access").
"</span><br/> ";
458 foreach ($infos as $info)
460 switch ($info[
'type'])
462 case IL_STATUS_MESSAGE:
463 $text .=
"<span class=\"".$okay.
"\">".$info[
'text'].
"</span><br/> ";
467 $obj = $ilias->obj_factory->getInstanceByRefId($info[
'data']);
468 $text .=
"<span class=\"".$alert.
"\">".$info[
'text'].
" (".$lng->txt(
"obj_".$obj->getType()).
" #".$obj->getId().
": ".$obj->getTitle().
")</span><br/> ";
473 $text .=
"<span class=\"".$alert.
"\">".$info[
'text'].
"</span><br/> ";
480 $result_set[4][] = $text;
487 global $objDefinition;
489 $class = $objDefinition->getClassName($a_type);
490 $location = $objDefinition->getLocation($a_type);
491 $full_class =
"ilObj".$class.
"Access";
492 include_once(
$location.
"/class.".$full_class.
".php");
494 $cmds = call_user_func(array($full_class,
"_getCommands"));
496 array_push($cmds,array(
'permission' =>
'visible',
'cmd' =>
'info'));