summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMichael Neves2012-01-26 20:09:28 +0100
committerMichael Neves2012-01-26 20:09:28 +0100
commit9a44d009e7ba95d433e57520669b9d328d274ca1 (patch)
tree8fd1ddf77d740f751c81b89ef8ae5c514eb1c5d0
parentBootiso download (diff)
downloadpbs2-9a44d009e7ba95d433e57520669b9d328d274ca1.tar.gz
pbs2-9a44d009e7ba95d433e57520669b9d328d274ca1.tar.xz
pbs2-9a44d009e7ba95d433e57520669b9d328d274ca1.zip
Bootiso download
-rw-r--r--application/modules/user/controllers/BootisoController.php9
1 files changed, 6 insertions, 3 deletions
diff --git a/application/modules/user/controllers/BootisoController.php b/application/modules/user/controllers/BootisoController.php
index 344de0e..2136e5f 100644
--- a/application/modules/user/controllers/BootisoController.php
+++ b/application/modules/user/controllers/BootisoController.php
@@ -96,7 +96,7 @@ class user_BootisoController extends Zend_Controller_Action {
$bootiso->setGroupID("[".$bootiso->getGroupID()."] ".$groupMapper->find($bootiso->getGroupID())->getTitle());
$bootiso->setPreBootTypeID($preboottypeMapper->find($bootiso->getPreBootTypeID())->getName());
$bootiso->setCreated(date(Zend_Registry::get('dateformat'), $bootiso->getCreated()));
- if($prebootMapper->findBy(array("serialnumber" => $bootiso->getSerialnumber())) != null){
+ if($prebootMapper->findBy(array('serialnumber' => $bootiso->getSerialnumber(), 'preboottypeID' => $bootiso->getPreboottypeID())) != null){
$this->view->download[$bootiso->getID()] = true;
}
if($bootiso->getExpires() == "") {
@@ -146,8 +146,11 @@ class user_BootisoController extends Zend_Controller_Action {
{ $this->_redirect('/user/bootiso/index/page/'.$this->page.'/downloadresult/forbidden'); }
$bootiso = $this->bootisoMapper->find($bootisoID);
- $prebootID = $bootiso->getPrebootID();
-
+
+ $prebootMapper = new Application_Model_PreBootMapper();
+ $preboot = array_shift($prebootMapper->findBy(array('serialnumber' => $bootiso->getSerialnumber(), 'preboottypeID' => $bootiso->getPreboottypeID())));
+ $prebootID = $preboot->getID();
+
if(!is_dir("../resources/bootmedium/$prebootID/"))
{ $this->_redirect('/user/bootiso/index/page/'.$this->page.'/downloadresult/404'); }