summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-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'); }