</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"); portal_allow($clientip, $clientmac, "unauthenticated"); } else { if (isset($config['voucher'][$cpzone]['enable']) && $_POST['accept'] && $_POST['auth_voucher']) { $voucher = trim($_POST['auth_voucher']); $timecredit = voucher_auth($voucher); // $timecredit contains either a credit in minutes or an error message if ($timecredit > 0) { // voucher is valid. Remaining minutes returned // if multiple vouchers given, use the first as username $a_vouchers = preg_split("/[\t\n\r ]+/s", $voucher);
} if ($connection) { $checkBlocked = $pdo->prepare("\n\t\tSELECT mac_addr FROM blocklist\n\t\tWHERE mac_addr = :mac\n\t"); $checkBlocked->bindParam(':mac', $mac_addr); $checkBlocked->execute(); $blocked = $checkBlocked->fetch(PDO::FETCH_ASSOC); if ($blocked) { portal_reply_page($redirurl, 'error', $hotspot_errors['block'][$lang]); captiveportal_logportalauth('', $clientmac, $clientip, 'ENGELLENMIS MAC ADRESI'); exit; } } else { log_error('HOTSPOT servisi duzgun calismiyor. Harici veri kaynaklarını kontrol edin.'); exit; } if ($clientmac && portal_mac_radius($clientmac, $clientip)) { exit; } else { if ($_POST['accept']) { if ($_POST['auth_user'] && $_POST['auth_pass']) { if ($external != 'none' && $external_connection) { $found = checkUser($external_connection, $settings['table_name'], $settings['username_field'], $settings['password_field'], $_POST['auth_user'], $_POST['auth_pass']); if ($found) { captiveportal_logportalauth($_POST['auth_user'], $clientmac, $clientip, 'YENI OTURUM'); portal_allow($clientip, $clientmac, $_POST['auth_user'], $_POST['auth_pass'], array('url_redirection' => $redirurl), null, 'external'); $external = true; } } if (!$external) { $auth_list = radius($_POST['auth_user'], $_POST['auth_pass'], $clientip, $clientmac, 'YENI OTURUM'); $type = 'error';