]> git.mxchange.org Git - quix0rs-gnu-social.git/blobdiff - lib/siteprofile.php
GNUSOCIAL, not STATUSNET. Too many changes to be backwards compatible
[quix0rs-gnu-social.git] / lib / siteprofile.php
index 51ce907b1927d039bd4178e219768d4b49b5c59b..087dca48587759fef3e68d6e26023131384b7044 100644 (file)
@@ -28,7 +28,7 @@
  * @link      http://status.net/
  */
 
-if (!defined('STATUSNET')) {
+if (!defined('GNUSOCIAL')) {
     exit(1);
 }
 
@@ -73,7 +73,17 @@ class SiteProfile
  */
 abstract class SiteProfileSettings
 {
-    abstract static function getSettings();
+    static function getSettings()
+    {
+        throw new MethodNotImplementedException(__METHOD__);
+    }
+
+    static function corePlugins() {
+        return common_config('plugins', 'core');
+    }
+    static function defaultPlugins() {
+        return common_config('plugins', 'default');
+    }
 }
 
 /**
@@ -90,7 +100,7 @@ class PublicSite extends SiteProfileSettings
         global $config;
         return array(
             // We only want to change these values, not replace entire 'site' array
-            'site' => array_replace(
+            'site' => array_merge(
                 $config['site'], array(
                     'inviteonly' => false,
                     'private'    => false,
@@ -98,23 +108,13 @@ class PublicSite extends SiteProfileSettings
                 )
             ),
             'plugins' => array(
-                'default' => array(
-                    'Activity'                => null,
-                    'Bookmark'                => null,
-                    'ClientSideShorten'       => null,
+                'core'    => self::corePlugins(),
+                'default' => array_merge(self::defaultPlugins(), array(
                     'Directory'               => null,
-                    'Event'                   => null,
                     'ExtendedProfile'         => null,
-                    'Geonames'                => null,
-                    'Gravatar'                => null,
-                    'OpenID'                  => null,
                     'OStatus'                 => null,
-                    'Poll'                    => null,
-                    'QnA'                     => null,
-                    'SearchSub'               => null,
-                    'StrictTransportSecurity' => null,
-                    'TagSub'                  => null
-                )
+                    'WebFinger'               => null,
+                ))
             ),
             'discovery' => array('cors' => true) // Allow Cross-Origin Resource Sharing for service discovery (host-meta, XRD, etc.)
         );
@@ -137,32 +137,20 @@ class PrivateSite extends SiteProfileSettings
         global $config;
         return array(
             // We only want to change these values, not replace entire 'site' array
-            'site' => array_replace(
+            'site' => array_merge(
                 $config['site'], array(
                     'inviteonly' => true,
                     'private'    => true,
                 )
             ),
             'plugins' => array(
-                'default' => array(
-                    'Activity'                => null,
-                    'Bookmark'                => null,
-                    'ClientSideShorten'       => null,
+                'core'    => self::corePlugins(),
+                'default' => array_merge(self::defaultPlugins(), array(
                     'Directory'               => null,
-                    'Event'                   => null,
                     'ExtendedProfile'         => null,
                     'EmailRegistration'       => null,
-                    'Geonames'                => null,
-                    'Gravatar'                => null,
-                    'NewMenu'                 => null,
                     'MobileProfile'           => null,
-                    'OpenID'                  => null,
-                    'Poll'                    => null,
-                    'QnA'                     => null,
-                    'SearchSub'               => null,
-                    'StrictTransportSecurity' => null,
-                    'TagSub'                  => null
-                )
+                ))
              ),
             'profile'       => array('delete' => 'true'),
             'license'       => array('type'   => 'private'),
@@ -200,29 +188,19 @@ class CommunitySite extends SiteProfileSettings
         global $config;
         return array(
             // We only want to change these values, not replace entire 'site' array
-            'site' => array_replace(
+            'site' => array_merge(
                 $config['site'], array(
                     'private'    => false,
                     'closed'     => false
                 )
             ),
             'plugins' => array(
-                'default' => array(
-                    'Activity'                => null,
-                    'Bookmark'                => null,
-                    'ClientSideShorten'       => null,
+                'core'    => self::corePlugins(),
+                'default' => array_merge(self::defaultPlugins(), array(
                     'Directory'               => null,
-                    'Event'                   => null,
-                    'Geonames'                => null,
-                    'Gravatar'                => null,
-                    'OpenID'                  => null,
                     'OStatus'                 => null,
-                    'Poll'                    => null,
-                    'QnA'                     => null,
-                    'SearchSub'               => null,
-                    'StrictTransportSecurity' => null,
-                    'TagSub'                  => null
-                )
+                    'WebFinger'               => null,
+                ))
             ),
             'discovery' => array('cors' => true) // Allow Cross-Origin Resource Sharing for service discovery (host-meta, XRD, etc.)
         );
@@ -245,31 +223,21 @@ class SingleuserSite extends SiteProfileSettings
         return array(
             'singleuser' => array('enabled' => true),
             // We only want to change these values, not replace entire 'site' array
-            'site' => array_replace(
+            'site' => array_merge(
                 $config['site'], array(
                     'private'    => false,
                     'closed'     => true,
                 )
             ),
             'plugins' => array(
-                'default' => array(
-                    'Activity'                => null,
-                    'Bookmark'                => null,
-                    'ClientSideShorten'       => null,
-                    'Event'                   => null,
-                    'Geonames'                => null,
-                    'NewMenu'                 => null,
+                'core'    => self::corePlugins(),
+                'default' => array_merge(self::defaultPlugins(), array(
                     'MobileProfile'           => null,
-                    'OpenID'                  => null,
                     'OStatus'                 => null,
-                    'Poll'                    => null,
-                    'QnA'                     => null,
-                    'SearchSub'               => null,
-                    'StrictTransportSecurity' => null,
-                    'TagSub'                  => null,
                     'TwitterBridge'           => null,
                     'FacebookBridge'          => null,
-                )
+                    'WebFinger'               => null,
+                ))
             ),
             'discovery' => array('cors' => true) // Allow Cross-Origin Resource Sharing for service discovery (host-meta, XRD, etc.)
         );