summaryrefslogtreecommitdiffstats
path: root/application/controllers/ResourceController.php
diff options
context:
space:
mode:
Diffstat (limited to 'application/controllers/ResourceController.php')
-rw-r--r--application/controllers/ResourceController.php52
1 files changed, 50 insertions, 2 deletions
diff --git a/application/controllers/ResourceController.php b/application/controllers/ResourceController.php
index f73ca37..ba268d7 100644
--- a/application/controllers/ResourceController.php
+++ b/application/controllers/ResourceController.php
@@ -1029,7 +1029,55 @@ class ResourceController extends Zend_Controller_Action
$xml .= "</xml>";
header('Content-Type: text/xml');
- header('Content-Disposition: inline; filename="group.xml"');
+ header('Content-Disposition: inline; filename="membership.xml"');
+ header('Pragma: no-cache');
+ header('Expires: 0');
+ echo $xml;
+ }
+
+ public function getroleAction() {
+ $apikey = $this->_request->getParam('apikey');
+ if($apikey == ""){
+ header('HTTP/1.0 400 No API-Key');
+ die();
+ }
+
+ $roleMapper = new Application_Model_RoleMapper();
+
+ if(isset($params['roleid'])) {
+ $roleID = $params['roleid'];
+ if($this->membership->getRoleID() != $roleID) {
+ list($rightroles1) = $this->rightrolesMapper->findBy(array('rightID' => '24', 'roleID' => $this->membership->getRoleID()));
+ if($rightroles1 == null){
+ header('HTTP/1.0 403 No Right to Show Roles');
+ die();
+ }
+ }
+ } else {
+ $roleID = $this->membership->getRoleID();
+ }
+
+ $role = new Application_Model_Role();
+ $roleMapper->find($roleID, $role);
+
+ if($role == null){
+ header('HTTP/1.0 400 No Pool was found');
+ die();
+ }
+
+ $xml = "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n";
+ $xml .= "<xml>\n";
+ $xml .= "\t<role>\n";
+ $xml .= "\t\t<id>" . $role->getID() . "</id>\n";
+ $xml .= "\t\t<groupid>" . $role->getGroupID() . "</groupid>\n";
+ $xml .= "\t\t<title>" . $role->getTitle() . "</title>\n";
+ $xml .= "\t\t<description>" . $role->getDescription() . "</description>\n";
+ $xml .= "\t\t<inheritance>" . $role->getInheritance() . "</inheritance>\n";
+ $xml .= "\t</role>\n";
+ $xml .= "</xml>";
+
+ header('Content-Type: text/xml');
+ header('Content-Disposition: inline; filename="role.xml"');
header('Pragma: no-cache');
header('Expires: 0');
echo $xml;
@@ -1070,7 +1118,7 @@ class ResourceController extends Zend_Controller_Action
$xml .= "</xml>";
header('Content-Type: text/xml');
- header('Content-Disposition: inline; filename="group.xml"');
+ header('Content-Disposition: inline; filename="checkright.xml"');
header('Pragma: no-cache');
header('Expires: 0');
echo $xml;