summaryrefslogtreecommitdiffstats
path: root/application/controllers/ResourceController.php
diff options
context:
space:
mode:
authorSimon2011-03-14 16:09:03 +0100
committerSimon2011-03-14 16:09:03 +0100
commitb5cbdd6b400aa1ec77c9846e9cc8d4257f437e3c (patch)
treefcef50ad1ddf831f457d6aecd83e7fdc63297a1c /application/controllers/ResourceController.php
parentfooter bleibt am fensterbottom (diff)
downloadpbs2-b5cbdd6b400aa1ec77c9846e9cc8d4257f437e3c.tar.gz
pbs2-b5cbdd6b400aa1ec77c9846e9cc8d4257f437e3c.tar.xz
pbs2-b5cbdd6b400aa1ec77c9846e9cc8d4257f437e3c.zip
Application in 3 Modules gesplittet, Dev = unsere entwicklungsumgebung, user = die weboberfläche fr anwender mit acl etc, fbgui = für die fbgui truppe - links in dev müssen noch angepasst werden
Diffstat (limited to 'application/controllers/ResourceController.php')
-rw-r--r--application/controllers/ResourceController.php192
1 files changed, 0 insertions, 192 deletions
diff --git a/application/controllers/ResourceController.php b/application/controllers/ResourceController.php
deleted file mode 100644
index aef8649..0000000
--- a/application/controllers/ResourceController.php
+++ /dev/null
@@ -1,192 +0,0 @@
-<?php
-
-class ResourceController extends Zend_Controller_Action
-{
-
-
- public function init()
- {
-
- }
-
- public function indexAction()
- {
-
-
- }
-
- public function getinitramfsAction()
- {
- $this->_helper->layout->disableLayout();
- $this->_helper->viewRenderer->setNoRender();
-
- $alphasessionID = $this->_request->getParam('alpha');
- $session = new Application_Model_Session();
- $sm = new Application_Model_SessionMapper();
- $result = $sm->findBy('alphasessionID',$alphasessionID);
- # print_a($result);
- $thisSession = $result[0];
- $bootosID = $thisSession['bootosID'];
-
- if(is_dir("../resources/bootos/$bootosID/initramfs/") && is_numeric($bootosID)){
-
- header('Content-Type: application/x-gzip');
- $content_disp = ( ereg('MSIE ([0-9].[0-9]{1,2})', $HTTP_USER_AGENT) == 'IE') ? 'inline' : 'attachment';
- header('Content-Disposition: ' . $content_disp . '; filename="initramfs.tar.gz"');
- header('Pragma: no-cache');
- header('Expires: 0');
-
- // create the gzipped tarfile.
- chdir("../resources/bootos/$bootosID/initramfs/");
- passthru( "tar cz ./");
- }
- }
-
- public function getconfigAction()
- {
-
- $this->_helper->layout->disableLayout();
- $this->_helper->viewRenderer->setNoRender();
-
- $alphasessionID = $this->_request->getParam('alpha');
- $session = new Application_Model_Session();
- $sm = new Application_Model_SessionMapper();
- $result = $sm->findBy('alphasessionID',$alphasessionID);
- # print_a($result);
- $thisSession = $result[0];
- $bootmenuentryID = $thisSession['bootmenuentryID'];
- $bootmenuentry = new Application_Model_BootMenuEntries();
- $bmm = new Application_Model_BootMenuEntriesMapper();
- $bmm->find($bootmenuentryID,$bootmenuentry);
- # print_a($bootmenuentry);
- $configID = $bootmenuentry->getConfigID();
-
- if(is_dir("../resources/config/$configID/config/") && is_numeric($configID)){
-
- header('Content-Type: application/x-gzip');
- $content_disp = ( ereg('MSIE ([0-9].[0-9]{1,2})', $HTTP_USER_AGENT) == 'IE') ? 'inline' : 'attachment';
- header('Content-Disposition: ' . $content_disp . '; filename="config.tar.gz"');
- header('Pragma: no-cache');
- header('Expires: 0');
-
- // create the gzipped tarfile.
- chdir("../resources/config/$configID/config/");
- passthru( "tar cz ./");
- }
- }
-
- public function getkernelAction()
- {
- $this->_helper->layout->disableLayout();
- $this->_helper->viewRenderer->setNoRender();
-
- $alphasessionID = $this->_request->getParam('alpha');
- $session = new Application_Model_Session();
- $sm = new Application_Model_SessionMapper();
- $result = $sm->findBy('alphasessionID',$alphasessionID);
- # print_a($result);
- $thisSession = $result[0];
- $bootosID = $thisSession['bootosID'];
-
-
- if(is_dir("../resources/bootos/$bootosID/kernel/") && is_numeric($bootosID)){
-
- header('Content-Type: application/x-gzip');
- $content_disp = ( ereg('MSIE ([0-9].[0-9]{1,2})', $HTTP_USER_AGENT) == 'IE') ? 'inline' : 'attachment';
- header('Content-Disposition: ' . $content_disp . '; filename="kernel.tar.gz"');
- header('Pragma: no-cache');
- header('Expires: 0');
-
- // create the gzipped tarfile.
- chdir("../resources/bootos/$bootosID/kernel/");
- passthru( "tar cz ./");
- }
- }
-
- public function getkclAction()
- {
- $this->_helper->layout->disableLayout();
- $this->_helper->viewRenderer->setNoRender();
-
- $alphasessionID = $this->_request->getParam('alpha');
- $session = new Application_Model_Session();
- $sm = new Application_Model_SessionMapper();
- $result = $sm->findBy('alphasessionID',$alphasessionID);
- # print_a($result);
- $thisSession = $result[0];
- $bmeID = $thisSession['bootmenuentryID'];
-
- if(is_numeric($bmeID)){
- $bmemapper = new Application_Model_BootMenuEntriesMapper();
- $bme = new Application_Model_BootMenuEntries();
- $bmemapper->find($bmeID,$bme);
-
- if($bme->getKcl() != null){
- header('Content-Type: text/html');
- $content_disp = ( ereg('MSIE ([0-9].[0-9]{1,2})', $HTTP_USER_AGENT) == 'IE') ? 'inline' : 'attachment';
- header('Content-Disposition: ' . $content_disp . '; filename="kcl.txt"');
- header('Pragma: no-cache');
- header('Expires: 0');
- echo $bme->getKcl();
- }
-
- }
-
- }
-
- public function getbootmenuentryAction()
- {
- // obsolete function (now only for debugging)
- // after selecting the BootOS it will be saved in session
- // so getkclAction, getkernelAction, getconfigAction and getinitramfsAction
- // can be called with session-identifier
-
- $this->_helper->layout->disableLayout();
- $this->_helper->viewRenderer->setNoRender();
-
- $bmeID = $this->_request->getParam('bootmenuentryID');
- $bmeID = 4;
-
- if(isset($_SESSION['alphasessionID'])){
- $sessionmapper = new Application_Model_SessionMapper();
- $session = $sessionmapper->findBy('alphasessionID',$_SESSION['alphasessionID']);
- $session = $session[0];
- if($session['bootmenuentryID'] != null){
- $return_val =
- array(
- 'info' => 'This function is for debugging purpose only',
- 'kernel' => $this->generateURL('getkernel', 'alpha', $_SESSION['alphasessionID']),
- 'initramfs' => $this->generateURL('getinitramfs', 'alpha', $_SESSION['alphasessionID']),
- 'kcl' => $this->generateURL('getkcl', 'alpha', $_SESSION['alphasessionID']),
- 'config' => $_SESSION['alphasessionID']
- );
- echo json_encode($return_val);
- }
- else{
- echo json_encode(
- array( 'info' => 'This function is for debugging purpose only',
- 'error'=>'your session is out of date')
- );
- }
- }
-
- }
-
- function generateURL($action, $varname, $varvalue){
- $path = '/resource/'. $action .'/' . $varname .'/' . $varvalue;
- $path = "http://" . $_SERVER['SERVER_NAME'] . $path;
- return $path;
- }
-
-}
-
-
-
-
-
-
-
-
-
-
-