4require_once
'Services/Object/classes/class.ilObjectAccess.php';
5require_once
'Services/WebAccessChecker/interfaces/interface.ilWACCheckingClass.php';
26 $commands[] = array(
"permission" =>
"read",
"cmd" =>
"view",
"lang_var" =>
"enter",
"default" =>
true);
27 $commands[] = array(
"permission" =>
"write",
"cmd" =>
"settings-general",
"lang_var" =>
"settings");
42 if (is_string($a_target)) {
43 $t_arr = explode(
"_", $a_target);
45 if (count($t_arr) < 2 || $t_arr[0] !=
"chtr" || ((
int) $t_arr[1]) <= 0) {
49 if (
$DIC->rbac()->system()->checkAccess(
"read", $t_arr[1])) {
60 public function _checkAccess($a_cmd, $a_permission, $a_ref_id, $a_obj_id, $a_user_id =
"")
62 if ($a_user_id ==
'') {
63 $a_user_id =
$GLOBALS[
'DIC']->user()->getId();
70 public static function checkRoomAccess($a_permission, $a_ref_id, $a_obj_id, $a_user_id)
72 if (self::$chat_enabled ===
null) {
74 self::$chat_enabled = (boolean) $chatSetting->get(
'chat_enabled');
77 if (
$GLOBALS[
'DIC']->rbac()->system()->checkAccessOfUser($a_user_id,
'write', $a_ref_id)) {
81 switch ($a_permission) {
86 $hasWriteAccess =
$GLOBALS[
'DIC']->rbac()->system()->checkAccessOfUser($a_user_id,
'write', $a_ref_id);
92 if (!$hasWriteAccess && !$active && !$visible) {
98 $hasWriteAccess =
$GLOBALS[
'DIC']->rbac()->system()->checkAccessOfUser($a_user_id,
'write', $a_ref_id);
99 if ($hasWriteAccess) {
120 public static function isActivated($refId, $objId, &$a_visible_flag =
null)
122 if (!self::lookupOnline($objId)) {
123 $a_visible_flag =
false;
127 $a_visible_flag =
true;
129 require_once
'Services/Object/classes/class.ilObjectActivation.php';
131 switch ($item[
'timing_type']) {
133 if (time() < $item[
'timing_start'] || time() > $item[
'timing_end']) {
134 $a_visible_flag = $item[
'visible'];
152 $res =
$DIC->database()->query(
"SELECT online_status FROM chatroom_settings WHERE object_id = " .
$DIC->database()->quote($a_obj_id,
'integer'));
155 return (
bool)
$row[
'online_status'];
163 if (preg_match(
"/chatroom\\/smilies\\//ui", $ilWACPath->
getPath())) {
An exception for terminatinating execution or to throw for unit testing.
const IL_NO_OBJECT_ACCESS
Access class for chatroom objects.
static isActivated($refId, $objId, &$a_visible_flag=null)
_checkAccess($a_cmd, $a_permission, $a_ref_id, $a_obj_id, $a_user_id="")
{Checks wether a user may invoke a command or not (this method is called by ilAccessHandler::checkAcc...
static _checkGoto($a_target)
{check whether goto script will succeed}
canBeDelivered(ilWACPath $ilWACPath)
bool
static _getCommands()
{get commandsthis method returns an array of all possible commands/permission combinationsexample: $c...
static lookupOnline($a_obj_id)
static checkRoomAccess($a_permission, $a_ref_id, $a_obj_id, $a_user_id)
static getItem($a_ref_id)
Get item data.
$GLOBALS['loaded']
Global hash that tracks already loaded includes.
Class ilWACCheckingClass.
foreach($_POST as $key=> $value) $res