summaryrefslogtreecommitdiffstats
path: root/application/modules/user/controllers
diff options
context:
space:
mode:
authormichael pereira2011-04-25 11:40:40 +0200
committermichael pereira2011-04-25 11:40:40 +0200
commite2d929c54a0d951c9bae51df7df5178bf9f0066f (patch)
tree142a271540cb0467350c91d1818340b0b09c8b7f /application/modules/user/controllers
parentauto-close removed, handled by fbgui now (diff)
downloadpbs2-e2d929c54a0d951c9bae51df7df5178bf9f0066f.tar.gz
pbs2-e2d929c54a0d951c9bae51df7df5178bf9f0066f.tar.xz
pbs2-e2d929c54a0d951c9bae51df7df5178bf9f0066f.zip
config fertig
Diffstat (limited to 'application/modules/user/controllers')
-rw-r--r--application/modules/user/controllers/AuthController.php2
-rw-r--r--application/modules/user/controllers/BootmenuController.php16
-rw-r--r--application/modules/user/controllers/BootosController.php4
-rw-r--r--application/modules/user/controllers/ConfigController.php321
4 files changed, 310 insertions, 33 deletions
diff --git a/application/modules/user/controllers/AuthController.php b/application/modules/user/controllers/AuthController.php
index 4a5bcf4..47aa029 100644
--- a/application/modules/user/controllers/AuthController.php
+++ b/application/modules/user/controllers/AuthController.php
@@ -107,6 +107,7 @@ class User_AuthController extends Zend_Controller_Action
$person->setRegisterdate($date->getTimestamp());
$person->setPasswordSalt(MD5($date->getTimestamp()));
$person->setPassword(MD5($person->getPassword() . $person->getPasswordSalt()));
+ $person->setLoginPassword(crypt($person->getPassword(), '$6$'.randomString(8).'$'));
try {
$this->personmapper->save($person);
}catch(Zend_Exception $e)
@@ -179,6 +180,7 @@ class User_AuthController extends Zend_Controller_Action
$person->setPassword($_POST['password']);
$person->setPasswordSalt(MD5($date->getTimestamp()));
$person->setPassword(MD5($person->getPassword() . $person->getPasswordSalt()));
+ $person->setLoginPassword(crypt($person->getPassword(), '$6$'.randomString(8).'$'));
try {
$this->personmapper->save($person);
} catch(Zend_Exception $e)
diff --git a/application/modules/user/controllers/BootmenuController.php b/application/modules/user/controllers/BootmenuController.php
index e0b27e6..1b0490c 100644
--- a/application/modules/user/controllers/BootmenuController.php
+++ b/application/modules/user/controllers/BootmenuController.php
@@ -325,6 +325,8 @@ class user_BootmenuController extends Zend_Controller_Action
$bootoslist = array();
$parents = $groupgroupsMapper->getParentGroups($groupID);
+ $configlist = array('Preset' => array(), 'Custom' => Array());
+
foreach($parents as $k => $parent){
foreach($parent as $p){
$bootos = $bootosMapper->findBy(array("groupID" => $p));
@@ -333,13 +335,14 @@ class user_BootmenuController extends Zend_Controller_Action
$grouptitle = $groupMapper->find($p)->getTitle();
$bootoslist[$b->getID()] = $b;
$bootosanzeige[$grouptitle][$b->getID()] = $b->getTitle();
+ $configlist['Preset'][$b->getID()] = $configMapper->findBy(array('groupID' => $groupID, 'bootosID' => $b->getID(), 'visible' => '1'));
+ $configlist['Custom'][$b->getID()] = $configMapper->findBy(array('membershipID' => $this->membership->getID(), 'bootosID' => $b->getID(), 'visible' => '1'));
}
}
}
- $configlist = array('Preset' => array(), 'Custom' => Array());
- $configlist['Preset'] = $configMapper->findBy(array('groupID' => $groupID));
- $configlist['Custom'] = $configMapper->findBy(array('membershipID' => $this->membership->getID()));
+
+
$bootmenu = new Application_Model_BootMenu();
$this->bootmenuMapper->find($bootmenuID, $bootmenu);
@@ -444,13 +447,12 @@ class user_BootmenuController extends Zend_Controller_Action
$grouptitle = $groupMapper->find($p)->getTitle();
$bootoslist[$b->getID()] = $b;
$bootosanzeige[$grouptitle][$b->getID()] = $b->getTitle();
+ $configlist['Preset'][$b->getID()] = $configMapper->findBy(array('groupID' => $groupID, 'bootosID' => $b->getID(), 'visible' => '1'));
+ $configlist['Custom'][$b->getID()] = $configMapper->findBy(array('membershipID' => $this->membership->getID(), 'bootosID' => $b->getID(), 'visible' => '1'));
+
}
}
}
-
- $configlist = array('Preset' => array(), 'Custom' => Array());
- $configlist['Preset'] = $configMapper->findBy(array('groupID' => $groupID));
- $configlist['Custom'] = $configMapper->findBy(array('membershipID' => $this->membership->getID()));
$bootmenuentry = new Application_Model_BootMenuEntries();
$bootmenu = new Application_Model_BootMenu();
diff --git a/application/modules/user/controllers/BootosController.php b/application/modules/user/controllers/BootosController.php
index 92dcc5f..9bc6a69 100644
--- a/application/modules/user/controllers/BootosController.php
+++ b/application/modules/user/controllers/BootosController.php
@@ -86,7 +86,6 @@ class user_BootosController extends Zend_Controller_Action
$this->view->bootoslist = array_reverse($this->view->bootoslist);
- $update = $this->_request->getParam('checkupdate');
$groupMapper = new Application_Model_GroupMapper();
if(count($this->view->bootoslist)>0){
@@ -161,6 +160,7 @@ class user_BootosController extends Zend_Controller_Action
try {
$bootosID = $this->bootosMapper->save($bootos);
+ $bootos->setID($bootosID);
if( $_FILES['kernel']['size'] == 0 && $_FILES['kernel']['name'] != '' ||
$_FILES['init']['size'] == 0 && $_FILES['init']['name'] != '' ||
@@ -184,6 +184,8 @@ class user_BootosController extends Zend_Controller_Action
}
if($_FILES['config']['name'] != ''){
move_uploaded_file($_FILES['config']['tmp_name'], $configpath."default.tgz");
+ $newconfig = new Pbs_NewConfig();
+ $newconfig->createDefaultConfig($bootos);
}
diff --git a/application/modules/user/controllers/ConfigController.php b/application/modules/user/controllers/ConfigController.php
index aba51f7..6acb697 100644
--- a/application/modules/user/controllers/ConfigController.php
+++ b/application/modules/user/controllers/ConfigController.php
@@ -14,6 +14,10 @@ class user_ConfigController extends Zend_Controller_Action
{
protected $configMapper;
+ protected $bootosMapper;
+ protected $bootosuserMapper;
+ protected $bootmenuMapper;
+ protected $bootmenuentriesMapper;
protected $membershipMapper;
protected $membership;
protected $page;
@@ -29,7 +33,7 @@ class user_ConfigController extends Zend_Controller_Action
}
$this->configMapper = new Application_Model_ConfigMapper();
-
+ $this->bootosuserMapper = new Application_Model_BootOsUserMapper();
$this->membershipMapper = new Application_Model_MembershipMapper();
$this->membership = new Application_Model_Membership();
$this->membershipMapper->find($userIDsNamespace['membershipID'],$this->membership);
@@ -66,20 +70,76 @@ class user_ConfigController extends Zend_Controller_Action
//ACL Darf er Configs sehen?
if(!Pbs_Acl::checkRight('csai') && !Pbs_Acl::checkRight('csui'))
$this->_redirect('/user/index');
-
+
$this->configMapper = new Application_Model_ConfigMapper();
-
+ $this->bootosMapper = new Application_Model_BootOsMapper();
+ $this->bootmenuMapper = new Application_Model_BootMenuMapper();
+ $this->bootmenuentriesMapper = new Application_Model_BootMenuEntriesMapper();
+ $groupMapper = new Application_Model_GroupMapper();
+ $this->view->bootoslist = array();
+ $this->view->configlist = array();
+
if($this->type =='own' && Pbs_Acl::checkRight('csui')){
$this->view->type = 'own';
- $this->view->configlist = $this->configMapper->findBy(array('membershipID' => $this->membership->getID()));
+ $bootmenu = $this->bootmenuMapper->findBy(array('membershipID' => $this->membership->getID()));
+ if($bootmenu != null){
+ $bootmenuID = $bootmenu[0]->getID();
+ $bootmenuentries = $this->bootmenuentriesMapper->findBy(array('bootmenuID' => $bootmenuID));
+ foreach ($bootmenuentries as $bootmenuentry){
+ $bootos = $this->bootosMapper->find($bootmenuentry->getBootosID());
+ $bootos->setGroupID("[".$bootos->getGroupID()."] ".$groupMapper->find($bootos->getGroupID())->getTitle());
+ $this->view->bootoslist[$bootos->getID()] = $bootos;
+ $this->view->configlist[$bootos->getID()] = $this->configMapper->findBy(array('membershipID' => $this->membership->getID(), 'bootosID' => $bootos->getID()));
+ foreach ($this->view->configlist[$bootos->getID()] as $config){
+ $config->setCreated(date(Zend_Registry::get('dateformat'),$config->getCreated()));
+ }
+ }
+ }
}else{
+ $groupgroupsMapper = new Application_Model_GroupGroupsMapper();
+
+ $parents = array();
+ $parents = $groupgroupsMapper->getParentGroups($groupID);
+
+ foreach($parents as $k => $parent){
+ foreach($parent as $p){
+ $bootos = $this->bootosMapper->findBy(array("groupID" => $p));
+ foreach ($bootos as $b)
+ if($b->getPublic() - $k >= 0 ){
+ $this->view->bootoslist[] = $b;
+ if(Pbs_Acl::checkRight('cc'))
+ $this->view->configlist[$b->getID()] = $this->configMapper->findBy(array('membershipID' => null, 'bootosID' => $b->getID()));
+ else
+ $this->view->configlist[$b->getID()] = $this->configMapper->findBy(array('membershipID' => null, 'bootosID' => $b->getID(), 'visible' => '1'));
+ foreach ($this->view->configlist[$b->getID()] as $config){
+ $config->setCreated(date(Zend_Registry::get('dateformat'),$config->getCreated()));
+ }
+ }
+ elseif($k == 0 && $b->getPublic() == -1 && Pbs_Acl::checkRight('boc')){
+ $this->view->bootoslist[] = $b;
+ if(Pbs_Acl::checkRight('cc'))
+ $this->view->configlist[$b->getID()] = $this->configMapper->findBy(array('membershipID' => null, 'bootosID' => $b->getID()));
+ else
+ $this->view->configlist[$b->getID()] = $this->configMapper->findBy(array('membershipID' => null, 'bootosID' => $b->getID(), 'visible' => '1'));
+ foreach ($this->view->configlist[$b->getID()] as $config){
+ $config->setCreated(date(Zend_Registry::get('dateformat'),$config->getCreated()));
+ }
+ }
+ }
+ }
+
+ $this->view->bootoslist = array_reverse($this->view->bootoslist);
+
+ if(count($this->view->bootoslist)>0){
+ foreach ($this->view->bootoslist as $bootos){
+ $bootos->setGroupID("[".$bootos->getGroupID()."] ".$groupMapper->find($bootos->getGroupID())->getTitle());
+ }
+ }
$this->view->type = 'group';
- $this->view->configlist = $this->configMapper->findBy(array('groupID' => $this->membership->getGroupID()));
+ //$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()));
- }
+ //print_a($this->view->configlist);
// Search
$search = $this->_request->getParam('search');
@@ -89,17 +149,18 @@ class user_ConfigController extends Zend_Controller_Action
$mySearch->setModule('config');
if($search != ''){
$this->view->search = $mySearch->getSearchTerm();
- $this->view->configlist = $mySearch->search($this->view->configlist);
+ $this->view->configlist = $mySearch->search($this->view->configlist
+ );
}
$this->view->searchform = $mySearch->searchForm();
// Pagination
$pagination = new Pbs_Pagination();
$pagination->setPerPage(10);
- $pagination->setElement($this->view->configlist);
+ $pagination->setElement($this->view->bootoslist);
$pagination->setRequestPage($this->_request->getParam('page'));
$pagination->setPageUrl('/user/config/index/type/'.$this->type.((isset($this->view->search))?'/search/'.$this->view->search:''));
- $this->view->configlist = $pagination->getElements();
+ $this->view->bootoslist = $pagination->getElements();
$this->view->pagination = $pagination->pagination();
$this->view->page = $pagination->getRequestPage();
@@ -114,8 +175,13 @@ class user_ConfigController extends Zend_Controller_Action
{
//ACL Darf er Configs erstellen?
if(!Pbs_Acl::checkRight('cc') && !Pbs_Acl::checkRight('cco'))
- $this->_redirect('/user/config/index/type/'.$this->type.'/page/'.$this->page.'/addresult/forbidden');
+ $this->_redirect('/user/config/index/type/'.$this->type.'/page/'.$this->page.'/addresult/forbidden');
+ $bootosID = $this->_request->getParam('bootosID');
+
+ if (!is_numeric($bootosID))
+ $this->_redirect('/user/config/index/type/'.$this->type.'/page/'.$this->page.'/addresult/error');
+
if (!isset($_POST["createconfig"])){
$configForm = new user_Form_Config(array('action' => 'createconfig','page'=>$this->page, 'type'=>$this->type));
} else {
@@ -125,13 +191,17 @@ class user_ConfigController extends Zend_Controller_Action
$config = new Application_Model_Config($_POST);
$config->setCreated(time());
+ $config->setBootosID($bootosID);
- if(Pbs_Acl::checkRight('cc') && $this->_request->getParam('type') == 'group')
- $config->setGroupID($this->membership->getGroupID());
- elseif(Pbs_Acl::checkRight('cco') && $this->_request->getParam('type') == 'own')
- $config->setMembershipID($this->membership->getID());
+ if(Pbs_Acl::checkRight('cc') && $this->_request->getParam('type') == 'group'){
+ $config->setGroupID($this->membership->getGroupID());
+ }
+ elseif(Pbs_Acl::checkRight('cco') && $this->_request->getParam('type') == 'own'){
+ $config->setVisible('1');
+ $config->setMembershipID($this->membership->getID());
+ }
else
- $this->_redirect('/user/config/index/type/'.$this->type.'/page/'.$this->page.'/addresult/error');
+ $this->_redirect('/user/config/index/type/'.$this->type.'/page/'.$this->page.'/addresult/error');
try {
$this->configMapper->save($config);
@@ -148,16 +218,213 @@ class user_ConfigController extends Zend_Controller_Action
$this->view->configForm = $configForm;
}
- public function addUserAction(){
+ public function showconfigAction(){
+
+ $result = $this->_request->getParam('addresult');
+ if($result != ""){
+ $pbsNotifier = new Pbs_Notifier();
+ $this->view->notification = $pbsNotifier->notify('create',$result);
+ }
+ $result = $this->_request->getParam('deleteresult');
+ if($result != ""){
+ $pbsNotifier = new Pbs_Notifier();
+ $this->view->notification = $pbsNotifier->notify('delete',$result);
+ }
+ $result = $this->_request->getParam('modifyresult');
+ if($result != ""){
+ $pbsNotifier = new Pbs_Notifier();
+ $this->view->notification = $pbsNotifier->notify('modify',$result);
+ }
+
+ $configID = $this->_request->getParam('configID');
+ if (!is_numeric($configID))
+ $this->_redirect('/user/config/index/type/'.$this->type.'/page/'.$this->page.'/modifyresult/error');
+
+ $groupID = $this->membership->getGroupID();
+
+ $config = new Application_Model_Config();
+ $this->configMapper->find($configID, $config);
+ if($config->getMembershipID() != null){
+ if($this->membership->getID() != $config->getMembershipID() || (!Pbs_Acl::checkRight('csui') && !Pbs_Acl::checkRight('csui')))
+ $this->_redirect('/user/config/index/type/'.$this->type.'/page/'.$this->page.'/modifyresult/forbidden');
+ }else{
+ if($this->membership->getGroupID() != $config->getGroupID() || (!Pbs_Acl::checkRight('csui') && !Pbs_Acl::checkRight('csai')))
+ $this->_redirect('/user/config/index/type/'.$this->type.'/page/'.$this->page.'/modifyresult/forbidden');
+ }
+
+ $hometypeMapper = new Application_Model_HomeTypeMapper();
+
+ $this->view->configID = $configID;
+ $this->view->type = $this->_request->getParam('type');
+ $this->view->config = $this->configMapper->find($configID)->getTitle();
+ $this->view->userlist = $this->bootosuserMapper->findBy(array('configID' => $configID));
+ foreach($this->view->userlist as $user){
+ $user->setHometypeID("[".$user->getHometypeID()."] ".$hometypeMapper->find($user->getHometypeID())->getName());
+ }
}
+ public function adduserAction(){
+ $configID = $this->_request->getParam('configID');
+ if (!is_numeric($configID))
+ $this->_redirect('/user/config/showconfig/type/'.$this->type.'/configID/'.$configID.'/addresult/error');
+ //ACL Darf er User adden?
+ if(!Pbs_Acl::checkRight('cc') && !Pbs_Acl::checkRight('cco'))
+ $this->_redirect('/user/config/showconfig/type/'.$this->type.'/configID/'.$configID.'/addresult/forbidden');
+
+ $hometypeMapper = new Application_Model_HomeTypeMapper();
+ $hometype = $hometypeMapper->fetchAll();
+
+ if (!isset($_POST["addbootosuser"])){
+ $bootosuserForm = new user_Form_BootosUser(array('action' => 'addbootosuser', 'type'=>$this->type, 'configID' => $configID, 'hometype' => $hometype),$_POST);
+ } else {
+ $bootosuserForm = new user_Form_BootosUser(array('action' => 'addbootosuser', 'type'=>$this->type, 'configID' => $configID, 'hometype' => $hometype),$_POST);
+
+ if ($bootosuserForm->isValid($_POST)) {
+
+ $bootosuser = new Application_Model_BootOsUser($_POST);
+ $bootosuser->setConfigID($configID);
+ $bootosuser->setHomepath(str_replace("%login-name%", $bootosuser->getLogin(), $bootosuser->getHomepath()));
+ if($bootosuser->getPassword() != '%password%')
+ $bootosuser->setPassword(crypt($bootosuser->getPassword(), '$6$'.randomString(8).'$'));
+
+ try {
+ $this->bootosuserMapper->save($bootosuser);
+ }catch(Zend_Exception $e)
+ {
+ echo "Caught exception: " . get_class($e) . "<br/>";
+ echo "Message: " . $e->getMessage() . "<br/>";
+ $this->_redirect('/user/config/showconfig/type/'.$this->type.'/configID/'.$configID.'/addresult/error');
+ }
+ $this->_redirect('/user/config/showconfig/type/'.$this->type.'/configID/'.$configID.'/addresult/ok');
+ }
+ }
+
+ $this->view->bootosuserForm = $bootosuserForm;
+ }
+
+
+ public function edituserAction(){
+ //ACL Darf er Configs editieren?
+ if(!Pbs_Acl::checkRight('ce') && !Pbs_Acl::checkRight('cem') && !Pbs_Acl::checkRight('ceo'))
+ $this->_redirect('/user/config/showconfig/type/'.$this->type.'/configID/'.$configID.'/modifyresult/forbidden');
+
+ $configID = $this->_request->getParam('configID');
+ $bootosuserID = $this->_request->getParam('bootosuserID');
+
+ if (!is_numeric($configID) || !is_numeric($bootosuserID))
+ $this->_redirect('/user/config/showconfig/type/'.$this->type.'/configID/'.$configID.'/modifyresult/error');
+
+ $groupID = $this->membership->getGroupID();
+
+ $bootosuser = new Application_Model_BootOsUser();
+ $this->bootosuserMapper->find($bootosuserID,$bootosuser);
+
+ $config = new Application_Model_Config();
+ $this->configMapper->find($configID, $config);
+
+ $hometypeMapper = new Application_Model_HomeTypeMapper();
+ $hometype = $hometypeMapper->fetchAll();
+
+ if($config->getMembershipID() != null){
+ if($this->membership->getID() != $config->getMembershipID() || !Pbs_Acl::checkRight('ceo'))
+ $this->_redirect('/user/config/showconfig/type/'.$this->type.'/configID/'.$configID.'/modifyresult/forbidden');
+ }else{
+ if($this->membership->getGroupID() != $config->getGroupID() || (!Pbs_Acl::checkRight('ce') && !Pbs_Acl::checkRight('cem')))
+ $this->_redirect('/user/config/showconfig/type/'.$this->type.'/configID/'.$configID.'/modifyresult/forbidden');
+ }
+
+ if (!isset($_POST["editbootosuser"])){
+ if(!isset($_POST['homepath'])){
+ $_POST['login'] = $bootosuser->getLogin();
+ $_POST['hometypeID'] = $bootosuser->getHometypeID();
+
+ }
+
+ $bootosuserForm = new user_Form_BootosUser(array('action' => 'editbootosuser', 'type'=>$this->type, 'configID' => $configID, 'hometype' => $hometype),$_POST);
+
+ if(!isset($_POST['homepath']) && $bootosuser->getHometypeID() == '2')
+ $bootosuserForm->populate(array('homepath' => $bootosuser->getHomepath()));
+ }else{
+ $bootosuserForm = new user_Form_BootosUser(array('action' => 'editbootosuser', 'type'=>$this->type, 'configID' => $configID, 'hometype' => $hometype),$_POST);
+
+ if ($bootosuserForm->isValid($_POST)) {
+
+ $bootosuserold = $bootosuser;
+
+ $bootosuser = new Application_Model_BootOsUser($_POST);
+
+ if($bootosuserold->getHometypeID() != $bootosuser->getHometypeID() ||
+ $bootosuserold->getHomepath() != $bootosuser->getHomepath()){
+ //ACL Is he allowed to edit other than Metadata?
+ if(!Pbs_Acl::checkRight('ce'))
+ $this->_redirect('/user/config/showconfig/type/'.$this->type.'/configID/'.$configID.'/modifyresult/forbidden');
+ }
+
+ $bootosuser->setHomepath(str_replace("%login-name%", $bootosuser->getLogin(), $bootosuser->getHomepath()));
+ if($bootosuser->getPassword() != '%password%')
+ $bootosuser->setPassword(crypt($bootosuser->getPassword(), '$6$'.randomString(8).'$'));
+
+ try {
+ $this->bootosuserMapper->save($bootosuser);
+ }catch(Zend_Exception $e)
+ {
+ echo "Caught exception: " . get_class($e) . "<br/>";
+ echo "Message: " . $e->getMessage() . "<br/>";
+ $this->_redirect('/user/config/showconfig/type/'.$this->type.'/configID/'.$configID.'/modifyresult/error');
+ }
+
+ $this->_redirect('/user/config/showconfig/type/'.$this->type.'/configID/'.$configID.'/modifyresult/ok');
+ }
+
+ }
+
+ $this->view->bootosuserForm = $bootosuserForm;
+ }
+
+ public function deleteuserAction(){
+
+ $configID = $this->_request->getParam('configID');
+ $bootosuserID = $this->_request->getParam('bootosuserID');
+ if (!is_numeric($configID) || !is_numeric($bootosuserID))
+ $this->_redirect('/user/config/showconfig/type/'.$this->type.'/configID/'.$configID.'/deleteresult/error');
+ //ACL Darf er User löschen?
+ if(!Pbs_Acl::checkRight('cd') && !Pbs_Acl::checkRight('cdo'))
+ $this->_redirect('/user/config/showconfig/type/'.$this->type.'/configID/'.$configID.'/deleteresult/forbidden');
+
+ try{
+ $bootosuser = new Application_Model_BootOsUser();
+ $this->bootosuserMapper->find($bootosuserID,$bootosuser);
+
+ $config = new Application_Model_Config();
+ $this->configMapper->find($configID,$config);
+
+ if($config->getMembershipID() != null){
+ if($this->membership->getID() != $config->getMembershipID() || !Pbs_Acl::checkRight('cdo'))
+ $this->_redirect('/user/config/showconfig/type/'.$this->type.'/configID/'.$configID.'/deleteresult/forbidden');
+ }else{
+ if($this->membership->getGroupID() != $config->getGroupID() || !Pbs_Acl::checkRight('cd'))
+ $this->_redirect('/user/config/showconfig/type/'.$this->type.'/configID/'.$configID.'/deleteresult/forbidden');
+ }
+
+ $this->bootosuserMapper->delete($bootosuser);
+
+ }catch(Zend_Exception $e){
+ echo "Caught exception: " . get_class($e) . "<br/>";
+ echo "Message: " . $e->getMessage() . "<br/>";
+ $this->_redirect('/user/config/showconfig/type/'.$this->type.'/configID/'.$configID.'/deleteresult/error');
+ }
+ $this->_redirect('/user/config/showconfig/type/'.$this->type.'/configID/'.$configID.'/deleteresult/ok');
+ }
+
+
+
public function editconfigAction()
{
//ACL Darf er Configs editieren?
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/type/'.$this->type.'/page/'.$this->page.'/modifyresult/error');
@@ -189,17 +456,21 @@ class user_ConfigController extends Zend_Controller_Action
$config = new Application_Model_Config($_POST);
$config->setCreated(time());
+ $config->setBootosID($configold->getBootosID());
- if(Pbs_Acl::checkRight('ce') && $configold->getGroupID() != null)
- $config->setGroupID($this->membership->getGroupID());
- elseif(Pbs_Acl::checkRight('ceo') && $configold->getMembershipID() != null)
- $config->setMembershipID($this->membership->getID());
+ if(Pbs_Acl::checkRight('ce') && $configold->getGroupID() != null){
+ $config->setGroupID($this->membership->getGroupID());
+ }
+ elseif(Pbs_Acl::checkRight('ceo') && $configold->getMembershipID() != null){
+ $config->setVisible($configold->getVisible());
+ $config->setMembershipID($this->membership->getID());
+ }
else
- $this->_redirect('/user/config/index/type/'.$this->type.'/page/'.$this->page.'/modifyresult/error');
+ $this->_redirect('/user/config/index/type/'.$this->type.'/page/'.$this->page.'/modifyresult/error');
$config->setID($configID);
- if($configold->getShellscript() != $config->getShellscript()){
+ if($configold->getVisible() != $config->getVisible()){
//ACL Is he allowed to edit other than Metadata?
if(!Pbs_Acl::checkRight('ce'))
$this->_redirect('/user/config/index/type/'.$this->type.'/page/'.$this->page.'/modifyresult/forbidden');