64 $this->lng->loadLanguageModule(
"chat");
76 return (
bool) $ilias->getSetting(
"chat_active");
83 $this->internal_ip = $ip;
93 $this->external_ip = $ip;
133 $this->moderator = $a_passwd;
178 $this->active = $status;
188 return substr($this->nic,0,6);
193 $this->error_message =
"";
197 $this->error_message .= $this->lng->txt(
"chat_add_internal_ip");
201 if($this->error_message)
203 $this->error_message .=
"<br />";
205 $this->error_message .= $this->lng->txt(
"chat_add_external_ip");
209 if($this->error_message)
211 $this->error_message .=
"<br />";
213 $this->error_message .= $this->lng->txt(
"chat_add_port");
217 if($this->error_message)
219 $this->error_message .=
"<br />";
221 $this->error_message .= $this->lng->txt(
"chat_add_ssl_port");
225 if($this->error_message)
227 $this->error_message .=
"<br />";
229 $this->error_message .= $this->lng->txt(
"chat_add_moderator_password");
233 if($this->error_message)
235 $this->error_message .=
"<br />";
237 $this->error_message .= $this->lng->txt(
"chat_add_allowed_hosts");
245 return $this->error_message ?
false :
true;
250 $this->ilias->setSetting(
"chat_internal_ip",$this->
getInternalIp());
251 $this->ilias->setSetting(
"chat_external_ip",$this->
getExternalIp());
252 $this->ilias->setSetting(
"chat_port",$this->
getPort());
253 $this->ilias->setSetting(
"chat_ssl_status",$this->
getSSLStatus());
254 $this->ilias->setSetting(
"chat_ssl_port",$this->
getSSLPort());
255 $this->ilias->setSetting(
"chat_logfile",$this->
getLogfile());
256 $this->ilias->setSetting(
"chat_loglevel",$this->
getLogLevel());
271 $this->internal_ip = $this->ilias->getSetting(
"chat_internal_ip");
272 $this->external_ip = $this->ilias->getSetting(
"chat_external_ip");
273 $this->port = $this->ilias->getSetting(
"chat_port");
274 $this->ssl_status = $this->ilias->getSetting(
"chat_ssl_status");
275 $this->ssl_port = $this->ilias->getSetting(
"chat_ssl_port");
276 $this->moderator = $this->ilias->getSetting(
"chat_moderator_password");
277 $this->loglevel = $this->ilias->getSetting(
"chat_loglevel");
278 $this->logfile = $this->ilias->getSetting(
"chat_logfile");
279 $this->hosts = $this->ilias->getSetting(
"chat_hosts");
280 $this->active = $this->ilias->getSetting(
"chat_active");
281 $this->nic = $this->ilias->getSetting(
"nic_key");
300 $hosts_arr2 = array();
303 for($i = 0;$i < count($hosts_arr); ++$i)
305 if(trim($hosts_arr[$i]))
307 $hosts_arr2[] = trim($hosts_arr[$i]);
323 $this->error_message =
ilUtil::getDataDir().
'/chat/server.ini ' .$this->lng->txt(
"chat_no_write_perm");
326 $content =
"LogLevel = ".$this->getLogLevel().
"\n";
329 $content .=
"LogFile = ".$this->getLogfile().
"\n";
331 $content .=
"IpAddress = ".$this->getInternalIp().
"\n";
332 $content .=
"ExternalIpAddress = ".$this->getExternalIp().
"\n";
333 $content .=
"Port = ".$this->getPort().
"\n";
334 #$content .= "SSLStatus = ".($this->getSSLStatus() ? $this->getSSLStatus() : 0)."\n";
335 #$content .= "SSLPort = ".$this->getSSLPort()."\n";
336 $content .=
"ModeratorPassword = ".$this->getModeratorPassword().
"\n";
337 $content .=
"HeaderFileName = ".ILIAS_ABSOLUTE_PATH.
"/Modules/Chat/templates/default/header.html\n";
338 $content .=
"FooterFileName = ".ILIAS_ABSOLUTE_PATH.
"/Modules/Chat/templates/default/footer.html\n";
339 $content .=
"Authentication = 1\n";
340 $content .=
"ConnectionsFrom = ".$this->getAllowedHosts().
"\n";
342 if(!@fwrite($fp,$content))
344 $this->error_message =
ilUtil::getDataDir().
'/chat/server.ini '.$this->lng->txt(
"chat_no_write_perm");