summaryrefslogtreecommitdiffstats
path: root/application/modules
diff options
context:
space:
mode:
Diffstat (limited to 'application/modules')
-rw-r--r--application/modules/user/controllers/BootisoController.php23
-rw-r--r--application/modules/user/controllers/BootmenuController.php26
-rw-r--r--application/modules/user/controllers/BootosController.php33
-rw-r--r--application/modules/user/controllers/ConfigController.php86
-rw-r--r--application/modules/user/views/scripts/bootiso/index.phtml109
-rw-r--r--application/modules/user/views/scripts/bootmenu/index.phtml150
-rw-r--r--application/modules/user/views/scripts/bootos/index.phtml115
-rw-r--r--application/modules/user/views/scripts/config/index.phtml32
-rw-r--r--application/modules/user/views/scripts/preboot/index.phtml85
9 files changed, 395 insertions, 264 deletions
diff --git a/application/modules/user/controllers/BootisoController.php b/application/modules/user/controllers/BootisoController.php
index ae34ca0..b928a19 100644
--- a/application/modules/user/controllers/BootisoController.php
+++ b/application/modules/user/controllers/BootisoController.php
@@ -77,7 +77,17 @@ class user_BootisoController extends Zend_Controller_Action
}
$this->view->bootisolist = array_reverse($this->view->bootisolist);
-
+
+ $prebootMapper = new Application_Model_PreBootMapper();
+ $this->view->prebootlist = array();
+
+ foreach ($this->view->bootisolist as $bootiso){
+ $bootiso->setPrebootID("[".$bootiso->getPrebootID()."] ".$prebootMapper->find($bootiso->getPrebootID())->getTitle());
+ $bootiso->setGroupID("[".$bootiso->getGroupID()."] ".$groupMapper->find($bootiso->getGroupID())->getTitle());
+ $bootiso->setCreated(date(Zend_Registry::get('dateformat'),$bootiso->getCreated()));
+ $bootiso->setExpires(date(Zend_Registry::get('dateformat'),$bootiso->getExpires()));
+ }
+
// Search
$search = $this->_request->getParam('search');
$mySearch = new Pbs_Search();
@@ -99,17 +109,6 @@ class user_BootisoController extends Zend_Controller_Action
$this->view->pagination = $pagination->pagination($pageurl);
$this->view->page = $pagination->getRequestPage();
-
- $prebootMapper = new Application_Model_PreBootMapper();
- $this->view->prebootlist = array();
-
- foreach ($this->view->bootisolist as $bootiso){
- $bootiso->setPrebootID("[".$bootiso->getPrebootID()."] ".$prebootMapper->find($bootiso->getPrebootID())->getTitle());
- $bootiso->setGroupID("[".$bootiso->getGroupID()."] ".$groupMapper->find($bootiso->getGroupID())->getTitle());
- $bootiso->setCreated(date(Zend_Registry::get('dateformat'),$bootiso->getCreated()));
- $bootiso->setExpires(date(Zend_Registry::get('dateformat'),$bootiso->getExpires()));
- }
-
}
public function searchAction(){
diff --git a/application/modules/user/controllers/BootmenuController.php b/application/modules/user/controllers/BootmenuController.php
index 03d0362..5689f11 100644
--- a/application/modules/user/controllers/BootmenuController.php
+++ b/application/modules/user/controllers/BootmenuController.php
@@ -86,18 +86,20 @@ class user_BootmenuController extends Zend_Controller_Action
}else{
$bootmenu = $this->bootmenuMapper->findBy(array('membershipID' => $this->membership->getID()));
- $bootmenu[0]->setCreated(date(Zend_Registry::get('dateformat'),$bootmenu[0]->getCreated()));
- $bootmenuID = $bootmenu[0]->getID();
- $bootmenuentries[$bootmenuID] = $this->bootmenuentriesMapper->findBy(array('bootmenuID' => $bootmenuID));
- foreach ($bootmenuentries[$bootmenuID] as $bootmenuentry){
- if($bootmenuentry->getKcl())
- $bootmenuentry->setKcl($bootosMapper->find($bootmenuentry->getBootosID())->getDefaultkcl());
- else
- $bootmenuentry->setKcl("deactivated (edit Bootmenuentry to activate)");
- if($bootmenuentry->getKclappend() == null)
- $bootmenuentry->setKclappend("none");
- $bootmenuentry->setBootosID("[".$bootmenuentry->getBootosID()."] ".$bootosMapper->find($bootmenuentry->getBootosID())->getTitle());
- $bootmenuentry->setConfigID("[".$bootmenuentry->getConfigID()."] ".$configMapper->find($bootmenuentry->getConfigID())->gettitle());
+ if($bootmenu != null){
+ $bootmenu[0]->setCreated(date(Zend_Registry::get('dateformat'),$bootmenu[0]->getCreated()));
+ $bootmenuID = $bootmenu[0]->getID();
+ $bootmenuentries[$bootmenuID] = $this->bootmenuentriesMapper->findBy(array('bootmenuID' => $bootmenuID));
+ foreach ($bootmenuentries[$bootmenuID] as $bootmenuentry){
+ if($bootmenuentry->getKcl())
+ $bootmenuentry->setKcl($bootosMapper->find($bootmenuentry->getBootosID())->getDefaultkcl());
+ else
+ $bootmenuentry->setKcl("deactivated (edit Bootmenuentry to activate)");
+ if($bootmenuentry->getKclappend() == null)
+ $bootmenuentry->setKclappend("none");
+ $bootmenuentry->setBootosID("[".$bootmenuentry->getBootosID()."] ".$bootosMapper->find($bootmenuentry->getBootosID())->getTitle());
+ $bootmenuentry->setConfigID("[".$bootmenuentry->getConfigID()."] ".$configMapper->find($bootmenuentry->getConfigID())->gettitle());
+ }
}
}
diff --git a/application/modules/user/controllers/BootosController.php b/application/modules/user/controllers/BootosController.php
index aad26aa..917441a 100644
--- a/application/modules/user/controllers/BootosController.php
+++ b/application/modules/user/controllers/BootosController.php
@@ -75,7 +75,23 @@ class user_BootosController extends Zend_Controller_Action
$this->view->bootoslist = array_reverse($this->view->bootoslist);
- // Search
+ $this->view->update = array();
+ $update = $this->_request->getParam('checkupdate');
+ $groupMapper = new Application_Model_GroupMapper();
+ $configMapper = new Application_Model_ConfigMapper();
+
+
+ if(count($this->view->bootoslist)>0){
+ foreach ($this->view->bootoslist as $bootos){
+ $this->view->update[$bootos->getID()] = $update && $this->checkupdateAction($bootos);
+ $bootos->setGroupID("[".$bootos->getGroupID()."] ".$groupMapper->find($bootos->getGroupID())->getTitle());
+ $bootos->setConfigID("[".$bootos->getConfigID()."] ".$configMapper->find($bootos->getConfigID())->getTitle());
+ $bootos->setCreated(date(Zend_Registry::get('dateformat'),$bootos->getCreated()));
+ $bootos->setExpires(date(Zend_Registry::get('dateformat'),$bootos->getExpires()));
+ }
+ }
+
+ // Search
$search = $this->_request->getParam('search');
$mySearch = new Pbs_Search();
$mySearch->setSearchTerm($search);
@@ -97,21 +113,6 @@ class user_BootosController extends Zend_Controller_Action
$this->view->pagination = $pagination->pagination($pageurl);
$this->view->page = $pagination->getRequestPage();
- $this->view->update = array();
- $update = $this->_request->getParam('checkupdate');
- $groupMapper = new Application_Model_GroupMapper();
- $configMapper = new Application_Model_ConfigMapper();
-
-
- if(count($this->view->bootoslist)>0){
- foreach ($this->view->bootoslist as $bootos){
- $this->view->update[$bootos->getID()] = $update && $this->checkupdateAction($bootos);
- $bootos->setGroupID("[".$bootos->getGroupID()."] ".$groupMapper->find($bootos->getGroupID())->getTitle());
- $bootos->setConfigID("[".$bootos->getConfigID()."] ".$configMapper->find($bootos->getConfigID())->getTitle());
- $bootos->setCreated(date(Zend_Registry::get('dateformat'),$bootos->getCreated()));
- $bootos->setExpires(date(Zend_Registry::get('dateformat'),$bootos->getExpires()));
- }
- }
}
public function searchAction(){
diff --git a/application/modules/user/controllers/ConfigController.php b/application/modules/user/controllers/ConfigController.php
index 1af05cc..df32385 100644
--- a/application/modules/user/controllers/ConfigController.php
+++ b/application/modules/user/controllers/ConfigController.php
@@ -8,6 +8,7 @@ class user_ConfigController extends Zend_Controller_Action
protected $membership;
protected $page;
protected $config;
+ protected $type;
public function init()
{
@@ -24,6 +25,11 @@ class user_ConfigController extends Zend_Controller_Action
$this->membershipMapper->find($userIDsNamespace['membershipID'],$this->membership);
$this->db = Zend_Db_Table::getDefaultAdapter();
+
+
+ $this->type = $this->_request->getParam('type');
+
+
} else {
$this->_helper->redirector('login', 'auth');
}
@@ -54,16 +60,18 @@ class user_ConfigController extends Zend_Controller_Action
$this->_redirect('/user/index');
$this->configMapper = new Application_Model_ConfigMapper();
-
- if(Pbs_Acl::checkRight('csai')){
- $this->view->configlist = $this->configMapper->findBy(array('groupID' => $this->membership->getGroupID()));
- }else{
+
+ if($this->type =='own' && Pbs_Acl::checkRight('csui')){
+ $this->view->type = 'own';
$this->view->configlist = $this->configMapper->findBy(array('membershipID' => $this->membership->getID()));
- }
-
+ }else{
+ $this->view->type = 'group';
+ $this->view->configlist = $this->configMapper->findBy(array('groupID' => $this->membership->getGroupID()));
+ }
+
foreach ($this->view->configlist as $config){
$config->setCreated(date(Zend_Registry::get('dateformat'),$config->getCreated()));
- }
+ }
// Search
$search = $this->_request->getParam('search');
@@ -78,10 +86,10 @@ class user_ConfigController extends Zend_Controller_Action
// Pagination
$pagination = new Pbs_Pagination();
- $pagination->setPerPage(2);
+ $pagination->setPerPage(4);
$pagination->setElement($this->view->configlist);
$pagination->setRequestPage($this->_request->getParam('page'));
- $pagination->setPageUrl('/user/config/index'.((isset($this->view->search))?'/search/'.$this->view->search:''));
+ $pagination->setPageUrl('/user/config/index/type/'.$this->type.((isset($this->view->search))?'/search/'.$this->view->search:''));
$this->view->configlist = $pagination->getElements();
$this->view->pagination = $pagination->pagination($pageurl);
@@ -90,14 +98,14 @@ class user_ConfigController extends Zend_Controller_Action
}
public function searchAction(){
- $this->_redirect('/user/config/index/search/'.($_GET['search']));
+ $this->_redirect('/user/config/index/type/'.$this->type.'/search/'.($_GET['search']));
}
public function createconfigAction()
{
//ACL Darf er Configs erstellen?
- if(!Pbs_Acl::checkRight('cc'))
- $this->_redirect('/user/config/index/page/'.$this->page.'/addresult/forbidden');
+ if(!Pbs_Acl::checkRight('cc') && !Pbs_Acl::checkRight('cco'))
+ $this->_redirect('/user/config/index/type/'.$this->type.'/page/'.$this->page.'/addresult/forbidden');
if (!isset($_POST["createconfig"])){
$configForm = new user_Form_Config(array('action' => 'createconfig','page'=>$this->page));
@@ -109,20 +117,22 @@ class user_ConfigController extends Zend_Controller_Action
$config = new Application_Model_Config($_POST);
$config->setCreated(time());
- if(Pbs_Acl::checkRight('csai'))
+ if(Pbs_Acl::checkRight('cc') && $this->_request->getParam('type') == 'group')
$config->setGroupID($this->membership->getGroupID());
- else
+ elseif(Pbs_Acl::checkRight('cco') && $this->_request->getParam('type') == 'own')
$config->setMembershipID($this->membership->getID());
-
+ else
+ $this->_redirect('/user/config/index/type/'.$this->type.'/page/'.$this->page.'/addresult/error');
+
try {
$this->configMapper->save($config);
}catch(Zend_Exception $e)
{
echo "Caught exception: " . get_class($e) . "<br/>";
echo "Message: " . $e->getMessage() . "<br/>";
- $this->_redirect('/user/config/index/page/'.$this->page.'/addresult/error');
+ $this->_redirect('/user/config/index/type/'.$this->type.'/page/'.$this->page.'/addresult/error');
}
- $this->_redirect('/user/config/index/page/'.$this->page.'/addresult/ok');
+ $this->_redirect('/user/config/index/type/'.$this->type.'/page/'.$this->page.'/addresult/ok');
}
}
@@ -132,12 +142,12 @@ class user_ConfigController extends Zend_Controller_Action
public function editconfigAction()
{
//ACL Darf er Configs editieren?
- if(!Pbs_Acl::checkRight('ce') && !Pbs_Acl::checkRight('cem'))
- $this->_redirect('/user/config/index/page/'.$this->page.'/modifyresult/forbidden');
+ if(!Pbs_Acl::checkRight('ce') && !Pbs_Acl::checkRight('cem') && !Pbs_Acl::checkRight('ceo'))
+ $this->_redirect('/user/config/index/type/'.$this->type.'/page/'.$this->page.'/modifyresult/forbidden');
$configID = $this->_request->getParam('configID');
if (!is_numeric($configID))
- $this->_redirect('/user/config/index/page/'.$this->page.'/modifyresult/error');
+ $this->_redirect('/user/config/index/type/'.$this->type.'/page/'.$this->page.'/modifyresult/error');
$groupID = $this->membership->getGroupID();
@@ -146,10 +156,10 @@ class user_ConfigController extends Zend_Controller_Action
if($config->getMembershipID() != null){
if($this->membership->getID() != $config->getMembershipID())
- $this->_redirect('/user/config/index/page/'.$this->page.'/modifyresult/forbidden');
+ $this->_redirect('/user/config/index/type/'.$this->type.'/page/'.$this->page.'/modifyresult/forbidden');
}else{
if($this->membership->getGroupID() != $config->getGroupID())
- $this->_redirect('/user/config/index/page/'.$this->page.'/modifyresult/forbidden');
+ $this->_redirect('/user/config/index/type/'.$this->type.'/page/'.$this->page.'/modifyresult/forbidden');
}
if (!isset($_POST["editconfig"])){
@@ -167,17 +177,19 @@ class user_ConfigController extends Zend_Controller_Action
$config = new Application_Model_Config($_POST);
$config->setCreated(time());
- if(Pbs_Acl::checkRight('csai'))
+ if(Pbs_Acl::checkRight('ce') && $configold->getGroupID() != null)
$config->setGroupID($this->membership->getGroupID());
- else
+ elseif(Pbs_Acl::checkRight('ceo') && $configold->getMembershipID() != null)
$config->setMembershipID($this->membership->getID());
-
+ else
+ $this->_redirect('/user/config/index/type/'.$this->type.'/page/'.$this->page.'/modifyresult/error');
+
$config->setID($configID);
if($configold->getShellscript() != $config->getShellscript()){
//ACL Is he allowed to edit other than Metadata?
if(!Pbs_Acl::checkRight('ce'))
- $this->_redirect('/user/config/index/page/'.$this->page.'/modifyresult/forbidden');
+ $this->_redirect('/user/config/index/type/'.$this->type.'/page/'.$this->page.'/modifyresult/forbidden');
}
@@ -187,10 +199,10 @@ class user_ConfigController extends Zend_Controller_Action
{
echo "Caught exception: " . get_class($e) . "<br/>";
echo "Message: " . $e->getMessage() . "<br/>";
- $this->_redirect('/user/config/index/page/'.$this->page.'/modifyresult/error');
+ $this->_redirect('/user/config/index/type/'.$this->type.'/page/'.$this->page.'/modifyresult/error');
}
- $this->_redirect('/user/config/index/page/'.$this->page.'/modifyresult/ok');
+ $this->_redirect('/user/config/index/type/'.$this->type.'/page/'.$this->page.'/modifyresult/ok');
}
}
@@ -201,23 +213,23 @@ class user_ConfigController extends Zend_Controller_Action
public function deleteconfigAction()
{
//ACL Darf er Configs löschen?
- if(!Pbs_Acl::checkRight('cd'))
- $this->_redirect('/user/config/index/page/'.$this->page.'/deleteresult/forbidden');
+ if(!Pbs_Acl::checkRight('cd') && !Pbs_Acl::checkRight('cdo'))
+ $this->_redirect('/user/config/index/type/'.$this->type.'/page/'.$this->page.'/deleteresult/forbidden');
try{
$configID = $this->_request->getParam('configID');
if (!is_numeric($configID))
- $this->_redirect('/user/config/index/page/'.$this->page.'/deleteresult/error');
+ $this->_redirect('/user/config/index/type/'.$this->type.'/page/'.$this->page.'/deleteresult/error');
$config = new Application_Model_Config();
$this->configMapper->find($configID,$config);
if($config->getMembershipID() != null){
- if($this->membership->getID() != $config->getMembershipID())
- $this->_redirect('/user/config/index/page/'.$this->page.'/deleteresult/forbidden');
+ if($this->membership->getID() != $config->getMembershipID() || !Pbs_Acl::checkRight('cdo'))
+ $this->_redirect('/user/config/index/type/'.$this->type.'/page/'.$this->page.'/deleteresult/forbidden');
}else{
- if($this->membership->getGroupID() != $config->getGroupID())
- $this->_redirect('/user/config/index/page/'.$this->page.'/deleteresult/forbidden');
+ if($this->membership->getGroupID() != $config->getGroupID() || !Pbs_Acl::checkRight('cd'))
+ $this->_redirect('/user/config/index/type/'.$this->type.'/page/'.$this->page.'/deleteresult/forbidden');
}
$this->configMapper->delete($config);
@@ -225,9 +237,9 @@ class user_ConfigController extends Zend_Controller_Action
}catch(Zend_Exception $e){
echo "Caught exception: " . get_class($e) . "<br/>";
echo "Message: " . $e->getMessage() . "<br/>";
- $this->_redirect('/user/config/index/page/'.$this->page.'/deleteresult/error');
+ $this->_redirect('/user/config/index/type/'.$this->type.'/page/'.$this->page.'/deleteresult/error');
}
- $this->_redirect('/user/config/index/page/'.$this->page.'/deleteresult/ok');
+ $this->_redirect('/user/config/index/type/'.$this->type.'/page/'.$this->page.'/deleteresult/ok');
}
diff --git a/application/modules/user/views/scripts/bootiso/index.phtml b/application/modules/user/views/scripts/bootiso/index.phtml
index 1c0c5fe..d0e8dd1 100644
--- a/application/modules/user/views/scripts/bootiso/index.phtml
+++ b/application/modules/user/views/scripts/bootiso/index.phtml
@@ -1,19 +1,26 @@
<h1>BootMedien</h1>
<?php if($this->notification != ''){echo $this->notification;} ?>
<?php echo $this->searchform; ?>
+
+<?php if(Pbs_Acl::checkRight('bc')): ?>
<?php echo $this->formButton('createbootiso', 'Create BootISO', array(
'onclick' => 'self.location="/user/bootiso/createbootiso/page/'.$this->page.'"',
'class' => 'addbutton'))?>
+<?php endif;?>
<div class='searchvars'>
<div class='head'>Available searchfilter:</div>
- <div class='code'>bootosID</div>
+ <?php if(Pbs_Acl::checkRight('bai')): ?>
+ <div class='code'>bootmediumID</div>
+ <div class='code'>serialnumber</div>
+ <div class='code'>public</div>
+ <?php endif; ?>
+ <div class='code'>prebootID</div>
<div class='code'>title</div>
<div class='code'>groupID</div>
- <div class='code'>prebootID</div>
- <div class='code'>serialnumber</div>
<div class='code'>created</div>
<div class='code'>expires</div>
- <div class='code'>public</div>
+
+
</div>
<div class='listelement'>
@@ -24,48 +31,68 @@
<div class='number'><?php echo $k+1; ?></div>
<div class='content'>
<div class='actions'>
- <a href="<?php echo $this->url(
- array(
- 'module' => 'user',
- 'controller' => 'bootiso',
- 'action' => 'downloadbootiso',
- 'bootisoID' => $bootiso->getID(),
- 'page' => $this->page
- ),
- 'default',
- true, false) ?>"><img src='/media/img/download.png' alt='Download BootMedium' /></a>
- <a href="<?php echo $this->url(
- array(
- 'module' => 'user',
- 'controller' => 'bootiso',
- 'action' => 'editbootiso',
- 'bootisoID' => $bootiso->getID(),
- 'page' => $this->page
- ),
- 'default',
- true, false) ?>"><img src='/media/img/edit.png' alt='Edit BootISO' /></a>
- <a href="<?php echo $this->url(
- array(
- 'module' => 'user',
- 'controller' => 'bootiso',
- 'action' => 'deletebootiso',
- 'bootisoID' => $bootiso->getID(),
- 'page' => $this->page
- ),
- 'default',
- true) ?>"><img src='/media/img/delete.png' alt='Delete BootISO'/></a>
+ <?php if(Pbs_Acl::checkRight('bdld')): ?>
+ <a href="<?php echo $this->url(
+ array(
+ 'module' => 'user',
+ 'controller' => 'bootiso',
+ 'action' => 'downloadbootiso',
+ 'bootisoID' => $bootiso->getID(),
+ 'page' => $this->page
+ ),
+ 'default',
+ true, false) ?>"><img src='/media/img/download.png' alt='Download BootMedium' /></a>
+ <?php endif; ?>
+ <?php if(Pbs_Acl::checkRight('be') || Pbs_Acl::checkRight('bem')): ?>
+ <a href="<?php echo $this->url(
+ array(
+ 'module' => 'user',
+ 'controller' => 'bootiso',
+ 'action' => 'editbootiso',
+ 'bootisoID' => $bootiso->getID(),
+ 'page' => $this->page
+ ),
+ 'default',
+ true, false) ?>"><img src='/media/img/edit.png' alt='Edit BootISO' /></a>
+ <?php endif; ?>
+ <?php if(Pbs_Acl::checkRight('bd')): ?>
+ <a href="<?php echo $this->url(
+ array(
+ 'module' => 'user',
+ 'controller' => 'bootiso',
+ 'action' => 'deletebootiso',
+ 'bootisoID' => $bootiso->getID(),
+ 'page' => $this->page
+ ),
+ 'default',
+ true) ?>"><img src='/media/img/delete.png' alt='Delete BootISO'/></a>
+ <?php endif; ?>
</div>
+ <?php if(!Pbs_Acl::checkRight('bai')){
+ $bootiso->setPrebootID(preg_replace("!^\[[0-9]+\]\s!",'',$bootiso->getPrebootID()));
+ $bootiso->setGroupID(preg_replace("!^\[[0-9]+\]\s!",'',$bootiso->getGroupID()));
+ } ?>
<div class='title'><?php echo $this->escape($bootiso->getTitle()); ?></div>
- <div class='subtitle'><?php echo $this->escape($bootiso->getGroupID()); ?> - Serialnumber: <?php echo $this->escape($bootiso->getSerialnumber()); ?></div>
+ <div class='subtitle'><?php echo $this->escape($bootiso->getGroupID()); ?>
+ <?php if(Pbs_Acl::checkRight('bai')): ?>
+ - Serialnumber: <?php echo $this->escape($bootiso->getSerialnumber()); ?>
+ <?php endif; ?>
+ </div>
<div class='details dispnone'>
- <label>PreebootID</label>
- <div class='item'><?php echo $this->escape($bootiso->getPrebootID()); ?></div>
- <label>Created</label>
+ <?php if(Pbs_Acl::checkRight('bai')): ?>
+ <label>BootmediumID</label>
+ <div class='item'><?php echo $this->escape($bootiso->getID()); ?></div>
+ <?php endif; ?>
+ <label>PrebootID</label>
+ <div class='item'><?php echo $this->escape($bootiso->getPrebootID()); ?></div>
+ <label>Changed</label>
<div class='item'><?php echo $this->escape($bootiso->getCreated()); ?></div>
<label>Expires</label>
- <div class='item'><?php echo $this->escape($bootiso->getExpires()); ?></div>
- <label>Public</label>
- <div class='item'><?php echo $this->escape($bootiso->getPublic()); ?></div>
+ <div class='item'><?php echo $this->escape($bootiso->getExpires()); ?></div>
+ <?php if(Pbs_Acl::checkRight('bai')): ?>
+ <label>Public</label>
+ <div class='item'><?php echo $this->escape($bootiso->getPublic()); ?></div>
+ <?php endif; ?>
</div>
</div>
<div class='clear'></div>
diff --git a/application/modules/user/views/scripts/bootmenu/index.phtml b/application/modules/user/views/scripts/bootmenu/index.phtml
index 0b4b12f..751b648 100644
--- a/application/modules/user/views/scripts/bootmenu/index.phtml
+++ b/application/modules/user/views/scripts/bootmenu/index.phtml
@@ -2,30 +2,35 @@
<?php if($this->notification != ''){echo $this->notification;} ?>
<div id='notification' style='display:none;'></div>
<?php echo $this->searchform; ?>
+
+<?php if(Pbs_Acl::checkRight('booc')): ?>
<?php echo $this->formButton('createbootmenu', 'Create BootMenu', array(
'onclick' => 'self.location="/user/bootmenu/createbootmenu/page/'.$this->page.'"',
'class' => 'addbutton'))?>
-
+<?php endif;?>
<div class='searchvars'>
<div class='head'>Available searchfilter:</div>
- <div class='code'>bootmenuID</div>
+ <?php if(Pbs_Acl::checkRight('booai')): ?>
+ <div class='code'>bootmenuID</div>
+ <?php endif; ?>
<div class='code'>title</div>
- <div class='code'>created</div>
+ <div class='code'>changed</div>
</div>
<div class='listelement'>
<?php if(count($this->bootmenulist)==0)
echo "There are no BootMenus to display." ?>
- <?php foreach ($this->bootmenulist as $bootmenu): ?>
+ <?php foreach ($this->bootmenulist as $k => $bootmenu): ?>
<?php
$class='';
if($bootmenu->getDefaultbootmenu() == true)
$class= 'highlight';
?>
<div class='element<?php echo " $class";?>'>
- <div class='number'><?php echo $this->escape($bootmenu->getID()); ?></div>
+ <div class='number'><?php echo $k+1 ?></div>
<div class='content'>
- <div class='actions'>
+ <div class='actions'>
+ <?php if(Pbs_Acl::checkRight('booai')): ?>
<?php if($bootmenu->getDefaultbootmenu() == true): ?>
<a><img src='/media/img/default.png' alt='Checked as default'/></a>
<?php else: ?>
@@ -41,16 +46,20 @@
true, false) ?>">
<img src='/media/img/default_grey.png' alt='Not checked as default' /></a>
<?php endif; ?>
- <a href="<?php echo $this->url(
- array(
- 'module' => 'user',
- 'controller' => 'bootmenu',
- 'action' => 'editbootmenu',
- 'bootmenuID' => $bootmenu->getID(),
- 'page' => $this->page
- ),
- 'default',
- true, false) ?>"><img src='/media/img/edit.png' alt='Edit Bootmenu'/></a>
+ <?php endif; ?>
+ <?php if(Pbs_Acl::checkRight('booe')): ?>
+ <a href="<?php echo $this->url(
+ array(
+ 'module' => 'user',
+ 'controller' => 'bootmenu',
+ 'action' => 'editbootmenu',
+ 'bootmenuID' => $bootmenu->getID(),
+ 'page' => $this->page
+ ),
+ 'default',
+ true, false) ?>"><img src='/media/img/edit.png' alt='Edit Bootmenu'/></a>
+ <?php endif; ?>
+ <?php if(Pbs_Acl::checkRight('bood')): ?>
<a href="<?php echo $this->url(
array(
'module' => 'user',
@@ -61,61 +70,82 @@
),
'default',
true) ?>"><img src='/media/img/delete.png' alt='Delete Bootmenu'/></a>
- <a href="<?php echo $this->url(
- array(
- 'module' => 'user',
- 'controller' => 'bootmenu',
- 'action' => 'addbootmenuentry',
- 'bootmenuID' => $bootmenu->getID(),
- 'maxorder' => count($this->bootmenuentrylist[$bootmenu->getID()]),
- 'page' => $this->page
- ),
- 'default',
- true) ?>"><img src='/media/img/add.png' alt='Add Entry'/></a>
+ <?php endif; ?>
+ <?php if(Pbs_Acl::checkRight('booae')): ?>
+ <a href="<?php echo $this->url(
+ array(
+ 'module' => 'user',
+ 'controller' => 'bootmenu',
+ 'action' => 'addbootmenuentry',
+ 'bootmenuID' => $bootmenu->getID(),
+ 'maxorder' => count($this->bootmenuentrylist[$bootmenu->getID()]),
+ 'page' => $this->page
+ ),
+ 'default',
+ true) ?>"><img src='/media/img/add.png' alt='Add Entry'/></a>
+ <?php endif; ?>
</div>
<div class='title'><?php echo $this->escape($bootmenu->getTitle()); ?></div>
<div class='subtitle'><?php echo count($this->bootmenuentrylist[$bootmenu->getID()]);?> Entrys - <?php echo $this->escape($bootmenu->getCreated()); ?></div>
<div class='details dispnone'>
- <?php foreach ($this->bootmenuentrylist[$bootmenu->getID()] as $bootmenuentry): ?>
+ <?php if(Pbs_Acl::checkRight('booai')): ?>
+ <label>BootmenuID</label>
+ <div class='item'><?php echo $this->escape($bootmenu->getID()); ?></div>
+ <?php endif; ?>
+ <?php foreach ($this->bootmenuentrylist[$bootmenu->getID()] as $k => $bootmenuentry): ?>
<div class='element'>
- <div class='number'><?php echo $this->escape($bootmenuentry->getID()); ?></div>
+ <div class='number'><?php echo $k+1 ?></div>
<div class='content'>
<div class='actions'>
- <a class='play' href="<?php echo $this->url(
- array(
- 'controller' => 'resource',
- 'action' => 'getbootmenuentry',
- 'bootmenuentryID' => $bootmenuentry->getID(),
- 'page' => $this->page
- ),
- 'default',
- true, false) ?>"><img src='/media/img/play.gif'></a>
- <a href="<?php echo $this->url(
- array(
- 'module' => 'user',
- 'controller' => 'bootmenu',
- 'action' => 'editbootmenuentry',
- 'bootmenuentryID' => $bootmenuentry->getID(),
- 'maxorder' => count($this->bootmenuentrylist[$bootmenu->getID()]),
- 'oldorder' => $bootmenuentry->getOrder(),
- 'page' => $this->page
- ),
- 'default',
- true, false) ?>"><img src='/media/img/edit.png' alt='Edit Entry'/></a>
- <a href="<?php echo $this->url(
- array(
- 'module' => 'user',
- 'controller' => 'bootmenu',
- 'action' => 'removebootmenuentry',
- 'bootmenuentryID' => $bootmenuentry->getID(),
- 'page' => $this->page
- ),
- 'default',
- true) ?>"><img src='/media/img/delete.png' alt='Remove Entry'/></a>
+ <?php if(Pbs_Acl::checkRight('booai')): ?>
+ <a class='play' href="<?php echo $this->url(
+ array(
+ 'controller' => 'resource',
+ 'action' => 'getbootmenuentry',
+ 'bootmenuentryID' => $bootmenuentry->getID(),
+ 'page' => $this->page
+ ),
+ 'default',
+ true, false) ?>"><img src='/media/img/play.gif'></a>
+ <?php endif; ?>
+ <?php if(Pbs_Acl::checkRight('booee') || Pbs_Acl::checkRight('booeem')): ?>
+ <a href="<?php echo $this->url(
+ array(
+ 'module' => 'user',
+ 'controller' => 'bootmenu',
+ 'action' => 'editbootmenuentry',
+ 'bootmenuentryID' => $bootmenuentry->getID(),
+ 'maxorder' => count($this->bootmenuentrylist[$bootmenu->getID()]),
+ 'oldorder' => $bootmenuentry->getOrder(),
+ 'page' => $this->page
+ ),
+ 'default',
+ true, false) ?>"><img src='/media/img/edit.png' alt='Edit Entry'/></a>
+ <?php endif; ?>
+ <?php if(Pbs_Acl::checkRight('boode')): ?>
+ <a href="<?php echo $this->url(
+ array(
+ 'module' => 'user',
+ 'controller' => 'bootmenu',
+ 'action' => 'removebootmenuentry',
+ 'bootmenuentryID' => $bootmenuentry->getID(),
+ 'page' => $this->page
+ ),
+ 'default',
+ true) ?>"><img src='/media/img/delete.png' alt='Remove Entry'/></a>
+ <?php endif; ?>
</div>
+ <?php if(!Pbs_Acl::checkRight('booai')){
+ $bootmenuentry->setBootosID(preg_replace("!^\[[0-9]+\]\s!",'',$bootmenuentry->getBootosID()));
+ $bootmenuentry->setConfigID(preg_replace("!^\[[0-9]+\]\s!",'',$bootmenuentry->getConfigID()));
+ } ?>
<div class='title'><?php echo $this->escape($bootmenuentry->getTitle()); ?></div>
<div class='subtitle'><?php echo $this->escape($bootmenuentry->getBootosID()) ?></div>
<div class='details dispnone'>
+ <?php if(Pbs_Acl::checkRight('booai')): ?>
+ <label>BootmenuentryID</label>
+ <div class='item'><?php echo $this->escape($bootmenuentry->getID()); ?></div>
+ <?php endif; ?>
<label>Default KCL</label>
<div class='item'><?php echo $this->escape($bootmenuentry->getKcl()); ?></div>
<label>KCL-Append</label>
diff --git a/application/modules/user/views/scripts/bootos/index.phtml b/application/modules/user/views/scripts/bootos/index.phtml
index 99ddfc3..d135ed3 100644
--- a/application/modules/user/views/scripts/bootos/index.phtml
+++ b/application/modules/user/views/scripts/bootos/index.phtml
@@ -1,89 +1,114 @@
<h1>BootOS</h1>
<?php if($this->notification != ''){echo $this->notification;} ?>
<?php echo $this->searchform; ?>
+
+<?php if(Pbs_Acl::checkRight('bou')): ?>
<?php echo $this->formButton('checkupdate', 'Check for Updates', array(
'onclick' => 'self.location="/user/bootos/index/page/'.$this->page.'/checkupdate/true"',
'class' => 'updatebutton',
))?>
+<?php endif;?>
+<?php if(Pbs_Acl::checkRight('boc')): ?>
<?php echo $this->formButton('createbootos', 'Create BootOS', array(
'onclick' => 'self.location="/user/bootos/createbootos/page/'.$this->page.'"',
'class' => 'addbutton'))?>
-
+<?php endif;?>
<div class='searchvars'>
<div class='head'>Available searchfilter:</div>
- <div class='code'>bootosID</div>
+ <?php if(Pbs_Acl::checkRight('boai')): ?>
+ <div class='code'>bootosID</div>
+ <div class='code'>public</div>
+ <div class='code'>kernel</div>
+ <div class='code'>kcl</div>
+ <div class='code'>init</div>
+ <?php endif; ?>
+
<div class='code'>title</div>
<div class='code'>groupID</div>
<div class='code'>configID</div>
- <div class='code'>init</div>
- <div class='code'>kernel</div>
- <div class='code'>kcl</div>
<div class='code'>description</div>
- <div class='code'>changed</div>
+ <div class='code'>created</div>
<div class='code'>expires</div>
- <div class='code'>public</div>
</div>
<div class='listelement'>
<?php if(count($this->bootoslist)==0)
echo "There are no BootOs's to display." ?>
- <?php foreach ($this->bootoslist as $bootos): ?>
+ <?php foreach ($this->bootoslist as $k => $bootos): ?>
<div class='element'>
- <div class='number'><?php echo $this->escape($bootos->getID()); ?></div>
+ <div class='number'><?php echo $k+1 ?></div>
<div class='content'>
<div class='actions'>
- <?php if($this->update[$bootos->getID()]==true): ?>
- <a href="<?php echo $this->url(
+ <?php if(Pbs_Acl::checkRight('bou')): ?>
+ <?php if($this->update[$bootos->getID()]==true): ?>
+ <a href="<?php echo $this->url(
+ array(
+ 'module' => 'user',
+ 'controller' => 'bootos',
+ 'action' => 'updatebootos',
+ 'bootosID' => $bootos->getID(),
+ 'page' => $this->page
+ ),
+ 'default',
+ true, false) ?>"><img src='/media/img/update.png' alt='Updates available' /></a></td>
+ <?php else: ?>
+ <a><img src='/media/img/update_grey.png' alt='No updates available' /></a>
+ <?php endif; ?>
+ <?php endif; ?>
+ <?php if(Pbs_Acl::checkRight('boe') || Pbs_Acl::checkRight('boem')): ?>
+ <a href="<?php echo $this->url(
+ array(
+ 'module' => 'user',
+ 'controller' => 'bootos',
+ 'action' => 'editbootos',
+ 'bootosID' => $bootos->getID(),
+ 'page' => $this->page
+ ),
+ 'default',
+ true, false) ?>"><img src='/media/img/edit.png' alt='Edit BootOS' /></a>
+ <?php endif; ?>
+ <?php if(Pbs_Acl::checkRight('bod')): ?>
+ <a href="<?php echo $this->url(
array(
'module' => 'user',
'controller' => 'bootos',
- 'action' => 'updatebootos',
+ 'action' => 'deletebootos',
'bootosID' => $bootos->getID(),
'page' => $this->page
),
'default',
- true, false) ?>"><img src='/media/img/update.png' alt='Updates available' /></a></td>
- <?php else: ?>
- <a><img src='/media/img/update_grey.png' alt='No updates available' /></a>
- <?php endif; ?>
- <a href="<?php echo $this->url(
- array(
- 'module' => 'user',
- 'controller' => 'bootos',
- 'action' => 'editbootos',
- 'bootosID' => $bootos->getID(),
- 'page' => $this->page
- ),
- 'default',
- true, false) ?>"><img src='/media/img/edit.png' alt='Edit BootOS' /></a>
- <a href="<?php echo $this->url(
- array(
- 'module' => 'user',
- 'controller' => 'bootos',
- 'action' => 'deletebootos',
- 'bootosID' => $bootos->getID(),
- 'page' => $this->page
- ),
- 'default',
- true) ?>"><img src='/media/img/delete.png' alt='Delete BootOS' /></a>
+ true) ?>"><img src='/media/img/delete.png' alt='Delete BootOS' /></a>
+ <?php endif; ?>
</div>
+ <?php if(!Pbs_Acl::checkRight('boai')){
+ $bootos->setConfigID(preg_replace("!^\[[0-9]+\]\s!",'',$bootos->getConfigID()));
+ $bootos->setGroupID(preg_replace("!^\[[0-9]+\]\s!",'',$bootos->getGroupID()));
+ } ?>
<div class='title'><?php echo $this->escape($bootos->getTitle()); ?></div>
<div class='subtitle'><?php echo $this->escape($bootos->getGroupID()); ?> - <?php echo $this->escape($bootos->getDescription()); ?></div>
<div class='details dispnone'>
+ <?php if(Pbs_Acl::checkRight('boai')): ?>
+ <label>BootosID</label>
+ <div class='item'><?php echo $this->escape($bootos->getID()); ?></div>
+ <?php endif; ?>
<label>ConfigID</label>
<div class='item'><?php echo $this->escape($bootos->getConfigID()); ?></div>
- <label>initPath</label>
- <div class='item'><?php echo $this->escape($bootos->getPath_init()); ?></div>
- <label>kernelPath</label>
- <div class='item'><?php echo $this->escape($bootos->getPath_kernel()); ?></div>
- <label>Default KCL</label>
- <div class='item'><?php echo $this->escape($bootos->getDefaultkcl()); ?></div>
- <label>Created</label>
+ <?php if(Pbs_Acl::checkRight('boai')): ?>
+ <label>initPath</label>
+ <div class='item'><?php echo $this->escape($bootos->getPath_init()); ?></div>
+ <label>kernelPath</label>
+ <div class='item'><?php echo $this->escape($bootos->getPath_kernel()); ?></div>
+ <label>Default KCL</label>
+ <div class='item'><?php echo $this->escape($bootos->getDefaultkcl()); ?></div>
+ <?php endif; ?>
+ <label>Changed</label>
<div class='item'><?php echo $this->escape($bootos->getCreated()); ?></div>
<label>Expires</label>
<div class='item'><?php echo $this->escape($bootos->getExpires()); ?></div>
- <label>Public</label>
- <div class='item'><?php echo $this->escape($bootos->getPublic()); ?></div>
+ <?php if(Pbs_Acl::checkRight('boai')): ?>
+ <label>Public</label>
+ <div class='item'><?php echo $this->escape($bootos->getPublic()); ?></div>
+ <?php endif; ?>
</div>
</div>
diff --git a/application/modules/user/views/scripts/config/index.phtml b/application/modules/user/views/scripts/config/index.phtml
index 28200e2..7966a3e 100644
--- a/application/modules/user/views/scripts/config/index.phtml
+++ b/application/modules/user/views/scripts/config/index.phtml
@@ -2,11 +2,25 @@
<?php if($this->notification != ''){echo $this->notification;} ?>
<?php echo $this->searchform; ?>
+<?php $conflabel = $this->type == 'own'?'group':'own';?>
+
+<?php if((Pbs_Acl::checkRight('cc') && $this->type == 'group') || (Pbs_Acl::checkRight('cco') && $this->type == 'own')): ?>
<?php echo $this->formButton('createconfig', 'Create Config', array(
- 'onclick' => 'self.location="/user/config/createconfig/page/'.$this->page.'"',
+ 'onclick' => 'self.location="/user/config/createconfig/type/'.$this->type.'/page/'.$this->page.'"',
+ 'class' => 'addbutton'))?>
+<?php endif;?>
+
+<?php if(Pbs_Acl::checkRight('csui')): ?>
+<?php echo $this->formButton('ownconfig', 'Show '.$conflabel.' configs', array(
+ 'onclick' => 'self.location="/user/config/index/type/'.$conflabel.'/page/'.$this->page.'"',
'class' => 'addbutton'))?>
+<?php endif;?>
+
<div class='searchvars'>
<div class='head'>Available searchfilter:</div>
+ <?php if(Pbs_Acl::checkRight('csai')): ?>
+ <div class='code'>configID</div>
+ <?php endif; ?>
<div class='code'>title</div>
<div class='code'>shellscript</div>
<div class='code'>created</div>
@@ -15,36 +29,44 @@
<div class='listelement'>
<?php if(count($this->configlist)==0)
echo "There are no Config's to display." ?>
- <?php foreach ($this->configlist as $config): ?>
+ <?php foreach ($this->configlist as $k => $config): ?>
<div class='element'>
- <?php if(Pbs_Acl::checkRight('csai')): ?>
- <div class='number'><?php echo $this->escape($config->getID()); ?></div>
- <?php endif; ?>
+ <div class='number'><?php echo $k+1; ?></div>
<div class='content'>
<div class='actions'>
+ <?php if(((Pbs_Acl::checkRight('ce') || Pbs_Acl::checkRight('cem')) && $this->type == 'group') || ($this->type == 'own' && Pbs_Acl::checkRight('ceo'))): ?>
<a href="<?php echo $this->url(
array(
'module' => 'user',
'controller' => 'config',
'action' => 'editconfig',
+ 'type' => $this->type,
'configID' => $config->getID(),
'page' => $this->page
),
'default',
true, false) ?>"><img src='/media/img/edit.png' alt='Edit Config'/></a>
+ <?php endif; ?>
+ <?php if((Pbs_Acl::checkRight('cd') && $this->type == 'group') || ($this->type == 'own' && Pbs_Acl::checkRight('cdo'))): ?>
<a href="<?php echo $this->url(
array(
'module' => 'user',
'controller' => 'config',
'action' => 'deleteconfig',
+ 'type' => $this->type,
'configID' => $config->getID(),
'page' => $this->page
),
'default',
true) ?>"><img src='/media/img/delete.png' alt='Delete Config'/></a>
+ <?php endif; ?>
</div>
<div class='title'><?php echo $this->escape($config->getTitle()); ?></div>
<div class='details'>
+ <?php if(Pbs_Acl::checkRight('csai')): ?>
+ <label>ConfigID</label>
+ <div class='item'><?php echo $this->escape($config->getID()); ?></div>
+ <?php endif; ?>
<label>Shellscript</label>
<div class='item'><?php echo $this->escape($config->getShellscript()); ?></div>
<label>Created</label>
diff --git a/application/modules/user/views/scripts/preboot/index.phtml b/application/modules/user/views/scripts/preboot/index.phtml
index fc0d07d..dba956c 100644
--- a/application/modules/user/views/scripts/preboot/index.phtml
+++ b/application/modules/user/views/scripts/preboot/index.phtml
@@ -1,13 +1,18 @@
<h1>Preboot</h1>
<?php if($this->notification != ''){echo $this->notification;} ?>
<?php echo $this->searchform; ?>
+
+<?php if(Pbs_Acl::checkRight('pru')): ?>
<?php echo $this->formButton('checkupdate', 'Check for Updates', array(
'onclick' => 'self.location="/user/preboot/index/checkupdate/true"',
'class' => 'updatebutton',
))?>
+<?php endif;?>
+<?php if(Pbs_Acl::checkRight('prc')): ?>
<?php echo $this->formButton('createpreboot', 'Create PreBoot', array(
'onclick' => 'self.location="/user/preboot/createpreboot/page/'.$this->page.'"',
'class' => 'addbutton'))?>
+<?php endif;?>
<div class='searchvars'>
<div class='head'>Available searchfilter:</div>
<div class='code'>prebootID</div>
@@ -18,48 +23,56 @@
<div class='listelement'>
<?php if(count($this->prebootlist)==0)
echo "There are no Preboot entries to display." ?>
- <?php foreach ($this->prebootlist as $preboot): ?>
+ <?php foreach ($this->prebootlist as $k => $preboot): ?>
<div class='element'>
- <div class='number'><?php echo $this->escape($preboot->getID()); ?></div>
+ <div class='number'><?php echo $k+1 ?></div>
<div class='content'>
<div class='actions'>
- <?php if($this->update[$preboot->getID()]==true): ?><a href="<?php echo $this->url(
- array(
- 'module' => 'user',
- 'controller' => 'preboot',
- 'action' => 'updatepreboot',
- 'prebootID' => $preboot->getID(),
- 'page' => $this->page
- ),
- 'default',
- true, false) ?>"><img src='/media/img/update.png' alt='Updates available' /></a>
- <?php else: ?>
- <a><img src='/media/img/update_grey.png' alt='No updates available' /></a>
- <?php endif; ?>
- <a href="<?php echo $this->url(
- array(
- 'module' => 'user',
- 'controller' => 'preboot',
- 'action' => 'editpreboot',
- 'prebootID' => $preboot->getID(),
- 'page' => $this->page
- ),
- 'default',
- true, false) ?>"><img src='/media/img/edit.png' alt='Edit Preboot' /></a>
- <a href="<?php echo $this->url(
- array(
- 'module' => 'user',
- 'controller' => 'preboot',
- 'action' => 'deletepreboot',
- 'prebootID' => $preboot->getID(),
- 'page' => $this->page
- ),
- 'default',
- true) ?>"><img src='/media/img/delete.png' alt='Delete Preboot'/></a>
+ <?php if(Pbs_Acl::checkRight('pru')): ?>
+ <?php if($this->update[$preboot->getID()]==true): ?><a href="<?php echo $this->url(
+ array(
+ 'module' => 'user',
+ 'controller' => 'preboot',
+ 'action' => 'updatepreboot',
+ 'prebootID' => $preboot->getID(),
+ 'page' => $this->page
+ ),
+ 'default',
+ true, false) ?>"><img src='/media/img/update.png' alt='Updates available' /></a>
+ <?php else: ?>
+ <a><img src='/media/img/update_grey.png' alt='No updates available' /></a>
+ <?php endif; ?>
+ <?php endif; ?>
+ <?php if(Pbs_Acl::checkRight('pre') || Pbs_Acl::checkRight('prem')): ?>
+ <a href="<?php echo $this->url(
+ array(
+ 'module' => 'user',
+ 'controller' => 'preboot',
+ 'action' => 'editpreboot',
+ 'prebootID' => $preboot->getID(),
+ 'page' => $this->page
+ ),
+ 'default',
+ true, false) ?>"><img src='/media/img/edit.png' alt='Edit Preboot' /></a>
+ <?php endif; ?>
+ <?php if(Pbs_Acl::checkRight('prd')): ?>
+ <a href="<?php echo $this->url(
+ array(
+ 'module' => 'user',
+ 'controller' => 'preboot',
+ 'action' => 'deletepreboot',
+ 'prebootID' => $preboot->getID(),
+ 'page' => $this->page
+ ),
+ 'default',
+ true) ?>"><img src='/media/img/delete.png' alt='Delete Preboot'/></a>
+ <?php endif; ?>
</div>
<div class='title'><?php echo $this->escape($preboot->getTitle()); ?></div>
<div class='details'>
- <label>Prebootpath:</label>
+ <label>PrebootID</label>
+ <div class='item'><?php echo $this->escape($preboot->getID()); ?></div>
+ <label>Prebootpath</label>
<div class='item'><?php echo $this->escape($preboot->getPath_preboot()); ?></div>
</div>
</div>