[pLog-svn] r2212 - plog/trunk/class/dao
ork at devel.plogworld.net
ork at devel.plogworld.net
Sun Jun 12 10:03:21 GMT 2005
Author: ork
Date: 2005-06-12 10:03:20 +0000 (Sun, 12 Jun 2005)
New Revision: 2212
Modified:
plog/trunk/class/dao/users.class.php
Log:
marked getUserInfo( $username, $pass ) as deprecated, it's easier to implement a cache if we only use getUserFromUsername().
but the code will still work, as some plugins might use it .. added a debug message
Modified: plog/trunk/class/dao/users.class.php
===================================================================
--- plog/trunk/class/dao/users.class.php 2005-06-12 09:53:05 UTC (rev 2211)
+++ plog/trunk/class/dao/users.class.php 2005-06-12 10:03:20 UTC (rev 2212)
@@ -34,7 +34,8 @@
// see which class has been configured as the user data provider
$providerClass = $config->getValue( "provider" );
- $this->log->debug( "Tring to load provider: $providerClass" );
+ if( DEBUG_ENABLED && DEBUG_CHANNELS & DEBUG_CHANNEL_USERMANAGEMENT )
+ $this->debug->info( "Tring to load provider: $providerClass" );
if( !$providerClass ) {
die( "ERROR: No provider class was specified in userdata.properties.php!" );
@@ -71,13 +72,27 @@
/**
* Returns all the information associated to the user given
*
+ * @deprecated please use authenticateUser() for auth and getUserInfoFromUsername()
+ for userinfo by username
* @param user Username of the user from who we'd like to get the information
* @param pass Password of the user we'd like to get the information
* @return Returns a UserInfo object with the requested information, or false otherwise.
*/
- function getUserInfo( $user, $pass )
+ function getUserInfo( $username, $pass = null )
{
- return( $this->_provider->getUserInfo( $user, $pass ));
+ if( $pass != null ) {
+ if( DEBUG_ENABLED && DEBUG_CHANNELS & DEBUG_CHANNEL_USERMANAGEMENT )
+ $this->debug->log("getUserInfo is deprecated for authentication,
+ please use authenticateUser() instead",
+ LOGGER_PRIO_WARN );
+ if( !$this->authenticateUser($username, $pass) )
+ return false;
+ }
+
+ $userInfo = $this->getUserInfoFromUsername( $username );
+
+ return $userInfo;
+
}
/**
More information about the pLog-svn
mailing list