summaryrefslogtreecommitdiffstats
path: root/application/modules/user/controllers
diff options
context:
space:
mode:
authorSimon2011-03-18 18:49:30 +0100
committerSimon2011-03-18 18:49:30 +0100
commit5139008cee049b2ab24b870a263996fe9043adeb (patch)
treea79c36fce9afc587c73cd4e71c94e72bbc83830e /application/modules/user/controllers
parentAnsicht von Pools geändert (diff)
downloadpbs2-5139008cee049b2ab24b870a263996fe9043adeb.tar.gz
pbs2-5139008cee049b2ab24b870a263996fe9043adeb.tar.xz
pbs2-5139008cee049b2ab24b870a263996fe9043adeb.zip
User-Oberfläche, FBGui-Oberfläche legt Session&Clients an - für Kiosk-System
apache-default zum ersetzen, damit server von außen erreichbar ist FilterController weitergearbeitet
Diffstat (limited to 'application/modules/user/controllers')
-rw-r--r--application/modules/user/controllers/ClientController.php4
-rw-r--r--application/modules/user/controllers/FilterController.php103
-rw-r--r--application/modules/user/controllers/PoolController.php14
3 files changed, 118 insertions, 3 deletions
diff --git a/application/modules/user/controllers/ClientController.php b/application/modules/user/controllers/ClientController.php
index d40e1b1..4bb2b35 100644
--- a/application/modules/user/controllers/ClientController.php
+++ b/application/modules/user/controllers/ClientController.php
@@ -5,6 +5,10 @@ class User_ClientController extends Zend_Controller_Action
private $membership;
public function init()
{
+ if($_SESSION['membershipID'] ==''){
+ $pbsNotifier = new Pbs_Notifier();
+ echo $pbsNotifier->notify('No membershipID set','forbidden');
+ }
/* Initialize action controller here */
$membershipMapper = new Application_Model_MembershipMapper();
$this->membership = new Application_Model_Membership();
diff --git a/application/modules/user/controllers/FilterController.php b/application/modules/user/controllers/FilterController.php
index 2704309..8ceefe3 100644
--- a/application/modules/user/controllers/FilterController.php
+++ b/application/modules/user/controllers/FilterController.php
@@ -2,13 +2,100 @@
class User_FilterController extends Zend_Controller_Action
{
-
+ protected $filterMapper;
+ protected $membershipMapper;
public function init()
{
- /* Initialize action controller here */
+ if($_SESSION['membershipID'] ==''){
+ $pbsNotifier = new Pbs_Notifier();
+ echo $pbsNotifier->notify('No membershipID set','forbidden');
+ }
+ $this->filterMapper = new Application_Model_FilterMapper();
+
+ $membershipMapper = new Application_Model_MembershipMapper();
+ $this->membership = new Application_Model_Membership();
+ $membershipMapper->find($_SESSION['membershipID'],$this->membership);
+
+ $this->db = Zend_Db_Table::getDefaultAdapter();
}
public function indexAction()
+ {
+ // TODO: ACL: is he authorized to see this?
+
+ $result = $this->_request->getParam('addresult');
+ if($result != ""){
+ $pbsNotifier = new Pbs_Notifier();
+ $this->view->notification = $pbsNotifier->notify('create',$result);
+ }
+
+ $filters = $this->filterMapper->findBy('groupID',$this->membership->getGroupID());
+ foreach($filters as $filter){
+ $ff = new Application_Model_Filter();
+ $ff->setOptions($filter);
+ $ff->setID($filter['filterID']);
+ $allFilter[] = $ff;
+ }
+ $this->view->filters = $allFilter;
+ }
+
+ public function addfilterAction()
+ {
+ // TODO: ACL: is he authorized to add a filter?
+ $bmmapper = new Application_Model_BootMenuMapper();
+ $result = $bmmapper->findBy('groupID',$this->membership->getGroupID());
+ foreach($result as $rr){
+ $bm = new Application_Model_BootMenu();
+ $bm->setOptions($rr);
+ $bm->setID($rr['bootmenuID']);
+ $bootmenus[] = $bm;
+ }
+ $this->view->bootmenus = $bootmenus;
+
+ if (!isset($_POST["add"])){
+ $addfilterform = new user_Form_Filter(array('buttontext' => 'Create Filter','bootmenus'=>$bootmenus));
+ $this->view->addfilterform = $addfilterform;
+ }else {
+ $addfilterform = new user_Form_Filter(array('buttontext' => 'Create Filter','bootmenus'=>$bootmenus),$_POST);
+ if ($addfilterform->isValid($_POST)) {
+ try{
+ $newfilter = new Application_Model_Filter($_POST);
+ $newfilter->setCreated(time());
+ $newfilter->setGroupID($this->membership->getGroupID());
+ $newfilter->setMembershipID($this->membership->getID());
+ $newfilter2 = new Application_Model_FilterMapper();
+ $newfilter2->save($newfilter);
+ $this->_redirect('/user/filter/index/addresult/ok');
+ }catch (Zend_Exception $e) {
+ echo "Error message 2: " . $e->getMessage() . "\n";
+ $this->_redirect('/user/filter/index/addresult/error');
+ }
+ }
+ $this->view->addfilterform = $addfilterform;
+ }
+ }
+
+ public function removefilterAction()
+ {
+ // action body
+ }
+
+ public function editfilterAction()
+ {
+ // action body
+ }
+
+ public function addfilterentryAction()
+ {
+ // action body
+ }
+
+ public function editfilterentryAction()
+ {
+ // action body
+ }
+
+ public function removefilterentryAction()
{
// action body
}
@@ -16,3 +103,15 @@ class User_FilterController extends Zend_Controller_Action
}
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/application/modules/user/controllers/PoolController.php b/application/modules/user/controllers/PoolController.php
index 7ff4da1..f786aa8 100644
--- a/application/modules/user/controllers/PoolController.php
+++ b/application/modules/user/controllers/PoolController.php
@@ -5,6 +5,11 @@ class User_PoolController extends Zend_Controller_Action
private $membership;
public function init()
{
+ if($_SESSION['membershipID'] ==''){
+ $pbsNotifier = new Pbs_Notifier();
+ echo $pbsNotifier->notify('No membershipID set','forbidden');
+ }
+
$membershipMapper = new Application_Model_MembershipMapper();
$this->membership = new Application_Model_Membership();
$membershipMapper->find($_SESSION['membershipID'],$this->membership);
@@ -41,7 +46,14 @@ class User_PoolController extends Zend_Controller_Action
}
$poolMapper = new Application_Model_PoolMapper();
- $this->view->pools = $poolMapper->fetchAll();
+ $pools = $poolMapper->findBy('groupID',$this->membership->getGroupID());
+ foreach($pools as $pool){
+ $ff = new Application_Model_Pool();
+ $ff->setOptions($pool);
+ $ff->setID($pool['poolID']);
+ $yourpools[] = $ff;
+ }
+ $this->view->pools = $yourpools;
$clientmapper = new Application_Model_ClientMapper();
$clients = $clientmapper->fetchAll();