Avoid access by registered users
authorDuck (Jakob Munih) <duck@obala.net>
Thu, 2 Jul 2009 09:39:02 +0000 (11:39 +0200)
committerDuck (Jakob Munih) <duck@obala.net>
Thu, 2 Jul 2009 09:39:02 +0000 (11:39 +0200)
folks/account/resetpassword.php

index f680ef1..835b655 100644 (file)
@@ -28,6 +28,12 @@ function _getCAPTCHA($new = false)
     return $_SESSION['folks']['CAPTCHA'];
 }
 
+// We are already logged
+if (Auth::isAuthenticated()) {
+    header('Location: ' . Folks::getUrlFor('user', Auth::getAuth()));
+    exit;
+}
+
 // Make sure auth backend allows passwords to be reset.
 $auth = Auth::singleton($conf['auth']['driver']);
 if (!$auth->hasCapability('resetpassword')) {