[geeklog-cvs] Auth_Enterprise/Client AEBaseClientProvider.class.php,1.1.1.1,1.2 AEClient.class.php,1.1.1.1,1.2 AEClientProviderFactory.class.php,1.1.1.1,1.2 AEUser.class.php,1.1.1.1,1.2 AEXMLRPC.class.php,1.1.1.1,1.2
tony at geeklog.net
tony at geeklog.net
Tue Oct 28 19:52:42 EST 2003
- Previous message (by thread): [geeklog-cvs] Auth_Enterprise/Server AEBaseCommand.class.php,1.1.1.1,1.2 AEIncludes.php,1.1.1.1,1.2 AEProviderFactory.class.php,1.1.1.1,1.2 AEServerConfig.php,1.1.1.1,1.2 AEServiceUser.class.php,1.1.1.1,1.2 includes.php,1.1.1.1,1.2 config.php,1.1.1.1,NONE
- Next message (by thread): [geeklog-cvs] Auth_Enterprise/Server/providers AEBaseProvider.class.php,1.1.1.1,1.2 AEPearDB.class.php,1.1.1.1,1.2
- Messages sorted by:
[ date ]
[ thread ]
[ subject ]
[ author ]
Update of /usr/cvs/geeklog/Auth_Enterprise/Client
In directory geeklog_prod:/tmp/cvs-serv1664/Client
Modified Files:
AEBaseClientProvider.class.php AEClient.class.php
AEClientProviderFactory.class.php AEUser.class.php
AEXMLRPC.class.php
Log Message:
Authenticate method nearly complete using XML_RPC
Index: AEBaseClientProvider.class.php
===================================================================
RCS file: /usr/cvs/geeklog/Auth_Enterprise/Client/AEBaseClientProvider.class.php,v
retrieving revision 1.1.1.1
retrieving revision 1.2
diff -C2 -d -r1.1.1.1 -r1.2
*** AEBaseClientProvider.class.php 23 Oct 2003 14:17:34 -0000 1.1.1.1
--- AEBaseClientProvider.class.php 29 Oct 2003 00:52:40 -0000 1.2
***************
*** 1,120 ****
<?php
!
! /**
! * Auth_Enterprise
! *
! * This source file is subject to version 2.02 of the PHP license,
! * that is bundled with this package in the file LICENSE, and is
! * available at through the world-wide-web at
! * http://www.php.net/license/2_02.txt.
! * If you did not receive a copy of the PHP license and are unable to
! * obtain it through the world-wide-web, please send a note to
! * license at php.net so we can mail you a copy immediately.
! *
! * @author Tony Bibbs <tony at geeklog.net>
! * @copyright 2003
! * @version $Id$
! *
! */
!
! /**
! * Auth_Enteprise base client provider
! *
! * All client implementation of the Auth_Enterprise service
! * should extend this abstract class
! *
! * @author Tony Bibbs <tony at geeklog.net>
! * @package net.geeklog.auth_enterprise.client
! * @todo When converting to PHP5 make this an abstract class
! *
*/
! class AEBaseClientProvider extends AEServiceInterface {
! /**
! * Application ID
! * @access private
! * @var string
! */
var $_appId = null;
! /**
! * Host name or IP of Auth_Enteprise server
! * @access private
! * @var string
! */
var $_server = null;
! /**
! * Relative path on server where service can be found
! * @access private
! * @var string
! */
var $_path = null;
! /**
! * Port on Auth_Enterprise server to connect to
! * @access private
! * @var int
! */
var $_port = null;
! /**
! * Host name or IP of proxy server to use
! * @access private
! * @var string
! */
var $_proxy = null;
! /**
! * Port on proxy server to use
! * @access private
! * @var int
! */
var $_proxyPort = null;
! /**
! * Username to authenticate with on proxy server
! * @access private
! * @var string
! */
var $_proxyUser = null;
! /**
! * Password to authenticate with on proxy server
! * @access private
! * @var string
! */
var $_proxyPassword = null;
!
! /**
! * Constructor
! *
! * Sets up client properties so that calls to Auth_Enterprise will work
! *
! * @author Tony Bibbs <tony.bibbs at iowa.gov>
! * @access public
! * @param string $appId The ID assigned to the application by the
! * Auth_Enterprise service
! * @param string $server Host name or IP for Auth_Enterprise service
! * @param string $path Path on the server where the service is located
! * @param int $port Port on Auth_Enterprise service to connect to
! * @param string $proxy Host name or IP of proxy server client should
! * use to get out
! * @param int $proxyPort Port on proxy server to connect through to get
! * out to use Auth_Enterprise service
! * @param string $proxyUser Username to use to authenticate with on proxy
! * @param string $proxyPassword Password to use to authenticate with on
! * proxy server
! *
! */
! function AEBaseClientProvider($appId, $server, $path, $port, $proxy, $proxyPort, $proxyUser, $proxyPassword)
! {
! $this->_appId = $appId;
! $this->_server = $server;
! $this->_path = $path;
! $this->_port = $port;
! $this->_proxy = $proxy;
! $this->_proxyPort = $proxyPort;
! $this->_proxyUser = $proxyUser;
! $this->_proxyPassword = $proxyPassword;
! }
!
! function getAppId()
! {
! return $this->_appId;
}
}
-
?>
--- 1,115 ----
<?php
! /**
! * Auth_Enterprise
! *
! * This source file is subject to version 2.02 of the PHP license,
! * that is bundled with this package in the file LICENSE, and is
! * available at through the world-wide-web at
! * http://www.php.net/license/2_02.txt.
! * If you did not receive a copy of the PHP license and are unable to
! * obtain it through the world-wide-web, please send a note to
! * license at php.net so we can mail you a copy immediately.
! *
! * @author Tony Bibbs <tony at geeklog.net>
! * @copyright 2003
! * @version $Id$
! *
*/
! /**
! * Auth_Enteprise base client provider
! *
! * All client implementation of the Auth_Enterprise service
! * should extend this abstract class
! *
! * @author Tony Bibbs <tony at geeklog.net>
! * @package net.geeklog.auth_enterprise.client
! * @todo When converting to PHP5 make this an abstract class
! *
! */
! class AEBaseClientProvider extends AEServiceInterface {
! /**
! * Application ID
! * @access private
! * @var string
! */
var $_appId = null;
! /**
! * Host name or IP of Auth_Enteprise server
! * @access private
! * @var string
! */
var $_server = null;
! /**
! * Relative path on server where service can be found
! * @access private
! * @var string
! */
var $_path = null;
! /**
! * Port on Auth_Enterprise server to connect to
! * @access private
! * @var int
! */
var $_port = null;
! /**
! * Host name or IP of proxy server to use
! * @access private
! * @var string
! */
var $_proxy = null;
! /**
! * Port on proxy server to use
! * @access private
! * @var int
! */
var $_proxyPort = null;
! /**
! * Username to authenticate with on proxy server
! * @access private
! * @var string
! */
var $_proxyUser = null;
! /**
! * Password to authenticate with on proxy server
! * @access private
! * @var string
! */
var $_proxyPassword = null;
! /**
! * Constructor
! *
! * Sets up client properties so that calls to Auth_Enterprise will work
! *
! * @author Tony Bibbs <tony.bibbs at iowa.gov>
! * @access public
! * @param string $appId The ID assigned to the application by the
! * Auth_Enterprise service
! * @param string $server Host name or IP for Auth_Enterprise service
! * @param string $path Path on the server where the service is located
! * @param int $port Port on Auth_Enterprise service to connect to
! * @param string $proxy Host name or IP of proxy server client should
! * use to get out
! * @param int $proxyPort Port on proxy server to connect through to get
! * out to use Auth_Enterprise service
! * @param string $proxyUser Username to use to authenticate with on proxy
! * @param string $proxyPassword Password to use to authenticate with on
! * proxy server
! *
! */
! function AEBaseClientProvider($appId, $server='', $path='', $port='', $proxy='', $proxyPort='', $proxyUser='', $proxyPassword='')
! {
! $this->_appId = $appId;
! $this->_server = $server;
! $this->_path = $path;
! $this->_port = $port;
! $this->_proxy = $proxy;
! $this->_proxyPort = $proxyPort;
! $this->_proxyUser = $proxyUser;
! $this->_proxyPassword = $proxyPassword;
}
+ function getAppId()
+ {
+ return $this->_appId;
+ }
}
?>
Index: AEClient.class.php
===================================================================
RCS file: /usr/cvs/geeklog/Auth_Enterprise/Client/AEClient.class.php,v
retrieving revision 1.1.1.1
retrieving revision 1.2
diff -C2 -d -r1.1.1.1 -r1.2
*** AEClient.class.php 23 Oct 2003 14:17:34 -0000 1.1.1.1
--- AEClient.class.php 29 Oct 2003 00:52:40 -0000 1.2
***************
*** 1,277 ****
<?php
!
! /**
! * Auth_Enterprise
! *
! * This source file is subject to version 2.02 of the PHP license,
! * that is bundled with this package in the file LICENSE, and is
! * available at through the world-wide-web at
! * http://www.php.net/license/2_02.txt.
! * If you did not receive a copy of the PHP license and are unable to
! * obtain it through the world-wide-web, please send a note to
! * license at php.net so we can mail you a copy immediately.
! *
! * @author Tony Bibbs <tony at geeklog.net>
! * @copyright 2003
! * @version $Id$
! *
! */
!
! /**
! * The Base PEAR object
*/
require_once 'PEAR.php';
!
! /**
! * The Auth_Enterprise Service Interface
! */
require_once 'Auth_Enterprise/Common/AEServiceInterface.class.php';
!
! /**
! * A&A User Class
! */
! require_once 'Auth_Enterprise/Client/AEUser.class.php';
!
! /**
! * A&A Privilege Class
! */
//require_once 'Auth_Enterprise/Common/AEPrivilege.class.php';
!
! /**
! * The Auth_Enterprise Client Provider Factory
! */
require_once 'Auth_Enterprise/Client/AEClientProviderFactory.class.php';
!
! /**
! * Used to tell client to use Auth_Enterprise's
! * XML RPC Implementation
! * @const AE_XML_RPC
! */
define('AE_XML_RPC', 'AEXMLRPC');
!
! /**
! * Used to tell client to use Auth_Enterprise's
! * SOAP implementation
! * @const AE_SOAP
! */
! define('AE_SOAP', 'AESOAP');
!
! /**
! * Auth_Enteprise Client
! *
! * @author Tony Bibbs <tony at geeklog.net>
! * @package net.geeklog.auth_enterprise.client
! *
! */
! class AEClient extends AEServiceInterface {
! /**
! * Authenticates a user with the Auth_Enterprise service
! *
! * Uses the instance to the client provider to authenticate a user. Typically this
! * is the only method in this class you should have to call directly. After you
! * successfully authentciate you should have a valid AEUser instance and you can
! * call the methods you need from there.
! *
! * @author Tony Bibbs <tony at geeklog.net>
! * @access public
! * @param string $userId User ID to authenticate to the service with
! * @param string $password Password to authenticate with
! * @param string $appId Application ID that identifies app withthe Auth_Enterprise server
! * @param string $method Communication method to use when talking with server
! * @param string $server Host name or IP for Auth_Enterprise service
! * @param string $path Path on the server where the service is located
! * @param int $port Port on Auth_Enterprise service to connect to
! * @param string $proxy Host name or IP of proxy server client should
! * use to get out
! * @param int $proxyPort Port on proxy server to connect through to get
! * out to use Auth_Enterprise service
! * @param string $proxyUser Username to use to authenticate with on proxy
! * @param string $proxyPassword Password to use to authenticate with on
! * proxy server
! * @return object AEUser Object
! *
! */
! function &authenticate($userId, $password, $appId, $method, $server, $path = '', $port = 80,
! $proxy = '', $proxyPort = 8080, $proxyUser = '', $proxyPassword = '')
! {
!
! AEUtility::logMessage('Inside client authentication method',__FILE__,__LINE__);
! $clientProvider = &AEClientProviderFactory::getProvider($method, $appId, $server, $path, $port, $proxy, $proxyPort, $proxyUser, $proxyPassword);
! AEUtility::logMessage('Calling authenticate on the XMLRPC client provider',__FILE__,__LINE__);
! $userObj = $clientProvider->authenticate($userId, $password);
! if (!PEAR::isError($userObj)) {
! $userObj->setAEProperties($method, $appId, $server, $path, $port, $proxy, $proxyPort, $proxyUser, $proxyPassword);
! }
! return $userObj;
! }
!
! /**
! * Registers a new account with the service
! *
! * @author Tony Bibbs <tony at geeklog.net>
! * @access public
! * @param string $appId Application ID that identifies app withthe Auth_Enterprise server
! * @param string $method Communication method to use when talking with server
! * @param string $server Host name or IP for Auth_Enterprise service
! * @param string $path Path on the server where the service is located
! * @param int $port Port on Auth_Enterprise service to connect to
! * @param string $proxy Host name or IP of proxy server client should
! * use to get out
! * @param int $proxyPort Port on proxy server to connect through to get
! * out to use Auth_Enterprise service
! * @param string $proxyUser Username to use to authenticate with on proxy
! * @param string $proxyPassword Password to use to authenticate with on
! * proxy server
! *
! */
! function createAccount($appId, $method, $server, $path = '', $port = 80, $proxy = '', $proxyPort = 8080, $proxyUser = '', $proxyPassword = '')
! {
! }
!
! /**
! * Changes a user's password
! *
! * @author Tony Bibbs <tony at geeklog.net>
! * @access public
! * @param string $userId User ID to change password for
! * @param string $newPassword User's new password
! * @param string $appId Application ID that identifies app withthe Auth_Enterprise server
! * @param string $method Communication method to use when talking with server
! * @param string $server Host name or IP for Auth_Enterprise service
! * @param string $path Path on the server where the service is located
! * @param int $port Port on Auth_Enterprise service to connect to
! * @param string $proxy Host name or IP of proxy server client should
! * use to get out
! * @param int $proxyPort Port on proxy server to connect through to get
! * out to use Auth_Enterprise service
! * @param string $proxyUser Username to use to authenticate with on proxy
! * @param string $proxyPassword Password to use to authenticate with on
! * proxy server
! * @return object Either a PEAR Error or nothing
! *
! */
! function changePassword($userId, $newPassword, $appId, $method, $server, $path = '', $port = 80, $proxy = '', $proxyPort = 8080, $proxyUser = '', $proxyPassword = '')
! {
! $clientProvider = &AEClientProviderFactory::getProvider($method, $appId, $server, $path, $port, $proxy, $proxyPort, $proxyUser, $proxyPassword);
! return $clientProvider->changePassword($userId, $newPassword);
}
!
! /**
! * Allows an application level admin to change a
! * user's password
! *
! * @author Tony Bibbs <tony at geeklog.net>
! * @access public
! * @param string $adminUserId ID of admin user making the request
! * @param string $adminPassword Password of admin user making the request
! * @param string $userId ID of user to change password for
! * @param string $newPassword New password for the given user
! * @param string $appId Application ID that identifies app withthe Auth_Enterprise server
! * @param string $method Communication method to use when talking with server
! * @param string $server Host name or IP for Auth_Enterprise service
! * @param string $path Path on the server where the service is located
! * @param int $port Port on Auth_Enterprise service to connect to
! * @param string $proxy Host name or IP of proxy server client should
! * use to get out
! * @param int $proxyPort Port on proxy server to connect through to get
! * out to use Auth_Enterprise service
! * @param string $proxyUser Username to use to authenticate with on proxy
! * @param string $proxyPassword Password to use to authenticate with on
! * proxy server
! *
! */
! function changePasswordByAdmin($adminUserId, $adminPassword, $userId, $newPassword, $appId, $method, $server, $path = '', $port = 80, $proxy = '', $proxyPort = 8080, $proxyUser = '', $proxyPassword = '')
! {
! $clientProvider = &AEClientProviderFactory::getProvider($method, $appId, $server, $path, $port, $proxy, $proxyPort, $proxyUser, $proxyPassword);
! return $clientProvider->changePasswordByAdmin($adminUserId, $adminPassword, $userId, $newPassword);
}
!
! /**
! * Gets the application privileges for a given user
! *
! * @author Tony Bibbs <tony at geeklog.net>
! * @access public
! * @param string $adminUserId Admin user making the request
! * @param string $adminPassword Password for admin making the request
! * @param string $userId ID of user to get privileges for
! * @param string $appId Application ID that identifies app withthe Auth_Enterprise server
! * @param string $method Communication method to use when talking with server
! * @param string $server Host name or IP for Auth_Enterprise service
! * @param string $path Path on the server where the service is located
! * @param int $port Port on Auth_Enterprise service to connect to
! * @param string $proxy Host name or IP of proxy server client should
! * use to get out
! * @param int $proxyPort Port on proxy server to connect through to get
! * out to use Auth_Enterprise service
! * @param string $proxyUser Username to use to authenticate with on proxy
! * @param string $proxyPassword Password to use to authenticate with on
! * proxy server
! * @return Array|object Either an array of privileges or a PEAR Error
! *
! */
! function getUserPrivilegesByAdmin($adminUserId, $adminPassword, $userId, $appId, $method, $server, $path = '', $port = 80, $proxy = '', $proxyPort = 8080, $proxyUser = '', $proxyPassword = '')
! {
! $clientProvider = &AEClientProviderFactory::getProvider($method, $appId, $server, $path, $port, $proxy, $proxyPort, $proxyUser, $proxyPassword);
! return $clientProvider->changePasswordByAdmin($adminUserId, $adminPassword, $userId, $newPassword);
}
!
! /**
! * Sets the application privileges for a given user
! *
! * @author Tony Bibbs <tony at geeklog.net>
! * @access public
! * @param string $adminUserId Admin user making the request
! * @param string $adminPassword Password for admin making the request
! * @param string $userId ID of user to set privileges for
! * @param array $privArray Array of privileges to give the user
! * @param string $appId Application ID that identifies app withthe Auth_Enterprise server
! * @param string $method Communication method to use when talking with server
! * @param string $server Host name or IP for Auth_Enterprise service
! * @param string $path Path on the server where the service is located
! * @param int $port Port on Auth_Enterprise service to connect to
! * @param string $proxy Host name or IP of proxy server client should
! * use to get out
! * @param int $proxyPort Port on proxy server to connect through to get
! * out to use Auth_Enterprise service
! * @param string $proxyUser Username to use to authenticate with on proxy
! * @param string $proxyPassword Password to use to authenticate with on
! * proxy server
! * @return object PEAR Error or nothing
! *
! */
! function setUserPrivilegesByAdmin($adminUserId, $adminPassword, $userId, $privArray, $appId, $method, $server, $path = '', $port = 80, $proxy = '', $proxyPort = 8080, $proxyUser = '', $proxyPassword = '')
! {
! $clientProvider = &AEClientProviderFactory::getProvider($method, $appId, $server, $path, $port, $proxy, $proxyPort, $proxyUser, $proxyPassword);
! return $clientProvider->setUserPrivilegesByAdmin($adminUserId, $adminPassword, $userId, $privArray);
}
!
! /**
! * Lists all available privileges for a given application
! *
! * @author Tony Bibbs <tony at geeklog.net>
! * @access public
! * @param string $adminUserId Admin user making the request
! * @param string $adminPassword Password for admin making the request
! * @param string $appId Application ID that identifies app withthe Auth_Enterprise server
! * @param string $method Communication method to use when talking with server
! * @param string $server Host name or IP for Auth_Enterprise service
! * @param string $path Path on the server where the service is located
! * @param int $port Port on Auth_Enterprise service to connect to
! * @param string $proxy Host name or IP of proxy server client should
! * use to get out
! * @param int $proxyPort Port on proxy server to connect through to get
! * out to use Auth_Enterprise service
! * @param string $proxyUser Username to use to authenticate with on proxy
! * @param string $proxyPassword Password to use to authenticate with on
! * proxy server
! * @return Array|Object Either an array of privileges or a PEAR Error
! *
! */
! function listAppPrivilegesByAdmin($adminUserId, $adminPassword, $appId, $method, $server, $path = '', $port = 80, $proxy = '', $proxyPort = 8080, $proxyUser = '', $proxyPassword = '')
! {
! $clientProvider = &AEClientProviderFactory::getProvider($method, $appId, $server, $path, $port, $proxy, $proxyPort, $proxyUser, $proxyPassword);
! return $clientProvider->listAppPrivilegesByAdmin($adminUserId, $adminPassword, $userId, $privArray);
}
}
-
?>
--- 1,269 ----
<?php
! /**
! * Auth_Enterprise
! *
! * This source file is subject to version 2.02 of the PHP license,
! * that is bundled with this package in the file LICENSE, and is
! * available at through the world-wide-web at
! * http://www.php.net/license/2_02.txt.
! * If you did not receive a copy of the PHP license and are unable to
! * obtain it through the world-wide-web, please send a note to
! * license at php.net so we can mail you a copy immediately.
! *
! * @author Tony Bibbs <tony at geeklog.net>
! * @copyright 2003
! * @version $Id$
! *
*/
+ /**
+ * The Base PEAR object
+ */
require_once 'PEAR.php';
! /**
! * The Auth_Enterprise Service Interface
! */
require_once 'Auth_Enterprise/Common/AEServiceInterface.class.php';
! /**
! * A&A User Class
! */
! require_once 'Auth_Enterprise/Client/AEUser.class.php';
!
! /**
! * A&A Privilege Class
! */
//require_once 'Auth_Enterprise/Common/AEPrivilege.class.php';
! /**
! * The Auth_Enterprise Client Provider Factory
! */
require_once 'Auth_Enterprise/Client/AEClientProviderFactory.class.php';
! /**
! * Used to tell client to use Auth_Enterprise's
! * Localhost Implementation
! * @const AE_LOCALHOST
! */
! define('AE_LOCALHOST', 'AELocalhost');
! /**
! * Used to tell client to use Auth_Enterprise's
! * XML RPC Implementation
! * @const AE_XML_RPC
! */
define('AE_XML_RPC', 'AEXMLRPC');
! /**
! * Used to tell client to use Auth_Enterprise's
! * SOAP implementation
! * @const AE_SOAP
! */
! define('AE_SOAP', 'AESOAP');
!
! /**
! * Auth_Enteprise Client
! *
! * @author Tony Bibbs <tony at geeklog.net>
! * @package net.geeklog.auth_enterprise.client
! *
! */
! class AEClient extends AEServiceInterface {
! /**
! * Authenticates a user with the Auth_Enterprise service
! *
! * Uses the instance to the client provider to authenticate a user. Typically this
! * is the only method in this class you should have to call directly. After you
! * successfully authentciate you should have a valid AEUser instance and you can
! * call the methods you need from there.
! *
! * @author Tony Bibbs <tony at geeklog.net>
! * @access public
! * @param string $userId User ID to authenticate to the service with
! * @param string $password Password to authenticate with
! * @param string $appId Application ID that identifies app withthe Auth_Enterprise server
! * @param string $method Communication method to use when talking with server
! * @param string $server Host name or IP for Auth_Enterprise service
! * @param string $path Path on the server where the service is located
! * @param int $port Port on Auth_Enterprise service to connect to
! * @param string $proxy Host name or IP of proxy server client should
! * use to get out
! * @param int $proxyPort Port on proxy server to connect through to get
! * out to use Auth_Enterprise service
! * @param string $proxyUser Username to use to authenticate with on proxy
! * @param string $proxyPassword Password to use to authenticate with on
! * proxy server
! * @return object AEUser Object
! *
! */
! function &authenticate($userId, $password, $appId, $method, $server, $path = '', $port = 80,
! $proxy = '', $proxyPort = 8080, $proxyUser = '', $proxyPassword = '')
! {
! AEUtility::logMessage('Inside client authentication method',__FILE__,__LINE__);
! $clientProvider = &AEClientProviderFactory::getProvider($method, $appId, $server, $path, $port, $proxy, $proxyPort, $proxyUser, $proxyPassword);
! AEUtility::logMessage('Calling authenticate on the XMLRPC client provider',__FILE__,__LINE__);
! $userObj = $clientProvider->authenticate($userId, $password);
! if (!PEAR::isError($userObj)) {
! $userObj->setAEProperties($method, $appId, $server, $path, $port, $proxy, $proxyPort, $proxyUser, $proxyPassword);
! }
! return $userObj;
}
! /**
! * Registers a new account with the service
! *
! * @author Tony Bibbs <tony at geeklog.net>
! * @access public
! * @param string $appId Application ID that identifies app withthe Auth_Enterprise server
! * @param string $method Communication method to use when talking with server
! * @param string $server Host name or IP for Auth_Enterprise service
! * @param string $path Path on the server where the service is located
! * @param int $port Port on Auth_Enterprise service to connect to
! * @param string $proxy Host name or IP of proxy server client should
! * use to get out
! * @param int $proxyPort Port on proxy server to connect through to get
! * out to use Auth_Enterprise service
! * @param string $proxyUser Username to use to authenticate with on proxy
! * @param string $proxyPassword Password to use to authenticate with on
! * proxy server
! *
! */
! function createAccount($appId, $method, $server, $path = '', $port = 80, $proxy = '', $proxyPort = 8080, $proxyUser = '', $proxyPassword = '')
! {
! }
!
! /**
! * Changes a user's password
! *
! * @author Tony Bibbs <tony at geeklog.net>
! * @access public
! * @param string $userId User ID to change password for
! * @param string $newPassword User's new password
! * @param string $appId Application ID that identifies app withthe Auth_Enterprise server
! * @param string $method Communication method to use when talking with server
! * @param string $server Host name or IP for Auth_Enterprise service
! * @param string $path Path on the server where the service is located
! * @param int $port Port on Auth_Enterprise service to connect to
! * @param string $proxy Host name or IP of proxy server client should
! * use to get out
! * @param int $proxyPort Port on proxy server to connect through to get
! * out to use Auth_Enterprise service
! * @param string $proxyUser Username to use to authenticate with on proxy
! * @param string $proxyPassword Password to use to authenticate with on
! * proxy server
! * @return object Either a PEAR Error or nothing
! *
! */
! function changePassword($userId, $newPassword, $appId, $method, $server, $path = '', $port = 80, $proxy = '', $proxyPort = 8080, $proxyUser = '', $proxyPassword = '')
! {
! $clientProvider = &AEClientProviderFactory::getProvider($method, $appId, $server, $path, $port, $proxy, $proxyPort, $proxyUser, $proxyPassword);
! return $clientProvider->changePassword($userId, $newPassword);
}
! /**
! * Allows an application level admin to change a
! * user's password
! *
! * @author Tony Bibbs <tony at geeklog.net>
! * @access public
! * @param string $adminUserId ID of admin user making the request
! * @param string $adminPassword Password of admin user making the request
! * @param string $userId ID of user to change password for
! * @param string $newPassword New password for the given user
! * @param string $appId Application ID that identifies app withthe Auth_Enterprise server
! * @param string $method Communication method to use when talking with server
! * @param string $server Host name or IP for Auth_Enterprise service
! * @param string $path Path on the server where the service is located
! * @param int $port Port on Auth_Enterprise service to connect to
! * @param string $proxy Host name or IP of proxy server client should
! * use to get out
! * @param int $proxyPort Port on proxy server to connect through to get
! * out to use Auth_Enterprise service
! * @param string $proxyUser Username to use to authenticate with on proxy
! * @param string $proxyPassword Password to use to authenticate with on
! * proxy server
! *
! */
! function changePasswordByAdmin($adminUserId, $adminPassword, $userId, $newPassword, $appId, $method, $server, $path = '', $port = 80, $proxy = '', $proxyPort = 8080, $proxyUser = '', $proxyPassword = '')
! {
! $clientProvider = &AEClientProviderFactory::getProvider($method, $appId, $server, $path, $port, $proxy, $proxyPort, $proxyUser, $proxyPassword);
! return $clientProvider->changePasswordByAdmin($adminUserId, $adminPassword, $userId, $newPassword);
}
! /**
! * Gets the application privileges for a given user
! *
! * @author Tony Bibbs <tony at geeklog.net>
! * @access public
! * @param string $adminUserId Admin user making the request
! * @param string $adminPassword Password for admin making the request
! * @param string $userId ID of user to get privileges for
! * @param string $appId Application ID that identifies app withthe Auth_Enterprise server
! * @param string $method Communication method to use when talking with server
! * @param string $server Host name or IP for Auth_Enterprise service
! * @param string $path Path on the server where the service is located
! * @param int $port Port on Auth_Enterprise service to connect to
! * @param string $proxy Host name or IP of proxy server client should
! * use to get out
! * @param int $proxyPort Port on proxy server to connect through to get
! * out to use Auth_Enterprise service
! * @param string $proxyUser Username to use to authenticate with on proxy
! * @param string $proxyPassword Password to use to authenticate with on
! * proxy server
! * @return Array|object Either an array of privileges or a PEAR Error
! *
! */
! function getUserPrivilegesByAdmin($adminUserId, $adminPassword, $userId, $appId, $method, $server, $path = '', $port = 80, $proxy = '', $proxyPort = 8080, $proxyUser = '', $proxyPassword = '')
! {
! $clientProvider = &AEClientProviderFactory::getProvider($method, $appId, $server, $path, $port, $proxy, $proxyPort, $proxyUser, $proxyPassword);
! return $clientProvider->changePasswordByAdmin($adminUserId, $adminPassword, $userId, $newPassword);
}
! /**
! * Sets the application privileges for a given user
! *
! * @author Tony Bibbs <tony at geeklog.net>
! * @access public
! * @param string $adminUserId Admin user making the request
! * @param string $adminPassword Password for admin making the request
! * @param string $userId ID of user to set privileges for
! * @param array $privArray Array of privileges to give the user
! * @param string $appId Application ID that identifies app withthe Auth_Enterprise server
! * @param string $method Communication method to use when talking with server
! * @param string $server Host name or IP for Auth_Enterprise service
! * @param string $path Path on the server where the service is located
! * @param int $port Port on Auth_Enterprise service to connect to
! * @param string $proxy Host name or IP of proxy server client should
! * use to get out
! * @param int $proxyPort Port on proxy server to connect through to get
! * out to use Auth_Enterprise service
! * @param string $proxyUser Username to use to authenticate with on proxy
! * @param string $proxyPassword Password to use to authenticate with on
! * proxy server
! * @return object PEAR Error or nothing
! *
! */
! function setUserPrivilegesByAdmin($adminUserId, $adminPassword, $userId, $privArray, $appId, $method, $server, $path = '', $port = 80, $proxy = '', $proxyPort = 8080, $proxyUser = '', $proxyPassword = '')
! {
! $clientProvider = &AEClientProviderFactory::getProvider($method, $appId, $server, $path, $port, $proxy, $proxyPort, $proxyUser, $proxyPassword);
! return $clientProvider->setUserPrivilegesByAdmin($adminUserId, $adminPassword, $userId, $privArray);
}
+ /**
+ * Lists all available privileges for a given application
+ *
+ * @author Tony Bibbs <tony at geeklog.net>
+ * @access public
+ * @param string $adminUserId Admin user making the request
+ * @param string $adminPassword Password for admin making the request
+ * @param string $appId Application ID that identifies app withthe Auth_Enterprise server
+ * @param string $method Communication method to use when talking with server
+ * @param string $server Host name or IP for Auth_Enterprise service
+ * @param string $path Path on the server where the service is located
+ * @param int $port Port on Auth_Enterprise service to connect to
+ * @param string $proxy Host name or IP of proxy server client should
+ * use to get out
+ * @param int $proxyPort Port on proxy server to connect through to get
+ * out to use Auth_Enterprise service
+ * @param string $proxyUser Username to use to authenticate with on proxy
+ * @param string $proxyPassword Password to use to authenticate with on
+ * proxy server
+ * @return Array|Object Either an array of privileges or a PEAR Error
+ *
+ */
+ function listAppPrivilegesByAdmin($adminUserId, $adminPassword, $appId, $method, $server, $path = '', $port = 80, $proxy = '', $proxyPort = 8080, $proxyUser = '', $proxyPassword = '')
+ {
+ $clientProvider = &AEClientProviderFactory::getProvider($method, $appId, $server, $path, $port, $proxy, $proxyPort, $proxyUser, $proxyPassword);
+ return $clientProvider->listAppPrivilegesByAdmin($adminUserId, $adminPassword, $userId, $privArray);
+ }
}
?>
Index: AEClientProviderFactory.class.php
===================================================================
RCS file: /usr/cvs/geeklog/Auth_Enterprise/Client/AEClientProviderFactory.class.php,v
retrieving revision 1.1.1.1
retrieving revision 1.2
diff -C2 -d -r1.1.1.1 -r1.2
*** AEClientProviderFactory.class.php 23 Oct 2003 14:17:34 -0000 1.1.1.1
--- AEClientProviderFactory.class.php 29 Oct 2003 00:52:40 -0000 1.2
***************
*** 1,57 ****
<?php
!
! /**
! * Auth_Enterprise
! *
! * This source file is subject to version 2.02 of the PHP license,
! * that is bundled with this package in the file LICENSE, and is
! * available at through the world-wide-web at
! * http://www.php.net/license/2_02.txt.
! * If you did not receive a copy of the PHP license and are unable to
! * obtain it through the world-wide-web, please send a note to
! * license at php.net so we can mail you a copy immediately.
! *
! * @author Tony Bibbs <tony at geeklog.net>
! * @copyright 2003
! * @version $Id$
! *
! */
!
! /**
! * Auth_Enteprise Client Provider Factory
! *
! * @author Tony Bibbs <tony at geeklog.net>
! * @package net.geeklog.auth_enterprise.client
! *
*/
! class AEClientProviderFactory {
! /**
! * Builds the request provider
! *
! * @author Tony Bibbs <tony at geeklog.net>
! * @access public
! * @param string $method Implementation of service to use
! * @param string $appId The ID assigned to the application by the
! * Auth_Enterprise service
! * @param string $server Host name or IP for Auth_Enterprise service
! * @param string $path Path on the server where the service is located
! * @param int $port Port on Auth_Enterprise service to connect to
! * @param string $proxy Host name or IP of proxy server client should
! * use to get out
! * @param int $proxyPort Port on proxy server to connect through to get
! * out to use Auth_Enterprise service
! * @param string $proxyUser Username to use to authenticate with on proxy
! * @param string $proxyPassword Password to use to authenticate with on
! * proxy server
! * @return object Client provider or a PEAR Error
! *
! */
! function &getProvider($method, $appId, $server, $path, $port, $proxy, $proxyPort, $proxyUser, $proxyPassword)
! {
! $clientFile = 'Auth_Enterprise/Client/' . $method . '.class.php';
! require_once $clientFile;
! return new $method($appId, $server, $path, $port, $proxy, $proxyPort, $proxyUser, $proxyPassword);
! }
}
-
?>
--- 1,54 ----
<?php
! /**
! * Auth_Enterprise
! *
! * This source file is subject to version 2.02 of the PHP license,
! * that is bundled with this package in the file LICENSE, and is
! * available at through the world-wide-web at
! * http://www.php.net/license/2_02.txt.
! * If you did not receive a copy of the PHP license and are unable to
! * obtain it through the world-wide-web, please send a note to
! * license at php.net so we can mail you a copy immediately.
! *
! * @author Tony Bibbs <tony at geeklog.net>
! * @copyright 2003
! * @version $Id$
! *
*/
! /**
! * Auth_Enteprise Client Provider Factory
! *
! * @author Tony Bibbs <tony at geeklog.net>
! * @package net.geeklog.auth_enterprise.client
! *
! */
! class AEClientProviderFactory {
! /**
! * Builds the request provider
! *
! * @author Tony Bibbs <tony at geeklog.net>
! * @access public
! * @param string $method Implementation of service to use
! * @param string $appId The ID assigned to the application by the
! * Auth_Enterprise service
! * @param string $server Host name or IP for Auth_Enterprise service
! * @param string $path Path on the server where the service is located
! * @param int $port Port on Auth_Enterprise service to connect to
! * @param string $proxy Host name or IP of proxy server client should
! * use to get out
! * @param int $proxyPort Port on proxy server to connect through to get
! * out to use Auth_Enterprise service
! * @param string $proxyUser Username to use to authenticate with on proxy
! * @param string $proxyPassword Password to use to authenticate with on
! * proxy server
! * @return object Client provider or a PEAR Error
! *
! */
! function &getProvider($method, $appId, $server, $path, $port, $proxy, $proxyPort, $proxyUser, $proxyPassword)
! {
! $clientFile = 'Auth_Enterprise/Client/' . $method . '.class.php';
! require_once $clientFile;
! return new $method($appId, $server, $path, $port, $proxy, $proxyPort, $proxyUser, $proxyPassword);
! }
}
?>
Index: AEUser.class.php
===================================================================
RCS file: /usr/cvs/geeklog/Auth_Enterprise/Client/AEUser.class.php,v
retrieving revision 1.1.1.1
retrieving revision 1.2
diff -C2 -d -r1.1.1.1 -r1.2
*** AEUser.class.php 23 Oct 2003 14:17:34 -0000 1.1.1.1
--- AEUser.class.php 29 Oct 2003 00:52:40 -0000 1.2
***************
*** 1,239 ****
<?php
!
! /**
! * Auth_Enterprise
! *
! * This source file is subject to version 2.02 of the PHP license,
! * that is bundled with this package in the file LICENSE, and is
! * available at through the world-wide-web at
! * http://www.php.net/license/2_02.txt.
! * If you did not receive a copy of the PHP license and are unable to
! * obtain it through the world-wide-web, please send a note to
! * license at php.net so we can mail you a copy immediately.
! *
! * @author Tony Bibbs <tony at geeklog.net>
! * @copyright 2003
! * @version $Id$
! *
! */
!
! /**
! * The Auth_Enterprise Service Interface
*/
require_once 'Auth_Enterprise/Common/AEServiceInterface.class.php';
!
! /**
! * Auth_Enteprise User object
! *
! * You should not instantiate this object directly. Instead
! * you should have received an instance using the Client's
! * authenticate method.
! *
! * @author Tony Bibbs <tony at geeklog.net>
! * @package net.geeklog.auth_enterprise.common
! * @todo For PHP5 this will become a real interface so do
! * not implement anything here.
! */
! class AEUser extends AEServiceInterface {
! /**
! * Client provider to use
! * @access private
! * @var string
! */
var $_method = null;
! /**
! * Application ID
! * @access private
! * @var string
! */
var $_appId = null;
! /**
! * Host name or IP of Auth_Enteprise server
! * @access private
! * @var string
! */
var $_server = null;
! /**
! * Relative path on server where service can be found
! * @access private
! * @var string
! */
var $_path = null;
! /**
! * Port on Auth_Enterprise server to connect to
! * @access private
! * @var int
! */
var $_port = null;
! /**
! * Host name or IP of proxy server to use
! * @access private
! * @var string
! */
var $_proxy = null;
! /**
! * Port on proxy server to use
! * @access private
! * @var int
! */
var $_proxyPort = null;
! /**
! * Username to authenticate with on proxy server
! * @access private
! * @var string
! */
var $_proxyUser = null;
! /**
! * Password to authenticate with on proxy server
! * @access private
! * @var string
! */
! var $_proxyPassword = null;
! /**
! * User ID
! * @access private
! * @var string
! */
! var $_userId = null;
! /**
! * User's password
! * @access private
! * @var string
! */
var $_password = null;
! /**
! * Set of privileges for this user
! * @access private
! * @var array
! */
! var $_privileges = null;
! /**
! * Groups user belongs to
! * @access private
! * @var array
! */
var $_groups = array();
!
! /**
! * Constructor
! *
! * @author Tony Bibbs <tony at geeklog.net>
! * @access public
! *
! */
! function AEUser()
! {
! }
!
! /**
! * Changes a user's password
! *
! * @author Tony Bibbs <tony at geeklog.net>
! * @access public
! * @param string $newPassword What to set new password to
! * @return object Nothing on success, otherwise a PEAR error
! *
! */
! function changePassword($newPassword)
! {
! $retval = AEClient::changePassword($this->_userId, $this->_password, $newPassword, $this->_method, $this->_server, $this->_path = '', $this->port = 80,
! $this->_proxy = '', $this->_proxyPort = 8080, $this->_proxyUser = '', $this->_proxyPassword = '');
! if (PEAR::isError($retval)) {
! return $retval;
! } else {
! $this->_password = $newPassword;
! }
! }
!
! /**
! * Allows an application level admin to change a
! * user's password
! *
! * NOTE: this assumes this user is the administrator
! *
! * @author Tony Bibbs <tony at geeklog.net>
! * @access public
! * @param string $userId User Id to set password for
! * @param string $newPassword Password to set for user
! * @return object Nothing on success, otherwise a PEAR error
! *
! */
! function changePasswordByAdmin($userId, $newPassword)
! {
! $retval = AEClient::changePasswordByAdmin($this->_userId, $this->_password, $userId, $newPassword, $this->_appId, $this->_method, $this->_server, $this->_path = '', $this->port = 80,
! $this->_proxy = '', $this->_proxyPort = 8080, $this->_proxyUser = '', $this->_proxyPassword = '');
! if (PEAR::isError($retval)) {
! return $retval;
! }
! }
!
! /**
! * Gets the application privileges for a given user
! *
! * @author Tony Bibbs <tony at geeklog.net>
! * @access public
! * @param string $userId ID of user to get privileges for
! * @return Array|Object Either an array of privileges or a PEAR error
! *
! */
! function getUserPrivilegesByAdmin($userId)
! {
! return AEClient::getUserPrivilegesByAdmin($this->_userId, $this->_password, $userId, $this->_appId, $this->_method, $this->_server, $this->_path = '', $this->port = 80,
! $this->_proxy = '', $this->_proxyPort = 8080, $this->_proxyUser = '', $this->_proxyPassword = '');
! }
!
! /**
! * Sets the application privileges for a given user
! *
! * @author Tony Bibbs <tony at geeklog.net>
! * @access public
! * @param string $userId ID of user to set privileges for
! * @param array $privArray Array of privilege objects
! * @return Object PEAR Error or nothing
! *
! */
! function setUserPrivilegesByAdmin($userId, $privArray)
! {
! $retval = AEClient::setUserPrivilegesByAdmin($this->_userId, $this->_password, $userId, $privArray, $this->_appId, $this->_method, $this->_server, $this->_path = '', $this->port = 80,
! $this->_proxy = '', $this->_proxyPort = 8080, $this->_proxyUser = '', $this->_proxyPassword = '');
! if (PEAR::isError($retval)) {
! return $retval;
! }
! }
!
! /**
! * Lists all available privileges for a given application
! *
! * @author Tony Bibbs <tony at geeklog.net>
! * @access public
! * @return object PEAR Error or nothing
! *
! */
! function listAppPrivilegesByAdmin()
! {
! return AEClient::listAppPrivilegesByAdmin($this->_userId, $this->_password, $this->_appId, $this->_method, $this->_server, $this->_path = '', $this->port = 80,
! $this->_proxy = '', $this->_proxyPort = 8080, $this->_proxyUser = '', $this->_proxyPassword = '');
}
!
! /**
! * This method determines if user has privilege to the given
! * authorization code
! *
! * @author Tony Bibbs <tony at geeklog.net>
! * @access public
! * @param string $authCode Authorization code to verify
! * @return boolean rue if user has access, otherwise false
! *
! */
! function isAuthorized($authCode)
! {
! foreach ($this->_privileges as $curPriv) {
! if ($curPriv->getPrivilegeCode() == $authCode) {
! return true;
! }
! }
! return false;
}
}
-
?>
--- 1,235 ----
<?php
! /**
! * Auth_Enterprise
! *
! * This source file is subject to version 2.02 of the PHP license,
! * that is bundled with this package in the file LICENSE, and is
! * available at through the world-wide-web at
! * http://www.php.net/license/2_02.txt.
! * If you did not receive a copy of the PHP license and are unable to
! * obtain it through the world-wide-web, please send a note to
! * license at php.net so we can mail you a copy immediately.
! *
! * @author Tony Bibbs <tony at geeklog.net>
! * @copyright 2003
! * @version $Id$
! *
*/
+ /**
+ * The Auth_Enterprise Service Interface
+ */
require_once 'Auth_Enterprise/Common/AEServiceInterface.class.php';
! /**
! * Auth_Enteprise User object
! *
! * You should not instantiate this object directly. Instead
! * you should have received an instance using the Client's
! * authenticate method.
! *
! * @author Tony Bibbs <tony at geeklog.net>
! * @package net.geeklog.auth_enterprise.common
! * @todo For PHP5 this will become a real interface so do
! * not implement anything here.
! */
! class AEUser extends AEServiceInterface {
! /**
! * Client provider to use
! * @access private
! * @var string
! */
var $_method = null;
! /**
! * Application ID
! * @access private
! * @var string
! */
var $_appId = null;
! /**
! * Host name or IP of Auth_Enteprise server
! * @access private
! * @var string
! */
var $_server = null;
! /**
! * Relative path on server where service can be found
! * @access private
! * @var string
! */
var $_path = null;
! /**
! * Port on Auth_Enterprise server to connect to
! * @access private
! * @var int
! */
var $_port = null;
! /**
! * Host name or IP of proxy server to use
! * @access private
! * @var string
! */
var $_proxy = null;
! /**
! * Port on proxy server to use
! * @access private
! * @var int
! */
var $_proxyPort = null;
! /**
! * Username to authenticate with on proxy server
! * @access private
! * @var string
! */
var $_proxyUser = null;
! /**
! * Password to authenticate with on proxy server
! * @access private
! * @var string
! */
! var $_proxyPassword = null;
!
! /**
! * User ID
! * @access private
! * @var string
! */
! var $_userId = null;
!
! /**
! * User's password
! * @access private
! * @var string
! */
var $_password = null;
! /**
! * Set of privileges for this user
! * @access private
! * @var array
! */
! var $_privileges = null;
!
! /**
! * Groups user belongs to
! * @access private
! * @var array
! */
var $_groups = array();
! /**
! * Constructor
! *
! * @author Tony Bibbs <tony at geeklog.net>
! * @access public
! *
! */
! function AEUser()
! {
! }
!
! /**
! * Changes a user's password
! *
! * @author Tony Bibbs <tony at geeklog.net>
! * @access public
! * @param string $newPassword What to set new password to
! * @return object Nothing on success, otherwise a PEAR error
! *
! */
! function changePassword($newPassword)
! {
! $retval = AEClient::changePassword($this->_userId, $this->_password, $newPassword, $this->_method, $this->_server, $this->_path = '', $this->port = 80,
! $this->_proxy = '', $this->_proxyPort = 8080, $this->_proxyUser = '', $this->_proxyPassword = '');
! if (PEAR::isError($retval)) {
! return $retval;
! } else {
! $this->_password = $newPassword;
! }
! }
!
! /**
! * Allows an application level admin to change a
! * user's password
! *
! * NOTE: this assumes this user is the administrator
! *
! * @author Tony Bibbs <tony at geeklog.net>
! * @access public
! * @param string $userId User Id to set password for
! * @param string $newPassword Password to set for user
! * @return object Nothing on success, otherwise a PEAR error
! *
! */
! function changePasswordByAdmin($userId, $newPassword)
! {
! $retval = AEClient::changePasswordByAdmin($this->_userId, $this->_password, $userId, $newPassword, $this->_appId, $this->_method, $this->_server, $this->_path = '', $this->port = 80,
! $this->_proxy = '', $this->_proxyPort = 8080, $this->_proxyUser = '', $this->_proxyPassword = '');
! if (PEAR::isError($retval)) {
! return $retval;
! }
! }
!
! /**
! * Gets the application privileges for a given user
! *
! * @author Tony Bibbs <tony at geeklog.net>
! * @access public
! * @param string $userId ID of user to get privileges for
! * @return Array|Object Either an array of privileges or a PEAR error
! *
! */
! function getUserPrivilegesByAdmin($userId)
! {
! return AEClient::getUserPrivilegesByAdmin($this->_userId, $this->_password, $userId, $this->_appId, $this->_method, $this->_server, $this->_path = '', $this->port = 80,
! $this->_proxy = '', $this->_proxyPort = 8080, $this->_proxyUser = '', $this->_proxyPassword = '');
}
! /**
! * Sets the application privileges for a given user
! *
! * @author Tony Bibbs <tony at geeklog.net>
! * @access public
! * @param string $userId ID of user to set privileges for
! * @param array $privArray Array of privilege objects
! * @return Object PEAR Error or nothing
! *
! */
! function setUserPrivilegesByAdmin($userId, $privArray)
! {
! $retval = AEClient::setUserPrivilegesByAdmin($this->_userId, $this->_password, $userId, $privArray, $this->_appId, $this->_method, $this->_server, $this->_path = '', $this->port = 80,
! $this->_proxy = '', $this->_proxyPort = 8080, $this->_proxyUser = '', $this->_proxyPassword = '');
! if (PEAR::isError($retval)) {
! return $retval;
! }
! }
!
! /**
! * Lists all available privileges for a given application
! *
! * @author Tony Bibbs <tony at geeklog.net>
! * @access public
! * @return object PEAR Error or nothing
! *
! */
! function listAppPrivilegesByAdmin()
! {
! return AEClient::listAppPrivilegesByAdmin($this->_userId, $this->_password, $this->_appId, $this->_method, $this->_server, $this->_path = '', $this->port = 80,
! $this->_proxy = '', $this->_proxyPort = 8080, $this->_proxyUser = '', $this->_proxyPassword = '');
}
+ /**
+ * This method determines if user has privilege to the given
+ * authorization code
+ *
+ * @author Tony Bibbs <tony at geeklog.net>
+ * @access public
+ * @param string $authCode Authorization code to verify
+ * @return boolean rue if user has access, otherwise false
+ *
+ */
+ function isAuthorized($authCode)
+ {
+ foreach ($this->_privileges as $curPriv) {
+ if ($curPriv->getPrivilegeCode() == $authCode) {
+ return true;
+ }
+ }
+ return false;
+ }
}
?>
Index: AEXMLRPC.class.php
===================================================================
RCS file: /usr/cvs/geeklog/Auth_Enterprise/Client/AEXMLRPC.class.php,v
retrieving revision 1.1.1.1
retrieving revision 1.2
diff -C2 -d -r1.1.1.1 -r1.2
*** AEXMLRPC.class.php 23 Oct 2003 14:17:34 -0000 1.1.1.1
--- AEXMLRPC.class.php 29 Oct 2003 00:52:40 -0000 1.2
***************
*** 1,163 ****
<?php
!
! /**
! * Auth_Enterprise
! *
! * This source file is subject to version 2.02 of the PHP license,
! * that is bundled with this package in the file LICENSE, and is
! * available at through the world-wide-web at
! * http://www.php.net/license/2_02.txt.
! * If you did not receive a copy of the PHP license and are unable to
! * obtain it through the world-wide-web, please send a note to
! * license at php.net so we can mail you a copy immediately.
! *
! * @author Tony Bibbs <tony at geeklog.net>
! * @copyright 2003
! * @version $Id$
! *
! */
!
! /**
! * Abstract client provider
*/
require_once 'Auth_Enterprise/Client/AEBaseClientProvider.class.php';
!
! /**
! * PEAR's XML RPC Client
! */
require_once 'XML/RPC.php';
!
! /**
! * Auth_Enteprise XML RPC Implementation
! *
! * @author Tony Bibbs <tony at geeklog.net>
! * @package net.geeklog.auth_enterprise.client
! *
! */
! class AEXMLRPC extends AEBaseClientProvider {
! /**
! * Instance of PEAR XML RPC Client
! * @access private
! * @var object
! */
var $_XMLRPCClient = null;
!
! /**
! * Constructor
! *
! * Get handle to an instance of XML RPC Client
! *
! * @author Tony Bibbs <tony at geeklog.net>
! * @access public
! *
! */
! function AEXMLRPC($appId, $server, $path, $port, $proxy, $proxyPort, $proxyUser, $proxyPassword)
! {
! // Call constructor of parent
! $this->AEBaseClientProvider($appId, $server, $path, $port, $proxy, $proxyPort, $proxyUser, $proxyPassword);
! $this->_XMLRPCClient = new XML_RPC_Client($path, $server, $port, $proxy, $proxyPort, $proxyUser, $proxyPassword);
! $this->_XMLRPCClient->setDebug(true);
! }
!
! /**
! * Authenticates a user to an application
! *
! * @author Tony Bibbs <tony at geeklog.net>
! * @access public
! *
! */
! function &authenticate($userId, $password)
! {
! $xmlRequest = new XML_RPC_Message('Auth_Enterprise.processRequest', array(new XML_RPC_Value('authenticate','string'),
! new XML_RPC_Value($this->getAppId(), 'string'),
! new XML_RPC_Value($userId, 'string'),
! new XML_RPC_Value($password, 'string')));
! AEUtility::logMessage('Calling service from XMLRPC client provider',__FILE__,__LINE__);
! AEUtility::logObject($xmlRequest,__FILE__,__LINE__);
! $response = $this->_XMLRPCClient->send($xmlRequest);
! $retval = $response->getValue();
! /*if (!$response->faultCode()) {
!
! }*/
! }
!
! /**
! * Registers a new account with the service
! *
! * @author Tony Bibbs <tony at geeklog.net>
! * @access public
! *
! */
! function createAccount()
! {
! }
!
! /**
! * Changes a user's password
! *
! * @author Tony Bibbs <tony at geeklog.net>
! * @access public
! *
! */
! function changePassword()
! {
! }
!
! /**
! * Allows an application level admin to change a
! * user's password
! *
! * @author Tony Bibbs <tony at geeklog.net>
! * @access public
! *
! */
! function changePasswordByAdmin()
! {
! }
!
! /**
! * Resets a user's password
! *
! * @author Tony Bibbs <tony at geeklog.net>
! * @access public
! *
! */
! function resetPassword()
! {
! }
!
! /**
! * Gets the application privileges for a given user
! *
! * @author Tony Bibbs <tony at geeklog.net>
! * @access public
! *
! */
! function getUserPrivileges()
! {
! }
!
! /**
! * Sets the application privileges for a given user
! *
! * @author Tony Bibbs <tony at geeklog.net>
! * @access public
! *
! */
! function setUserPrivileges()
! {
! }
!
! /**
! * Lists all available privileges for a given application
! *
! * @author Tony Bibbs <tony at geeklog.net>
! * @access public
! *
! */
! function listAppPrivileges()
! {
}
}
-
?>
--- 1,159 ----
<?php
! /**
! * Auth_Enterprise
! *
! * This source file is subject to version 2.02 of the PHP license,
! * that is bundled with this package in the file LICENSE, and is
! * available at through the world-wide-web at
! * http://www.php.net/license/2_02.txt.
! * If you did not receive a copy of the PHP license and are unable to
! * obtain it through the world-wide-web, please send a note to
! * license at php.net so we can mail you a copy immediately.
! *
! * @author Tony Bibbs <tony at geeklog.net>
! * @copyright 2003
! * @version $Id$
! *
*/
+ /**
+ * Abstract client provider
+ */
require_once 'Auth_Enterprise/Client/AEBaseClientProvider.class.php';
! /**
! * PEAR's XML RPC Client
! */
require_once 'XML/RPC.php';
! /**
! * Auth_Enteprise XML RPC Implementation
! *
! * @author Tony Bibbs <tony at geeklog.net>
! * @package net.geeklog.auth_enterpriseclient
! *
! */
! class AEXMLRPC extends AEBaseClientProvider {
! /**
! * Instance of PEAR XML RPC Client
! * @access private
! * @var object
! */
var $_XMLRPCClient = null;
! /**
! * Constructor
! *
! * Get handle to an instance of XML RPC Client
! *
! * @author Tony Bibbs <tony at geeklog.net>
! * @access public
! *
! */
! function AEXMLRPC($appId, $server, $path, $port, $proxy, $proxyPort, $proxyUser, $proxyPassword)
! {
! // Call constructor of parent
! $this->AEBaseClientProvider($appId, $server, $path, $port, $proxy, $proxyPort, $proxyUser, $proxyPassword);
! $this->_XMLRPCClient = new XML_RPC_Client($path, $server, $port, $proxy, $proxyPort, $proxyUser, $proxyPassword);
! $this->_XMLRPCClient->setDebug(true);
! }
!
! /**
! * Authenticates a user to an application
! *
! * @author Tony Bibbs <tony at geeklog.net>
! * @access public
! *
! */
! function &authenticate($userId, $password)
! {
! $xmlRequest = new XML_RPC_Message('Auth_Enterprise.processRequest', array(new XML_RPC_Value('authenticate','string'),
! new XML_RPC_Value($this->getAppId(), 'string'),
! new XML_RPC_Value($userId, 'string'),
! new XML_RPC_Value($password, 'string')));
! AEUtility::logMessage('Calling service from XMLRPC client provider',__FILE__,__LINE__);
! AEUtility::logObject($xmlRequest,__FILE__,__LINE__);
! $response = $this->_XMLRPCClient->send($xmlRequest);
! print_r($response);
! print "\n<br>HERE:<br>\n";
! $retval = $response->value();
! print_r($retval);
! /*if (!$response->faultCode()) {
!
! }*/
! }
!
! /**
! * Registers a new account with the service
! *
! * @author Tony Bibbs <tony at geeklog.net>
! * @access public
! *
! */
! function createAccount()
! {
! }
!
! /**
! * Changes a user's password
! *
! * @author Tony Bibbs <tony at geeklog.net>
! * @access public
! *
! */
! function changePassword()
! {
! }
!
! /**
! * Allows an application level admin to change a
! * user's password
! *
! * @author Tony Bibbs <tony at geeklog.net>
! * @access public
! *
! */
! function changePasswordByAdmin()
! {
! }
!
! /**
! * Resets a user's password
! *
! * @author Tony Bibbs <tony at geeklog.net>
! * @access public
! *
! */
! function resetPassword()
! {
! }
!
! /**
! * Gets the application privileges for a given user
! *
! * @author Tony Bibbs <tony at geeklog.net>
! * @access public
! *
! */
! function getUserPrivileges()
! {
! }
!
! /**
! * Sets the application privileges for a given user
! *
! * @author Tony Bibbs <tony at geeklog.net>
! * @access public
! *
! */
! function setUserPrivileges()
! {
}
+ /**
+ * Lists all available privileges for a given application
+ *
+ * @author Tony Bibbs <tony at geeklog.net>
+ * @access public
+ *
+ */
+ function listAppPrivileges()
+ {
+ }
}
?>
- Previous message (by thread): [geeklog-cvs] Auth_Enterprise/Server AEBaseCommand.class.php,1.1.1.1,1.2 AEIncludes.php,1.1.1.1,1.2 AEProviderFactory.class.php,1.1.1.1,1.2 AEServerConfig.php,1.1.1.1,1.2 AEServiceUser.class.php,1.1.1.1,1.2 includes.php,1.1.1.1,1.2 config.php,1.1.1.1,NONE
- Next message (by thread): [geeklog-cvs] Auth_Enterprise/Server/providers AEBaseProvider.class.php,1.1.1.1,1.2 AEPearDB.class.php,1.1.1.1,1.2
- Messages sorted by:
[ date ]
[ thread ]
[ subject ]
[ author ]
More information about the geeklog-cvs
mailing list