$db->upsertPassthruMAC($tagcontent->mac,$arp_maclist[$mac]['ip'],$db_maclist[$mac]->pipeno_in,$db_maclist[$mac]->pipeno_out);// new ip according to arp table
$this->handle->execute("insert or ignore into captiveportal_ip(ip) values (:ip)",array("ip"=>$ip),$this->captiveportal_ip_types);
$this->handle->execute(
$this->handle->execute("update captiveportal_ip set ip=:ip, last_checked=:last_checked, pipeno_in = :pipeno_in, pipeno_out = :pipeno_out where ip =:ip ",$params,$this->captiveportal_ip_types);
"insert or ignore into captiveportal_ip(ip) values (:ip)",
array("ip"=>$ip),
$this->captiveportal_ip_types
);
$sql="update captiveportal_ip set ip=:ip, last_checked=:last_checked, ".
"pipeno_in = :pipeno_in, pipeno_out = :pipeno_out where ip =:ip ";
$this->handle->execute("insert or ignore into captiveportal_mac(mac) values (:mac)",array("mac"=>$mac),$this->captiveportal_mac_types);
"mac"=>$mac,
$this->handle->execute("update captiveportal_mac set ip=:ip, last_checked=:last_checked, pipeno_in = :pipeno_in, pipeno_out = :pipeno_out where mac =:mac ",$params,$this->captiveportal_mac_types);
"ip"=>$ip,
"pipeno_in"=>$pipeno_in,
"pipeno_out"=>$pipeno_out,
"last_checked"=>time()
);
$this->handle->execute(
"insert or ignore into captiveportal_mac(mac) values (:mac)",
array("mac"=>$mac),
$this->captiveportal_mac_types
);
$sql="update captiveportal_mac set ip=:ip, last_checked=:last_checked, ".
"pipeno_in = :pipeno_in, pipeno_out = :pipeno_out where mac =:mac ";
$this->rules[]="add ".(3000+($zone->zoneid*10)+1)." skipto ".((($zone->zoneid*1000)+10000)+1)." ip from table(".$this->getAuthUsersTables($zone->zoneid)["in"].") to any via ".$interface->if;
$this->rules[]="add ".(3000+($zone->zoneid*10)+2)." skipto ".((($zone->zoneid*1000)+10000)+1)." ip from any to table(".$this->getAuthUsersTables($zone->zoneid)["in"].") via ".$interface->if;
((($zone->zoneid*1000)+10000)+1)." ip from table(".
$this->getAuthUsersTables($zone->zoneid)["in"].") to any via ".$interface->if;
((($zone->zoneid*1000)+10000)+1)." ip from any to table(".
$this->getAuthUsersTables($zone->zoneid)["in"].") via ".$interface->if;
// authenticated hosts ( table 3 + 4 )
// authenticated hosts ( table 3 + 4 )
$this->rules[]="add ".(3000+($zone->zoneid*10)+3)." skipto ".((($zone->zoneid*1000)+10000)+1)." ip from table(".$this->getAuthIPTables($zone->zoneid)["in"].") to any via ".$interface->if;
$this->rules[]="add ".(3000+($zone->zoneid*10)+4)." skipto ".((($zone->zoneid*1000)+10000)+1)." ip from any to table(".$this->getAuthIPTables($zone->zoneid)["in"].") via ".$interface->if;
((($zone->zoneid*1000)+10000)+1)." ip from table(".
$this->getAuthIPTables($zone->zoneid)["in"].") to any via ".$interface->if;
((($zone->zoneid*1000)+10000)+1)." ip from any to table(".
$this->getAuthIPTables($zone->zoneid)["in"].") via ".$interface->if;
// authenticated mac addresses ( table 5 + 6 )
// authenticated mac addresses ( table 5 + 6 )
$this->rules[]="add ".(3000+($zone->zoneid*10)+5)." skipto ".((($zone->zoneid*1000)+10000)+1)." ip from table(".$this->getAuthMACTables($zone->zoneid)["in"].") to any via ".$interface->if;
$this->rules[]="add ".(3000+($zone->zoneid*10)+6)." skipto ".((($zone->zoneid*1000)+10000)+1)." ip from any to table(".$this->getAuthMACTables($zone->zoneid)["in"].") via ".$interface->if;
((($zone->zoneid*1000)+10000)+1)." ip from table(".
$this->getAuthMACTables($zone->zoneid)["in"].") to any via ".$interface->if;