summaryrefslogtreecommitdiffstats
path: root/application/controllers/ClientController.php
diff options
context:
space:
mode:
authormichael pereira2011-03-06 20:12:43 +0100
committermichael pereira2011-03-06 20:12:43 +0100
commitc2e050df18557a3fe1093f0fef1685c2e631b95b (patch)
tree532672f37cf928d0c2c81b6e3d55fd8cda7e393d /application/controllers/ClientController.php
parentdatenbank erweitert, BootMenu, Config fertig (diff)
parentPool add, edit und remove hinzugefügt (diff)
downloadpbs2-c2e050df18557a3fe1093f0fef1685c2e631b95b.tar.gz
pbs2-c2e050df18557a3fe1093f0fef1685c2e631b95b.tar.xz
pbs2-c2e050df18557a3fe1093f0fef1685c2e631b95b.zip
Merge branch 'master' of openslx.org:lsfks/master-teamprojekt/pbs2
Diffstat (limited to 'application/controllers/ClientController.php')
-rw-r--r--application/controllers/ClientController.php54
1 files changed, 54 insertions, 0 deletions
diff --git a/application/controllers/ClientController.php b/application/controllers/ClientController.php
new file mode 100644
index 0000000..336bf9e
--- /dev/null
+++ b/application/controllers/ClientController.php
@@ -0,0 +1,54 @@
+<?php
+
+class ClientController extends Zend_Controller_Action
+{
+
+ public function init()
+ {
+ /* Initialize action controller here */
+ }
+
+ public function indexAction()
+ {
+ $clientMapper = new Application_Model_ClientMapper();
+ $this->view->clients = $clientMapper->fetchAll();
+ }
+
+ public function addclientAction()
+ {
+ $mac = $this->_request->getParam('mac');
+ $hh = $this->_request->getParam('hh');
+
+ if($mac != '' && $hh != ''){
+ $client = new Application_Model_Client();
+ $client->setMacadress($mac);
+ $client->setHardwarehash($hh);
+ $clientmapper = new Application_Model_ClientMapper();
+ $clientmapper->save($client);
+ print_a('inserted');
+ }
+ else{
+ print_a('no insert');
+ }
+ }
+
+ public function removeclientAction()
+ {
+ $clientID = $this->_request->getParam('clientID');
+ // TODO: ACL implementieren ob er den filter löschen darf
+ if(is_numeric($clientID)){
+ $removeClient = new Application_Model_Client();
+ $removeClient->setID($clientID);
+ $clientMapper = new Application_Model_ClientMapper();
+ $clientMapper->delete($removeClient);
+ }
+ $this->_redirect('/client');
+ }
+
+
+}
+
+
+
+
+