ADD: Add identity to /forbidden page for easy administration
authorJustin J. Novack <jnovack@gmail.com>
Mon, 17 Sep 2012 13:53:19 +0000 (09:53 -0400)
committerJustin J. Novack <jnovack@gmail.com>
Mon, 17 Sep 2012 13:53:19 +0000 (09:53 -0400)
data/templates/forbidden.htm
www/auth.php
www/secure.php

index ad40a9fdc76801e3afecac02596c3c706250bf76..e6965dd7a10d89affd8c6db9bdaaaaa63a1699db 100644 (file)
@@ -5,7 +5,11 @@
 
 <fieldset>
   <legend>Access Denied</legend>
-  <img src="images/access_denied.png">
+  <img src="images/access_denied.png" align='left'>
+  <p>We're sorry, your identity is not authorized:</p>
+  <p><code>{{ identity }}</code></p>
+  <p>If you feel this message is in error, please notify the site admin
+    and include your identity.</p>
 </fieldset>
 {% endblock %}
 
index bb4fcb240804a332b7a5cf63c14b4b371ab353b9..b8d08ff0a90cde6f3464e301042fe417f29d0584 100644 (file)
@@ -201,15 +201,6 @@ if (isset($_POST['start'])) {
     }
 
     $openid = $message->getArrayFormat();
-    if ($GLOBALS['phorkie']['auth']['secure'] > 0 &&
-        $GLOBALS['phorkie']['auth']['userlist']) {
-        if (!in_array($openid['openid.identity'], $GLOBALS['phorkie']['users'])) {
-            $redirect = 'http://' . $_SERVER['HTTP_HOST'] . "/forbidden";
-            header('Location: ' . filter_var($redirect, FILTER_SANITIZE_URL));
-            exit;
-        }
-    }
-    // include_once 'openid/wrapper.php';
 
        $email = (isset($openid['openid.ext1.value.email'])) ? $openid['openid.ext1.value.email'] : null;
     $email = (isset($openid['openid.ext2.value.email']) && !isset($email)) ? $openid['openid.ext2.value.email'] : $email;
index 07cdfb64051768364542a802e85de9a7546cafe8..4b81d5963d08f7812a965d10282151c00cb5829c 100644 (file)
@@ -9,4 +9,12 @@ if (!isset($_SESSION['identity'])) {
     header("Location: /login");
     exit;
 }
+if ($GLOBALS['phorkie']['auth']['secure'] > 0 &&
+    $GLOBALS['phorkie']['auth']['userlist']) {
+    if (!in_array($_SESSION['identity'], $GLOBALS['phorkie']['users'])) {
+        $redirect = 'http://' . $_SERVER['HTTP_HOST'] . "/forbidden";
+        header('Location: ' . filter_var($redirect, FILTER_SANITIZE_URL));
+        exit;
+    }
+}
 ?>