[opw-web] Add an error message if the server secret is not set



commit 48bf1fc2f6e3f4a4f56b853de4ef5ad48f8687ea
Author: Owen W. Taylor <otaylor fishsoup net>
Date:   Tue Mar 11 18:21:45 2014 -0400

    Add an error message if the server secret is not set
    
    Add an error message, so that server adminstrators don't accidentally
    use an empty server secret.

 classes/class_user.php |    9 +++++++++
 1 files changed, 9 insertions(+), 0 deletions(-)
---
diff --git a/classes/class_user.php b/classes/class_user.php
index 1af04e9..8b5a25f 100644
--- a/classes/class_user.php
+++ b/classes/class_user.php
@@ -19,12 +19,21 @@ class user
     // Constructor
     function __construct()
     {
+        global $config, $gsod;
+
         $this->_hybridauth = null;
         $this->username = null;
         $this->sid = null;
         $this->is_admin = false;
         $this->is_logged_in = false;
         $this->max_age = time() - 24 * 60 * 60;
+
+        if (!isset($config->server_secret))
+        {
+            $title   = 'Server secret not set';
+            $message = 'Please generate a server secret and add it to config.php.';
+            $gsod->trigger($title, $message);
+        }
     }
 
     function hybridauth() {


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]