Access class for chatroom objects.
More...
|
static | checkRoomAccess (string $a_permission, int $a_ref_id, int $a_obj_id, int $a_user_id) |
|
Access class for chatroom objects.
- Author
- Jan Posselt <jposselt at databay.de>
- Version
- $Id$
Definition at line 27 of file class.ilObjChatroomAccess.php.
◆ _checkAccess()
ilObjChatroomAccess::_checkAccess |
( |
string |
$cmd, |
|
|
string |
$permission, |
|
|
int |
$ref_id, |
|
|
int |
$obj_id, |
|
|
?int |
$user_id = null |
|
) |
| |
Definition at line 58 of file class.ilObjChatroomAccess.php.
References $GLOBALS.
61 $user_id =
$GLOBALS[
'DIC']->user()->getId();
64 return self::checkRoomAccess($permission,
$ref_id, $obj_id, (
int) $user_id);
if(!defined('PATH_SEPARATOR')) $GLOBALS['_PEAR_default_error_mode']
◆ _checkGoto()
static ilObjChatroomAccess::_checkGoto |
( |
string |
$target | ) |
|
|
static |
Definition at line 40 of file class.ilObjChatroomAccess.php.
References ilChatroom\checkUserPermissions().
42 $t_arr = explode(
'_', $target);
44 if (count($t_arr) < 2 || $t_arr[0] !==
'chtr' || ((
int) $t_arr[1]) <= 0) {
static checkUserPermissions($permissions, int $ref_id, bool $send_info=true)
Checks user permissions by given array and ref_id.
◆ _getCommands()
static ilObjChatroomAccess::_getCommands |
( |
| ) |
|
|
static |
Definition at line 31 of file class.ilObjChatroomAccess.php.
Referenced by ilObjChatroomListGUI\init().
34 $commands[] = [
'permission' =>
'read',
'cmd' =>
'view',
'lang_var' =>
'enter',
'default' =>
true];
35 $commands[] = [
'permission' =>
'write',
'cmd' =>
'settings-general',
'lang_var' =>
'settings'];
◆ canBeDelivered()
ilObjChatroomAccess::canBeDelivered |
( |
ilWACPath |
$ilWACPath | ) |
|
◆ checkRoomAccess()
static ilObjChatroomAccess::checkRoomAccess |
( |
string |
$a_permission, |
|
|
int |
$a_ref_id, |
|
|
int |
$a_obj_id, |
|
|
int |
$a_user_id |
|
) |
| |
|
staticprivate |
Definition at line 67 of file class.ilObjChatroomAccess.php.
References $DIC, and ilAccessInfo\IL_NO_OBJECT_ACCESS.
71 if (self::$chat_enabled === null) {
73 self::$chat_enabled = (bool) $chatSetting->get(
'chat_enabled',
'0');
76 $hasWriteAccess = $DIC->rbac()->system()->checkAccessOfUser($a_user_id,
'write', $a_ref_id);
77 if ($hasWriteAccess) {
81 switch ($a_permission) {
85 $active = self::isActivated($a_ref_id, $a_obj_id, $visible);
88 $DIC->access()->addInfoItem(
90 $DIC->language()->txt(
'offline')
94 if ($active ===
false && $visible ===
false) {
100 $active = self::isActivated($a_ref_id, $a_obj_id);
102 $DIC->access()->addInfoItem(
104 $DIC->language()->txt(
'offline')
111 return self::$chat_enabled;
const IL_NO_OBJECT_ACCESS
◆ isActivated()
static ilObjChatroomAccess::isActivated |
( |
int |
$refId, |
|
|
int |
$objId, |
|
|
bool & |
$a_visible_flag = null |
|
) |
| |
|
static |
◆ lookupOnline()
static ilObjChatroomAccess::lookupOnline |
( |
int |
$a_obj_id | ) |
|
|
static |
Definition at line 135 of file class.ilObjChatroomAccess.php.
References $DIC, and $res.
139 $res = $DIC->database()->query(
140 'SELECT online_status FROM chatroom_settings WHERE object_id = ' .
141 $DIC->database()->quote($a_obj_id,
'integer')
143 $row = $DIC->database()->fetchAssoc(
$res);
145 return (
bool) ($row[
'online_status'] ??
false);
◆ $chat_enabled
bool ilObjChatroomAccess::$chat_enabled = null |
|
staticprivate |
The documentation for this class was generated from the following file: