[geeklog-cvs] Auth_Enterprise/Enterprise/Client SOAP.php,1.3,1.4
tony at iowaoutdoors.org
tony at iowaoutdoors.org
Wed Jul 28 11:18:44 EDT 2004
Update of /var/cvs/Auth_Enterprise/Enterprise/Client
In directory www:/tmp/cvs-serv17887
Modified Files:
SOAP.php
Log Message:
All function are implemented, none other than authenticate have been tested.
Index: SOAP.php
===================================================================
RCS file: /var/cvs/Auth_Enterprise/Enterprise/Client/SOAP.php,v
retrieving revision 1.3
retrieving revision 1.4
diff -C2 -d -r1.3 -r1.4
*** SOAP.php 27 Jul 2004 20:43:05 -0000 1.3
--- SOAP.php 28 Jul 2004 15:18:40 -0000 1.4
***************
*** 52,56 ****
* Get handle to an instance of XML RPC Client. This client provider has the following options:
* - appId string Auth_Enterprise ID given to an application, REQUIRED
- * - debug int 1=on, 0=off, OPTIONAL
* - wsdl string WSDL File for Auth_Enterprise SOAP Service, REQUIRED but can be null
* - php_soap_options Array of client options to built in PHP SOAP Server (See
--- 52,55 ----
***************
*** 87,100 ****
$result = $this->SOAPClient->authenticate($userName, $password, $this->getAppId());
! // If we got a fault, throw an exception back to the calling
! // application
! if (is_soap_fault($result)) {
! try {
! $e = $this->faultToException($result->faultcode, $result->faultstring);
! throw $e;
! } catch (AEBaseException $e) {
! throw $e;
! }
! }
// Convert SOAP response to user object. This is quite easy as the SOAP server returns an
--- 86,90 ----
$result = $this->SOAPClient->authenticate($userName, $password, $this->getAppId());
! $this->checkForFault($result);
// Convert SOAP response to user object. This is quite easy as the SOAP server returns an
***************
*** 122,137 ****
public function createAccountByAdmin($adminUserName, $adminPassword, $userName, $userPassword)
{
! $result->$this->SOAPClient->createAccountByAdmin($adminUsername, $adminPassword, $userName, $userPassword, $this->getAppId());
!
! // If we got a fault, throw an exception back to the calling
! // application
! if (is_soap_fault($result)) {
! try {
! $e = $this->faultToException($result->faultcode, $result->faultstring);
! throw $e;
! } catch (AEBaseException $e) {
! throw $e;
! }
! }
}
--- 112,246 ----
public function createAccountByAdmin($adminUserName, $adminPassword, $userName, $userPassword)
{
! $result = $this->SOAPClient->createAccountByAdmin($adminUsername, $adminPassword, $userName, $userPassword, $this->getAppId());
! $this->checkForFault($result);
! }
!
! /**
! * Changes a user's password
! *
! * @author Tony Bibbs <tony at geeklog.net>
! * @access public
! *
! */
! public function changePassword($userName, $newPassword)
! {
! $result = $this->SOAPClient->changePassword($userName, $newPassword, $this->getAppId());
! $this->checkForFault($result);
! }
!
! /**
! * Allows an application level admin to change a
! * user's password
! *
! * @author Tony Bibbs <tony at geeklog.net>
! * @access public
! *
! */
! public function changePasswordByAdmin($adminUserName, $adminPassword, $userName, $newPassword)
! {
! $result = $this->SOAPClient->changePasswordByAdmin($adminUserName, $adminPassword,
! $userName, $newPassword, $this->getAppId());
! $this->checkForFault($result);
! }
!
! /**
! * Resets a user's password
! *
! * @author Tony Bibbs <tony at geeklog.net>
! * @access public
! *
! */
! public function resetPassword($userName)
! {
! $result = $this->SOAPClient->resetPassword($userName, $this->getAppId());
! $this->checkForFault($result);
! }
!
! /**
! * Gets the application privileges for a given user
! *
! * @author Tony Bibbs <tony at geeklog.net>
! * @access public
! *
! */
! public function getUserPrivilegesByAdmin($adminUserName, $adminPassword, $userName)
! {
! $result = $this->SOAPClient->getUserPrivilegesByAdmin($adminUserName, $adminPassword,
! $userName, $this->getAppId());
! $this->checkForFault($result);
! return $this->stdObjArrayToPrivileges($result);
! }
!
! /**
! * Sets the application privileges for a given user
! *
! * @author Tony Bibbs <tony at geeklog.net>
! * @access public
! *
! */
! public function setUserPrivilegesByAdmin($adminUserName, $adminPassword, $userName, $privArray)
! {
! $result = $this->SOAPClient->setUserPrivilegesByAdmin($adminUserName, $adminPassword,
! $userName, $privArray, $this->getAppId());
! $this->checkForFault($result);
! }
!
! /**
! * Lists all available privileges for a given application
! *
! * @author Tony Bibbs <tony at geeklog.net>
! * @access public
! *
! */
! public function listAppPrivilegesByAdmin($adminUserName, $adminPassword)
! {
! $result = $this->SOAPClient->listAppPrivilegesByAdmin($adminUserName, $adminPassword,
! $this->getAppId());
! $this->checkForFault($result);
! return $this->stdObjArrayToPrivileges($result);
! }
!
! /**
! * Lists all available groups for a given application
! *
! * @author Tony Bibbs <tony at geeklog.net>
! * @access public
! *
! */
! public function listAppGroupsByAdmin($adminUserName, $adminPassowrd)
! {
! $result = $this->SOAPClient->listAppGroupsByAdmin($adminUserName, $adminPassword,
! $this->getAppId());
! $this->checkForFault($result);
! return $this->stdObjArrayToPrivileges($result);
! }
!
! /**
! * Gets the application privileges for a given user
! *
! * @author Tony Bibbs <tony at geeklog.net>
! * @access public
! *
! */
! public function getUserGroupsByAdmin($adminUserName, $adminPassword, $userName)
! {
! $result = $this->SOAPClient->getUserGroupsByAdmin($adminUserName, $adminPassword,
! $userName, $this->getAppId());
! $this->checkForFault($result);
! return $this->stdObjArrayToGroups($result);
! }
!
! /**
! * Sets the application privileges for a given user
! *
! * @author Tony Bibbs <tony at geeklog.net>
! * @access public
! *
! */
! public function setUserGroupsByAdmin($adminUserName, $adminPassword, $userName, $groupArray)
! {
! $result = $this->SOAPClient->setUserGroupsByAdmin($adminUserName, $adminPassword,
! $userName, $groupArray, $this->getAppId());
! $this->checkForFault($result);
}
***************
*** 274,277 ****
--- 383,409 ----
}
}
+
+ /**
+ * Checks to see if given SOAP response is a fault, if so it will throw the corresponding
+ * exception.
+ *
+ * @author Tony Bibbs <tony at geeklog.net>
+ * @access private
+ * @param obj $soapResponse Possible soap fault
+ *
+ */
+ private function checkForFault($soapResponse)
+ {
+ // If we got a fault, throw an exception back to the calling
+ // application
+ if (is_soap_fault($result)) {
+ try {
+ $e = $this->faultToException($result->faultcode, $result->faultstring);
+ throw $e;
+ } catch (AEBaseException $e) {
+ throw $e;
+ }
+ }
+ }
}
More information about the geeklog-cvs
mailing list