36 require_once
"classes/class.ilObjectGUI.php";
49 #define("ILIAS_MODULE","chat");
51 $this->
ilObjectGUI($a_data,$a_id,$a_call_by_reference, $a_prepare_output);
53 $this->lng->loadLanguageModule(
"chat");
58 $next_class = $this->ctrl->getNextClass($this);
59 $cmd = $this->ctrl->getCmd();
64 case 'ilpermissiongui':
65 include_once(
"./classes/class.ilPermissionGUI.php");
67 $ret =& $this->ctrl->forwardCommand($perm_gui);
85 include_once(
'./Services/Form/classes/class.ilPropertyFormGUI.php');
87 $this->form_gui->setFormAction($this->ctrl->getFormAction($this,
'update'));
89 if($this->object->server_conf->isAlive() or $this->
object->server_conf->getActiveStatus())
93 $sec_cd->setTitle($this->lng->txt(
'chat_ilias'));
94 $this->form_gui->addItem($sec_cd);
98 1 => $this->lng->txt(
'chat_active'),
99 0 => $this->lng->txt(
'chat_inactive')
103 $this->form_gui->addItem($sel);
105 else if(!$this->object->server_conf->isAlive() && $this->ctrl->getCmd() !=
'update')
112 $sec_l->setTitle($this->lng->txt(
'chat_server_settings'));
113 $this->form_gui->addItem($sec_l);
116 $inp =
new ilTextInputGUI($this->lng->txt(
'chat_server_internal_ip'),
'chat_internal_ip');
119 $inp->setMaxLength(128);
120 $this->form_gui->addItem($inp);
123 $inp =
new ilTextInputGUI($this->lng->txt(
'chat_server_external_ip'),
'chat_external_ip');
126 $inp->setMaxLength(128);
127 $this->form_gui->addItem($inp);
130 $inp =
new ilTextInputGUI($this->lng->txt(
'chat_server_port'),
'chat_port');
133 $inp->setMaxLength(5);
134 $this->form_gui->addItem($inp);
137 $chb =
new ilCheckboxInputGUI($this->lng->txt(
'chat_server_ssl_settings'),
'chat_ssl_status');
139 $chb->setChecked(
false);
140 $inp =
new ilTextInputGUI($this->lng->txt(
'chat_server_ssl_port'),
'chat_ssl_port');
142 $inp->setMaxLength(5);
143 $chb->addSubItem($inp);
144 $this->form_gui->addItem($chb);
147 $inp =
new ilPasswordInputGUI($this->lng->txt(
'chat_moderator_password'),
'chat_moderator');
150 $inp->setMaxLength(16);
151 $this->form_gui->addItem($inp);
154 $inp =
new ilTextInputGUI($this->lng->txt(
'chat_server_logfile'),
'chat_logfile');
156 $inp->setMaxLength(256);
157 $this->form_gui->addItem($inp);
160 $sel =
new ilSelectInputGUI($this->lng->txt(
'chat_server_loglevel'),
'chat_loglevel');
162 1 => $this->lng->txt(
'chat_level_fatal'),
163 2 => $this->lng->txt(
'chat_level_error'),
164 3 => $this->lng->txt(
'chat_level_info'),
165 5 => $this->lng->txt(
'chat_level_debug'),
166 6 => $this->lng->txt(
'chat_level_all')
170 $this->form_gui->addItem($sel);
173 $inp =
new ilTextInputGUI($this->lng->txt(
'chat_server_allowed'),
'chat_allowed');
174 $inp->
setInfo($this->lng->txt(
'chat_server_allowed_b'));
175 $inp->setRequired(
true);
177 $inp->setMaxLength(256);
178 $this->form_gui->addItem($inp);
182 $sec_cd->setTitle($this->lng->txt(
'chat_general_settings'));
183 $this->form_gui->addItem($sec_cd);
188 $ro =
new ilRadioOption($this->lng->txt(
'chat_sound_status_activate'), 1);
190 $chb->setOptionTitle($this->lng->txt(
'chat_new_invitation_sound_status'));
191 $chb->setChecked(
false);
194 $ro =
new ilRadioOption($this->lng->txt(
'chat_sound_status_deactivate'), 0);
196 $this->form_gui->addItem($rg);
198 $this->form_gui->addCommandButton(
'update', $this->lng->txt(
'save'));
199 $this->form_gui->addCommandButton(
'cancel', $this->lng->txt(
'cancel'));
207 $data[
'chat_internal_ip'] = $this->
object->server_conf->getInternalIp();
208 $data[
'chat_external_ip'] = $this->
object->server_conf->getExternalIp();
209 $data[
'chat_port'] = $this->
object->server_conf->getPort();
210 $data[
'chat_ssl_status'] = $this->
object->server_conf->getSSLStatus();
211 $data[
'chat_ssl_port'] = $this->
object->server_conf->getSSLPort();
212 $data[
'chat_moderator'] = $this->
object->server_conf->getModeratorPassword();
213 $data[
'chat_logfile'] = $this->
object->server_conf->getLogfile();
214 $data[
'chat_loglevel'] = $this->
object->server_conf->getLogLevel();
215 $data[
'chat_allowed'] = $this->
object->server_conf->getAllowedHosts();
216 $data[
'chat_active'] = $this->
object->server_conf->getActiveStatus();
217 $data[
'chat_new_invitation_sound_status'] = (bool)$ilSetting->get(
'chat_new_invitation_sound_status');
218 $data[
'chat_sound_status'] = (int)$ilSetting->get(
'chat_sound_status');
220 $this->form_gui->setValuesByArray(
$data);
227 $this->tabs_gui->setTabActive(
'edit_properties');
229 if(!$rbacsystem->checkAccess(
'read', $this->ref_id))
231 $this->ilias->raiseError($this->lng->txt(
'msg_no_perm_read'), $this->ilias->error_obj->MESSAGE);
236 $this->tpl->setContent($this->form_gui->getHTML());
243 if(!$rbacsystem->checkAccess(
'write', $this->ref_id))
245 $this->ilias->raiseError($this->lng->txt(
'msg_no_perm_write'), $this->ilias->error_obj->MESSAGE);
250 if(!$this->form_gui->checkInput())
252 $this->tabs_gui->setTabActive(
'edit_properties');
254 $this->form_gui->setValuesByPost();
256 $this->tpl->setContent($this->form_gui->getHtml());
264 $this->
object->server_conf->setSSLStatus((
int)$_POST[
'chat_ssl_status'] ? 1 : 0);
266 $this->
object->server_conf->setModeratorPassword(
ilUtil::stripSlashes($_POST[
'chat_moderator']));
271 $this->
object->server_conf->validate();
273 $ilSetting->set(
'chat_sound_status', (
int)$_POST[
'chat_sound_status']);
274 $ilSetting->set(
'chat_new_invitation_sound_status', (
int)$_POST[
'chat_new_invitation_sound_status']);
276 $this->
object->server_conf->setActiveStatus((
bool)$_POST[
'chat_active']);
277 $this->
object->server_conf->updateStatus();
279 if(!$this->object->server_conf->update())
297 global $rbacsystem,$rbacreview;
299 $this->ctrl->setParameter($this,
"ref_id",$this->object->getRefId());
301 if($rbacsystem->checkAccess(
'read',$this->object->getRefId()))
303 $force_active = (
$_GET[
"cmd"] ==
"" ||
$_GET[
"cmd"] ==
"view")
306 $tabs_gui->addTarget(
"chat_rooms",
307 $this->ctrl->getLinkTarget($this,
"view"), array(
"view",
""), get_class($this),
310 if($rbacsystem->checkAccess(
'write',$this->object->getRefId()))
312 $force_active = (
$_GET[
"cmd"] ==
"edit")
315 $tabs_gui->addTarget(
"edit_properties",
316 $this->ctrl->getLinkTarget($this,
"edit"),
"edit", get_class($this),
319 if($rbacsystem->checkAccess(
'edit_permission',$this->object->getRefId()))
321 $tabs_gui->addTarget(
"perm_settings",
322 $this->ctrl->getLinkTargetByClass(array(get_class($this),
'ilpermissiongui'),
"perm"), array(
"perm",
"info",
"owner"),
'ilpermissiongui');