[geeklog-cvs] Auth_Enterprise/Server/XMLRPC/commands authenticate.class.php,1.1.1.1,1.2
tony at geeklog.net
tony at geeklog.net
Tue Oct 28 19:52:42 EST 2003
Update of /usr/cvs/geeklog/Auth_Enterprise/Server/XMLRPC/commands
In directory geeklog_prod:/tmp/cvs-serv1664/Server/XMLRPC/commands
Modified Files:
authenticate.class.php
Log Message:
Authenticate method nearly complete using XML_RPC
Index: authenticate.class.php
===================================================================
RCS file: /usr/cvs/geeklog/Auth_Enterprise/Server/XMLRPC/commands/authenticate.class.php,v
retrieving revision 1.1.1.1
retrieving revision 1.2
diff -C2 -d -r1.1.1.1 -r1.2
*** authenticate.class.php 23 Oct 2003 14:17:35 -0000 1.1.1.1
--- authenticate.class.php 29 Oct 2003 00:52:40 -0000 1.2
***************
*** 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$
! *
*/
!
require_once 'Auth_Enterprise/Server/AEBaseCommand.class.php';
!
require_once 'Auth_Enterprise/Server/AEProviderFactory.class.php';
!
! /**
! * Authenticates a user
! *
! * @author Tony Bibbs <tony at geeklog.net>
! * @package net.geeklog.auth_enterprise.server.xmlrpc
! *
! */
! class authenticate extends AEBaseCommand {
! /**
! * Authenticates a user with the Auth_Enterprise Service
! *
! * @author Tony Bibbs <tony at geeklog.net>
! * @access public
! * @param array $params Array of parameters
! *
! */
! function execute($params)
! {
! AEUtility::logMessage('in authenticate command',__FILE__,__LINE__);
!
! $appId = $params[1];
! $userId = $params[2];
! $password = $params[3];
$provider = &AEProviderFactory::getProvider($appId);
AEUtility::logObject($provider,__FILE__,__LINE__);
! $user = &$provider->authenticate($appId, $userId, $password);
! AEUtility::logObject($user,__FILE__,__LINE__);
! }
}
-
?>
--- 1,84 ----
<?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 command class
! */
require_once 'Auth_Enterprise/Server/AEBaseCommand.class.php';
! /**
! * The provider factory
! */
require_once 'Auth_Enterprise/Server/AEProviderFactory.class.php';
! /**
! * Authenticates a user
! *
! * @author Tony Bibbs <tony at geeklog.net>
! * @package net.geeklog.auth_enterprise.server.xmlrpc
! *
! */
! class authenticate extends AEBaseCommand {
! /**
! * Holds the handle to the user object when
! * authentication is successful
! * @access private
! * @var obj
! */
! var $_user = null;
!
! /**
! * Authenticates a user with the Auth_Enterprise Service
! *
! * @author Tony Bibbs <tony at geeklog.net>
! * @access public
! * @param array $params Array of parameters
! *
! */
! function execute($params)
! {
! AEUtility::logMessage('in authenticate command',__FILE__,__LINE__);
! $appId = $params[1];
! $userId = $params[2];
! $password = $params[3];
$provider = &AEProviderFactory::getProvider($appId);
AEUtility::logObject($provider,__FILE__,__LINE__);
! $user = &$provider->authenticate($appId, $userId, $password);
$this->_user = $user;
! AEUtility::logObject($user,__FILE__,__LINE__);
! }
!
! /**
! * Generates the XML_RPC Response to the
! * Authenticate request
! *
! * @author Tony Bibbs <tony at geeklog.net>
! * @return Object XML_RPC_Response
! *
! */
! function getXMLRPCResponse()
! {
! if (PEAR::isError($this->_user)) {
! $response = new XML_RPC_Response('',$this->_user->getCode(),$this->_user->getMessage());
! } else {
! $response = new XML_RPC_Response(new XML_RPC_Value(array(new XML_RPC_Value($this->_user->getUserId(),'int'),
! new XML_RPC_Value($this->_user->getUserName(),'string'),
! new XML_RPC_Value($this->_user->getAppId(),'string'),
! new XML_RPC_Value($this->_user->getAccountLocked(),'boolean'),
! new XML_RPC_Value($this->_user->getFailedAttempts(),'int')),'array'));
! }
! return $response;
! }
}
?>
More information about the geeklog-cvs
mailing list