[Mapbender-commits] r5904 - branches/3_dev/http/plugins

svn_mapbender at osgeo.org svn_mapbender at osgeo.org
Sun Apr 11 04:27:19 EDT 2010


Author: astrid_emde
Date: 2010-04-11 04:27:16 -0400 (Sun, 11 Apr 2010)
New Revision: 5904

Modified:
   branches/3_dev/http/plugins/mb_forgot_password_server.php
Log:


Modified: branches/3_dev/http/plugins/mb_forgot_password_server.php
===================================================================
--- branches/3_dev/http/plugins/mb_forgot_password_server.php	2010-04-11 08:27:00 UTC (rev 5903)
+++ branches/3_dev/http/plugins/mb_forgot_password_server.php	2010-04-11 08:27:16 UTC (rev 5904)
@@ -13,18 +13,19 @@
 
 switch ($ajaxResponse->getMethod()) {
   case "setNewPasswordRequest" :
-
+	
     	$name = $ajaxResponse->getParameter("name");
   	$email = $ajaxResponse->getParameter("email");
 
-	$id = $admin->getUserIdByUserName($name);
-	$mailAddressMatch = ($admin->getEmailByUserId($id) == $email);
-	$user_id = $id;
-	
-	$user = new User();
-	$user->id = $user_id;	
+		
+	$user = User::byName($name);
+	if (is_null($user)){
+		$ajaxResponse->setSuccess(false);
+		$ajaxResponse->setMessage(_mb("Either your username could not be found or you have registered another or no mail address."));
+		break;				
+	}
 
-	if ($user_id && $mailAddressMatch) {
+	if ($user->email === $email && $email !== '') {
 		$user->setNewUserPasswordTicket();	
 	}
 	else {
@@ -32,7 +33,8 @@
 		$ajaxResponse->setMessage(_mb("Either your username could not be found or you have registered another or no mail address."));
 		break;		
 	}
-    
+	$ajaxResponse->setSuccess(true);
+	$ajaxResponse->setMessage(_mb("Success"));    
 	break;
 
   default: 



More information about the Mapbender_commits mailing list