コード例 #1
0
function Save()
{
    $sock = new wifidog_settings($_POST["ruleid"]);
    unset($_POST["ruleid"]);
    while (list($key, $value) = each($_POST)) {
        $value = url_decode_special_tool($value);
        $sock->SET_INFO($key, $value);
    }
}
コード例 #2
0
function tests_smtp()
{
    //ini_set('display_errors', 1);ini_set('error_reporting', E_ALL);ini_set('error_prepend_string',null);ini_set('error_append_string',null);
    header("content-type: application/x-javascript");
    $sock = new sockets();
    $sock = new wifidog_settings($_GET["ruleid"]);
    $wifidog_templates = new wifidog_templates($_GET["ruleid"]);
    $ArticaSplashHotSpotEndTime = $sock->GET_INFO("ArticaSplashHotSpotEndTime");
    $proto = "http";
    $myHostname = $_SERVER["HTTP_HOST"];
    $page = CurrentPageName();
    if (isset($_SERVER["HTTPS"])) {
        $proto = "https";
    }
    $URL_REDIRECT = "{$proto}://{$myHostname}/{$page}?wifidog-confirm=NONE";
    $tpl = new templates();
    $smtp_sender = $sock->GET_INFO("smtp_sender");
    $smtp_senderTR = explode("@", $smtp_sender);
    $instance = $smtp_senderTR[1];
    $random_hash = md5(date('r', time()));
    $body[] = "Return-Path: <{$smtp_sender}>";
    $body[] = "Date: " . date("D, d M Y H:i:s") . " +0100 (CET)";
    $body[] = "From: {$smtp_sender}";
    $body[] = "Subject: {$wifidog_templates->REGISTER_SUBJECT}";
    $body[] = "To: {$smtp_sender}";
    $body[] = "";
    $body[] = "";
    $body[] = $wifidog_templates->REGISTER_MESSAGE;
    $body[] = $URL_REDIRECT;
    $body[] = "";
    $body[] = "";
    $finalbody = @implode("\r\n", $body);
    $webauth_msmtp = new webauth_msmtp($smtp_sender, $finalbody, $smtp_sender, $_GET["ruleid"]);
    if ($webauth_msmtp->Send()) {
        echo "alert('" . $tpl->javascript_parse_text("{$wifidog_templates->REGISTER_SUBJECT}\nTo {$smtp_sender}: {success}") . "');";
        return;
    }
    $smtp = new smtp();
    if ($sock->GET_INFO("smtp_auth_user") != null) {
        $params["auth"] = true;
        $params["user"] = $sock->GET_INFO("smtp_auth_user");
        $params["pass"] = $sock->GET_INFO("smtp_auth_passwd");
    }
    $params["host"] = $sock->GET_INFO("smtp_server_name");
    $params["port"] = $sock->GET_INFO("smtp_server_port");
    if (!$smtp->connect($params)) {
        echo "alert('" . $tpl->javascript_parse_text("{error_while_sending_message} {error} {$smtp->error_number} {$smtp->error_text}") . "');";
        return;
    }
    if (!$smtp->send(array("from" => $smtp_sender, "recipients" => $smtp_sender, "body" => $finalbody, "headers" => null))) {
        $smtp->quit();
        echo "alert('" . $tpl->javascript_parse_text("{error_while_sending_message} {error} {$smtp->error_number} {$smtp->error_text}") . "');";
        return;
    }
    echo "alert('" . $tpl->javascript_parse_text("{$wifidog_templates->REGISTER_SUBJECT}\nTo {$smtp_sender}: {success}") . "');";
    $smtp->quit();
}
コード例 #3
0
function Save()
{
    $sock = new wifidog_settings($_POST["ruleid"]);
    unset($_POST["ruleid"]);
    while (list($key, $value) = each($_POST)) {
        $value = url_decode_special_tool($value);
        $sock->SET_INFO($key, $value);
    }
    $sock = new sockets();
    $sock->getFrameWork("hotspot.php?remove-cache=yes");
}
コード例 #4
0
function Save()
{
    ini_set('display_errors', 1);
    ini_set('error_reporting', E_ALL);
    ini_set('error_prepend_string', null);
    ini_set('error_append_string', null);
    $sock = new wifidog_settings($_POST["ruleid"]);
    unset($_POST["ruleid"]);
    while (list($key, $value) = each($_POST)) {
        $sock->SET_INFO($key, $value);
    }
}
コード例 #5
0
ファイル: hotspot.php プロジェクト: articatech/artica
function wifidog_register_perform()
{
    session_start();
    $page = CurrentPageName();
    $tpl = new templates();
    $autocreate_confirmed = 0;
    if ($GLOBALS["HOTSPOT_DEBUG"]) {
        wifidog_logs("Starting wifidog_register_perform()");
    }
    $wifidog_build_uri = wifidog_build_uri();
    $uriext = $wifidog_build_uri[0];
    $HiddenFields = $wifidog_build_uri[1];
    $sock = new wifidog_settings($_SESSION["WIFIDOG_RULES"]);
    $ENABLED_SMTP = intval($sock->GET_INFO("ENABLED_SMTP"));
    $wifidog_templates = new wifidog_templates($_SESSION["WIFIDOG_RULES"]);
    $ENABLED_REDIRECT_LOGIN = intval($sock->GET_INFO("ENABLED_REDIRECT_LOGIN"));
    $email = trim(strtolower($_POST["email"]));
    $q = new mysql_hotspot();
    $password2 = trim($_POST["password2"]);
    $password = trim($_POST["password"]);
    $passphrase = trim(strtolower($_POST["passphrase"]));
    if ($GLOBALS["HOTSPOT_DEBUG"]) {
        wifidog_logs("{$email}: Ask a passphrase: {$wifidog_templates->REGISTER_GENERIC_PASSWORD}");
    }
    if ($wifidog_templates->REGISTER_GENERIC_PASSWORD == 1) {
        if ($passphrase != trim(strtolower($wifidog_templates->REGISTER_GENERIC_PASSTXT))) {
            return wifidog_register($wifidog_templates->char($wifidog_templates->REGISTER_GENERIC_PASSERR));
        }
    }
    if ($password2 != $password) {
        return wifidog_register("{password_mismatch}");
    }
    if ($ENABLED_SMTP == 1) {
        if (!filter_var($email, FILTER_VALIDATE_EMAIL)) {
            return wifidog_register("{error_email_invalid}");
        }
        $tr = explode("@", $email);
        $domain = $tr[1];
        if (!checkdnsrr($domain, 'MX')) {
            return wifidog_register("&laquo;{$domain}&raquo;<br>{error_domain_email_invalid}");
        }
    }
    $ligne = mysql_fetch_array($q->QUERY_SQL("SELECT uid,autocreate FROM hotspot_members WHERE `uid`='{$email}'"));
    if ($ENABLED_REDIRECT_LOGIN == 1) {
        if (intval($ligne["autocreate"]) == 1) {
            if ($ligne["uid"] != null) {
                $q->QUERY_SQL("DELETE FROM hotspot_members WHERE `uid`='{$email}'");
                $ligne["uid"] = null;
            }
        }
    }
    if ($ligne["uid"] != null) {
        if ($ENABLED_SMTP == 1) {
            $link = "<br><strong><a href=\"{$page}?wifidog-recover=yes&{$uriext}\">{lost_password}</a></strong>";
        }
        return wifidog_register($tpl->_ENGINE_parse_body("{this_account_already_exists}<br>{$link}"));
    }
    wifidog_logs("Ruleid: {$_SESSION["WIFIDOG_RULES"]}");
    $MAC = $_REQUEST["mac"];
    $REGISTER_MAX_TIME = intval($sock->GET_INFO("REGISTER_MAX_TIME"));
    $ArticaSplashHotSpotEndTime = intval($sock->GET_INFO("ArticaSplashHotSpotEndTime"));
    if ($REGISTER_MAX_TIME == 0) {
        $REGISTER_MAX_TIME = 5;
    }
    wifidog_logs("Ruleid: REGISTER_MAX_TIME:{$REGISTER_MAX_TIME}");
    wifidog_logs("Ruleid: ArticaSplashHotSpotEndTime:{$ArticaSplashHotSpotEndTime}");
    $password = md5($password);
    $creationtime = time();
    $autocreate_maxttl = $ArticaSplashHotSpotEndTime;
    $sessionkey = md5($password . $creationtime . $email);
    $gateway_addr = $_REQUEST["gw_address"];
    $gw_port = $_REQUEST["gw_port"];
    $gw_id = $_REQUEST["gw_id"];
    $ARP = $_REQUEST["mac"];
    $url = $_REQUEST["url"];
    $token = $_REQUEST["token"];
    if ($token == null) {
        if ($GLOBALS["HOTSPOT_DEBUG"]) {
            wifidog_logs("no token retrive", __FUNCTION__, __LINE__);
        }
        $token = generateToken($ARP);
        if ($token == null) {
            $token = md5(uniqid(rand(), 1));
            if ($GLOBALS["HOTSPOT_DEBUG"]) {
                wifidog_logs("Generate a temporary token {$token}", __FUNCTION__, __LINE__);
            }
        }
    }
    if ($ENABLED_SMTP == 0) {
        $autocreate_confirmed = 1;
    }
    if ($GLOBALS["HOTSPOT_DEBUG"]) {
        wifidog_logs("Create new member {$email},{$password},TTL:{$ArticaSplashHotSpotEndTime}", __FUNCTION__, __LINE__);
    }
    $sql = "INSERT IGNORE INTO hotspot_members \n\t(uid,username,token,ruleid,ttl,sessiontime,password,enabled,creationtime,autocreate,autocreate_confirmed,autocreate_maxttl,sessionkey,MAC) VALUES\n\t('{$email}','{$email}','{$token}','{$_SESSION["WIFIDOG_RULES"]}','{$ArticaSplashHotSpotEndTime}','','{$password}',1,'{$creationtime}',1,'{$autocreate_confirmed}',{$autocreate_maxttl},'{$sessionkey}','{$MAC}')";
    $q->QUERY_SQL($sql);
    wifidog_logs("[{$ARP}]:[{$GLOBALS["CONNECTED_IP"]}]: {$email}: Create New member with a token {$token}", __FUNCTION__, __LINE__);
    if (!$q->ok) {
        events(0, "MySQL error: {$q->mysql_error} (Line: " . __LINE__ . ")");
        wifidog_logs("{$q->mysql_error}");
        wifidog_logs("{$sql}");
        return wifidog_register($q->mysql_error);
    }
    if ($ENABLED_SMTP == 0) {
        $array["SERVER_NAME"] = $_SERVER["SERVER_NAME"];
        $array["redirecturi"] = $url;
        $array["LOGIN"] = $email;
        $array["redirecturi"] = $_REQUEST["url"];
        $array["REMOTE_ADDR"] = $_REQUEST["ip"];
        $array["token"] = $token;
        $array["HOST"] = $_REQUEST["ip"];
        $array["ruleid"] = $_SESSION["WIFIDOG_RULES"];
        UnLock($array);
        wifidog_logs("wifidog_auth/" . __FUNCTION__ . ":: SESSION(HOTSPOT_REDIRECT_URL) = {$url}");
        $_SESSION["HOTSPOT_AUTO_REGISTER"] = true;
        $_SESSION["HOTSPOT_REDIRECT_URL"] = $url;
        $redirecturi = "http://{$gateway_addr}:{$gw_port}/wifidog/auth?token={$token}";
        wifidog_logs("wifidog_auth/" . __FUNCTION__ . ":: Redirect Token: {$token} to {$redirecturi}");
        header("Location: {$redirecturi}");
        return;
    }
    $proto = "http";
    $myHostname = $_SERVER["HTTP_HOST"];
    $page = CurrentPageName();
    if (isset($_SERVER["HTTPS"])) {
        $proto = "https";
    }
    $URL_REDIRECT = "{$proto}://{$myHostname}/{$page}?wifidog-confirm={$sessionkey}";
    $smtp_sender = $sock->GET_INFO("smtp_sender");
    include_once dirname(__FILE__) . "/ressources/externals/mime/mime.inc";
    $message = new Mail_mime("\r\n");
    $text = "<p style=font-size:18px>{$wifidog_templates->REGISTER_MESSAGE}</p>\n\t<p>\t\n\t<hr>\n\t\t<center>\n\t\t\t<a href=\"{$URL_REDIRECT}\" style='font-size:22px;text-decoration:underline'>{$URL_REDIRECT}</a>\n\t\t</center>\n\t</p>";
    $message->setFrom($smtp_sender);
    $message->addTo($email);
    $message->setSubject($wifidog_templates->REGISTER_SUBJECT);
    $message->setTXTBody(strip_tags($text));
    $message->setHTMLBody($text);
    $finalbody = $message->getMessage();
    $webauth_msmtp = new webauth_msmtp($smtp_sender, $finalbody, $email);
    if (!$webauth_msmtp->Send()) {
        events(0, "SMTP Error[method 1]: {$webauth_msmtp->logs}", $webauth_msmtp->logs);
        $content[] = "Method 1:\n{$webauth_msmtp->logs}\n";
        $smtp = new smtp();
        if ($sock->GET_INFO("smtp_auth_user") != null) {
            $params["auth"] = true;
            $params["user"] = $sock->GET_INFO("smtp_auth_user");
            $params["pass"] = $sock->GET_INFO("smtp_auth_passwd");
        }
        $params["host"] = $sock->GET_INFO("smtp_server_name");
        $params["port"] = $sock->GET_INFO("smtp_server_port");
        if (!$smtp->connect($params)) {
            $content[] = "Method2 Error:{$smtp->error_number} {$smtp->error_text}";
            events(0, "SMTP Error[method 2 - Connect]: {$params["host"]} {$smtp->error_number} {$smtp->error_text}", @implode("\n", $content));
            return wifidog_register("{$email}: {error_while_sending_message} {error} {$smtp->error_number} {$smtp->error_text}");
        }
        if (!$smtp->send(array("from" => $smtp_sender, "recipients" => $email, "body" => $finalbody, "headers" => null))) {
            events(0, "SMTP Error[method 2 - Send]: {$smtp->error_number} {$smtp->error_text}", null);
            $smtp->quit();
            return wifidog_register("{error_while_sending_message} {error} {$smtp->error_number} {$smtp->error_text}");
        }
        if ($GLOBALS["HOTSPOT_DEBUG"]) {
            wifidog_logs("From: {$smtp_sender} to {$email} {$wifidog_templates->REGISTER_SUBJECT} success");
        }
        $smtp->quit();
    }
    if ($GLOBALS["HOTSPOT_DEBUG"]) {
        wifidog_logs("wifidog_auth/" . __FUNCTION__ . ":: Token: {$token} -> UnLock(..");
    }
    $array["LOGIN"] = $email;
    $array["ARP"] = $_REQUEST["mac"];
    $array["token"] = $token;
    $array["redirecturi"] = $_REQUEST["url"];
    $array["REMOTE_ADDR"] = $_REQUEST["ip"];
    $array["REGISTER"] = true;
    if (!UnLock($array)) {
        if ($GLOBALS["HOTSPOT_DEBUG"]) {
            wifidog_logs("wifidog_auth/" . __FUNCTION__ . "::failed_to_create_session");
        }
        return wifidog_register("{error} {failed_to_create_session}");
    }
    wifidog_logs("wifidog_auth/" . __FUNCTION__ . ":: SESSION(HOTSPOT_REDIRECT_URL) = {$url}");
    $_SESSION["HOTSPOT_AUTO_REGISTER"] = true;
    $_SESSION["HOTSPOT_REDIRECT_URL"] = $url;
    $redirecturi = "http://{$gateway_addr}:{$gw_port}/wifidog/auth?token={$token}";
    wifidog_logs("wifidog_auth/" . __FUNCTION__ . ":: Redirect Token: {$token} to {$redirecturi}");
    header("Location: {$redirecturi}");
}
コード例 #6
0
function uncompress()
{
    $tpl = new templates();
    $t = time();
    $page = CurrentPageName();
    $fileName = $_GET["uncompress"];
    $sock = new wifidog_settings($_GET["ruleid"]);
    $sock->SET_INFO("BackgroundPicturePath", "/img/{$fileName}");
    $sock = new sockets();
    $sock->getFrameWork("hotspot.php?remove-cache=yes");
    echo "<div id='{$t}'></div>\n\t<script>\n\t\tRefreshTab('HOTSPOT_TAB');\n\t\tYahooWinBrowseHide();\n\t</script>\n\t\n\t";
}
コード例 #7
0
function tests_smtp()
{
    ini_set('display_errors', 1);
    ini_set('error_reporting', E_ALL);
    ini_set('error_prepend_string', null);
    ini_set('error_append_string', null);
    $tpl = new templates();
    $sock = new sockets();
    $sock = new wifidog_settings($_POST["ruleid"]);
    $mobile = $_POST["mobile"];
    $CODE_NUMBER = "1234";
    $wifidog_templates = new wifidog_templates($_POST["ruleid"]);
    $wifidog_templates->SMS_SMTP_SUBJECT = str_replace("%MOBILE%", $mobile, $wifidog_templates->SMS_SMTP_SUBJECT);
    $wifidog_templates->SMS_SMTP_SUBJECT = str_replace("%CODE%", $CODE_NUMBER, $wifidog_templates->SMS_SMTP_SUBJECT);
    $wifidog_templates->SMS_SMTP_SUBJECT = str_replace("%TIME%", time(), $wifidog_templates->SMS_SMTP_SUBJECT);
    $wifidog_templates->SMS_SMTP_BODY = str_replace("%MOBILE%", $mobile, $wifidog_templates->SMS_SMTP_BODY);
    $wifidog_templates->SMS_SMTP_BODY = str_replace("%CODE%", $CODE_NUMBER, $wifidog_templates->SMS_SMTP_BODY);
    $wifidog_templates->SMS_SMTP_BODY = str_replace("%TIME%", time(), $wifidog_templates->SMS_SMTP_BODY);
    $wifidog_templates->SMS_SMTP_BODY = str_replace("\n", "\r\n", $wifidog_templates->SMS_SMTP_BODY);
    echo "Rule: {$_POST["ruleid"]}\n";
    $smtp_sender = $sock->GET_INFO("sms_smtp_sender");
    $smtp_senderTR = explode("@", $smtp_sender);
    $instance = $smtp_senderTR[1];
    $sms_smtp_recipient = $sock->GET_INFO("sms_smtp_recipient");
    $random_hash = md5(date('r', time()));
    $boundary = "{$random_hash}/{$instance}";
    $body[] = "Return-Path: <{$smtp_sender}>";
    $body[] = "Date: " . date("D, d M Y H:i:s") . " +0100 (CET)";
    $body[] = "From: {$smtp_sender}";
    $body[] = "Subject: {$wifidog_templates->SMS_SMTP_SUBJECT}";
    $body[] = "To: {$sms_smtp_recipient}";
    $body[] = "Auto-Submitted: auto-replied";
    $body[] = "MIME-Version: 1.0";
    $body[] = "Content-Type: multipart/mixed;";
    $body[] = "\tboundary=\"{$boundary}\"";
    $body[] = "Content-Transfer-Encoding: 8bit";
    $body[] = "Message-Id: <{$random_hash}@{$instance}>";
    $body[] = "--{$boundary}";
    $body[] = "Content-Description: Notification";
    $body[] = "Content-Type: text/plain; charset=us-ascii";
    $body[] = "";
    $body[] = $wifidog_templates->SMS_SMTP_BODY;
    $body[] = "";
    $body[] = "";
    $body[] = "--{$boundary}";
    $finalbody = @implode("\r\n", $body);
    include_once dirname(__FILE__) . "/ressources/class.webauth-sms-msmtp.inc";
    $webauth_msmtp = new webauth_sms_msmtp($finalbody, $_POST["ruleid"]);
    if ($webauth_msmtp->Send()) {
        echo $tpl->javascript_parse_text("{$wifidog_templates->SMS_SMTP_SUBJECT}\nTo {$sms_smtp_recipient}: {success}", 1);
        return;
    }
    $smtp = new smtp();
    if ($sock->GET_INFO("sms_smtp_auth_user") != null) {
        $params["auth"] = true;
        $params["user"] = $sock->GET_INFO("sms_smtp_auth_user");
        $params["pass"] = $sock->GET_INFO("sms_smtp_auth_passwd");
    }
    $params["host"] = $sock->GET_INFO("sms_smtp_server_name");
    $params["port"] = $sock->GET_INFO("sms_smtp_server_port");
    if (!$smtp->connect($params)) {
        echo $tpl->javascript_parse_text("{error_while_sending_message} {error} {$smtp->error_number} {$smtp->error_text}", 1);
        return;
    }
    if (!$smtp->send(array("from" => $smtp_sender, "recipients" => $sms_smtp_recipient, "body" => $finalbody, "headers" => null))) {
        $smtp->quit();
        echo $tpl->javascript_parse_text("{error_while_sending_message} {error} {$smtp->error_number} {$smtp->error_text}", 1);
        return;
    }
    echo $tpl->javascript_parse_text("{$wifidog_templates->SMS_SMTP_SUBJECT}\nTo {$sms_smtp_recipient}: {success}", 1);
    $smtp->quit();
}
コード例 #8
0
ファイル: hotspot.php プロジェクト: BillTheBest/1.6.x
function wifidog_register_perform()
{
    session_start();
    $page = CurrentPageName();
    $tpl = new templates();
    $autocreate_confirmed = 0;
    if ($GLOBALS["HOTSPOT_DEBUG"]) {
        wifidog_logs("Starting wifidog_register_perform()");
    }
    $wifidog_build_uri = wifidog_build_uri();
    $uriext = $wifidog_build_uri[0];
    $HiddenFields = $wifidog_build_uri[1];
    $sock = new wifidog_settings($_SESSION["WIFIDOG_RULES"]);
    $ENABLED_SMTP = intval($sock->GET_INFO("ENABLED_SMTP"));
    $wifidog_templates = new wifidog_templates($_SESSION["WIFIDOG_RULES"]);
    $ENABLED_REDIRECT_LOGIN = intval($sock->GET_INFO("ENABLED_REDIRECT_LOGIN"));
    $email = trim(strtolower($_POST["email"]));
    $q = new mysql_squid_builder();
    $password2 = trim($_POST["password2"]);
    $password = trim($_POST["password"]);
    if ($password2 != $password) {
        return wifidog_register("{password_mismatch}");
    }
    if ($ENABLED_SMTP == 1) {
        if (!filter_var($email, FILTER_VALIDATE_EMAIL)) {
            return wifidog_register("{error_email_invalid}");
        }
        $tr = explode("@", $email);
        $domain = $tr[1];
        if (!checkdnsrr($domain, 'MX')) {
            return wifidog_register("&laquo;{$domain}&raquo;<br>{error_domain_email_invalid}");
        }
    }
    $ligne = mysql_fetch_array($q->QUERY_SQL("SELECT uid,autocreate FROM hotspot_members WHERE `uid`='{$email}'"));
    if ($ENABLED_REDIRECT_LOGIN == 1) {
        if (intval($ligne["autocreate"]) == 1) {
            if ($ligne["uid"] != null) {
                $q->QUERY_SQL("DELETE FROM hotspot_members WHERE `uid`='{$email}'");
                $ligne["uid"] = null;
            }
        }
    }
    if ($ligne["uid"] != null) {
        if ($ENABLED_SMTP == 1) {
            $link = "<br><strong><a href=\"{$page}?wifidog-recover=yes&{$uriext}\">{lost_password}</a></strong>";
        }
        return wifidog_register($tpl->_ENGINE_parse_body("{this_account_already_exists}<hr>{$link}"));
    }
    wifidog_logs("Ruleid: {$_SESSION["WIFIDOG_RULES"]}");
    $MAC = $_REQUEST["mac"];
    $REGISTER_MAX_TIME = intval($sock->GET_INFO("REGISTER_MAX_TIME"));
    $ArticaSplashHotSpotEndTime = intval($sock->GET_INFO("ArticaSplashHotSpotEndTime"));
    if ($REGISTER_MAX_TIME == 0) {
        $REGISTER_MAX_TIME = 5;
    }
    wifidog_logs("Ruleid: REGISTER_MAX_TIME:{$REGISTER_MAX_TIME}");
    wifidog_logs("Ruleid: ArticaSplashHotSpotEndTime:{$ArticaSplashHotSpotEndTime}");
    $password = md5($password);
    $creationtime = time();
    $autocreate_maxttl = $ArticaSplashHotSpotEndTime;
    $sessionkey = md5($password . $creationtime . $email);
    $gateway_addr = $_REQUEST["gw_address"];
    $gw_port = $_REQUEST["gw_port"];
    $gw_id = $_REQUEST["gw_id"];
    $ARP = $_REQUEST["mac"];
    $url = $_REQUEST["url"];
    $token = $_REQUEST["token"];
    if ($ENABLED_SMTP == 0) {
        $autocreate_confirmed = 1;
    }
    if ($GLOBALS["HOTSPOT_DEBUG"]) {
        wifidog_logs("Create new member {$email},{$password},TTL:{$ArticaSplashHotSpotEndTime} in line:" . __LINE__);
    }
    $sql = "INSERT IGNORE INTO hotspot_members \n\t(uid,username,token,ruleid,ttl,sessiontime,password,enabled,creationtime,autocreate,autocreate_confirmed,autocreate_maxttl,sessionkey,MAC) VALUES\n\t('{$email}','{$email}','{$token}','{$_SESSION["WIFIDOG_RULES"]}','{$ArticaSplashHotSpotEndTime}','','{$password}',1,'{$creationtime}',1,'{$autocreate_confirmed}',{$autocreate_maxttl},'{$sessionkey}','{$MAC}')";
    $q->QUERY_SQL($sql);
    wifidog_logs("{$email}: Create New member with a token {$token}");
    if (!$q->ok) {
        if (strpos(" {$q->mysql_error}", "Unknown column") > 0) {
            if ($GLOBALS["HOTSPOT_DEBUG"]) {
                wifidog_logs("check_hotspot_tables in line:" . __LINE__);
            }
            $q->check_hotspot_tables();
            if (!$q->ok) {
                if ($GLOBALS["HOTSPOT_DEBUG"]) {
                    wifidog_logs("{$q->mysql_error} in line:" . __LINE__);
                }
            }
            $q->QUERY_SQL($sql);
        }
    }
    if (!$q->ok) {
        wifidog_logs("{$q->mysql_error}");
        wifidog_logs("{$sql}");
        return wifidog_register($q->mysql_error);
    }
    if ($ENABLED_SMTP == 0) {
        $array["SERVER_NAME"] = $_SERVER["SERVER_NAME"];
        $array["redirecturi"] = $url;
        $array["LOGIN"] = $email;
        $array["redirecturi"] = $_REQUEST["url"];
        $array["REMOTE_ADDR"] = $_REQUEST["ip"];
        $array["token"] = $token;
        $array["HOST"] = $_REQUEST["ip"];
        $array["ruleid"] = $_SESSION["WIFIDOG_RULES"];
        UnLock($array);
        wifidog_logs("wifidog_auth/" . __FUNCTION__ . ":: SESSION(HOTSPOT_REDIRECT_URL) = {$url}");
        $_SESSION["HOTSPOT_AUTO_REGISTER"] = true;
        $_SESSION["HOTSPOT_REDIRECT_URL"] = $url;
        $redirecturi = "http://{$gateway_addr}:{$gw_port}/wifidog/auth?token={$token}";
        wifidog_logs("wifidog_auth/" . __FUNCTION__ . ":: Redirect Token: {$token} to {$redirecturi}");
        header("Location: {$redirecturi}");
        return;
    }
    $proto = "http";
    $myHostname = $_SERVER["HTTP_HOST"];
    $page = CurrentPageName();
    if (isset($_SERVER["HTTPS"])) {
        $proto = "https";
    }
    $URL_REDIRECT = "{$proto}://{$myHostname}/{$page}?wifidog-confirm={$sessionkey}";
    $smtp_sender = $sock->GET_INFO("smtp_sender");
    $smtp_senderTR = explode("@", $smtp_sender);
    $instance = $smtp_senderTR[1];
    $random_hash = md5(date('r', time()));
    $boundary = "{$random_hash}/{$instance}";
    $body[] = "Return-Path: <{$smtp_sender}>";
    $body[] = "Date: " . date("D, d M Y H:i:s") . " +0100 (CET)";
    $body[] = "From: {$smtp_sender}";
    $body[] = "Subject: {$wifidog_templates->REGISTER_SUBJECT}";
    $body[] = "To: {$email}";
    $body[] = "Auto-Submitted: auto-replied";
    $body[] = "MIME-Version: 1.0";
    $body[] = "Content-Type: multipart/mixed;";
    $body[] = "\tboundary=\"{$boundary}\"";
    $body[] = "Content-Transfer-Encoding: 8bit";
    $body[] = "Message-Id: <{$random_hash}@{$instance}>";
    $body[] = "--{$boundary}";
    $body[] = "Content-Description: Notification";
    $body[] = "Content-Type: text/plain; charset=us-ascii";
    $body[] = "";
    $body[] = $wifidog_templates->REGISTER_MESSAGE;
    $body[] = $URL_REDIRECT;
    $body[] = "";
    $body[] = "";
    $body[] = "--{$boundary}";
    $finalbody = @implode("\r\n", $body);
    $webauth_msmtp = new webauth_msmtp($smtp_sender, $finalbody, $email);
    if (!$webauth_msmtp->Send()) {
        $smtp = new smtp();
        if ($sock->GET_INFO("smtp_auth_user") != null) {
            $params["auth"] = true;
            $params["user"] = $sock->GET_INFO("smtp_auth_user");
            $params["pass"] = $sock->GET_INFO("smtp_auth_passwd");
        }
        $params["host"] = $sock->GET_INFO("smtp_server_name");
        $params["port"] = $sock->GET_INFO("smtp_server_port");
        if (!$smtp->connect($params)) {
            return wifidog_register("{error_while_sending_message} {error} {$smtp->error_number} {$smtp->error_text}");
        }
        if (!$smtp->send(array("from" => $smtp_sender, "recipients" => $email, "body" => $finalbody, "headers" => null))) {
            $smtp->quit();
            return wifidog_register("{error_while_sending_message} {error} {$smtp->error_number} {$smtp->error_text}");
        }
        if ($GLOBALS["HOTSPOT_DEBUG"]) {
            wifidog_logs("From: {$smtp_sender} to {$email} {$wifidog_templates->REGISTER_SUBJECT} success");
        }
        $smtp->quit();
    }
    if ($GLOBALS["HOTSPOT_DEBUG"]) {
        wifidog_logs("wifidog_auth/" . __FUNCTION__ . ":: Token: {$token} -> UnLock(..");
    }
    $array["LOGIN"] = $email;
    $array["ARP"] = $_REQUEST["mac"];
    $array["token"] = $token;
    $array["redirecturi"] = $_REQUEST["url"];
    $array["REMOTE_ADDR"] = $_REQUEST["ip"];
    $array["REGISTER"] = true;
    if (!UnLock($array)) {
        if ($GLOBALS["HOTSPOT_DEBUG"]) {
            wifidog_logs("wifidog_auth/" . __FUNCTION__ . "::failed_to_create_session");
        }
        return wifidog_register("{error} {failed_to_create_session}");
    }
    wifidog_logs("wifidog_auth/" . __FUNCTION__ . ":: SESSION(HOTSPOT_REDIRECT_URL) = {$url}");
    $_SESSION["HOTSPOT_AUTO_REGISTER"] = true;
    $_SESSION["HOTSPOT_REDIRECT_URL"] = $url;
    $redirecturi = "http://{$gateway_addr}:{$gw_port}/wifidog/auth?token={$token}";
    wifidog_logs("wifidog_auth/" . __FUNCTION__ . ":: Redirect Token: {$token} to {$redirecturi}");
    header("Location: {$redirecturi}");
}
コード例 #9
0
function tests_smtp()
{
    //ini_set('display_errors', 1);ini_set('error_reporting', E_ALL);ini_set('error_prepend_string',null);ini_set('error_append_string',null);
    include_once dirname(__FILE__) . "/ressources/externals/mime/mime.inc";
    header("content-type: application/x-javascript");
    $sock = new sockets();
    $sock = new wifidog_settings($_GET["ruleid"]);
    $wifidog_templates = new wifidog_templates($_GET["ruleid"]);
    $ArticaSplashHotSpotEndTime = $sock->GET_INFO("ArticaSplashHotSpotEndTime");
    $proto = "http";
    $myHostname = $_SERVER["HTTP_HOST"];
    $page = CurrentPageName();
    if (isset($_SERVER["HTTPS"])) {
        $proto = "https";
    }
    $URL_REDIRECT = "{$proto}://{$myHostname}/{$page}?wifidog-confirm=NONE";
    $tpl = new templates();
    $smtp_sender = $sock->GET_INFO("smtp_sender");
    if ($GLOBALS["VERBOSE"]) {
        echo "new Mail_mime....<br>\n";
    }
    include_once dirname(__FILE__) . "/ressources/externals/mime/mime.inc";
    $message = new Mail_mime("\r\n");
    $text = "<p style=font-size:18px>{$wifidog_templates->REGISTER_MESSAGE}</p><p>\n\t<hr><center><a href=\"{$URL_REDIRECT}\" style='font-size:22px;text-decoration:underline'>{$URL_REDIRECT}</a></center></p>";
    $message->setFrom($smtp_sender);
    $message->addTo($smtp_sender);
    $message->setSubject($wifidog_templates->REGISTER_SUBJECT);
    $message->setTXTBody(strip_tags($text));
    // for plain-text
    $message->setHTMLBody($text);
    $finalbody = $message->getMessage();
    if ($GLOBALS["VERBOSE"]) {
        echo $finalbody . "<hr>\n";
    }
    $webauth_msmtp = new webauth_msmtp($smtp_sender, $finalbody, $smtp_sender, $_GET["ruleid"]);
    if ($webauth_msmtp->Send()) {
        echo "alert('Rule: {$_GET["ruleid"]} {$smtp_sender} " . $tpl->javascript_parse_text("{$wifidog_templates->REGISTER_SUBJECT}\nTo {$smtp_sender}: {success}") . "');";
        return;
    } else {
        echo "alert('Rule: {$_GET["ruleid"]} {$smtp_sender} Method 1 " . $tpl->javascript_parse_text($webauth_msmtp->logs) . "');";
    }
    $smtp = new smtp();
    if ($sock->GET_INFO("smtp_auth_user") != null) {
        $params["auth"] = true;
        $params["user"] = $sock->GET_INFO("smtp_auth_user");
        $params["pass"] = $sock->GET_INFO("smtp_auth_passwd");
    }
    $params["host"] = $sock->GET_INFO("smtp_server_name");
    $params["port"] = $sock->GET_INFO("smtp_server_port");
    if (!$smtp->connect($params)) {
        echo "alert('" . $tpl->javascript_parse_text("{error_while_sending_message} {error} {$smtp->error_number} {$smtp->error_text}") . "');";
        return;
    }
    if (!$smtp->send(array("from" => $smtp_sender, "recipients" => $smtp_sender, "body" => $finalbody, "headers" => null))) {
        $smtp->quit();
        echo "alert('" . $tpl->javascript_parse_text("{error_while_sending_message} {error} {$smtp->error_number} {$smtp->error_text}") . "');";
        return;
    }
    echo "alert('" . $tpl->javascript_parse_text("{$wifidog_templates->REGISTER_SUBJECT}\nTo {$smtp_sender}: {success}") . "');";
    $smtp->quit();
}
コード例 #10
0
function sessions_items()
{
    $myPage = CurrentPageName();
    $tpl = new templates();
    $q = new mysql_squid_builder();
    $table = "hotspot_sessions";
    $uid = $_SESSION["uid"];
    $t = $_GET["t"];
    $tm = array();
    $search = '%';
    $page = 1;
    $FORCE_FILTER = "";
    if (strpos($table, ",") == 0) {
        if (!$q->TABLE_EXISTS($table)) {
            json_error_show("{$table}: No such table", 1, true);
        }
    }
    if (isset($_POST["sortname"])) {
        if ($_POST["sortname"] != null) {
            $ORDER = "ORDER BY {$_POST["sortname"]} {$_POST["sortorder"]}";
        }
    }
    if (isset($_POST['page'])) {
        $page = $_POST['page'];
    }
    $searchstring = string_to_flexquery();
    if ($searchstring != null) {
        $sql = "SELECT COUNT(*) as TCOUNT FROM {$table} WHERE 1 {$FORCE_FILTER} {$searchstring}";
        $ligne = mysql_fetch_array($q->QUERY_SQL($sql));
        if (!$q->ok) {
            json_error_show($q->mysql_error);
        }
        $total = $ligne["TCOUNT"];
    } else {
        $sql = "SELECT COUNT(*) as TCOUNT FROM {$table} WHERE 1 {$FORCE_FILTER}";
        $ligne = mysql_fetch_array($q->QUERY_SQL($sql));
        if (!$q->ok) {
            json_error_show($q->mysql_error);
        }
        $total = $ligne["TCOUNT"];
    }
    if (isset($_POST['rp'])) {
        $rp = $_POST['rp'];
    }
    $md5 = $ligne["md5"];
    $pageStart = ($page - 1) * $rp;
    $limitSql = "LIMIT {$pageStart}, {$rp}";
    $sql = "SELECT *  FROM {$table} WHERE 1 {$searchstring} {$FORCE_FILTER} {$ORDER} {$limitSql}";
    $results = $q->QUERY_SQL($sql);
    if (!$q->ok) {
        json_error_show($q->mysql_error);
    }
    $data = array();
    $data['page'] = $page;
    $data['total'] = $total;
    $data['rows'] = array();
    $minutes = $tpl->_ENGINE_parse_body("{minutes}");
    if (mysql_num_rows($results) == 0) {
        json_error_show("No session", 1);
    }
    while ($ligne = mysql_fetch_assoc($results)) {
        $color = "black";
        $finaltime = $ligne["finaltime"];
        $logintime = intval($ligne["logintime"]);
        $nextcheck = $ligne["nextcheck"];
        $ArticaSplashHotSpotEndTime_text = null;
        $ArticaSplashHotSpotRemoveAccount_text = null;
        $Start = $tpl->_ENGINE_parse_body(date("{l} d H:i", $logintime));
        $delete = imgsimple("delete-42.png", null, "Loadjs('{$myPage}?delete-session-js={$ligne["md5"]}&t={$t}')");
        $End = $tpl->_ENGINE_parse_body(date("Y {l} d H:i", $nextcheck));
        $incoming = FormatBytes($ligne["incoming"]);
        $outgoing = FormatBytes($ligne["outgoing"]);
        $ipaddr = $ligne["ipaddr"];
        if ($ligne["nextcheck"] < time()) {
            $color = "#CD0D0D";
        }
        $ruleid = $ligne["ruleid"];
        if ($ruleid > 0) {
            $sql = "SELECT rulename FROM webauth_rules WHERE ID='{$ruleid}'";
            $ligne2 = mysql_fetch_array($q->QUERY_SQL($sql));
            $rulename = $tpl->_ENGINE_parse_body("{rule}:{$ruleid} &laquo;" . utf8_encode($ligne2["rulename"]) . "&raquo;");
            $sock = new wifidog_settings($ruleid);
            $ArticaSplashHotSpotCacheAuth = intval($sock->GET_INFO("ArticaSplashHotSpotCacheAuth"));
            if ($ArticaSplashHotSpotCacheAuth == 0) {
                $color = "black";
            }
            if ($ArticaSplashHotSpotCacheAuth > 0) {
                $nextcheck = strtotime("+30 minutes", time());
                $End = $tpl->_ENGINE_parse_body(date("Y {l} d H:i", $nextcheck));
            }
            $ArticaSplashHotSpotEndTime = $sock->GET_INFO("ArticaSplashHotSpotEndTime");
            $ArticaSplashHotSpotRemoveAccount = intval($sock->GET_INFO("ArticaSplashHotSpotRemoveAccount"));
            if ($ArticaSplashHotSpotEndTime == 0) {
                $ArticaSplashHotSpotEndTime_text = $tpl->_ENGINE_parse_body("{never}");
            }
            if ($ArticaSplashHotSpotEndTime > 0) {
                $endlife = strtotime("+{$ArticaSplashHotSpotEndTime} minutes", time());
                $ArticaSplashHotSpotEndTime_text = $tpl->_ENGINE_parse_body(date("{l} d H:i", $endlife));
            }
            if ($ArticaSplashHotSpotRemoveAccount == 0) {
                $ArticaSplashHotSpotRemoveAccount_text = $tpl->_ENGINE_parse_body("{never}");
            }
            if ($ArticaSplashHotSpotRemoveAccount > 0) {
                $endlife = strtotime("+{$ArticaSplashHotSpotRemoveAccount} minutes", time());
                $ArticaSplashHotSpotRemoveAccount_text = $tpl->_ENGINE_parse_body(date("{l} d H:i", $endlife));
            }
        } else {
            $rulename = $tpl->_ENGINE_parse_body("{rule}: &laquo;{default}&raquo;");
        }
        if ($ArticaSplashHotSpotCacheAuth == 0) {
            $End = $tpl->_ENGINE_parse_body("{never}");
        }
        $hostname = $ligne["hostname"];
        $nextcheck = $ligne["nextcheck"];
        $nextcheckS = $nextcheck - time();
        $nextcheckM = $tpl->javascript_parse_text(distanceOfTimeInWords(time(), $nextcheck));
        //$subject=mime_decode($subject);
        $data['rows'][] = array('id' => $ligne["md5"], 'cell' => array("<span style='font-size:18px;color:{$color}'>{$ligne["uid"]}<br>{$rulename}<br><i style='font-size:16px'>" . $tpl->javascript_parse_text("{disable_account}") . ":{$ArticaSplashHotSpotEndTime_text}<br>" . $tpl->javascript_parse_text("{remove_account}") . ":{$ArticaSplashHotSpotRemoveAccount_text}</i><br><i style='font-size:16px'>" . $tpl->javascript_parse_text("{nextcheck}") . ": {$nextcheckS}s ({$nextcheckM})</i>" . "<i style='font-size:18px'>{$hostname}</i></a></span>", "<span style='font-size:18px;color:{$color}'>{$ligne["MAC"]}</a><br><i style='font-size:18px'>{$ipaddr}</i></span>", "<span style='font-size:18px;color:{$color}'>{$Start}</a></span>", "<span style='font-size:18px;color:{$color}'>{$End}</a></span>", "<span style='font-size:18px;color:{$color}'>{$incoming}</a></span>", "<span style='font-size:18px;color:{$color}'>{$outgoing}</a></span>", "<center style='font-size:18px;color:{$color}'>{$delete}</a></center>"));
    }
    echo json_encode($data);
}
コード例 #11
0
function Save()
{
    ini_set('display_errors', 1);
    ini_set('error_reporting', E_ALL);
    ini_set('error_prepend_string', null);
    ini_set('error_append_string', null);
    $sock = new wifidog_settings($_POST["ruleid"]);
    unset($_POST["ruleid"]);
    while (list($key, $value) = each($_POST)) {
        $sock->SET_INFO($key, $value);
    }
    $sock = new sockets();
    $sock->getFrameWork("hotspot.php?remove-cache=yes");
    $sock->getFrameWork("squid.php?reconfigure-squid=yes");
}
コード例 #12
0
ファイル: webauth.rules.php プロジェクト: articatech/artica
function HOTSPOT_EXPLAIN_RULE($ID)
{
    $q = new mysql_squid_builder();
    $sock = new sockets();
    $page = CurrentPageName();
    $WifidogClientTimeout = intval($sock->GET_INFO("WifidogClientTimeout"));
    if ($WifidogClientTimeout < 5) {
        $WifidogClientTimeout = 30;
    }
    $Timez[5] = "5 {minutes}";
    $Timez[15] = "15 {minutes}";
    $Timez[30] = "30 {minutes}";
    $Timez[60] = "1 {hour}";
    $Timez[120] = "2 {hours}";
    $Timez[180] = "3 {hours}";
    $Timez[360] = "6 {hours}";
    $Timez[720] = "12 {hours}";
    $Timez[1440] = "1 {day}";
    $Timez[2880] = "2 {days}";
    $Timez[10080] = "1 {week}";
    $Timez[20160] = "2 {weeks}";
    $Timez[43200] = "1 {month}";
    $Timez[129600] = "3 {months}";
    $Timez[259200] = "6 {months}";
    $Timez[388800] = "9 {months}";
    $Timez[518400] = "1 {year}";
    $NETS = array();
    $results = $q->QUERY_SQL("SELECT * FROM webauth_rules_nets WHERE ruleid={$ID}");
    while ($ligne = mysql_fetch_assoc($results)) {
        $NETS[] = $ligne["pattern"];
    }
    if (count($NETS) == 0) {
        $network = "{no_network_defined}";
    } else {
        $network = @implode(" {or} ", $NETS);
    }
    $f[] = "{when_a_guest_computer_is_a_part_of_nets}:{$network} {then}";
    $ayDscp = array(0 => '{default}', 8 => '0x20', 10 => '0x28', 12 => '0x30', 14 => '0x38', 16 => '0x40', 18 => '0x48', 20 => '0x50', 22 => '0x58', 24 => '0x60', 26 => '0x68', 28 => '0x70', 30 => '0x78', 32 => '0x80', 34 => '0x88', 36 => '0x90', 38 => '0x98', 40 => '0xA0', 46 => '0xB8', 48 => '0xC0', 56 => '0xE0');
    $sock = new wifidog_settings($ID);
    $ArticaHotSpotNowPassword = intval($sock->GET_INFO("ArticaHotSpotNowPassword"));
    $ENABLED_REDIRECT_LOGIN = intval($sock->GET_INFO("ENABLED_REDIRECT_LOGIN"));
    $ArticaSplashHotSpotEndTime = intval($sock->GET_INFO("ArticaSplashHotSpotEndTime"));
    $ENABLED_META_LOGIN = intval($sock->GET_INFO("ENABLED_META_LOGIN"));
    $USE_TERMS = intval($sock->GET_INFO("USE_TERMS"));
    $ArticaSplashHotSpotCacheAuth = intval($sock->GET_INFO("ArticaSplashHotSpotCacheAuth"));
    $USE_MYSQL = intval($sock->GET_INFO("USE_MYSQL"));
    $USE_ACTIVEDIRECTORY = intval($sock->GET_INFO("USE_ACTIVEDIRECTORY"));
    $ENABLED_AUTO_LOGIN = intval($sock->GET_INFO("ENABLED_AUTO_LOGIN"));
    $DO_NOT_AUTENTICATE = intval($sock->GET_INFO("DO_NOT_AUTENTICATE"));
    $LIMIT_BY_SIZE = intval($sock->GET_INFO("LIMIT_BY_SIZE"));
    $LANDING_PAGE = trim($sock->GET_INFO("LANDING_PAGE"));
    $SMS_REGISTER = intval($sock->GET_INFO("SMS_REGISTER"));
    $MACWHITE = intval($sock->GET_INFO("MACWHITE"));
    $BOUNCE_AUTH = intval($sock->GET_INFO("BOUNCE_AUTH"));
    $TOS_VALUE = intval($sock->GET_INFO("TOS_VALUE"));
    $andadd_text = null;
    if ($USE_TERMS == 1) {
        $andadd_text = "{and} ";
        $f[] = "{send_first_the_itcharter}";
    }
    if ($SMS_REGISTER == 0) {
        if ($DO_NOT_AUTENTICATE == 0) {
            if ($ENABLED_AUTO_LOGIN == 1) {
                $f[] = "{$andadd_text}{allow_user_to_be_selfregistred}";
                if ($ArticaHotSpotNowPassword == 1) {
                    $f[] = "{without_need_to_set_password}";
                }
                if ($ENABLED_REDIRECT_LOGIN == 1) {
                    if ($MACWHITE == 0) {
                        $f[] = "{and} {force_user_to_register_again_after_expired_session}";
                    }
                }
            }
            if ($ENABLED_REDIRECT_LOGIN == 0) {
                if ($USE_ACTIVEDIRECTORY == 1) {
                    $f[] = "{$andadd_text}{authenticate_trough_activedirectory}";
                }
                $f[] = "{andor} {authenticate_trough_local_database}";
            }
        } else {
            $f[] = "{just_ask_an_username_hotspot}";
        }
    } else {
        $f[] = "{$andadd_text}{authenticate_users_with_sms}";
    }
    $CLOSE = false;
    if ($ArticaSplashHotSpotCacheAuth > 0) {
        if ($MACWHITE == 0) {
            $T[] = "{close_session_each}: {$ArticaSplashHotSpotCacheAuth} {minutes}";
        }
        $CLOSE = true;
    }
    if ($LIMIT_BY_SIZE > 0) {
        $or = null;
        if ($MACWHITE == 0) {
            if ($CLOSE) {
                $or = "{or} ";
            }
            $T[] = "{$or}{close_session_each} {downloaded} {$LIMIT_BY_SIZE} MB";
            $CLOSE = true;
        }
    }
    if (!$CLOSE) {
        if ($MACWHITE == 1) {
            $T[] = "{save_computer_in_whitelist} {and} ";
            $ArticaSplashHotSpotEndTime = 0;
        }
        $T[] = "{never_close_session}";
    }
    if ($ArticaSplashHotSpotEndTime > 0) {
        $T[] = "{and} {delete_the_account_after}: {$ArticaSplashHotSpotEndTime} {minutes}";
    } else {
        $T[] = "{and} {never_delete_the_account}";
    }
    if ($BOUNCE_AUTH == 1) {
        $T[] = "{and} <strong>{bounce_if_already_authenticated}</strong>";
    }
    if ($TOS_VALUE > 0) {
        $T[] = "{and} <strong>{tcp_outgoing_tos} {$ayDscp[$TOS_VALUE]}</strong>";
    }
    $f[] = @implode(" ", $T);
    if ($LANDING_PAGE != null) {
        $f[] = "{after_login_redirect_user_to}: {$LANDING_PAGE}";
    }
    $WifidogClientTimeout_text = $Timez[$WifidogClientTimeout];
    if ($MACWHITE == 1) {
        $WifidogClientTimeout_text = null;
    }
    $f[] = "<strong>{service_will_globally_force_users_to_reauth_each} <a href=\"javascript:blur();\"\n\tOnClick=\"javascript:Loadjs('{$page}?WifidogClientTimeout-js=yes');\"\n\tstyle='text-decoration:underline;font-weight:bold'>{$WifidogClientTimeout_text}</a></strong>";
    $tpl = new templates();
    return $tpl->_ENGINE_parse_body(@implode("<br>", $f));
}