123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244 |
- <?php
- if (!defined('GNUSOCIAL')) {
- exit(1);
- }
- class SiteProfile
- {
-
- static public function getSettings($name)
- {
- $sprofileClass = ucfirst($name) . "Site";
- if (class_exists($sprofileClass)) {
- return call_user_func(array($sprofileClass, 'getSettings'));
- } else {
- common_log(
- LOG_ERR,
- "Unknown site profile '{$name}' specified in config file.",
- __FILE__
- );
- return array();
- }
- }
- }
- abstract class SiteProfileSettings
- {
- static function getSettings()
- {
- throw new MethodNotImplementedException(__METHOD__);
- }
- static function corePlugins() {
- return common_config('plugins', 'core');
- }
- static function defaultPlugins() {
- return common_config('plugins', 'default');
- }
- }
- class PublicSite extends SiteProfileSettings
- {
-
- static function getSettings() {
- global $config;
- return array(
-
- 'site' => array_merge(
- $config['site'], array(
- 'inviteonly' => false,
- 'private' => false,
- 'closed' => false
- )
- ),
- 'plugins' => array(
- 'core' => self::corePlugins(),
- 'default' => array_merge(self::defaultPlugins(), array(
- 'RegisterThrottle' => array(),
- ))
- ),
- 'discovery' => array('cors' => true)
- );
- }
- }
- class PrivateSite extends SiteProfileSettings
- {
-
- static function getSettings() {
- global $config;
- return array(
-
- 'site' => array_merge(
- $config['site'], array(
- 'inviteonly' => true,
- 'private' => true,
- )
- ),
- 'plugins' => array(
- '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(
-
- 'supported' => array(
- 'image/png',
- 'image/jpeg',
- 'image/gif',
- 'image/svg+xml',
- 'application/pdf',
- 'application/msword',
- 'application/vnd.ms-office',
- 'application/vnd.ms-excel',
- 'application/vnd.ms-powerpoint',
- 'application/ogg'
- )
- ),
- 'discovery' => array('cors' => false)
- );
- }
- }
- class CommunitySite extends SiteProfileSettings
- {
-
- static function getSettings() {
- global $config;
- return array(
-
- 'site' => array_merge(
- $config['site'], array(
- 'private' => false,
- 'inviteonly' => true,
- 'closed' => false
- )
- ),
- 'plugins' => array(
- 'core' => self::corePlugins(),
- 'default' => array_merge(self::defaultPlugins(), array(
- ))
- ),
- 'public' => array('localonly' => true),
- 'discovery' => array('cors' => true)
- );
- }
- }
- class SingleuserSite extends SiteProfileSettings
- {
-
- static function getSettings() {
- global $config;
- return array(
- 'singleuser' => array('enabled' => true),
-
- 'site' => array_merge(
- $config['site'], array(
- 'private' => false,
- 'closed' => true,
- 'localonly' => true,
- )
- ),
- 'plugins' => array(
- 'core' => self::corePlugins(),
- 'default' => array_merge(self::defaultPlugins(), array(
- 'MobileProfile' => array(),
- )),
- 'disable-Directory' => 1,
- ),
- 'public' => array('localonly' => true),
- 'discovery' => array('cors' => true)
- );
- }
- }
|