From 1a82b501d9b85c37595c227743e097932f9b0450 Mon Sep 17 00:00:00 2001 From: michael pereira Date: Tue, 19 Apr 2011 15:43:47 +0200 Subject: Resource Controller fix --- application/controllers/ResourceController.php | 8 ++++---- application/modules/user/controllers/BootosController.php | 10 +++++----- 2 files changed, 9 insertions(+), 9 deletions(-) diff --git a/application/controllers/ResourceController.php b/application/controllers/ResourceController.php index bf9de06..2af7f92 100644 --- a/application/controllers/ResourceController.php +++ b/application/controllers/ResourceController.php @@ -120,7 +120,7 @@ class ResourceController extends Zend_Controller_Action mkdir($configpath ,0777, true); if(isset($_FILES['config'])){ - move_uploaded_file($_FILES['config']['tmp_name'], $configpath."config.tgz"); + move_uploaded_file($_FILES['config']['tmp_name'], $configpath."default.tgz"); } if(isset($_FILES['kernel'])){ move_uploaded_file($_FILES['kernel']['tmp_name'], $kernelpath."kernel"); @@ -162,14 +162,14 @@ class ResourceController extends Zend_Controller_Action { $bootmenuentryID = $this->thisSession->getBootmenuentryID(); - $bootmenuentry = new Application_Model_BootMenuEntries(); $bmm = new Application_Model_BootMenuEntriesMapper(); $bmm->find($bootmenuentryID,$bootmenuentry); $configID = $bootmenuentry->getConfigID(); + $bootosID = $this->thisSession->getBootosID(); - if(is_dir("../resources/config/$configID/")){ + if(is_dir("../resources/bootos/$bootosID/config/")){ header('Content-Type: application/x-gzip'); $content_disp = ( ereg('MSIE ([0-9].[0-9]{1,2})', $_SERVER['HTTP_USER_AGENT']) == 'IE') ? 'inline' : 'attachment'; @@ -204,7 +204,7 @@ class ResourceController extends Zend_Controller_Action chdir($path_userconf); passthru( "tar cz *"); }else { - chdir("../resources/config/$configID/"); + chdir("../resources/bootos/$bootosID/config/"); passthru( "cat default.tgz"); } }else{ diff --git a/application/modules/user/controllers/BootosController.php b/application/modules/user/controllers/BootosController.php index 796a2f7..d93f0cf 100644 --- a/application/modules/user/controllers/BootosController.php +++ b/application/modules/user/controllers/BootosController.php @@ -169,7 +169,7 @@ class user_BootosController extends Zend_Controller_Action $hash = md5(microtime(1)); exec("wget -O '".$path_tmp."kernel".$hash."' ".escapeshellcmd($bootos->getPath_kernel())." 2>&1 | grep 'saved'", $status); exec("wget -O '".$path_tmp."initramfs".$hash."' ".escapeshellcmd($bootos->getPath_init())." 2>&1 | grep 'saved'", $status2); - exec("wget -O '".$path_tmp."config".$hash."' ".escapeshellcmd($bootos->getPath_config())." 2>&1 | grep 'saved'", $status3); + exec("wget -O '".$path_tmp."default".$hash."' ".escapeshellcmd($bootos->getPath_config())." 2>&1 | grep 'saved'", $status3); if(!array_pop($status) && $bootos->getPath_kernel() != null || !array_pop($status2) && $bootos->getPath_init() != null || !array_pop($status3) && $bootos->getPath_config() != null ){ $this->view->bootosForm = $bootosForm; @@ -191,7 +191,7 @@ class user_BootosController extends Zend_Controller_Action exec("mv ../resources/bootos/kernel$hash $kernelpath"."kernel"); exec("mv ../resources/bootos/initramfs$hash $initpath"."initramfs"); - exec("mv ../resources/bootos/config$hash $configpath"."config.tgz"); + exec("mv ../resources/bootos/config$hash $configpath"."default.tgz"); }catch(Zend_Exception $e) { @@ -221,7 +221,7 @@ class user_BootosController extends Zend_Controller_Action if(is_file("../resources/bootos/$bootosID/kernel/kernel") && is_file("../resources/bootos/$bootosID/initramfs/initramfs") && is_file("../resources/bootos/$bootosID/config/config.tgz")){ $kernelolddate = filemtime("../resources/bootos/".$bootosID."/kernel/kernel"); $initolddate = filemtime("../resources/bootos/".$bootosID."/initramfs/initramfs"); - $configolddate = filemtime("../resources/bootos/".$bootosID."/config/config.tgz"); + $configolddate = filemtime("../resources/bootos/".$bootosID."/config/default.tgz"); } else { @@ -282,7 +282,7 @@ class user_BootosController extends Zend_Controller_Action exec("mv ../resources/bootos/kernel$hash $kernelpath"."kernel"); exec("mv ../resources/bootos/initramfs$hash $initpath"."initramfs"); - exec("mv ../resources/bootos/config$hash $initpath"."config.tgz"); + exec("mv ../resources/bootos/config$hash $initpath"."default.tgz"); $this->_redirect('/user/bootos/index/page/'.$this->page.'/updateresult/ok'); } @@ -376,7 +376,7 @@ class user_BootosController extends Zend_Controller_Action exec("mv ../resources/bootos/kernel$hash $kernelpath"."kernel"); exec("mv ../resources/bootos/initramfs$hash $initpath"."initramfs"); - exec("mv ../resources/bootos/config$hash $initpath"."config.tgz"); + exec("mv ../resources/bootos/config$hash $initpath"."default.tgz"); } try { -- cgit v1.2.3-55-g7522