diff options
| author | michael pereira | 2011-04-21 14:03:59 +0200 |
|---|---|---|
| committer | michael pereira | 2011-04-21 14:03:59 +0200 |
| commit | daf6e795d126ec49e25e8b40931470e3c63666a9 (patch) | |
| tree | 3368e0e2c463bfa9d77478dce2dc142ae7428836 /application | |
| parent | updates raus (diff) | |
| parent | Userpasswort verschlüsselung (diff) | |
| download | pbs2-daf6e795d126ec49e25e8b40931470e3c63666a9.tar.gz pbs2-daf6e795d126ec49e25e8b40931470e3c63666a9.tar.xz pbs2-daf6e795d126ec49e25e8b40931470e3c63666a9.zip | |
Merge branch 'master' of openslx.org:lsfks/master-teamprojekt/pbs2
Diffstat (limited to 'application')
8 files changed, 32 insertions, 23 deletions
diff --git a/application/controllers/ResourceController.php b/application/controllers/ResourceController.php index 5790dbd..3547818 100644 --- a/application/controllers/ResourceController.php +++ b/application/controllers/ResourceController.php @@ -35,7 +35,7 @@ class ResourceController extends Zend_Controller_Action $this->membership = new Application_Model_Membership(); $this->rightrolesMapper = new Application_Model_RightRolesMapper(); - @list($this->membership) = $membershipMapper->findBy(array('apikey' => $apikey)); + list($this->membership) = $membershipMapper->findBy(array('apikey' => $apikey)); if($this->membership == null){ header('HTTP/1.0 401 Member not found'); die(); @@ -85,7 +85,7 @@ class ResourceController extends Zend_Controller_Action public function addbootosAction() { - @list($rightroles) = $this->rightrolesMapper->findBy(array('rightID' => '55', 'roleID' => $this->membership->getRoleID())); + list($rightroles) = $this->rightrolesMapper->findBy(array('rightID' => '55', 'roleID' => $this->membership->getRoleID())); if($rightroles == null){ header('HTTP/1.0 403 No Right to Create Bootos'); die(); @@ -113,7 +113,7 @@ class ResourceController extends Zend_Controller_Action $bootosMapper = new Application_Model_BootOsMapper(); $groupID = $this->membership->getGroupID(); - @list($bootos) = $bootosMapper->findBy(array('groupid' => $groupID, 'title' => $params['title'], 'distro' => $params['distro'], 'distroversion' => $params['distroversion'], 'source' => $source, 'share' => $params['share'])); + list($bootos) = $bootosMapper->findBy(array('groupid' => $groupID, 'title' => $params['title'], 'distro' => $params['distro'], 'distroversion' => $params['distroversion'], 'source' => $source, 'share' => $params['share'])); if($bootos != null){ header('HTTP/1.0 400 Bootos already exists'); die(); @@ -152,7 +152,7 @@ class ResourceController extends Zend_Controller_Action public function editbootosAction() { - @list($rightroles) = $this->rightrolesMapper->findBy(array('rightID' => '58', 'roleID' => $this->membership->getRoleID())); + list($rightroles) = $this->rightrolesMapper->findBy(array('rightID' => '58', 'roleID' => $this->membership->getRoleID())); if($rightroles == null){ header('HTTP/1.0 403 No Right to Edit Bootos'); die(); @@ -176,7 +176,7 @@ class ResourceController extends Zend_Controller_Action $bootosMapper = new Application_Model_BootOsMapper(); $groupID = $this->membership->getGroupID(); - @list($bootos) = $bootosMapper->findBy(array('groupid' => $groupID, 'title' => $params['title'], 'distro' => $params['distro'], 'distroversion' => $params['distroversion'], 'source' => $source, 'share' => $params['share'])); + list($bootos) = $bootosMapper->findBy(array('groupid' => $groupID, 'title' => $params['title'], 'distro' => $params['distro'], 'distroversion' => $params['distroversion'], 'source' => $source, 'share' => $params['share'])); if($bootos == null){ header('HTTP/1.0 400 Bootos not found'); @@ -218,7 +218,7 @@ class ResourceController extends Zend_Controller_Action public function addprebootAction() { - @list($rightroles) = $this->rightrolesMapper->findBy(array('rightID' => '40', 'roleID' => $this->membership->getRoleID())); + list($rightroles) = $this->rightrolesMapper->findBy(array('rightID' => '40', 'roleID' => $this->membership->getRoleID())); if($rightroles == null){ header('HTTP/1.0 403 No Right to Create Preboots'); die(); @@ -247,7 +247,7 @@ class ResourceController extends Zend_Controller_Action $prebootMapper = new Application_Model_PreBootMapper(); $groupID = $this->membership->getGroupID(); - @list($preboot) = $prebootMapper->findBy(array('groupid' => $groupID, 'title' => $params['title'])); + list($preboot) = $prebootMapper->findBy(array('groupid' => $groupID, 'title' => $params['title'])); if($preboot != null){ header('HTTP/1.0 400 Preboot already exists'); die(); @@ -277,7 +277,7 @@ class ResourceController extends Zend_Controller_Action public function editprebootAction() { - @list($rightroles) = $this->rightrolesMapper->findBy(array('rightID' => '41', 'roleID' => $this->membership->getRoleID())); + list($rightroles) = $this->rightrolesMapper->findBy(array('rightID' => '41', 'roleID' => $this->membership->getRoleID())); if($rightroles == null){ header('HTTP/1.0 403 No Right to Edit Preboot'); die(); @@ -306,7 +306,7 @@ class ResourceController extends Zend_Controller_Action $groupID = $this->membership->getGroupID(); $preboot = new Application_Model_PreBoot(); - @list($preboot) = $prebootMapper->findBy(array('groupid' => $groupID, 'title' => $params['title'])); + list($preboot) = $prebootMapper->findBy(array('groupid' => $groupID, 'title' => $params['title'])); if($preboot == null){ header('HTTP/1.0 400 Preboot not found'); @@ -397,6 +397,7 @@ class ResourceController extends Zend_Controller_Action exec("tar -C $path_userconf -xvf ../resources/config/$configID/default.tgz"); exec("echo '$loginname:x:1000:1000:".$person->getName()." ".$person->getFirstname().",,,:/home/$loginname:/bin/bash' >> $path_userconf/rootfs/etc/passwd"); exec("md5pass ".$person->getPassword(), $pwhash); + // crypt(password, '$6$'.randomString(8).'$') exec("echo '$loginname:$pwhash[0]:0:0:99999:7:::' >> $path_userconf/rootfs/etc/shadow"); exec("echo 'mkdir /home/$loginname' >> $path_userconf/initramfs/postinit.local"); } diff --git a/application/modules/user/controllers/BootisoController.php b/application/modules/user/controllers/BootisoController.php index 18472a9..e83a2c5 100644 --- a/application/modules/user/controllers/BootisoController.php +++ b/application/modules/user/controllers/BootisoController.php @@ -97,7 +97,10 @@ class user_BootisoController extends Zend_Controller_Action $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())); + if($bootiso->getExpires() == ""){ + $bootiso->setExpires(0); + } + $bootiso->setExpires(date(Zend_Registry::get('dateformat'),$bootiso->getExpires())); } // Search diff --git a/application/modules/user/controllers/BootmenuController.php b/application/modules/user/controllers/BootmenuController.php index 38b278c..e0b27e6 100644 --- a/application/modules/user/controllers/BootmenuController.php +++ b/application/modules/user/controllers/BootmenuController.php @@ -79,6 +79,7 @@ class user_BootmenuController extends Zend_Controller_Action $bootosMapper = new Application_Model_BootOsMapper(); $configMapper = new Application_Model_ConfigMapper(); + $bootmenuentries = array(); if($this->type =='group' && Pbs_Acl::checkRight('booai')){ $this->view->type = 'group'; $bootmenu = $this->bootmenuMapper->findBy(array('groupID' => $this->membership->getGroupID())); @@ -143,7 +144,7 @@ class user_BootmenuController extends Zend_Controller_Action $this->view->page = $pagination->getRequestPage(); $this->view->bootmenulist = $bootmenu; - @$this->view->bootmenuentrylist = $bootmenuentries; + $this->view->bootmenuentrylist = $bootmenuentries; } @@ -283,7 +284,7 @@ class user_BootmenuController extends Zend_Controller_Action if($bootmenu->getDefaultbootmenu() == false){ - @list($defaultbootmenu) = $this->bootmenuMapper->findBy(array('defaultbootmenu' => '1')); + list($defaultbootmenu) = $this->bootmenuMapper->findBy(array('defaultbootmenu' => '1')); if($defaultbootmenu != null){ $defaultbootmenu->setDefaultbootmenu(false); $this->bootmenuMapper->save($defaultbootmenu); diff --git a/application/modules/user/controllers/FilterController.php b/application/modules/user/controllers/FilterController.php index f9a4724..ae91b4e 100644 --- a/application/modules/user/controllers/FilterController.php +++ b/application/modules/user/controllers/FilterController.php @@ -107,8 +107,6 @@ class User_FilterController extends Zend_Controller_Action $bmmapper = new Application_Model_BootMenuMapper(); $result = $bmmapper->findBy(array('groupID' => $this->membership->getGroupID()),true); - print_a($result); - foreach($result as $rr){ $bm = new Application_Model_BootMenu(); @@ -143,7 +141,6 @@ class User_FilterController extends Zend_Controller_Action $filterentry = new Application_Model_FilterEntries(); $filterentry->setFilterID($id); $filterentry->setFiltertypeID(6); - $filterentry->setCreated(time()); $filterentry->setFiltervalue($this->membership->getGroupID()); $filterentriesMapper->save($filterentry); diff --git a/application/modules/user/controllers/PersonController.php b/application/modules/user/controllers/PersonController.php index 07a69ee..cc8a1e2 100644 --- a/application/modules/user/controllers/PersonController.php +++ b/application/modules/user/controllers/PersonController.php @@ -49,7 +49,7 @@ class user_PersonController extends Zend_Controller_Action if(isset($this->memberships)) { foreach($this->memberships as $membership) { $group = $this->groupMapper->find($membership['groupID']); - @list($rightroles) = $rightrolesMapper->findBy(array('rightID' => '55', 'roleID' => $membership['roleID'])); + list($rightroles) = $rightrolesMapper->findBy(array('rightID' => '55', 'roleID' => $membership['roleID'])); $role = $roleMapper->find($membership['roleID']); if($rightroles != null) $this->view->apikeys[$group->getID()] = $membership['apikey']; @@ -228,7 +228,7 @@ class user_PersonController extends Zend_Controller_Action if($membership['groupID'] == $group->getID()) { $groupsFound[$count] = true; } else { - if(@$groupsFound[$count] != true) { + if(isset($groupsFound[$count]) && $groupsFound[$count] != true) { $groupsFound[$count] = false; } } diff --git a/application/modules/user/forms/BootmenuEntries.php b/application/modules/user/forms/BootmenuEntries.php index ded5cc5..1177d1c 100644 --- a/application/modules/user/forms/BootmenuEntries.php +++ b/application/modules/user/forms/BootmenuEntries.php @@ -54,7 +54,7 @@ class user_Form_BootmenuEntries extends Zend_Form { if(!isset($_POST['bootosID'])){ - @list($key) = array_keys($this->bootoslist); + list($key) = array_keys($this->bootoslist); $firstbootos = $this->bootoslist[$key]; $_POST['bootosID'] = $firstbootos->getID(); diff --git a/application/modules/user/forms/Filter.php b/application/modules/user/forms/Filter.php index 81d9e15..5eabd60 100644 --- a/application/modules/user/forms/Filter.php +++ b/application/modules/user/forms/Filter.php @@ -18,13 +18,18 @@ class user_Form_Filter extends Zend_Form public function init() { $this->setName("Add Filter"); - $this->setMethod('post'); + $this->setMethod('post'); - if(Pbs_Acl::checkRight('fefp') || Pbs_Acl::checkRight('fa')){ - $edit = 'true'; + if(stristr($_SERVER['REQUEST_URI'],'addfilter')){ + $edit = null; } else{ - $edit = null; + if(!Pbs_Acl::checkRight('fe') && Pbs_Acl::checkRight('fefp') ){ + $edit = 'true'; + } + else{ + $edit = null; + } } $this->addElement('text', 'title', array( diff --git a/application/modules/user/views/scripts/role/show.phtml b/application/modules/user/views/scripts/role/show.phtml index d6fb6cb..9e31dd3 100644 --- a/application/modules/user/views/scripts/role/show.phtml +++ b/application/modules/user/views/scripts/role/show.phtml @@ -58,7 +58,9 @@ if(count($this->rightsList)==0) { <?php if(isset($this->rightcategorieslist)) { foreach($this->rightcategorieslist as $k => $v): - @$rights = $this->rightsList[$k]; + if(isset($this->rightsList[$k])){ + $rights = $this->rightsList[$k]; + } if(count($rights) > 0) { ?> <h3><?php echo $v; ?>:</h3> |
