X-Git-Url: https://git.mxchange.org/?a=blobdiff_plain;f=lib%2Fsiteprofile.php;h=a2c09efb2f6be08f5dc0919573ff1a0b601d5d71;hb=959f971a6510a45f832f910999a24f063b41c953;hp=c294d24569c2adca80f3fe5ba263e6901569d1f3;hpb=e565477e3f5d88c32f002c3666ef9370c058c373;p=quix0rs-gnu-social.git diff --git a/lib/siteprofile.php b/lib/siteprofile.php index c294d24569..a2c09efb2f 100644 --- a/lib/siteprofile.php +++ b/lib/siteprofile.php @@ -28,7 +28,7 @@ * @link http://status.net/ */ -if (!defined('STATUSNET')) { +if (!defined('GNUSOCIAL')) { exit(1); } @@ -48,7 +48,7 @@ class SiteProfile $sprofileClass = ucfirst($name) . "Site"; if (class_exists($sprofileClass)) { - return $sprofileClass::getSettings(); + return call_user_func(array($sprofileClass, 'getSettings')); } else { common_log( LOG_ERR, @@ -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,10 @@ class PublicSite extends SiteProfileSettings ) ), 'plugins' => array( - 'default' => array( - 'Activity' => null, - 'Bookmark' => null, - 'ClientSideShorten' => null, - 'Directory' => null, - 'Event' => null, - 'ExtendedProfile' => null, - 'Geonames' => null, - 'Gravatar' => null, - 'OpenID' => null, - 'OStatus' => null, - 'Poll' => null, - 'QnA' => null, - 'SearchSub' => null, - 'StrictTransportSecurity' => null, - 'TagSub' => null - ) + 'core' => self::corePlugins(), + 'default' => array_merge(self::defaultPlugins(), array( + 'RegisterThrottle' => array(), + )) ), 'discovery' => array('cors' => true) // Allow Cross-Origin Resource Sharing for service discovery (host-meta, XRD, etc.) ); @@ -137,33 +134,23 @@ 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, - '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 - ) + 'core' => self::corePlugins(), + 'default' => array_merge(self::defaultPlugins(), array( + 'ExtendedProfile' => array(), + 'EmailRegistration' => array(), + 'MobileProfile' => array(), + )), + 'disable-OStatus' => 1, + 'disable-WebFinger' => 1, ), + 'public' => array('localonly' => true), 'profile' => array('delete' => 'true'), 'license' => array('type' => 'private'), 'attachments' => array( @@ -200,30 +187,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, + 'inviteonly' => true, 'closed' => false ) ), 'plugins' => array( - 'default' => array( - 'Activity' => null, - 'Bookmark' => null, - 'ClientSideShorten' => null, - 'Directory' => null, - 'Event' => null, - 'Geonames' => null, - 'Gravatar' => null, - 'OpenID' => null, - 'OStatus' => null, - 'Poll' => null, - 'QnA' => null, - 'SearchSub' => null, - 'StrictTransportSecurity' => null, - 'TagSub' => null - ) + 'core' => self::corePlugins(), + 'default' => array_merge(self::defaultPlugins(), array( + )) ), + 'public' => array('localonly' => true), 'discovery' => array('cors' => true) // Allow Cross-Origin Resource Sharing for service discovery (host-meta, XRD, etc.) ); } @@ -245,32 +221,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, + 'localonly' => true, ) ), 'plugins' => array( - 'default' => array( - 'Activity' => null, - 'Bookmark' => null, - 'ClientSideShorten' => null, - 'Event' => null, - 'Geonames' => null, - 'NewMenu' => null, - 'MobileProfile' => null, - 'OpenID' => null, - 'OStatus' => null, - 'Poll' => null, - 'QnA' => null, - 'SearchSub' => null, - 'StrictTransportSecurity' => null, - 'TagSub' => null, - 'TwitterBridge' => null, - 'FacebookBridge' => null, - ) + 'core' => self::corePlugins(), + 'default' => array_merge(self::defaultPlugins(), array( + 'MobileProfile' => array(), + )), + 'disable-Directory' => 1, ), + 'public' => array('localonly' => true), 'discovery' => array('cors' => true) // Allow Cross-Origin Resource Sharing for service discovery (host-meta, XRD, etc.) ); }