Exemplo n.º 1
0
         exec("tar -xvf " . PHONE_MODULES_PATH . 'temp/' . $_REQUEST['package'] . " -C " . PHONE_MODULES_PATH . "temp/");
         if (!file_exists(PHONE_MODULES_PATH . "endpoint")) {
             echo "Creating Provisioner Directory <br />";
             mkdir(PHONE_MODULES_PATH . "endpoint");
         }
         $endpoint_last_mod = filemtime(PHONE_MODULES_PATH . "temp/endpoint/base.php");
         //rename(PHONE_MODULES_PATH."temp/setup.php", PHONE_MODULES_PATH."setup.php");
         rename(PHONE_MODULES_PATH . "temp/endpoint/base.php", PHONE_MODULES_PATH . "endpoint/base.php");
         echo "Updating Last Modified <br />";
         $sql = "UPDATE endpointman_global_vars SET value = '" . $endpoint_last_mod . "' WHERE var_name = 'endpoint_vers'";
         $endpoint->db->query($sql);
     }
     break;
 case "upload_brand":
     if (file_exists(PHONE_MODULES_PATH . "temp/" . $_REQUEST['package']) and file_exists(PHONE_MODULES_PATH . "temp/" . $_REQUEST['xml'])) {
         $temp = $endpoint->xml2array(PHONE_MODULES_PATH . "temp/" . $_REQUEST['xml']);
         $brand_name = $temp['data']['brands']['name'];
         $brand_id = $temp['data']['brands']['brand_id'];
         $brand_version = $temp['data']['brands']['version'];
         $package = $temp['data']['brands']['package'];
         $brand_directory = $temp['data']['brands']['directory'];
         if (!file_exists(PHONE_MODULES_PATH . "endpoint/" . $brand_directory)) {
             echo "Creating " . $brand_name . " Directory <br />";
             mkdir(PHONE_MODULES_PATH . "endpoint/" . $brand_directory);
         }
         rename(PHONE_MODULES_PATH . "temp/" . $_REQUEST['xml'], PHONE_MODULES_PATH . "endpoint/" . $brand_directory . "/brand_data.xml");
         echo "Extracting Tarball........";
         exec("tar -xvf " . PHONE_MODULES_PATH . 'temp/' . $package . " -C " . PHONE_MODULES_PATH . "temp/");
         echo "Done!<br />";
         echo "Creating Directory Structure/Moving Files...............";
         $dir_iterator = new RecursiveDirectoryIterator(PHONE_MODULES_PATH . "temp/" . $brand_directory . "/");