From cab9dfaee99ed24d65809cf30bffa1b954b24606 Mon Sep 17 00:00:00 2001 From: Karl Burkhart Date: Thu, 17 Nov 2011 15:48:04 +0000 Subject: [PATCH] =?UTF-8?q?delete=20Projektphase=20hinzugef=C3=BCgt?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- soap/projektphase.soap.php | 28 ++++++++++++- soap/projektphase.wsdl.php | 82 ++++++++++++++++++++++++-------------- 2 files changed, 78 insertions(+), 32 deletions(-) diff --git a/soap/projektphase.soap.php b/soap/projektphase.soap.php index 39dbfc912..fbf484eff 100755 --- a/soap/projektphase.soap.php +++ b/soap/projektphase.soap.php @@ -33,6 +33,7 @@ require_once('../include/benutzerberechtigung.class.php'); $SOAPServer = new SoapServer(APP_ROOT."/soap/projektphase.wsdl.php?".microtime()); $SOAPServer->addFunction("saveProjektphase"); +$SOAPServer->addFunction("deleteProjektphase"); $SOAPServer->handle(); // WSDL Chache auf aus @@ -88,6 +89,29 @@ function saveProjektphase($username, $passwort, $phase) else return new SoapFault("Server", $projektphase->errormsg); } -?> - +/** + * + * Loescht die übergebene Projektphase + * @param $username + * @param $passwort + * @param $projektphase_kurzbz + */ +function deleteProjektphase($username, $passwort, $projektphase_id) +{ + if(!$user = check_user($username, $passwort)) + return new SoapFault("Server", "Invalid Credentials"); + + $rechte = new benutzerberechtigung(); + $rechte->getBerechtigungen($user); + + if(!$rechte->isBerechtigt('planner', null, 'suid')) + return new SoapFault("Server", "Sie haben keine Berechtigung zum Loeschen von Phasen"); + + $phase = new projektphase(); + if($phase->delete($projektphase_id)) + return "OK"; + else + return new SoapFault("Server", $phase->errormsg); +} +?> \ No newline at end of file diff --git a/soap/projektphase.wsdl.php b/soap/projektphase.wsdl.php index 173628a3f..fa0b7dd41 100755 --- a/soap/projektphase.wsdl.php +++ b/soap/projektphase.wsdl.php @@ -13,14 +13,14 @@ xmlns:xsd1="http://localhost/soap/projektphase.xsd" xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/"> - + - + - - + + @@ -35,33 +35,55 @@ xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/"> - - - + + + + + + + + + + + + - - - - - - + + + + + + + + + + - - - - " /> - - - - - - - - + + + + " /> + + + + + + + + + " /> + + + + + + + + - - - "/> - - + + + "/> + +