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.php45
1 files changed, 44 insertions, 1 deletions
diff --git a/application/controllers/ResourceController.php b/application/controllers/ResourceController.php
index cb993fe..2ec373a 100644
--- a/application/controllers/ResourceController.php
+++ b/application/controllers/ResourceController.php
@@ -1011,7 +1011,7 @@ class ResourceController extends Zend_Controller_Action
die();
}
- $membershipMapper = new Application_Model_MembershipMapper();
+ $membershipMapper = new Application_Model_MembershipMaper();
$membershipid = $this->membership->getID();
$membership = new Application_Model_Membership();
$membershipMapper->find($membershipid, $membership);
@@ -1035,6 +1035,49 @@ class ResourceController extends Zend_Controller_Action
echo $xml;
}
+ public function checkrightAction() {
+ $apikey = $this->_request->getParam('apikey');
+ if($apikey == ""){
+ header('HTTP/1.0 400 No API-Key');
+ die();
+ }
+
+ $rightShortcut = $this->_request->getParam('rightShortcut');
+ $rightMapper = new Application_Model_RightMapper();
+ $result = $rightMapper->findBy(array('shortcut' => $rightShortcut));
+ if(!is_array($result[0])) {
+ header('HTTP/1.0 400 Wrong Right Shortcut');
+ die();
+ }
+ $right = new Application_Model_Right($result[0]);
+ $right->setID($result[0]['rightID']);
+
+ $roleid = $this->membership->getRoleID();
+ $rightid = $right->getID();
+ $rightrolesMapper = new Application_Model_RightRolesMapper();
+ $rightroles = $rightrolesMapper->find($roleid, $rightid);
+
+ $xml = "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n";
+ $xml .= "<xml>\n";
+ $xml .= "\t<checkright>\n";
+
+ if(is_object($rightroles)) {
+ $xml .= "\t\t</success>true</success>\n";
+ } else {
+ $xml .= "\t\t</success>false</success>\n";
+ }
+
+ $xml .= "\t</checkright>\n";
+ $xml .= "</xml>";
+
+ header('Content-Type: text/xml');
+ header('Content-Disposition: inline; filename="group.xml"');
+ header('Pragma: no-cache');
+ header('Expires: 0');
+ echo $xml;
+
+ }
+
public function loginAction() {
$xml = "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n";
$xml .= "<xml>\n";