Project

General

Profile

« Previous | Next » 

Revision 90477318

Added by Ermal LUÇI almost 14 years ago

Fixes #1874. Correctly error out when the user or the pass is not posted during login of CP.

View differences:

usr/local/captiveportal/index.php
205 205

  
206 206
} else if ($_POST['accept'] && $config['captiveportal'][$cpzone]['auth_method'] == "local") {
207 207

  
208
    if ($_POST['auth_user'] && $_POST['auth_pass']) {
208 209
	//check against local user manager
209 210
	$loginok = local_backed($_POST['auth_user'], $_POST['auth_pass']);
210
    if ($loginok){
211
        captiveportal_logportalauth($_POST['auth_user'],$clientmac,$clientip,"LOGIN");
212
        portal_allow($clientip, $clientmac,$_POST['auth_user']);
213
    } else {
214
        captiveportal_logportalauth($_POST['auth_user'],$clientmac,$clientip,"FAILURE");
211
	if ($loginok){
212
		captiveportal_logportalauth($_POST['auth_user'],$clientmac,$clientip,"LOGIN");
213
		portal_allow($clientip, $clientmac,$_POST['auth_user']);
214
	} else {
215
		captiveportal_logportalauth($_POST['auth_user'],$clientmac,$clientip,"FAILURE");
216
		portal_reply_page($redirurl, "error", $errormsg);
217
	}
218
    } else
215 219
        portal_reply_page($redirurl, "error", $errormsg);
216
    }
217 220
} else if ($_POST['accept'] && $clientip && $config['captiveportal'][$cpzone]['auth_method'] == "none") {
218 221
    captiveportal_logportalauth("unauthenticated",$clientmac,$clientip,"ACCEPT");
219 222
    portal_allow($clientip, $clientmac, "unauthenticated");

Also available in: Unified diff