Beispiel #1
0
    exit;
}
if (isset($_GET["net-id"])) {
    net_id();
    exit;
}
if (isset($_POST["net-id"])) {
    net_id_save();
    exit;
}
if (isset($_POST["delete-id"])) {
    net_id_delete();
    exit;
}
if (isset($_POST["EnableRemoteAnnounce"])) {
    EnableRemoteAnnounceSave();
    exit;
}
popup();
function EnableRemoteAnnounceSave()
{
    $sock = new sockets();
    $sock->SET_INFO("SambaEnableRemoteAnnounce", $_POST["EnableRemoteAnnounce"]);
    $sock->getFrameWork('cmd.php?samba-save-config=yes');
}
function net_id_save()
{
    $sql = "INSERT INTO samba_remote_announce (hostname,ipaddr,domain) VALUES('{$_POST["hostname"]}','{$_POST["ipaddr"]}','{$_POST["domain"]}')";
    if ($_POST["net-id"] > 0) {
        $sql = "UPDATE samba_remote_announce SET ipaddr='{$_POST["ipaddr"]}',domain='{$_POST["domain"]}' WHERE ID='{$_POST["net-id"]}'";
    }
	include_once('ressources/class.samba.inc');
	include_once('ressources/class.user.inc');
	
	
	if(isset($_GET["debug-page"])){ini_set('display_errors', 1);ini_set('error_reporting', E_ALL);$GLOBALS["VERBOSE"]=true;}

	$tpl=new templates();
	$ERROR_NO_PRIVS=$tpl->_ENGINE_parse_body("{ERROR_NO_PRIVS}");
	if(!CheckSambaRights()){echo "<H1>$ERROR_NO_PRIVS</H1>";die();}
	
	if(isset($_GET["browse-net-list"])){net_list();exit;}
	if(isset($_GET["net-id-js"])){net_id_js();exit;}
	if(isset($_GET["net-id"])){net_id();exit;}
	if(isset($_POST["net-id"])){net_id_save();exit;}
	if(isset($_POST["delete-id"])){net_id_delete();exit;}
	if(isset($_POST["EnableRemoteAnnounce"])){EnableRemoteAnnounceSave();exit;}
popup();

function EnableRemoteAnnounceSave(){
	$sock=new sockets();
	$sock->SET_INFO("SambaEnableRemoteAnnounce", $_POST["EnableRemoteAnnounce"]);
	$sock->getFrameWork('cmd.php?samba-save-config=yes');
	
	
}

function net_id_save(){
	
	$sql="INSERT INTO samba_remote_announce (hostname,ipaddr,domain) VALUES('{$_POST["hostname"]}','{$_POST["ipaddr"]}','{$_POST["domain"]}')";
	if($_POST["net-id"]>0){
		$sql="UPDATE samba_remote_announce SET ipaddr='{$_POST["ipaddr"]}',domain='{$_POST["domain"]}' WHERE ID='{$_POST["net-id"]}'";