summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSimon2011-04-19 14:34:10 +0200
committerSimon2011-04-19 14:34:10 +0200
commite205bff25c5716ce1788d39a0803fa439928ff3c (patch)
tree52b2f64152099f1bbb0f7e4e11dca76cd3ea8044
parentFilterMöglichkeit umbenannt (diff)
downloadpbs2-e205bff25c5716ce1788d39a0803fa439928ff3c.tar.gz
pbs2-e205bff25c5716ce1788d39a0803fa439928ff3c.tar.xz
pbs2-e205bff25c5716ce1788d39a0803fa439928ff3c.zip
Notices und Warnings weggemacht
-rw-r--r--application/modules/fbgui/controllers/IndexController.php5
-rw-r--r--application/modules/user/controllers/BootisoController.php2
-rw-r--r--application/modules/user/controllers/BootmenuController.php2
-rw-r--r--application/modules/user/controllers/BootosController.php2
-rw-r--r--application/modules/user/controllers/ClientController.php2
-rw-r--r--application/modules/user/controllers/GroupController.php5
-rw-r--r--application/modules/user/controllers/PersonController.php14
-rw-r--r--application/modules/user/controllers/SessionController.php5
-rw-r--r--application/modules/user/views/scripts/person/owndetails.phtml2
-rw-r--r--application/modules/user/views/scripts/role/show.phtml2
-rw-r--r--library/Pbs/Acl.php2
-rw-r--r--library/Pbs/Filter.php10
12 files changed, 30 insertions, 23 deletions
diff --git a/application/modules/fbgui/controllers/IndexController.php b/application/modules/fbgui/controllers/IndexController.php
index fb8282a..d537e0b 100644
--- a/application/modules/fbgui/controllers/IndexController.php
+++ b/application/modules/fbgui/controllers/IndexController.php
@@ -17,6 +17,8 @@ class Fbgui_IndexController extends Zend_Controller_Action
public function init()
{
/* Initialize action controller here */
+ $userIDsNamespace = Zend_Session::namespaceGet('userIDs');
+
$membershipMapper = new Application_Model_MembershipMapper();
$this->membership = new Application_Model_Membership();
$membershipMapper->find($userIDsNamespace['membershipID'],$this->membership);
@@ -84,13 +86,14 @@ class Fbgui_IndexController extends Zend_Controller_Action
$_SESSION['alphasessionID'] = $session->getAlphasessionID();
}
else{
+ print_a('session wiedergefunden');
$session = new Application_Model_Session();
$sessionMapper = new Application_Model_SessionMapper();
$sessions = $sessionMapper->findBy(array('alphasessionID'=>$_SESSION['alphasessionID']));
$session = $sessions[0];
if($this->membership->getID() != ''){
$session->setMembershipID($this->membership->getID());
- $session->save();
+ $sessionMapper->save($session);
}
}
// Request Bootmenu
diff --git a/application/modules/user/controllers/BootisoController.php b/application/modules/user/controllers/BootisoController.php
index e0b9e6e..532cbe2 100644
--- a/application/modules/user/controllers/BootisoController.php
+++ b/application/modules/user/controllers/BootisoController.php
@@ -97,7 +97,7 @@ 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()));
+ @$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 9e9f972..f4b0d0f 100644
--- a/application/modules/user/controllers/BootmenuController.php
+++ b/application/modules/user/controllers/BootmenuController.php
@@ -143,7 +143,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;
}
diff --git a/application/modules/user/controllers/BootosController.php b/application/modules/user/controllers/BootosController.php
index 796a2f7..a247de9 100644
--- a/application/modules/user/controllers/BootosController.php
+++ b/application/modules/user/controllers/BootosController.php
@@ -98,7 +98,7 @@ class user_BootosController extends Zend_Controller_Action
$bootos->setDefaultkcl("none (edit Bootos to set KCL)");
$bootos->setGroupID("[".$bootos->getGroupID()."] ".$groupMapper->find($bootos->getGroupID())->getTitle());
$bootos->setCreated(date(Zend_Registry::get('dateformat'),$bootos->getCreated()));
- $bootos->setExpires(date(Zend_Registry::get('dateformat'),$bootos->getExpires()));
+ @$bootos->setExpires(date(Zend_Registry::get('dateformat'),$bootos->getExpires()));
}
}
diff --git a/application/modules/user/controllers/ClientController.php b/application/modules/user/controllers/ClientController.php
index cbb114a..087a7b6 100644
--- a/application/modules/user/controllers/ClientController.php
+++ b/application/modules/user/controllers/ClientController.php
@@ -78,7 +78,7 @@ class User_ClientController extends Zend_Controller_Action
$pagination->setPageUrl('/user/client/index'.((isset($this->view->search))?'/search/'.$this->view->search:''));
$clientsInGroup = $pagination->getElements();
- $this->view->pagination = $pagination->pagination($pageurl);
+ $this->view->pagination = $pagination->pagination();
$this->view->page = $pagination->getRequestPage();
$this->view->clients = $clientsInGroup;
diff --git a/application/modules/user/controllers/GroupController.php b/application/modules/user/controllers/GroupController.php
index 561f116..b1cee5c 100644
--- a/application/modules/user/controllers/GroupController.php
+++ b/application/modules/user/controllers/GroupController.php
@@ -231,6 +231,7 @@ class User_GroupController extends Zend_Controller_Action
$this->view->requestgroup = $groupID;
$groupRequests = $this->groupRequestMapper->findBy(array('groupID' => $groupID),true);
if(isset($groupRequests)) {
+ $groupRequestList = array();
foreach($groupRequests as $groupRequest) {
$person = $this->personmapper->find($groupRequest['personID']);
$groupRequestList[] = array(
@@ -238,7 +239,7 @@ class User_GroupController extends Zend_Controller_Action
'person' => $person
);
}
- if(is_array($groupRequestList)) {
+ if(count($groupRequestList) > 0) {
$this->view->groupRequestList = $groupRequestList;
}
// Search all inherit Roles
@@ -291,7 +292,7 @@ class User_GroupController extends Zend_Controller_Action
$memberPagination->setPageUrl('/user/group/show'.((isset($this->view->search))?'/search/'.$this->view->search:''));
}
$this->view->membersList = $memberPagination->getElements();
- $this->view->memberPagination = $memberPagination->pagination($pageurl);
+ $this->view->memberPagination = $memberPagination->pagination();
$this->view->page = $memberPagination->getRequestPage();
}
}
diff --git a/application/modules/user/controllers/PersonController.php b/application/modules/user/controllers/PersonController.php
index da640ba..ba4be8e 100644
--- a/application/modules/user/controllers/PersonController.php
+++ b/application/modules/user/controllers/PersonController.php
@@ -34,7 +34,7 @@ class user_PersonController extends Zend_Controller_Action
if (Zend_Auth::getInstance()->hasIdentity()) {
$this->personmapper = new Application_Model_PersonMapper();
$this->userIDsNamespace = Zend_Session::namespaceGet('userIDs');
- if($this->userIDsNamespace['personID']) {
+ if(isset($this->userIDsNamespace['personID'])) {
$this->person = $this->personmapper->find($this->userIDsNamespace['personID']);
} else {
$result = $this->personmapper->findBy(array('email' => Zend_Auth::getInstance()->getIdentity()),true);
@@ -111,7 +111,7 @@ class user_PersonController extends Zend_Controller_Action
$pagination->setPageUrl('/user/person/index/'.((isset($this->view->search))?'/search/'.$this->view->search:''));
$this->view->personList = $pagination->getElements();
- $this->view->pagination = $pagination->pagination($pageurl);
+ $this->view->pagination = $pagination->pagination();
$this->view->page = $pagination->getRequestPage();
}
@@ -123,6 +123,7 @@ class user_PersonController extends Zend_Controller_Action
$this->view->person = $this->person;
$groupRequests = $this->groupRequestMapper->findBy(array('personID' => $this->person->getID()),true);
if(isset($groupRequests)) {
+ $groupRequestList = array();
foreach($groupRequests as $groupRequest) {
$group = $this->groupMapper->find($groupRequest['groupID']);
$groupRequestList[] = array(
@@ -130,7 +131,7 @@ class user_PersonController extends Zend_Controller_Action
'group' => $group
);
}
- if(is_array($groupRequestList)) {
+ if(count($groupRequestList)> 0) {
$this->view->groupRequestList = $groupRequestList;
}
}
@@ -142,7 +143,7 @@ class user_PersonController extends Zend_Controller_Action
$pagination->setPageUrl('/user/person/index' .((isset($this->view->search))?'/search/'.$this->view->search:''));
$this->view->groups = $pagination->getElements();
- $this->view->pagination = $pagination->pagination($pageurl);
+ $this->view->pagination = $pagination->pagination();
$this->view->page = $pagination->getRequestPage();
// This should be activated in case the person has no membership and no rights.
$this->view->groupRequestRight = true;
@@ -235,7 +236,7 @@ class user_PersonController extends Zend_Controller_Action
if($membership['groupID'] == $group->getID()) {
$groupsFound[$count] = true;
} else {
- if($groupsFound[$count] != true) {
+ if(@$groupsFound[$count] != true) {
$groupsFound[$count] = false;
}
}
@@ -330,6 +331,7 @@ class user_PersonController extends Zend_Controller_Action
$groupMapper = new Application_Model_GroupMapper();
$roleMapper = new Application_Model_RoleMapper();
if(isset($this->memberships)) {
+ $suspendlist = array();
foreach($this->memberships as $membership) {
$group = $groupMapper->find($membership['groupID']);
$role = $roleMapper->find($membership['roleID']);
@@ -420,7 +422,7 @@ class user_PersonController extends Zend_Controller_Action
$pagination->setPageUrl('/user/person/show/personID/' . $personID .((isset($this->view->search))?'/search/'.$this->view->search:''));
$this->view->groups = $pagination->getElements();
- $this->view->pagination = $pagination->pagination($pageurl);
+ $this->view->pagination = $pagination->pagination();
$this->view->page = $pagination->getRequestPage();
$this->view->personID = $personID;
$this->view->editRight = Pbs_Acl::checkRight('peoa');
diff --git a/application/modules/user/controllers/SessionController.php b/application/modules/user/controllers/SessionController.php
index 88f73f4..4260a82 100644
--- a/application/modules/user/controllers/SessionController.php
+++ b/application/modules/user/controllers/SessionController.php
@@ -80,7 +80,7 @@ class User_SessionController extends Zend_Controller_Action
}
}
// Sort after date/id
- usort($mySessions, sortFunc);
+ usort($mySessions, 'sortFunc');
// Search
$search = $this->_request->getParam('search');
@@ -113,8 +113,7 @@ class User_SessionController extends Zend_Controller_Action
}
-
function sortFunc($func_a, $func_b) {
if($func_a->getID() == $func_b->getID()) return 0;
return ($func_a->getID() < $func_b->getID()) ? 1 : -1;
-} \ No newline at end of file
+}
diff --git a/application/modules/user/views/scripts/person/owndetails.phtml b/application/modules/user/views/scripts/person/owndetails.phtml
index 3f1cfb4..60364c0 100644
--- a/application/modules/user/views/scripts/person/owndetails.phtml
+++ b/application/modules/user/views/scripts/person/owndetails.phtml
@@ -74,7 +74,7 @@ if(count($this->groups)==0)
<label>Role</label>
<div class='item'><?php echo $group['role']; ?>&nbsp;</div>
</div>
- <?php if($this->apikeys[$group['groupID']] != null):?>
+ <?php if(isset($this->apikeys[$group['groupID']]) && $this->apikeys[$group['groupID']] != null):?>
<div class='details'>
<label>API-Key</label>
<div class='item'><?php echo $this->apikeys[$group['groupID']]; ?>&nbsp;</div>
diff --git a/application/modules/user/views/scripts/role/show.phtml b/application/modules/user/views/scripts/role/show.phtml
index 0e440f2..d6fb6cb 100644
--- a/application/modules/user/views/scripts/role/show.phtml
+++ b/application/modules/user/views/scripts/role/show.phtml
@@ -58,7 +58,7 @@ if(count($this->rightsList)==0) {
<?php
if(isset($this->rightcategorieslist)) {
foreach($this->rightcategorieslist as $k => $v):
- $rights = $this->rightsList[$k];
+ @$rights = $this->rightsList[$k];
if(count($rights) > 0) {
?>
<h3><?php echo $v; ?>:</h3>
diff --git a/library/Pbs/Acl.php b/library/Pbs/Acl.php
index b941694..766274a 100644
--- a/library/Pbs/Acl.php
+++ b/library/Pbs/Acl.php
@@ -16,6 +16,8 @@ class Pbs_Acl
public static function checkRight($rightShortcut) {
$userIDsNamespace = Zend_Session::namespaceGet('userIDs');
+ if(!isset($userIDsNamespace['roleID']))
+ return false;
$roleID = $userIDsNamespace['roleID'];
$rightMapper = new Application_Model_RightMapper();
diff --git a/library/Pbs/Filter.php b/library/Pbs/Filter.php
index 5231e59..6916c2a 100644
--- a/library/Pbs/Filter.php
+++ b/library/Pbs/Filter.php
@@ -58,7 +58,7 @@ class Pbs_Filter{
$sessionmapper = new Application_Model_SessionMapper();
$sessionarray = $sessionmapper->findBy(array('alphasessionID' => $_SESSION['alphasessionID']),true);
$session->setOptions($sessionarray[0]);
- $session->setID($sessionarray['sessionID']);
+ @$session->setID($sessionarray['sessionID']);
$bootisoMapper = new Application_Model_BootisoMapper();
$bootiso = new Application_Model_BootIso();
@@ -124,7 +124,7 @@ class Pbs_Filter{
$poolentry = new Application_Model_PoolEntries();
$poolentrymapper = new Application_Model_PoolEntriesMapper();
$poolentry = $poolentrymapper->findby(array('clientID' => $client->getID()),true);
- $poolentry = $poolentry[0];
+ @$poolentry = $poolentry[0];
$poolID = $poolentry['poolID'];
}
@@ -280,7 +280,7 @@ class Pbs_Filter{
$client = new Application_Model_Client();
$clientmapper = new Application_Model_ClientMapper();
$clientmapper->find($session->getClientID(),$client);
- $macAdress = $client->getHardwarehash();
+ $hardwarehash = $client->getHardwarehash();
}
try{
@@ -359,8 +359,8 @@ class Pbs_Filter{
$set = $kk;
// counting how often a filter is evaluated at database
$a = array();
- foreach($set as $k=> $s){
- $a[$s] += 1;
+ foreach($set as $k => $s){
+ @$a[$s] += 1;
}
if($debuglevel >= 2)
print_a('Übereinstimmungen pro Filter',$a);