diff options
| author | michael pereira | 2011-04-20 18:49:49 +0200 |
|---|---|---|
| committer | michael pereira | 2011-04-20 18:49:49 +0200 |
| commit | cc3660add480ac1dc217d7f853b325db7d6ec7d0 (patch) | |
| tree | 8056c87777d806c613a607c3f479ce07475b5db6 /application/controllers/ResourceController.php | |
| parent | API + Fixes (diff) | |
| parent | Url für Config gekürzt (diff) | |
| download | pbs2-cc3660add480ac1dc217d7f853b325db7d6ec7d0.tar.gz pbs2-cc3660add480ac1dc217d7f853b325db7d6ec7d0.tar.xz pbs2-cc3660add480ac1dc217d7f853b325db7d6ec7d0.zip | |
merges
Diffstat (limited to 'application/controllers/ResourceController.php')
| -rw-r--r-- | application/controllers/ResourceController.php | 18 |
1 files changed, 10 insertions, 8 deletions
diff --git a/application/controllers/ResourceController.php b/application/controllers/ResourceController.php index e94d9c7..88ec38e 100644 --- a/application/controllers/ResourceController.php +++ b/application/controllers/ResourceController.php @@ -34,20 +34,24 @@ class ResourceController extends Zend_Controller_Action $membershipMapper = new Application_Model_MembershipMapper(); $this->membership = new Application_Model_Membership(); $this->rightrolesMapper = new Application_Model_RightRolesMapper(); + $rightroles = new Application_Model_RightRoles(); + @list($this->membership) = $membershipMapper->findBy(array('apikey' => $apikey)); if($this->membership == null){ header('HTTP/1.0 401 Member not found'); die(); } - + } elseif($alpha == "0"){ $bootmenuentryID = $this->_request->getParam('bootmenuentryID'); $this->page = $this->_request->getParam('page'); - if(!is_numeric($bootmenuentryID)) - $this->_redirect('/user/bootmenu/index/page/'.$this->page.'/json/error'); + + if(!is_numeric($bootmenuentryID)){ + $this->_redirect('/user/bootmenu/index/page/'.$this->page.'/json/error'); + } $bootmenuentry = new Application_Model_BootMenuEntries(); $bootmenuentryMapper = new Application_Model_BootMenuEntriesMapper(); @@ -102,7 +106,6 @@ class ResourceController extends Zend_Controller_Action header('HTTP/1.0 400 Title, Distro, Distroversion and Share must be set'); die(); } - if($_FILES['config']['size'] == 0 && $_FILES['config']['name'] != '' || $_FILES['kernel']['size'] == 0 && $_FILES['kernel']['name'] != ''|| $_FILES['init']['size'] == 0 && $_FILES['init']['name'] != ''){ header('HTTP/1.0 400 File must be larger than 0 bytes'); @@ -367,7 +370,6 @@ class ResourceController extends Zend_Controller_Action public function getconfigAction() { - $bootmenuentryID = $this->thisSession->getBootmenuentryID(); $bootmenuentry = new Application_Model_BootMenuEntries(); $bmm = new Application_Model_BootMenuEntriesMapper(); @@ -415,6 +417,7 @@ class ResourceController extends Zend_Controller_Action if($configID == null) $configID = 'default'; chdir("../resources/config/$bootosID/$configID/"); + passthru( "cat default.tgz"); } }else{ @@ -470,9 +473,9 @@ class ResourceController extends Zend_Controller_Action $kcl = $bootosmapper->find($bme->getBootosID())->getDefaultkcl(); if($bme->getKcl() && $kcl != null){ - $result = $kcl . " alpha=" . $this->_request->getParam('alpha') . " file=http://".$_SERVER['HTTP_HOST']."/resource/getconfig/alpha/".$this->_request->getParam('alpha')."/file/default.tgz ".$bme->getKclappend(); + $result = $kcl . " alpha=" . $this->_request->getParam('alpha') . " file=http://".$_SERVER['HTTP_HOST']."/c/".$this->_request->getParam('alpha')."/default.tgz ".$bme->getKclappend(); }else{ - $result = "alpha=" . $this->_request->getParam('alpha') . " file=http://".$_SERVER['HTTP_HOST']."/resource/getconfig/alpha/".$this->_request->getParam('alpha')."/file/default.tgz ".$bme->getKclappend(); + $result = "alpha=" . $this->_request->getParam('alpha') . " file=http://".$_SERVER['HTTP_HOST']."/c/".$this->_request->getParam('alpha')."/default.tgz ".$bme->getKclappend(); } header("Content-Length: ".(strlen($result))); @@ -512,7 +515,6 @@ class ResourceController extends Zend_Controller_Action } private function generateURL($action, $varname, $varvalue, $filename){ - $path = '/resource/'. $action .'/' . $varname .'/' . $varvalue .'/bootmenuentryID/'.$this->thisSession->getBootmenuentryID().'/file/' . $filename ; $path = "http://" . $_SERVER['SERVER_NAME'] . $path; return $path; |
