示例#1
0
 function __construct()
 {
     $this->online = $this->online == 'Y';
     $this->away = $this->away == 'Y';
     $this->realname = htmlentities($this->realname, ENT_COMPAT, "UTF-8");
     $this->swhois = htmlentities($this->swhois, ENT_COMPAT, "UTF-8");
     $this->away_msg = htmlentities($this->away_msg, ENT_COMPAT, "UTF-8");
     $this->client_html = $this->client ? Magirc::irc2html($this->client) : null;
     $this->client = htmlentities($this->client, ENT_COMPAT, "UTF-8");
     $this->quit_msg = htmlentities($this->quit_msg, ENT_COMPAT, "UTF-8");
     $this->service = $this->service == 'Y';
     $this->bot = $this->hasMode(Protocol::bot_mode);
     if (filter_var($this->hostname, FILTER_VALIDATE_IP, FILTER_FLAG_IPV6)) {
         $this->ipv6 = true;
     }
     if (!empty($this->vhost)) {
         $this->hostname = $this->vhost;
     } elseif (Protocol::host_cloaking && !empty($this->hostname_cloaked)) {
         $this->hostname = $this->hostname_cloaked;
     }
     if (!Protocol::oper_hidden_mode || !$this->hasMode(Protocol::oper_hidden_mode)) {
         $this->helper = $this->hasMode(Protocol::helper_mode);
     }
     // Get the server country if user country is local
     if ($this->country_code == 'local' && $this->server_country_code) {
         $this->country = $this->server_country;
         $this->country_code = $this->server_country_code;
     }
 }
 function __construct()
 {
     $this->DT_RowId = $this->channel;
     $this->topic_html = $this->topic ? Magirc::irc2html($this->topic) : null;
     $this->topic = htmlentities($this->topic, ENT_COMPAT, "UTF-8");
 }
示例#3
0
 function __construct()
 {
     $this->online = $this->online == 'Y';
     $this->motd_html = $this->motd ? Magirc::irc2html($this->motd) : null;
     $this->motd = htmlentities($this->motd, ENT_COMPAT, "UTF-8");
 }
示例#4
0
error_reporting(E_ALL);
ini_set('default_charset', 'UTF-8');
date_default_timezone_set('UTC');
include_once '../lib/magirc/version.inc.php';
require_once '../lib/magirc/DB.class.php';
require_once '../lib/magirc/Config.class.php';
require_once '../lib/magirc/services/Service.interface.php';
require_once '../lib/magirc/services/Anope.class.php';
require_once '../lib/magirc/services/Denora.class.php';
require_once '../lib/magirc/objects/ServerBase.class.php';
require_once '../lib/magirc/objects/ChannelBase.class.php';
require_once '../lib/magirc/objects/UserBase.class.php';
require_once '../lib/magirc/Magirc.class.php';
require '../vendor/autoload.php';
// Initialization
$magirc = new Magirc('service');
//NOTE: we need to use HTTP 1.0 because nginx might chunk otherwise
$magirc->slim->config('http.version', '1.0');
$magirc->slim->contentType('application/json');
$magirc->slim->notFound(function () use($magirc) {
    $magirc->jsonOutput(array('error' => "HTTP 404 Not Found"));
});
date_default_timezone_set($magirc->cfg->timezone);
// Routing definitions
$magirc->slim->get('/network/status', function () use($magirc) {
    $magirc->jsonOutput($magirc->service->getCurrentStatus());
});
$magirc->slim->get('/network/max', function () use($magirc) {
    $magirc->jsonOutput($magirc->service->getMaxValues());
});
$magirc->slim->get('/network/clients/percent', function () use($magirc) {