示例#1
0
<head><title>Disconnecting...</title></head>
<body bgcolor="#435370">
<span style="color: #ffffff; font-family: Tahoma, Verdana, Arial, Helvetica, sans-serif; font-size: 11px;">
<b>You have been disconnected.</b>
</span>
<script type="text/javascript">
<!--
setTimeout('window.close();',5000) ;
-->
</script>
</body>
</html>

EOD;
    $safe_logout_id = SQLite3::escapeString($_POST['logout_id']);
    captiveportal_disconnect_client($safe_logout_id);
} else {
    if ($macfilter && $clientmac && captiveportal_blocked_mac($clientmac)) {
        captiveportal_logportalauth($clientmac, $clientmac, $clientip, "Blocked MAC address");
        if (!empty($cpcfg['blockedmacsurl'])) {
            portal_reply_page($cpcfg['blockedmacsurl'], "redir");
        } else {
            portal_reply_page($redirurl, "error", "This MAC address has been blocked");
        }
    } else {
        if ($clientmac && $radmac_enable && portal_mac_radius($clientmac, $clientip, $radiusctx)) {
            /* radius functions handle everything so we exit here since we're done */
        } else {
            if (portal_consume_passthrough_credit($clientmac)) {
                /* allow the client through if it had a pass-through credit for its MAC */
                captiveportal_logportalauth("unauthenticated", $clientmac, $clientip, "ACCEPT");
示例#2
0
	SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
	INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
	CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
	ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
	POSSIBILITY OF SUCH DAMAGE.
*/
require_once "guiconfig.inc";
require_once "functions.inc";
require_once "filter.inc";
require_once "captiveportal.inc";
$cpzone = $_GET['zone'];
if (isset($_POST['zone'])) {
    $cpzone = $_POST['zone'];
}
if ($_GET['act'] == "del" && !empty($cpzone)) {
    captiveportal_disconnect_client($_GET['id']);
    header("Location: status_captiveportal.php?zone={$cpzone}");
    exit;
}
$pgtitle = array(gettext("Status: Captive portal"));
$shortcut_section = "captiveportal";
if (!is_array($config['captiveportal'])) {
    $config['captiveportal'] = array();
}
$a_cp =& $config['captiveportal'];
if (count($a_cp) == 1) {
    $cpzone = current(array_keys($a_cp));
}
include "head.inc";
?>
示例#3
0
<html>
<head><title>Disconnecting...</title></head>
<body bgcolor="#435370">
<span style="color: #ffffff; font-family: Tahoma, Verdana, Arial, Helvetica, sans-serif; font-size: 11px;">
<b>You have been disconnected.</b>
</span>
<script type="text/javascript">
<!--
setTimeout('window.close();',5000) ;
-->
</script>
</body>
</html>

EOD;
    captiveportal_disconnect_client($_POST['logout_id']);
} else {
    if ($macfilter && $clientmac && captiveportal_blocked_mac($clientmac)) {
        captiveportal_logportalauth($clientmac, $clientmac, $clientip, "Blocked MAC address");
        if (!empty($cpcfg['blockedmacsurl'])) {
            portal_reply_page($cpcfg['blockedmacsurl'], "redir");
        } else {
            portal_reply_page($redirurl, "error", "This MAC address has been blocked");
        }
    } else {
        if ($clientmac && $radmac_enable && portal_mac_radius($clientmac, $clientip, $radiusctx)) {
            /* radius functions handle everything so we exit here since we're done */
        } else {
            if (portal_consume_passthrough_credit($clientmac)) {
                /* allow the client through if it had a pass-through credit for its MAC */
                captiveportal_logportalauth("unauthenticated", $clientmac, $clientip, "ACCEPT");
 $mac_addr = $_POST['mac_addr'];
 $description = htmlspecialchars($_POST['description'], ENT_QUOTES, 'UTF-8');
 /* Check user whether if logged in captiveportal */
 if ($cpcontents) {
     foreach ($cpcontents as $cpcontent) {
         $cpent = explode(",", $cpcontent);
         $mac_dash = str_replace(':', '-', $cpent[3]);
         if ($mac_dash == $mac_addr) {
             $usession = $cpent[5];
             $ufound = true;
             break;
         }
     }
     /* Logout the user from captiveportal */
     if ($ufound) {
         captiveportal_disconnect_client($usession);
     }
 }
 if (!is_mac($mac_addr)) {
     $input_errors[] = "'{$mac_addr}' geçerli bir MAC adresi değil.";
     $macError = true;
 }
 if (strlen($description) > 60) {
     $input_errors[] = 'Açıklama uzunluğu 60 karakteri geçmemelidir.';
 }
 if (!$macError) {
     /* Check if MAC exists */
     $checkMac = $pdo->prepare("\n\t\t\t\tSELECT mac_addr\n\t\t\t\tFROM blocklist\n\t\t\t\tWHERE mac_addr = :mac\n\t\t\t");
     $checkMac->bindParam(':mac', $mac_addr);
     $checkMac->execute();
     $macFound = $checkMac->fetch(PDO::FETCH_ASSOC);