summaryrefslogtreecommitdiffstats
path: root/application
diff options
context:
space:
mode:
Diffstat (limited to 'application')
-rw-r--r--application/controllers/ResourceController.php35
1 files changed, 29 insertions, 6 deletions
diff --git a/application/controllers/ResourceController.php b/application/controllers/ResourceController.php
index 5e12302..817bc60 100644
--- a/application/controllers/ResourceController.php
+++ b/application/controllers/ResourceController.php
@@ -188,10 +188,7 @@ class ResourceController extends Zend_Controller_Action
$params = $this->_request->getParams();
$groupID = $this->membership->getGroupID();
-
$filterMapper = new Application_Model_FilterMapper();
- $filterentriesMapper = new Application_Model_FilterEntriesMapper();
-
$filter = new Application_Model_Filter();
$filter->setOptions($params);
$filter->setGroupID($groupID);
@@ -200,6 +197,32 @@ class ResourceController extends Zend_Controller_Action
$filterid = $filterMapper->save($filter);
$filter->setID($filterid);
+ $xml = "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n";
+ $xml .= "<xml>\n";
+ $xml .= "\t<filterid>" . $filter->getID() . "</filterid>\n";
+ $xml .= "</xml>";
+
+ header('Content-Type: text/xml');
+ header('Content-Disposition: inline; filename="filter.xml"');
+ header('Pragma: no-cache');
+ header('Expires: 0');
+ echo $xml;
+ }
+
+ public function addFilterentrieAction() {
+ list($rightroles) = $this->rightrolesMapper->findBy(array('rightID' => '87', 'roleID' => $this->membership->getRoleID()));
+ if($rightroles == null){
+ header('HTTP/1.0 403 No Right to Create Filter');
+ die();
+ }
+
+ $apikey = $this->_request->getParam('apikey');
+ if($apikey == ""){
+ header('HTTP/1.0 400 No API-Key');
+ die();
+ }
+
+ $filterentriesMapper = new Application_Model_FilterEntriesMapper();
$filterentries = new Application_Model_FilterEntries();
$filterentries->setOptions($params);
$filterentries->setFilterID($filter->getID());
@@ -208,11 +231,11 @@ class ResourceController extends Zend_Controller_Action
$xml = "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n";
$xml .= "<xml>\n";
- $xml .= "\t<filterid>" . $filter->getID() . "</filterid>\n";
+ $xml .= "\t<filterentriesID>" . $filterentries->getID() . "</filterentriesid>\n";
$xml .= "</xml>";
header('Content-Type: text/xml');
- header('Content-Disposition: inline; filename="bootos.xml"');
+ header('Content-Disposition: inline; filename="filterentries.xml"');
header('Pragma: no-cache');
header('Expires: 0');
echo $xml;
@@ -1061,7 +1084,7 @@ class ResourceController extends Zend_Controller_Action
$role = new Application_Model_Role();
$roleMapper->find($roleID, $role);
-
+
$newRoleID = $role->getID();
if(!isset($newRoleID)) {