Public Member Functions | |
| ilChatServerConfig () | |
| Constructor public. | |
| setInternalIp ($ip) | |
| getInternalIp () | |
| setExternalIp ($ip) | |
| getExternalIp () | |
| setPort ($port) | |
| getPort () | |
| setModeratorPassword ($a_passwd) | |
| getModeratorPassword () | |
| setLogfile ($logfile) | |
| getLogfile () | |
| setLogLevel ($loglevel) | |
| getLogLevel () | |
| setAllowedHosts ($hosts) | |
| getAllowedHosts () | |
| getErrorMessage () | |
| setActiveStatus ($status) | |
| getActiveStatus () | |
| getNic () | |
| validate () | |
| update () | |
| updateStatus () | |
| read () | |
| isAlive () | |
| __parseAllowedHosts () | |
| __writeConfigFile () | |
Data Fields | |
| $ilias | |
| $lng | |
| $internal_ip | |
| $external_ip | |
| $port | |
| $moderator | |
| $logfile | |
| $loglevel | |
| $hosts | |
| $active | |
| $nic | |
| $error_message | |
Definition at line 33 of file class.ilChatServerConfig.php.
| ilChatServerConfig::__parseAllowedHosts | ( | ) |
Definition at line 232 of file class.ilChatServerConfig.php.
References getAllowedHosts(), and setAllowedHosts().
Referenced by validate().
{
$hosts_arr2 = array();
$hosts_arr = explode(',',$this->getAllowedHosts());
for($i = 0;$i < count($hosts_arr); ++$i)
{
if(trim($hosts_arr[$i]))
{
$hosts_arr2[] = trim($hosts_arr[$i]);
}
}
$this->setAllowedHosts(implode(',',$hosts_arr2));
return true;
}
Here is the call graph for this function:
Here is the caller graph for this function:| ilChatServerConfig::__writeConfigFile | ( | ) |
Definition at line 248 of file class.ilChatServerConfig.php.
References getLogfile().
Referenced by update().
{
if(!($fp = @fopen($a_path."./chat/chatserver/server.ini","w")))
{
$this->error_message = "./chat/chatserver/server.ini ".$this->lng->txt("chat_no_write_perm");
return false;
}
$content = "LogLevel = ".$this->getLogLevel()."\n";
if($this->getLogfile())
{
$content .= "LogFile = ".$this->getLogfile()."\n";
}
$content .= "IpAddress = ".$this->getInternalIp()."\n";
$content .= "ExternalIpAddress = ".$this->getExternalIp()."\n";
$content .= "Port = ".$this->getPort()."\n";
$content .= "ModeratorPassword = ".$this->getModeratorPassword()."\n";
$content .= "HeaderFileName = ".ILIAS_ABSOLUTE_PATH."/chat/templates/default/header.html\n";
$content .= "FooterFileName = ".ILIAS_ABSOLUTE_PATH."/chat/templates/default/footer.html\n";
$content .= "Authentication = 1\n";
$content .= "ConnectionsFrom = ".$this->getAllowedHosts()."\n";
if(!@fwrite($fp,$content))
{
$this->error_message = ILIAS_ABSOLUTE_PATH."/chat/chatserver/server.ini ".$this->lng->txt("chat_no_write_perm");
fclose($fp);
return false;
}
fclose($fp);
return true;
}
Here is the call graph for this function:
Here is the caller graph for this function:| ilChatServerConfig::getActiveStatus | ( | ) |
Definition at line 134 of file class.ilChatServerConfig.php.
Referenced by updateStatus().
{
return $this->active;
}
Here is the caller graph for this function:| ilChatServerConfig::getAllowedHosts | ( | ) |
Definition at line 121 of file class.ilChatServerConfig.php.
Referenced by __parseAllowedHosts(), update(), and validate().
{
return $this->hosts;
}
Here is the caller graph for this function:| ilChatServerConfig::getErrorMessage | ( | ) |
Definition at line 126 of file class.ilChatServerConfig.php.
{
return $this->error_message;
}
| ilChatServerConfig::getExternalIp | ( | ) |
Definition at line 81 of file class.ilChatServerConfig.php.
Referenced by update(), and validate().
{
return $this->external_ip ? $this->external_ip : $this->internal_ip;
}
Here is the caller graph for this function:| ilChatServerConfig::getInternalIp | ( | ) |
Definition at line 73 of file class.ilChatServerConfig.php.
Referenced by isAlive(), update(), and validate().
{
return $this->internal_ip;
}
Here is the caller graph for this function:| ilChatServerConfig::getLogfile | ( | ) |
Definition at line 105 of file class.ilChatServerConfig.php.
Referenced by __writeConfigFile(), and update().
{
return $this->logfile;
}
Here is the caller graph for this function:| ilChatServerConfig::getLogLevel | ( | ) |
Definition at line 113 of file class.ilChatServerConfig.php.
Referenced by update().
{
return $this->loglevel;
}
Here is the caller graph for this function:| ilChatServerConfig::getModeratorPassword | ( | ) |
Definition at line 97 of file class.ilChatServerConfig.php.
Referenced by update(), and validate().
{
return $this->moderator;
}
Here is the caller graph for this function:| ilChatServerConfig::getNic | ( | ) |
Definition at line 138 of file class.ilChatServerConfig.php.
{
return substr($this->nic,0,6);
}
| ilChatServerConfig::getPort | ( | ) |
Definition at line 89 of file class.ilChatServerConfig.php.
Referenced by isAlive(), update(), and validate().
{
return $this->port;
}
Here is the caller graph for this function:| ilChatServerConfig::ilChatServerConfig | ( | ) |
Constructor public.
| integer | reference_id or object_id | |
| boolean | treat the id as reference_id (true) or object_id (false) |
Definition at line 57 of file class.ilChatServerConfig.php.
References $ilias, $lng, and read().
{
global $ilias,$lng;
$this->ilias =& $ilias;
$this->lng =& $lng;
$this->lng->loadLanguageModule("chat");
$this->read();
}
Here is the call graph for this function:| ilChatServerConfig::isAlive | ( | ) |
Definition at line 217 of file class.ilChatServerConfig.php.
References getInternalIp(), and getPort().
{
if($this->getInternalIp() and $this->getPort())
{
if( $sp = @fsockopen($this->getInternalIp(),$this->getPort(), $errno, $errstr, 100))
{
fclose($sp);
return true;
}
return false;
}
return false;
}
Here is the call graph for this function:| ilChatServerConfig::read | ( | ) |
Definition at line 204 of file class.ilChatServerConfig.php.
Referenced by ilChatServerConfig().
{
$this->internal_ip = $this->ilias->getSetting("chat_internal_ip");
$this->external_ip = $this->ilias->getSetting("chat_external_ip");
$this->port = $this->ilias->getSetting("chat_port");
$this->moderator = $this->ilias->getSetting("chat_moderator_password");
$this->loglevel = $this->ilias->getSetting("chat_loglevel");
$this->logfile = $this->ilias->getSetting("chat_logfile");
$this->hosts = $this->ilias->getSetting("chat_hosts");
$this->active = $this->ilias->getSetting("chat_active");
$this->nic = $this->ilias->getSetting("nic_key");
}
Here is the caller graph for this function:| ilChatServerConfig::setActiveStatus | ( | $ | status | ) |
Definition at line 130 of file class.ilChatServerConfig.php.
References $status.
{
$this->active = $status;
}
| ilChatServerConfig::setAllowedHosts | ( | $ | hosts | ) |
Definition at line 117 of file class.ilChatServerConfig.php.
References $hosts.
Referenced by __parseAllowedHosts().
{
$this->hosts = $hosts;
}
Here is the caller graph for this function:| ilChatServerConfig::setExternalIp | ( | $ | ip | ) |
Definition at line 77 of file class.ilChatServerConfig.php.
{
$this->external_ip = $ip;
}
| ilChatServerConfig::setInternalIp | ( | $ | ip | ) |
Definition at line 69 of file class.ilChatServerConfig.php.
{
$this->internal_ip = $ip;
}
| ilChatServerConfig::setLogfile | ( | $ | logfile | ) |
Definition at line 101 of file class.ilChatServerConfig.php.
References $logfile.
{
$this->logfile = $logfile;
}
| ilChatServerConfig::setLogLevel | ( | $ | loglevel | ) |
Definition at line 109 of file class.ilChatServerConfig.php.
References $loglevel.
{
$this->loglevel = $loglevel;
}
| ilChatServerConfig::setModeratorPassword | ( | $ | a_passwd | ) |
Definition at line 93 of file class.ilChatServerConfig.php.
{
$this->moderator = $a_passwd;
}
| ilChatServerConfig::setPort | ( | $ | port | ) |
Definition at line 85 of file class.ilChatServerConfig.php.
References $port.
{
$this->port = $port;
}
| ilChatServerConfig::update | ( | ) |
Definition at line 187 of file class.ilChatServerConfig.php.
References __writeConfigFile(), getAllowedHosts(), getExternalIp(), getInternalIp(), getLogfile(), getLogLevel(), getModeratorPassword(), and getPort().
{
$this->ilias->setSetting("chat_internal_ip",$this->getInternalIp());
$this->ilias->setSetting("chat_external_ip",$this->getExternalIp());
$this->ilias->setSetting("chat_port",$this->getPort());
$this->ilias->setSetting("chat_logfile",$this->getLogfile());
$this->ilias->setSetting("chat_loglevel",$this->getLogLevel());
$this->ilias->setSetting("chat_hosts",$this->getAllowedHosts());
$this->ilias->setSetting("chat_moderator_password",$this->getModeratorPassword());
return $this->__writeConfigFile();
}
Here is the call graph for this function:| ilChatServerConfig::updateStatus | ( | ) |
Definition at line 199 of file class.ilChatServerConfig.php.
References getActiveStatus().
{
$this->ilias->setSetting("chat_active",$this->getActiveStatus());
}
Here is the call graph for this function:| ilChatServerConfig::validate | ( | ) |
Definition at line 143 of file class.ilChatServerConfig.php.
References __parseAllowedHosts(), getAllowedHosts(), getExternalIp(), getInternalIp(), getModeratorPassword(), and getPort().
{
$this->error_message = "";
if(!$this->getInternalIp())
{
$this->error_message .= $this->lng->txt("chat_add_internal_ip");
}
if(!$this->getExternalIp())
{
$this->error_message .= $this->lng->txt("chat_add_external_ip");
}
if(!$this->getPort())
{
if($this->error_message)
{
$this->error_message .= "<br />";
}
$this->error_message .= $this->lng->txt("chat_add_port");
}
if(!$this->getModeratorPassword())
{
if($this->error_message)
{
$this->error_message .= "<br />";
}
$this->error_message .= $this->lng->txt("chat_add_moderator_password");
}
if(!$this->getAllowedHosts())
{
if($this->error_message)
{
$this->error_message .= "<br />";
}
$this->error_message .= $this->lng->txt("chat_add_allowed_hosts");
}
if($this->getAllowedHosts())
{
$this->__parseAllowedHosts();
}
return $this->error_message ? false : true;
}
Here is the call graph for this function:| ilChatServerConfig::$active |
Definition at line 45 of file class.ilChatServerConfig.php.
| ilChatServerConfig::$error_message |
Definition at line 48 of file class.ilChatServerConfig.php.
| ilChatServerConfig::$external_ip |
Definition at line 39 of file class.ilChatServerConfig.php.
| ilChatServerConfig::$hosts |
Definition at line 44 of file class.ilChatServerConfig.php.
Referenced by setAllowedHosts().
| ilChatServerConfig::$ilias |
Definition at line 35 of file class.ilChatServerConfig.php.
Referenced by ilChatServerConfig().
| ilChatServerConfig::$internal_ip |
Definition at line 38 of file class.ilChatServerConfig.php.
| ilChatServerConfig::$lng |
Definition at line 36 of file class.ilChatServerConfig.php.
Referenced by ilChatServerConfig().
| ilChatServerConfig::$logfile |
Definition at line 42 of file class.ilChatServerConfig.php.
Referenced by setLogfile().
| ilChatServerConfig::$loglevel |
Definition at line 43 of file class.ilChatServerConfig.php.
Referenced by setLogLevel().
| ilChatServerConfig::$moderator |
Definition at line 41 of file class.ilChatServerConfig.php.
| ilChatServerConfig::$nic |
Definition at line 46 of file class.ilChatServerConfig.php.
| ilChatServerConfig::$port |
Definition at line 40 of file class.ilChatServerConfig.php.
Referenced by setPort().
1.7.1