} $usr = new ExtUsr(); $usr->load($g_ext_usr); if (isset($old_user)) { $usr->delete($old_user); } $prefix = array(); foreach ($model["gateway"] as $i => $gateway) { if (in_array($gateway["prefix"], $prefix)) { __invalid_entry($model, "gateway[{$i}][prefix]", "Duplicate Gateway Prefix"); } else { $prefix[] = $gateway["prefix"]; } $usr->add($model["username"], $gateway); } $ael = new ExtAel(); $ael->load($g_ext_ael); if (isset($old_user)) { $ael->delete($old_user); } $ael->add($model["username"]); $chan->dump($g_chan_sync); $sip->dump($g_sip); $usr->dump($g_ext_usr); $ael->dump($g_ext_ael); reload_all($g_vpn); header("Location: " . dirname($_SERVER["PHP_SELF"]) . "/list.php"); exit; } // load generic info by mac $ini = new Ini();
$ini->load($g_sip); foreach ($ini->sections() as $host) { if ($ini->get($host, "context") == $target_user) { $ini->deleteSection($host); } } $ini->dump($g_sip); } if (isset($target_user)) { $ext = new ExtUsr(); $ext->load($g_ext_usr); $ext->delete($target_user); $ext->dump($g_ext_usr); } if (isset($target_user)) { $ext = new ExtAel(); $ext->load($g_ext_ael); $ext->delete($target_user); $ext->dump($g_ext_ael); } reload_all($g_vpn); } } } $ini = new Ini(); $ini->load($g_chan_sync); $model = array(); foreach ($ini->sections() as $user) { if ($user == "general") { continue; }