Project

General

Profile

« Previous | Next » 

Revision 3e49e032

Added by Viktor Gurov about 3 years ago

Captive Portal host remove fix. Issue #13146

View differences:

src/etc/inc/captiveportal.inc
541 541
	$connected_users = captiveportal_read_db();
542 542
	if (!empty($connected_users) && $clear_auth_rules) {
543 543
		foreach ($connected_users as $user) {
544
			captiveportal_ether_delete_entry($ipent, 'auth');
544
			captiveportal_ether_delete_entry($user, 'auth');
545 545
		}
546 546
	}
547 547

  
......
874 874

  
875 875
	if (is_ipaddrv4($dbent[2])) {
876 876
		/*
877
		 * Delete client's anchor entry from tables auth_up and auth_down.
877
		 * Delete client's anchor entry from auth and authmac anchors
878 878
		 */
879 879
		$cpsession = captiveportal_isip_logged($dbent[2]);
880 880
		if (!empty($cpsession)) {
......
987 987

  
988 988
	captiveportal_radius_stop_all($term_cause, $logoutReason);
989 989

  
990
	/* reinit captiveportal pipes and anchors */
991
	captiveportal_init_rules(true);
992

  
990 993
	/* remove users from the database */
991 994
	$cpdb = captiveportal_read_db();
992 995
	$unsetindexes = array_column($cpdb,5);
......
995 998
		captiveportal_remove_entries($unsetindexes, true);
996 999
	}
997 1000

  
998
	/* reinit captiveportal pipes and anchors */
999
	captiveportal_init_rules(true);
1000

  
1001 1001
	unlock($cpdblck);
1002 1002
	unlock($rcprunelock);
1003 1003
	return true;
......
1106 1106
		$host = $hostent['ip'] . '_32';
1107 1107
	}
1108 1108

  
1109
	$result = pfSense_pf_cp_get_eth_pipes($anchor);
1109
	$result = pfSense_pf_cp_get_eth_pipes("{$cpzoneprefix}_{$anchor}/$host");
1110 1110
	if (!empty($result)) {
1111 1111
		list($pipeup, $pipedown) = $result;
1112

  
1113
		/* flush anchor rules */
1114
		pfSense_pf_cp_flush("{$cpzoneprefix}_{$anchor}/{$host}", "ether");
1115

  
1116 1112
		captiveportal_free_dn_ruleno($pipeup);
1117 1113
	}
1114
	/* flush anchor rules */
1115
	pfSense_pf_cp_flush("{$cpzoneprefix}_{$anchor}/{$host}", "ether");
1118 1116
}
1119 1117

  
1120 1118
function captiveportal_allowedhostname_configure() {

Also available in: Unified diff