54 $this->
object =& $a_obj;
56 $this->tpl =
new ilTemplate(
"tpl.info_layout.html",
false,
false);
57 $this->tpl->setVariable(
"INFO_REMARK_INTERRUPTED",$lng->txt(
'info_remark_interrupted'));
59 if (empty($_POST[
'Fuserid']))
61 $this->user =& $ilUser;
65 if ($_POST[
'Fselect_type'] ==
"id")
67 $this->user = $ilias->obj_factory->getInstanceByObjId($_POST[
'Fuserid'],
false);
71 include_once(
'Services/User/classes/class.ilObjUser.php');
73 $this->user = $ilias->obj_factory->getInstanceByObjId($user_id,
false);
76 if ($this->user ===
false or $this->user->getType() !=
'usr')
78 $this->user =& $ilUser;
88 $this->user_roles = $rbacreview->assignedRoles($this->user->getId());
89 $this->global_roles = $rbacreview->getGlobalRoles();
90 $this->valid_roles = $rbacreview->getParentRoleIds($this->object->getRefId());
106 $next_class = $this->ctrl->getNextClass($this);
107 $this->ctrl->setCmd(
"");
112 include_once
"./Services/Table/classes/class.ilTableGUI.php";
121 $tbl->disable(
'footer');
122 $tbl->disable(
'linkbar');
123 $tbl->disable(
'hits');
124 $tbl->disable(
'sort');
127 $tbl->setData($result_set);
135 $tpl =& $tbl->getTemplateObject();
138 $tbl->setTitle($lng->txt(
"info_access_permissions"),
"icon_perm.gif",$lng->txt(
"info_access_permissions"));
141 $tbl->setHeaderNames(array(
"",$lng->txt(
"operation"),$lng->txt(
"info_from_role")));
143 $tbl->setHeaderVars(array(
"",
"operation",
"role"),
"");
144 $tbl->setColumnWidth(array(
"1%",
"39%",
"60%"));
148 $tbl->setStyle(
'table',
'std');
150 $this->tpl->setVariable(
'INFO_PERMISSIONS',$tbl->tpl->get());
152 return $tbl->tpl->get();
160 $tpl =& $tbl->getTemplateObject();
163 $tbl->setTitle($lng->txt(
"info_available_roles"),
"icon_rolf.gif",$lng->txt(
"info_available_roles"));
165 $tbl->setHeaderNames(array(
"",$lng->txt(
"role"),str_replace(
" ",
" ",$lng->txt(
"info_permission_source")),str_replace(
" ",
" ",$lng->txt(
"info_permission_origin"))));
166 $tbl->setColumnWidth(array(
"1%",
"19%",
"40%",
"40%"));
168 $tbl->setStyle(
'table',
'std');
170 $this->tpl->setVariable(
'INFO_ROLES',$tbl->tpl->get());
172 return $tbl->tpl->get();
180 $tpl =& $tbl->getTemplateObject();
182 $tpl->setCurrentBlock(
"tbl_form_header");
183 $tpl->setVariable(
"FORMACTION",$this->ctrl->getFormActionByClass(
"ilpermissiongui",
"info"));
184 $tpl->parseCurrentBlock();
186 $tpl->setCurrentBlock(
"tbl_action_row");
188 $tpl->setCurrentBlock(
"plain_button");
189 $tpl->setVariable(
"PBTN_NAME",
"info");
190 $tpl->setVariable(
"PBTN_VALUE",$lng->txt(
"info_change_user_view"));
191 $tpl->parseCurrentBlock();
192 $tpl->setCurrentBlock(
"plain_buttons");
193 $tpl->parseCurrentBlock();
195 $tpl->setVariable(
"COLUMN_COUNTS",7);
198 $tpl->setVariable(
"TPLPATH",$this->tpl->tplPath);
201 $tbl->setTitle($lng->txt(
"info_access_and_status_info"));
204 $tbl->setHeaderNames(array(
" ",$lng->txt(
"info_enter_login_or_id")));
206 $tbl->setHeaderVars(array(
"",
""),
"");
207 $tbl->setColumnWidth(array(
"15%",
"85%"));
213 $this->tpl->setVariable(
'INFO_SUMMARY',$tbl->tpl->get());
215 return $tbl->tpl->get();
220 return $this->tpl->get();
227 include_once (
'./Services/AccessControl/classes/class.ilObjRole.php');
228 $assigned_valid_roles = array();
230 foreach ($this->valid_roles as $role)
232 if (in_array($role[
'obj_id'],$this->user_roles))
234 if ($role[
"obj_id"] == SYSTEM_ROLE_ID)
239 foreach ($ops_list as $ops_data)
241 $ops[] = (int) $ops_data[
'ops_id'];
248 $role[
'ops'] = $rbacreview->getRoleOperationsOnObject($role[
"obj_id"],$this->object->getRefId());
251 include_once(
'./Services/AccessControl/classes/class.ilObjRole.php');
253 $assigned_valid_roles[] = $role;
257 return $assigned_valid_roles;
262 global $ilAccess,
$lng,$rbacreview,$ilUser,$ilObjDataCache;
265 $icon_ok =
"<img src=\"".ilUtil::getImagePath(
"icon_ok.gif").
"\" alt=\"".$lng->txt(
"info_assigned").
"\" title=\"".$lng->txt(
"info_assigned").
"\" border=\"0\" vspace=\"0\"/>";
266 $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\"/>";
274 foreach ($ops_list as $ops)
276 $access = $ilAccess->doRBACCheck($ops[
'operation'],
"info",$this->object->getRefId(),$this->user->getId());
278 $result_set[$counter][] = $access ? $icon_ok : $icon_not_ok;
279 $result_set[$counter][] = $lng->txt($this->object->getType().
"_".$ops[
'operation']);
284 if($this->user->getId() == $ilObjDataCache->lookupOwner($this->object->getId()))
286 $list_role[] = $lng->txt(
'info_owner_of_object');
289 foreach ($this->assigned_valid_roles as $role)
291 if (in_array($ops[
'ops_id'],$role[
'ops']))
293 $list_role[] = $role[
'translation'];
297 if (empty($list_role))
299 $roles_formatted = $lng->txt(
'none');
303 $roles_formatted = implode(
"<br/>",$list_role);
306 $result_set[$counter][] = $roles_formatted;
318 include_once(
'./Services/AccessControl/classes/class.ilObjRole.php');
321 $icon_ok =
"<img src=\"".ilUtil::getImagePath(
"icon_ok.gif").
"\" alt=\"".$lng->txt(
"info_assigned").
"\" title=\"".$lng->txt(
"info_assigned").
"\" border=\"0\" vspace=\"0\"/>";
322 $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\"/>";
324 $path = array_reverse($tree->getPathId($this->object->getRefId()));
326 include_once (
'./Services/AccessControl/classes/class.ilObjRole.php');
328 foreach ($this->valid_roles as $role)
330 $result_set[$counter][] = in_array($role[
'obj_id'],$this->user_roles) ? $icon_ok : $icon_not_ok;
333 if ($role[
'role_type'] !=
"linked")
335 $result_set[$counter][] =
"";
339 $rolfs = $rbacreview->getFoldersAssignedToRole($role[
"obj_id"]);
342 foreach ($path as $node)
349 $rolf = $rbacreview->getRoleFolderOfObject($node);
351 if (in_array($rolf[
'ref_id'],$rolfs))
353 $nodedata = $tree->getNodeData($node);
354 $result_set[$counter][] = $nodedata[
"title"];
360 if (in_array($role[
'obj_id'],$this->global_roles))
362 $result_set[$counter][] = $lng->txt(
"global");
366 $rolf = $rbacreview->getFoldersAssignedToRole($role[
"obj_id"],
true);
367 $parent_node = $tree->getParentNodeData($rolf[0]);
368 $result_set[$counter][] = $parent_node[
"title"];
382 $input_field =
"<input class=\"std\" type=\"input\" name=\"Fuserid\" value=\"".$this->user->getLogin().
"\"/>";
383 $input_radio_login =
"<input class=\"std\" id=\"select_type_login\" type=\"radio\" name=\"Fselect_type\" value=\"login\" checked=\"checked\" />";
384 $input_radio_id =
"<input class=\"std\" id=\"select_type_id\" type=\"radio\" name=\"Fselect_type\" value=\"id\" />";
386 $result_set[0][] =
" ";
387 $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>";
389 $result_set[1][] =
"<b>".$lng->txt(
"info_view_of_user").
"</b>";
390 $result_set[1][] = $this->user->getFullname().
" (#".$this->user->getId().
")";
392 $assigned_valid_roles = array();
394 foreach ($this->assigned_valid_roles as $role)
396 $assigned_valid_roles[] = $role[
"translation"];
399 $roles_str = implode(
", ",$assigned_valid_roles);
401 $result_set[2][] =
"<b>".$lng->txt(
"roles").
"</b>";
402 $result_set[2][] = $roles_str;
404 $result_set[4][] =
"<b>".$lng->txt(
"status").
"</b>";
407 $ilAccess->doTreeCheck(
"visible",
"info",$this->object->getRefId(),$this->user->getId());
408 $infos = array_merge($infos,$ilAccess->getInfo());
411 $ilAccess->doPathCheck(
"visible",
"info",$this->object->getRefId(),$this->user->getId(),
true);
412 $infos = array_merge($infos,$ilAccess->getInfo());
415 $ilAccess->doConditionCheck(
"read",
"info",$this->object->getRefId(),$this->user->getId(),$this->
object->getId(),$this->
object->getType());
416 $infos = array_merge($infos,$ilAccess->getInfo());
418 $cmds = $this->
getCommands($this->object->getType());
420 foreach ($cmds as
$cmd)
423 $ilAccess->doStatusCheck($cmd[
'permission'],$cmd[
'cmd'],$this->object->getRefId(),$this->user->getId(),$this->
object->getId(),$this->
object->getType());
424 $infos = array_merge($infos,$ilAccess->getInfo());
427 $alert =
"il_ItemAlertProperty";
428 $okay =
"il_ItemOkayProperty";
432 $text =
"<span class=\"".$okay.
"\">".$lng->txt(
"access").
"</span><br/> ";
436 foreach ($infos as $info)
438 switch ($info[
'type'])
440 case IL_STATUS_MESSAGE:
441 $text .=
"<span class=\"".$okay.
"\">".$info[
'text'].
"</span><br/> ";
445 $obj = $ilias->obj_factory->getInstanceByRefId($info[
'data']);
446 $text .=
"<span class=\"".$alert.
"\">".$info[
'text'].
" (".$lng->txt(
"obj_".$obj->getType()).
" #".$obj->getId().
": ".$obj->getTitle().
")</span><br/> ";
451 $text .=
"<span class=\"".$alert.
"\">".$info[
'text'].
"</span><br/> ";
458 $result_set[4][] = $text;
465 global $objDefinition;
467 $class = $objDefinition->getClassName($a_type);
468 $location = $objDefinition->getLocation($a_type);
469 $full_class =
"ilObj".$class.
"Access";
470 include_once(
$location.
"/class.".$full_class.
".php");
472 $cmds = call_user_func(array($full_class,
"_getCommands"));
474 array_push($cmds,array(
'permission' =>
'visible',
'cmd' =>
'info'));