if(!sharepath_exist) var sharepath_delete_msg = "<?php 
echo I18N("j", "The share path for DLNA server is eliminated.");
?>
";
		}
		else if(service=="itunes")
		{
			var sharepath = XG(this.itunes+"/itunes/server/sharepath");
			var obj_root		= "itunes_root";
			var obj_sharepath	= "itunes_sharepath";
			var obj_chamber		= "itunes_chamber";			
			<?php 
$sharepath = "/var/tmp/storage/" . get("", "/itunes/server/sharepath");
?>
			var sharepath_exist = COMM_ToBOOL(<?php 
echo isdir($sharepath);
?>
);
			if(!sharepath_exist) var sharepath_delete_msg = "<?php 
echo I18N("j", "The share path for iTunes server is eliminated.");
?>
";
		}
		
		if(sharepath == "")
		{
			OBJ(obj_root).checked = false;	
			OBJ(obj_sharepath).value ="/";
			OBJ(obj_chamber).style.display ="";
		}	
		else if(sharepath == "/")
        $db_path = $mnt_root . "/" . $diskname . "/";
    }
    $sharepath = $mnt_root . "/" . $sharepath;
}
if ($partition_count != "" && $partition_count != "0") {
    $sd_status = "active";
} else {
    $sd_status = "inactive";
}
$MINIDLNA_CONF = "/var/etc/minidlna.conf";
//$PRESCAN     = "/var/run/prescan_start.sh";
/*---------------------------------------------------------------------*/
fwrite("w", $START, "#!/bin/sh\n");
fwrite("w", $STOP, "#!/bin/sh\n");
/* if path not exist, use root path */
if (isdir($sharepath) == 0) {
    $sharepath = $mnt_root . "/";
    $mntpath = $mnt_root . "/";
    fwrite("a", $START, "xmldbc -s /upnpav/dms/sharepath \"/\"\n");
}
if ($sd_status == "inactive") {
    fwrite("a", $START, "echo \"No HD found\"  > /dev/console\n");
} else {
    if ($active != "1") {
        fwrite("a", $START, "echo \"DLNA is disabled !\" > /dev/console\n");
    } else {
        fwrite("a", $START, "echo \"Start minidlna ...\" > /dev/console\n");
        //		fwrite("a", $START, "mkdir -p ".$mntpath.".systemfile/.upnpav-db/\n");
        //		fwrite("a", $START, "ScanMedia &\n");
        //+++ siyou, modelNumber must be number only, otherwise the xbox360 won't list our DMS.
        //		fwrite("a", $START, "upnp 0 \"".$vendor." Corporation\" \"".$product_url."\" \"Network File Server with USB2.0 and wifi interface\" ". "\"".$Genericname."\" \"".$product_url."\" ".$model_number." ".$mac_addr." ".$dms_name." &\n");
Exemple #3
0
include "/htdocs/phplib/trace.php";
/*
This file is called by ajax request. 
This file is created for checking if directory/file exist or not. 
Current is used by adv_itunes.php. 
*/
//$_POST["act"] 		= "checkfile";
//$_POST["dirname"] 	= "/var/run/aaaa";
//$_POST["filename"] 	= "/var/run/aaaa";
if ($AUTHORIZED_GROUP < 0) {
    $result = "Authenication fail";
} else {
    /* where our hd/usb will be mounted to ? */
    $mount_path = "/tmp/storage/";
    if ($_POST["act"] == "checkdir") {
        if (isdir($mount_path . $_POST["dirname"]) == 0) {
            $result = "NOTEXIST";
        } else {
            $result = "EXIST";
        }
    } else {
        if ($mount_path . $_POST["act"] == "checkfile") {
            if (isfile($_POST["filename"]) == 0) {
                $result = "NOTEXIST";
            } else {
                $result = "EXIST";
            }
        }
    }
}
echo "<checkreport>\n";