[geeklog-cvs] Auth_Enterprise/Server AEServiceUser.class.php,1.3,1.4
tony at iowaoutdoors.org
tony at iowaoutdoors.org
Sat Jun 19 16:26:33 EDT 2004
Update of /var/cvs/Auth_Enterprise/Server
In directory www:/tmp/cvs-serv16998
Modified Files:
AEServiceUser.class.php
Log Message:
Added toArray() method to get around PEAR::XML_RPC limitation with PHP5 objects.
Index: AEServiceUser.class.php
===================================================================
RCS file: /var/cvs/Auth_Enterprise/Server/AEServiceUser.class.php,v
retrieving revision 1.3
retrieving revision 1.4
diff -C2 -d -r1.3 -r1.4
*** AEServiceUser.class.php 18 Jun 2004 21:35:27 -0000 1.3
--- AEServiceUser.class.php 19 Jun 2004 20:26:31 -0000 1.4
***************
*** 62,65 ****
--- 62,100 ----
/**
+ * Converts an instance of this class into an array
+ *
+ * This class is needed because PEAR::XMLRPC is unable to encode PHP5 objects. Until this is
+ * addressed we will have to use this method before sending a user object back to the calling
+ * XMLRPC client application
+ *
+ * @author Tony Bibbs <tony at geeklog.net>
+ * @access public
+ * @return array Array representing this object
+ *
+ */
+ public function toArray()
+ {
+ $tmpArray = array();
+ $tmpArray['userName'] = $this->userName;
+ $tmpArray['appId'] = $this->appId;
+ $tmpArray['password'] = $this->password;
+ $tmpArray['accountLocked'] = $this->accountLocked;
+ $tmpArray['failedAttemtps'] = $this->failedAttempts;
+ $tmpArray['lastPWChange'] = $this->lastPWChange;
+ $privArray = array();
+ foreach ($this->privileges as $curPriv) {
+ $privArray[] = $curPriv->toArray();
+ }
+ $tmpArray['privileges'] = $privArray;
+
+ $groupArray = array();
+ foreach ($this->groups as $curGroup) {
+ $groupArray[] = $curGroup->toArray();
+ }
+ $tmpArray['groups'] = $groupArray;
+ return $tmpArray;
+ }
+
+ /**
* Constructor
*
***************
*** 549,551 ****
}
}
! ?>
\ No newline at end of file
--- 584,587 ----
}
}
!
! ?>
\ No newline at end of file
More information about the geeklog-cvs
mailing list