Pman/Login.php
[Pman.Base] / Pman / Login.php
index dc84b56..93db793 100644 (file)
@@ -257,12 +257,24 @@ class Pman_Login extends Pman
             return $this->passwordRequest($_REQUEST['passwordRequest']);   
         }
         
+       if (!empty($_REQUEST['ResetPassword'])) {
+           if (empty($_REQUEST['id']) || 
+               empty($_REQUEST['ts']) ||
+               empty($_REQUEST['key']) ||
+               empty($_REQUEST['password1']) ||
+               empty($_REQUEST['password2']) ||
+               ($_REQUEST['password1'] != $_REQUEST['password2'])
+           ) {
+               $this->jerr("Invalid request to reset password");
+           }
+           
+           $this->resetPassword($_REQUEST['id'], $_REQUEST['ts'], $_REQUEST['key'], $_REQUEST['password1'] );
+       }
        
-       
-       
-        //if (!empty($_REQUEST['changePassword'])) {
-        //    return $this->changePassword($_REQUEST);
-        //}
+       // this is 'classic' change password...
+        if (!empty($_REQUEST['changePassword'])) {
+            return $this->changePassword($_REQUEST);
+        }
         
         // login attempt..
         
@@ -438,7 +450,7 @@ class Pman_Login extends Pman
     }
     
     
-    function resetPassword($id,$t, $key)
+    function resetPassword($id,$t, $key, $newpass)
     {
         
         $au = $this->getAuthUser();