Exemplo n.º 1
0
                                //check against local user manager
                                $loginok = local_backed($_POST['auth_user'], $_POST['auth_pass']);
                                if ($loginok && isset($cpcfg['localauth_priv'])) {
                                    $loginok = userHasPrivilege(getUserEntry($_POST['auth_user']), "user-services-captiveportal-login");
                                }
                                if ($loginok) {
                                    captiveportal_logportalauth($_POST['auth_user'], $clientmac, $clientip, "LOGIN");
                                    portal_allow($clientip, $clientmac, $_POST['auth_user']);
                                } else {
                                    captiveportal_logportalauth($_POST['auth_user'], $clientmac, $clientip, "FAILURE");
                                    portal_reply_page($redirurl, "error", $errormsg);
                                }
                            } else {
                                portal_reply_page($redirurl, "error", $errormsg);
                            }
                        } else {
                            if ($_POST['accept'] && $clientip && $cpcfg['auth_method'] == "none") {
                                captiveportal_logportalauth("unauthenticated", $clientmac, $clientip, "ACCEPT");
                                portal_allow($clientip, $clientmac, "unauthenticated");
                            } else {
                                /* display captive portal page */
                                portal_reply_page($redirurl, "login", null, $clientmac, $clientip);
                            }
                        }
                    }
                }
            }
        }
    }
}
ob_flush();
Exemplo n.º 2
0
        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';
                if (!empty($auth_list['url_redirection'])) {
                    $redirurl = $auth_list['url_redirection'];
                    $type = 'redir';
                }
                if ($auth_list['auth_val'] == 1) {
                    captiveportal_logportalauth($_POST['auth_user'], $clientmac, $clientip, 'HATA', $auth_list['error']);
                    log_error('HOTSPOT servisi duzgun calismiyor. FreeRADIUS sunucusunu kontrol edin.');
                    exit;
                } else {