[Mapbender-commits] r5900 - branches/3_dev/http/plugins
svn_mapbender at osgeo.org
svn_mapbender at osgeo.org
Sat Apr 10 12:13:13 EDT 2010
Author: astrid_emde
Date: 2010-04-10 12:13:13 -0400 (Sat, 10 Apr 2010)
New Revision: 5900
Added:
branches/3_dev/http/plugins/mb_forgot_password_server.php
Log:
Added: branches/3_dev/http/plugins/mb_forgot_password_server.php
===================================================================
--- branches/3_dev/http/plugins/mb_forgot_password_server.php (rev 0)
+++ branches/3_dev/http/plugins/mb_forgot_password_server.php 2010-04-10 16:13:13 UTC (rev 5900)
@@ -0,0 +1,44 @@
+<?php
+# License:
+# Copyright (c) 2009, Open Source Geospatial Foundation
+# This program is dual licensed under the GNU General Public License
+# and Simplified BSD license.
+# http://svn.osgeo.org/mapbender/trunk/mapbender/license/license.txt
+
+require_once dirname(__FILE__) . "/../../core/globalSettings.php";
+require_once dirname(__FILE__)."/../../core/lib/class_Mapbender.php";
+require_once dirname(__FILE__)."/../../core/lib/class_User.php";
+
+$ajaxResponse = new AjaxResponse($_POST, false);
+
+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;
+
+ if ($user_id && $mailAddressMatch) {
+ $user->setNewUserPasswordTicket();
+ }
+ else {
+ $ajaxResponse->setSuccess(false);
+ $ajaxResponse->setMessage(_mb("Either your username could not be found or you have registered another or no mail address."));
+ break;
+ }
+
+ break;
+
+ default:
+ $ajaxResponse->setSuccess(false);
+ $ajaxResponse->setMessage(_mb("An unknown error occured."));
+ break;
+}
+$ajaxResponse->send();
+?>
More information about the Mapbender_commits
mailing list