fix CP login

This commit is contained in:
Ad Schellevis 2014-12-14 20:13:27 +01:00
parent b62380eaa4
commit dd353569a4
2 changed files with 3 additions and 1 deletions

View File

@ -223,6 +223,7 @@ EOD;
if ($loginok){
captiveportal_logportalauth($_POST['auth_user'],$clientmac,$clientip,"LOGIN");
portal_allow($clientip, $clientmac,$_POST['auth_user']);
portal_reply_page($redirurl, "redir", "Just redirect the user.");
} else {
captiveportal_logportalauth($_POST['auth_user'],$clientmac,$clientip,"FAILURE");
portal_reply_page($redirurl, "error", $errormsg);

View File

@ -154,7 +154,7 @@ function portal_allow($clientip,$clientmac,$username,$password = null, $attribut
else if (!empty($config['captiveportal'][$cpzone]['redirurl']))
$my_redirurl = $config['captiveportal'][$cpzone]['redirurl'];
if(isset($config['captiveportal'][$cpzone]['logoutwin_enable']) && !$passthrumac) {
if(isset($config['captiveportal'][$cpzone]['logoutwin_enable']) ) {
$ourhostname = portal_hostname_from_client_ip($clientip);
$protocol = (isset($config['captiveportal'][$cpzone]['httpslogin'])) ? 'https://' : 'http://';
$logouturl = "{$protocol}{$ourhostname}/";
@ -167,6 +167,7 @@ function portal_allow($clientip,$clientmac,$username,$password = null, $attribut
include("{$g['varetc_path']}/captiveportal-{$cpzone}-logout.html");
} else {
// TODO: remove? should be handled by login page
portal_reply_page($my_redirurl, "redir", "Just redirect the user.");
}