34 $this->
object =& $a_obj;
36 $this->tpl =
new ilTemplate(
"tpl.info_layout.html",
false,
false);
37 $this->tpl->setVariable(
"INFO_REMARK_INTERRUPTED",$lng->txt(
'info_remark_interrupted'));
39 if (empty(
$_POST[
'Fuserid']))
41 $this->user =& $ilUser;
45 if (
$_POST[
'Fselect_type'] ==
"id")
47 $this->user = $ilias->obj_factory->getInstanceByObjId(
$_POST[
'Fuserid'],
false);
51 include_once(
'Services/User/classes/class.ilObjUser.php');
53 $this->user = $ilias->obj_factory->getInstanceByObjId($user_id,
false);
56 if ($this->user ===
false or $this->user->getType() !=
'usr')
58 $this->user =& $ilUser;
68 $this->user_roles = $rbacreview->assignedRoles($this->user->getId());
69 $this->global_roles = $rbacreview->getGlobalRoles();
70 $this->valid_roles = $rbacreview->getParentRoleIds($this->object->getRefId());
86 $next_class = $this->ctrl->getNextClass($this);
87 $this->ctrl->setCmd(
"");
92 include_once
"./Services/Table/classes/class.ilTableGUI.php";
101 $tbl->disable(
'footer');
102 $tbl->disable(
'linkbar');
103 $tbl->disable(
'hits');
104 $tbl->disable(
'sort');
107 $tbl->setData($result_set);
115 $tpl =& $tbl->getTemplateObject();
118 $tbl->setTitle($lng->txt(
"info_access_permissions"),
"icon_perm.gif",$lng->txt(
"info_access_permissions"));
121 $tbl->setHeaderNames(array(
"",$lng->txt(
"operation"),$lng->txt(
"info_from_role")));
123 $tbl->setHeaderVars(array(
"",
"operation",
"role"),
"");
124 $tbl->setColumnWidth(array(
"1%",
"39%",
"60%"));
128 $tbl->setStyle(
'table',
'std');
130 $this->tpl->setVariable(
'INFO_PERMISSIONS',$tbl->tpl->get());
132 return $tbl->tpl->get();
140 $tpl =& $tbl->getTemplateObject();
143 $tbl->setTitle($lng->txt(
"info_available_roles"),
"icon_rolf.gif",$lng->txt(
"info_available_roles"));
145 $tbl->setHeaderNames(array(
"",$lng->txt(
"role"),str_replace(
" ",
" ",$lng->txt(
"info_permission_source")),str_replace(
" ",
" ",$lng->txt(
"info_permission_origin"))));
146 $tbl->setColumnWidth(array(
"1%",
"19%",
"40%",
"40%"));
148 $tbl->setStyle(
'table',
'std');
150 $this->tpl->setVariable(
'INFO_ROLES',$tbl->tpl->get());
152 return $tbl->tpl->get();
160 $tpl =& $tbl->getTemplateObject();
162 $tpl->setCurrentBlock(
"tbl_form_header");
163 $tpl->setVariable(
"FORMACTION",$this->ctrl->getFormActionByClass(
"ilpermissiongui",
"info"));
164 $tpl->parseCurrentBlock();
166 $tpl->setCurrentBlock(
"tbl_action_row");
168 $tpl->setCurrentBlock(
"plain_button");
169 $tpl->setVariable(
"PBTN_NAME",
"info");
170 $tpl->setVariable(
"PBTN_VALUE",$lng->txt(
"info_change_user_view"));
171 $tpl->parseCurrentBlock();
172 $tpl->setCurrentBlock(
"plain_buttons");
173 $tpl->parseCurrentBlock();
175 $tpl->setVariable(
"COLUMN_COUNTS",7);
178 $tpl->setVariable(
"TPLPATH",$this->tpl->tplPath);
181 $tbl->setTitle($lng->txt(
"info_access_and_status_info"));
184 $tbl->setHeaderNames(array(
" ",$lng->txt(
"info_enter_login_or_id")));
186 $tbl->setHeaderVars(array(
"",
""),
"");
187 $tbl->setColumnWidth(array(
"15%",
"85%"));
193 $this->tpl->setVariable(
'INFO_SUMMARY',$tbl->tpl->get());
195 return $tbl->tpl->get();
200 return $this->tpl->get();
207 include_once (
'./Services/AccessControl/classes/class.ilObjRole.php');
208 $assigned_valid_roles = array();
210 foreach ($this->valid_roles as $role)
212 if (in_array($role[
'obj_id'],$this->user_roles))
214 if ($role[
"obj_id"] == SYSTEM_ROLE_ID)
219 foreach ($ops_list as $ops_data)
221 $ops[] = (int) $ops_data[
'ops_id'];
228 $role[
'ops'] = $rbacreview->getRoleOperationsOnObject($role[
"obj_id"],$this->object->getRefId());
231 include_once(
'./Services/AccessControl/classes/class.ilObjRole.php');
233 $assigned_valid_roles[] = $role;
237 return $assigned_valid_roles;
242 global $ilAccess,
$lng,$rbacreview,$ilUser,$ilObjDataCache,$objDefinition;
245 $icon_ok =
"<img src=\"".ilUtil::getImagePath(
"icon_ok.gif").
"\" alt=\"".$lng->txt(
"info_assigned").
"\" title=\"".$lng->txt(
"info_assigned").
"\" border=\"0\" vspace=\"0\"/>";
246 $icon_not_ok =
"<img src=\"".ilUtil::getImagePath(
"icon_not_ok.gif").
"\" alt=\"".$lng->txt(
"info_not_assigned").
"\" title=\"".$lng->txt(
"info_not_assigned").
"\" border=\"0\" vspace=\"0\"/>";
254 foreach ($ops_list as $ops)
256 $access = $ilAccess->doRBACCheck($ops[
'operation'],
"info",$this->object->getRefId(),$this->user->getId(),$this->
object->getType());
258 $result_set[$counter][] = $access ? $icon_ok : $icon_not_ok;
260 if (substr($ops[
'operation'], 0, 7) ==
"create_" &&
261 $objDefinition->isPlugin(substr($ops[
'operation'], 7)))
264 $this->object->getType().
"_".$ops[
'operation']);
266 else if ($objDefinition->isPlugin($this->object->getType()))
269 $this->
object->getType().
"_".$ops[
'operation']);
273 $result_set[$counter][] = $lng->txt($this->object->getType().
"_".$ops[
'operation']);
279 if($this->user->getId() == $ilObjDataCache->lookupOwner($this->object->getId()))
281 $list_role[] = $lng->txt(
'info_owner_of_object');
284 foreach ($this->assigned_valid_roles as $role)
286 if (in_array($ops[
'ops_id'],$role[
'ops']))
288 $list_role[] = $role[
'translation'];
292 if (empty($list_role))
294 $roles_formatted = $lng->txt(
'none');
298 $roles_formatted = implode(
"<br/>",$list_role);
301 $result_set[$counter][] = $roles_formatted;
313 include_once(
'./Services/AccessControl/classes/class.ilObjRole.php');
316 $icon_ok =
"<img src=\"".ilUtil::getImagePath(
"icon_ok.gif").
"\" alt=\"".$lng->txt(
"info_assigned").
"\" title=\"".$lng->txt(
"info_assigned").
"\" border=\"0\" vspace=\"0\"/>";
317 $icon_not_ok =
"<img src=\"".ilUtil::getImagePath(
"icon_not_ok.gif").
"\" alt=\"".$lng->txt(
"info_not_assigned").
"\" title=\"".$lng->txt(
"info_not_assigned").
"\" border=\"0\" vspace=\"0\"/>";
319 $path = array_reverse($tree->getPathId($this->object->getRefId()));
321 include_once (
'./Services/AccessControl/classes/class.ilObjRole.php');
323 foreach ($this->valid_roles as $role)
325 $result_set[$counter][] = in_array($role[
'obj_id'],$this->user_roles) ? $icon_ok : $icon_not_ok;
328 if ($role[
'role_type'] !=
"linked")
330 $result_set[$counter][] =
"";
334 $rolfs = $rbacreview->getFoldersAssignedToRole($role[
"obj_id"]);
337 foreach ($path as $node)
344 $rolf = $rbacreview->getRoleFolderOfObject($node);
346 if (in_array($rolf[
'ref_id'],$rolfs))
348 $nodedata = $tree->getNodeData($node);
349 $result_set[$counter][] = $nodedata[
"title"];
355 if (in_array($role[
'obj_id'],$this->global_roles))
357 $result_set[$counter][] = $lng->txt(
"global");
361 $rolf = $rbacreview->getFoldersAssignedToRole($role[
"obj_id"],
true);
362 $parent_node = $tree->getParentNodeData($rolf[0]);
363 $result_set[$counter][] = $parent_node[
"title"];
377 $input_field =
"<input class=\"std\" type=\"input\" name=\"Fuserid\" value=\"".$this->user->getLogin().
"\"/>";
378 $input_radio_login =
"<input class=\"std\" id=\"select_type_login\" type=\"radio\" name=\"Fselect_type\" value=\"login\" checked=\"checked\" />";
379 $input_radio_id =
"<input class=\"std\" id=\"select_type_id\" type=\"radio\" name=\"Fselect_type\" value=\"id\" />";
381 $result_set[0][] =
" ";
382 $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>";
384 $result_set[1][] =
"<b>".$lng->txt(
"info_view_of_user").
"</b>";
385 $result_set[1][] = $this->user->getFullname().
" (#".$this->user->getId().
")";
387 $assigned_valid_roles = array();
389 foreach ($this->assigned_valid_roles as $role)
391 $assigned_valid_roles[] = $role[
"translation"];
394 $roles_str = implode(
", ",$assigned_valid_roles);
396 $result_set[2][] =
"<b>".$lng->txt(
"roles").
"</b>";
397 $result_set[2][] = $roles_str;
399 $result_set[4][] =
"<b>".$lng->txt(
"status").
"</b>";
416 $ilAccess->checkAccessOfUser(
417 $this->user->getId(),
420 $this->
object->getRefId(),
421 $this->
object->getType(),
422 $this->
object->getId()
425 $infos = array_merge($infos,$ilAccess->getInfo());
427 $cmds = $this->
getCommands($this->object->getType());
429 foreach ($cmds as
$cmd)
432 $ilAccess->doStatusCheck($cmd[
'permission'],$cmd[
'cmd'],$this->object->getRefId(),$this->user->getId(),$this->
object->getId(),$this->
object->getType());
433 $infos = array_merge($infos,$ilAccess->getInfo());
436 $alert =
"il_ItemAlertProperty";
437 $okay =
"il_ItemOkayProperty";
441 $text =
"<span class=\"".$okay.
"\">".$lng->txt(
"access").
"</span><br/> ";
445 foreach ($infos as $info)
447 switch ($info[
'type'])
449 case IL_STATUS_MESSAGE:
450 $text .=
"<span class=\"".$okay.
"\">".$info[
'text'].
"</span><br/> ";
454 $obj = $ilias->obj_factory->getInstanceByRefId($info[
'data']);
455 $text .=
"<span class=\"".$alert.
"\">".$info[
'text'].
" (".$lng->txt(
"obj_".$obj->getType()).
" #".$obj->getId().
": ".$obj->getTitle().
")</span><br/> ";
460 $text .=
"<span class=\"".$alert.
"\">".$info[
'text'].
"</span><br/> ";
467 $result_set[4][] = $text;
474 global $objDefinition;
476 $class = $objDefinition->getClassName($a_type);
477 $location = $objDefinition->getLocation($a_type);
478 $full_class =
"ilObj".$class.
"Access";
479 include_once(
$location.
"/class.".$full_class.
".php");
481 $cmds = call_user_func(array($full_class,
"_getCommands"));
483 array_push($cmds,array(
'permission' =>
'visible',
'cmd' =>
'info'));