[Piwik-svn] r483 - trunk/plugins/UsersManager

svnmaster at piwik.org svnmaster at piwik.org
Sun May 18 19:39:40 CEST 2008


Author: matt
Date: 2008-05-18 19:39:39 +0200 (Sun, 18 May 2008)
New Revision: 483

Modified:
   trunk/plugins/UsersManager/API.php
Log:
- UsersManager.getTokenAuth now accept a non-md5ied password and will md5() it if necessary (if lenght string != 32)

Modified: trunk/plugins/UsersManager/API.php
===================================================================
--- trunk/plugins/UsersManager/API.php	2008-05-18 17:22:35 UTC (rev 482)
+++ trunk/plugins/UsersManager/API.php	2008-05-18 17:39:39 UTC (rev 483)
@@ -562,16 +562,20 @@
 	}
 	
 	/**
-	 * Generates a unique MD5 for the given login & previously 'md5'ied password
+	 * Generates a unique MD5 for the given login & password
 	 * 
 	 * @param string Login
-	 * @param string Result of the md5 hash of the real password
+	 * @param string Password string, or the MD5ied string of the password
 	 */
-	static public function getTokenAuth($userLogin, $passwordMd5ied)
-	{
-		return md5($userLogin . $passwordMd5ied );
+	static public function getTokenAuth($userLogin, $password)
+	{
+		if(strlen($password) != 32)
+		{
+			$password = md5($password);
+		}
+		return md5($userLogin . $password );
 	}
-		
+
 	/**
 	 * Returns true if the login has a valid format : 
 	 * - only A-Z a-z and the characters _ . and -



More information about the Piwik-svn mailing list