X-Git-Url: https://git.mxchange.org/?a=blobdiff_plain;f=lib%2Fsiteprofile.php;h=6ab095d7121cfa573945cb309500800685a55b5c;hb=9ea57e5cb2622a8fc86c0cdd2cb6e73c0219fa51;hp=51ce907b1927d039bd4178e219768d4b49b5c59b;hpb=b53391e500abef00dcf6728eb367a10e5fb8478c;p=quix0rs-gnu-social.git diff --git a/lib/siteprofile.php b/lib/siteprofile.php index 51ce907b19..6ab095d712 100644 --- a/lib/siteprofile.php +++ b/lib/siteprofile.php @@ -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,21 @@ 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 +189,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 +224,22 @@ 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, + 'core' => self::corePlugins(), + 'default' => array_merge(self::defaultPlugins(), array( 'NewMenu' => null, '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.) );