]> git.mxchange.org Git - quix0rs-gnu-social.git/blobdiff - lib/statusnet.php
??? Not callable?
[quix0rs-gnu-social.git] / lib / statusnet.php
index 5c2c3d5fdc58553891ccba03374bbf7d6869a0e2..844a15c339d10cc8ab363ef296c366ccba1c5963 100644 (file)
@@ -91,6 +91,20 @@ class StatusNet
         return true;
     }
 
+    public static function delPlugin($name)
+    {
+        // Remove our plugin if it was previously loaded
+        $name = ucfirst($name);
+        if (isset(self::$plugins[$name])) {
+            unset(self::$plugins[$name]);
+        }
+
+        // make sure initPlugins will avoid this
+        common_config_set('plugins', 'disable-'.$name, true);
+
+        return true;
+    }
+
     /**
      * Get a list of activated plugins in this process.
      * @return array of (string $name, array $args) pairs
@@ -409,11 +423,20 @@ class StatusNet
     static function isHTTPS()
     {
         // There are some exceptions to this; add them here!
-        if(empty($_SERVER['HTTPS'])) {
+        if (empty($_SERVER['HTTPS'])) {
             return false;
-        } else {
-            return $_SERVER['HTTPS'] !== 'off';
         }
+
+        // If it is _not_ "off", it is on, so "true".
+        return strtolower($_SERVER['HTTPS']) !== 'off';
+    }
+
+    /**
+     * Can we use HTTPS? Then do! Only return false if it's not configured ("never").
+     */
+    static function useHTTPS()
+    {
+        return self::isHTTPS() || common_config('site', 'ssl') != 'never';
     }
 }