[Mapbender-commits] r5881 - branches/3_dev/core/lib

svn_mapbender at osgeo.org svn_mapbender at osgeo.org
Sat Apr 10 06:56:07 EDT 2010


Author: astrid_emde
Date: 2010-04-10 06:56:06 -0400 (Sat, 10 Apr 2010)
New Revision: 5881

Modified:
   branches/3_dev/core/lib/class_User.php
Log:
new function setPassword(x)

Modified: branches/3_dev/core/lib/class_User.php
===================================================================
--- branches/3_dev/core/lib/class_User.php	2010-04-10 10:55:57 UTC (rev 5880)
+++ branches/3_dev/core/lib/class_User.php	2010-04-10 10:56:06 UTC (rev 5881)
@@ -284,10 +284,24 @@
 		return true;
 	}
 
+	/*
+	*	@param	$newPassword values of the new password
+	*/
 	public function setPassword($newPassword)
 	{
-		//
-		return false;
+		//set new password in db
+		$sql_update = "UPDATE mb_user SET mb_user_password = $1";
+		$sql_update .= " WHERE mb_user_id = $2";
+		#echo $sql_update;
+		$v = array(md5($sql_password),$this->id);
+		$t = array('s','i');		      
+		$update_result = db_prep_query($sql_update,$v,$t);
+
+		if(!$update_result)
+		{
+			throw new Exception("Database error updating user password");
+		}
+		return true;
 	}
   
     /*



More information about the Mapbender_commits mailing list