64 $this->lng->loadLanguageModule(
"chat");
74 return (
bool) $ilias->getSetting(
"chat_active");
81 $this->internal_ip = $ip;
91 $this->external_ip = $ip;
131 $this->moderator = $a_passwd;
176 $this->active = $status;
186 return substr($this->nic,0,6);
191 $this->error_message =
"";
195 $this->error_message .= $this->lng->txt(
"chat_add_internal_ip");
199 if($this->error_message)
201 $this->error_message .=
"<br />";
203 $this->error_message .= $this->lng->txt(
"chat_add_external_ip");
207 if($this->error_message)
209 $this->error_message .=
"<br />";
211 $this->error_message .= $this->lng->txt(
"chat_add_port");
215 if($this->error_message)
217 $this->error_message .=
"<br />";
219 $this->error_message .= $this->lng->txt(
"chat_add_ssl_port");
223 if($this->error_message)
225 $this->error_message .=
"<br />";
227 $this->error_message .= $this->lng->txt(
"chat_add_moderator_password");
231 if($this->error_message)
233 $this->error_message .=
"<br />";
235 $this->error_message .= $this->lng->txt(
"chat_add_allowed_hosts");
243 return $this->error_message ?
false :
true;
248 $this->ilias->setSetting(
"chat_internal_ip",$this->
getInternalIp());
249 $this->ilias->setSetting(
"chat_external_ip",$this->
getExternalIp());
250 $this->ilias->setSetting(
"chat_port",$this->
getPort());
251 $this->ilias->setSetting(
"chat_ssl_status",$this->
getSSLStatus());
252 $this->ilias->setSetting(
"chat_ssl_port",$this->
getSSLPort());
253 $this->ilias->setSetting(
"chat_logfile",$this->
getLogfile());
254 $this->ilias->setSetting(
"chat_loglevel",$this->
getLogLevel());
269 $this->internal_ip = $this->ilias->getSetting(
"chat_internal_ip");
270 $this->external_ip = $this->ilias->getSetting(
"chat_external_ip");
271 $this->port = $this->ilias->getSetting(
"chat_port");
272 $this->ssl_status = $this->ilias->getSetting(
"chat_ssl_status");
273 $this->ssl_port = $this->ilias->getSetting(
"chat_ssl_port");
274 $this->moderator = $this->ilias->getSetting(
"chat_moderator_password");
275 $this->loglevel = $this->ilias->getSetting(
"chat_loglevel");
276 $this->logfile = $this->ilias->getSetting(
"chat_logfile");
277 $this->hosts = $this->ilias->getSetting(
"chat_hosts");
278 $this->active = $this->ilias->getSetting(
"chat_active");
279 $this->nic = $this->ilias->getSetting(
"nic_key");
298 $hosts_arr2 = array();
301 for($i = 0;$i < count($hosts_arr); ++$i)
303 if(trim($hosts_arr[$i]))
305 $hosts_arr2[] = trim($hosts_arr[$i]);
321 $this->error_message =
ilUtil::getDataDir().
'/chat/server.ini ' .$this->lng->txt(
"chat_no_write_perm");
324 $content =
"LogLevel = ".$this->getLogLevel().
"\n";
327 $content .=
"LogFile = ".$this->getLogfile().
"\n";
329 $content .=
"IpAddress = ".$this->getInternalIp().
"\n";
330 $content .=
"ExternalIpAddress = ".$this->getExternalIp().
"\n";
331 $content .=
"Port = ".$this->getPort().
"\n";
332 #$content .= "SSLStatus = ".($this->getSSLStatus() ? $this->getSSLStatus() : 0)."\n";
333 #$content .= "SSLPort = ".$this->getSSLPort()."\n";
334 $content .=
"ModeratorPassword = ".$this->getModeratorPassword().
"\n";
335 $content .=
"HeaderFileName = ".ILIAS_ABSOLUTE_PATH.
"/Modules/Chat/templates/default/header.html\n";
336 $content .=
"FooterFileName = ".ILIAS_ABSOLUTE_PATH.
"/Modules/Chat/templates/default/footer.html\n";
337 $content .=
"Authentication = 1\n";
338 $content .=
"ConnectionsFrom = ".$this->getAllowedHosts().
"\n";
340 if(!@fwrite($fp,$content))
342 $this->error_message =
ilUtil::getDataDir().
'/chat/server.ini '.$this->lng->txt(
"chat_no_write_perm");