/**
  * checks wether a user may invoke a command or not
  * (this method is called by ilAccessHandler::checkAccess)
  *
  * @param	string		$a_cmd		command (not permission!)
  * @param	string		$a_permission	permission
  * @param	int			$a_ref_id	reference id
  * @param	int			$a_obj_id	object id
  * @param	int			$a_user_id	user id (if not provided, current user is taken)
  *
  * @return	boolean		true, if everything is ok
  */
 function _checkAccess($a_cmd, $a_permission, $a_ref_id, $a_obj_id, $a_user_id = "")
 {
     global $ilUser, $lng, $rbacsystem, $ilAccess;
     if ($a_user_id == "") {
         $a_user_id = $ilUser->getId();
     }
     switch ($a_cmd) {
         case "view":
             if (!ilObjWikiAccess::_lookupOnline($a_obj_id) && !$rbacsystem->checkAccessOfUser($a_user_id, 'write', $a_ref_id)) {
                 $ilAccess->addInfoItem(IL_NO_OBJECT_ACCESS, $lng->txt("offline"));
                 return false;
             }
             break;
             // for permission query feature
         // for permission query feature
         case "infoScreen":
             if (!ilObjWikiAccess::_lookupOnline($a_obj_id)) {
                 $ilAccess->addInfoItem(IL_NO_OBJECT_ACCESS, $lng->txt("offline"));
             } else {
                 $ilAccess->addInfoItem(IL_STATUS_MESSAGE, $lng->txt("online"));
             }
             break;
     }
     switch ($a_permission) {
         case "read":
         case "visible":
             if (!ilObjWikiAccess::_lookupOnline($a_obj_id) && !$rbacsystem->checkAccessOfUser($a_user_id, 'write', $a_ref_id)) {
                 $ilAccess->addInfoItem(IL_NO_OBJECT_ACCESS, $lng->txt("offline"));
                 return false;
             }
             break;
     }
     return true;
 }
예제 #2
0
 /**
  * Get item properties
  *
  * @return	array		array of property arrays:
  *						"alert" (boolean) => display as an alert property (usually in red)
  *						"property" (string) => property name
  *						"value" (string) => property value
  */
 function getProperties()
 {
     global $lng, $ilUser;
     $props = array();
     include_once "./Modules/Wiki/classes/class.ilObjWikiAccess.php";
     if (!ilObjWikiAccess::_lookupOnline($this->obj_id)) {
         $props[] = array("alert" => true, "property" => $lng->txt("status"), "value" => $lng->txt("offline"));
     }
     return $props;
 }