5 require_once
"./Services/Object/classes/class.ilObject.php";
24 public function __construct($a_id = 0, $a_call_by_reference =
true)
27 $this->
ilObject($a_id, $a_call_by_reference);
38 $userInfo =
new stdClass();
48 return $settings->get(
'public_room_ref', 0);
54 $rset = $ilDB->query(
'SELECT object_id FROM chatroom_settings WHERE room_type=' . $ilDB->quote(
'default' ,
'text'));
55 if (
$row = $ilDB->fetchAssoc($rset)) {
56 return $row[
'object_id'];
69 global $rbacadmin,$rbacreview,$ilDB;
75 $role_obj = $rolf_obj->createRole(
"il_chat_moderator_".$this->
getRefId(),
"Moderator of chat obj_no.".$this->
getId());
76 $roles[] = $role_obj->getId();
79 $statement = $ilDB->queryF(
'
80 SELECT obj_id FROM object_data
83 array(
'text',
'text'),
84 array(
'rolt',
'il_chat_moderator'));
87 $res = $ilDB->fetchAssoc($statement);
90 $rbacadmin->copyRoleTemplatePermissions(
$res[
'obj_id'],ROLE_FOLDER_ID,$rolf_obj->getRefId(),$role_obj->getId());
93 $ops = $rbacreview->getOperationsOfRole($role_obj->getId(),
"chtr",$rolf_obj->getRefId());
94 $rbacadmin->grantPermission($role_obj->getId(),$ops,$this->
getRefId());
97 return $roles ? $roles : array();
100 public function cloneObject($a_target_id,$a_copy_id = 0,$a_omit_tree =
false) {
102 require_once
'Modules/Chatroom/classes/class.ilChatroom.php';
109 $objId = $newObj->getId();
113 $original_settings = $original_room->getSettings();
116 $original_settings[
'object_id'] = $objId;
118 $room->saveSettings($original_settings);
121 include_once
"Services/AccessControl/classes/class.ilRbacLog.php";
122 $rbac_log_roles = $rbacreview->getParentRoleIds( $newObj->getRefId(), false );