4 require_once
'Services/Object/classes/class.ilObjectAccess.php';
5 require_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();
66 return self::checkRoomAccess($a_permission, $a_ref_id, $a_obj_id, $a_user_id);
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) {
85 $active = self::isActivated($a_ref_id, $a_obj_id, $visible);
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) {
103 $active = self::isActivated($a_ref_id, $a_obj_id);
111 return self::$chat_enabled;
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'));
153 $row = $DIC->database()->fetchAssoc(
$res);
155 return (
bool)
$row[
'online_status'];
163 if (preg_match(
"/chatroom\\/smilies\\//ui", $ilWACPath->
getPath())) {
static lookupOnline($a_obj_id)
static _checkGoto($a_target)
{}
const IL_NO_OBJECT_ACCESS
static getItem($a_ref_id)
Get item data.
_checkAccess($a_cmd, $a_permission, $a_ref_id, $a_obj_id, $a_user_id="")
{}
Access class for chatroom objects.
foreach($_POST as $key=> $value) $res
canBeDelivered(ilWACPath $ilWACPath)
bool
Class ilWACCheckingClass.
static isActivated($refId, $objId, &$a_visible_flag=null)
static checkRoomAccess($a_permission, $a_ref_id, $a_obj_id, $a_user_id)
$GLOBALS['JPEG_Segment_Names']
Global Variable: XMP_tag_captions.