64 $this->lng->loadLanguageModule(
"chat");
74 return (
bool) $ilias->getSetting(
"chat_active");
81 $this->internal_ip = $ip;
89 $this->external_ip = $ip;
121 $this->moderator = $a_passwd;
158 $this->active = $status;
166 return substr($this->nic,0,6);
171 $this->error_message =
"";
175 $this->error_message .= $this->lng->txt(
"chat_add_internal_ip");
179 if($this->error_message)
181 $this->error_message .=
"<br />";
183 $this->error_message .= $this->lng->txt(
"chat_add_external_ip");
187 if($this->error_message)
189 $this->error_message .=
"<br />";
191 $this->error_message .= $this->lng->txt(
"chat_add_port");
195 if($this->error_message)
197 $this->error_message .=
"<br />";
199 $this->error_message .= $this->lng->txt(
"chat_add_ssl_port");
203 if($this->error_message)
205 $this->error_message .=
"<br />";
207 $this->error_message .= $this->lng->txt(
"chat_add_moderator_password");
211 if($this->error_message)
213 $this->error_message .=
"<br />";
215 $this->error_message .= $this->lng->txt(
"chat_add_allowed_hosts");
223 return $this->error_message ?
false :
true;
227 $this->ilias->setSetting(
"chat_internal_ip",$this->
getInternalIp());
228 $this->ilias->setSetting(
"chat_external_ip",$this->
getExternalIp());
229 $this->ilias->setSetting(
"chat_port",$this->
getPort());
230 $this->ilias->setSetting(
"chat_ssl_status",$this->
getSSLStatus());
231 $this->ilias->setSetting(
"chat_ssl_port",$this->
getSSLPort());
232 $this->ilias->setSetting(
"chat_logfile",$this->
getLogfile());
233 $this->ilias->setSetting(
"chat_loglevel",$this->
getLogLevel());
246 $this->internal_ip = $this->ilias->getSetting(
"chat_internal_ip");
247 $this->external_ip = $this->ilias->getSetting(
"chat_external_ip");
248 $this->port = $this->ilias->getSetting(
"chat_port");
249 $this->ssl_status = $this->ilias->getSetting(
"chat_ssl_status");
250 $this->ssl_port = $this->ilias->getSetting(
"chat_ssl_port");
251 $this->moderator = $this->ilias->getSetting(
"chat_moderator_password");
252 $this->loglevel = $this->ilias->getSetting(
"chat_loglevel");
253 $this->logfile = $this->ilias->getSetting(
"chat_logfile");
254 $this->hosts = $this->ilias->getSetting(
"chat_hosts");
255 $this->active = $this->ilias->getSetting(
"chat_active");
256 $this->nic = $this->ilias->getSetting(
"nic_key");
276 $hosts_arr2 = array();
279 for($i = 0;$i < count($hosts_arr); ++$i)
281 if(trim($hosts_arr[$i]))
283 $hosts_arr2[] = trim($hosts_arr[$i]);
298 $this->error_message =
ilUtil::getDataDir().
'/chat/server.ini ' .$this->lng->txt(
"chat_no_write_perm");
301 $content =
"LogLevel = ".$this->getLogLevel().
"\n";
304 $content .=
"LogFile = ".$this->getLogfile().
"\n";
306 $content .=
"IpAddress = ".$this->getInternalIp().
"\n";
307 $content .=
"ExternalIpAddress = ".$this->getExternalIp().
"\n";
308 $content .=
"Port = ".$this->getPort().
"\n";
309 #$content .= "SSLStatus = ".($this->getSSLStatus() ? $this->getSSLStatus() : 0)."\n";
310 #$content .= "SSLPort = ".$this->getSSLPort()."\n";
311 $content .=
"ModeratorPassword = ".$this->getModeratorPassword().
"\n";
312 $content .=
"HeaderFileName = ".ILIAS_ABSOLUTE_PATH.
"/Modules/Chat/templates/default/header.html\n";
313 $content .=
"FooterFileName = ".ILIAS_ABSOLUTE_PATH.
"/Modules/Chat/templates/default/footer.html\n";
314 $content .=
"Authentication = 1\n";
315 $content .=
"ConnectionsFrom = ".$this->getAllowedHosts().
"\n";
317 if(!@fwrite($fp,$content))
319 $this->error_message =
ilUtil::getDataDir().
'/chat/server.ini '.$this->lng->txt(
"chat_no_write_perm");