3 * StatusNet, the distributed open-source microblogging tool
5 * A site profile is a set of default settings for a particular style of
6 * StatusNet site: public, private, community, etc.
10 * LICENCE: This program is free software: you can redistribute it and/or modify
11 * it under the terms of the GNU Affero General Public License as published by
12 * the Free Software Foundation, either version 3 of the License, or
13 * (at your option) any later version.
15 * This program is distributed in the hope that it will be useful,
16 * but WITHOUT ANY WARRANTY; without even the implied warranty of
17 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
18 * GNU Affero General Public License for more details.
20 * You should have received a copy of the GNU Affero General Public License
21 * along with this program. If not, see <http://www.gnu.org/licenses/>.
23 * @category Installation
25 * @author Zach Copley <zach@status.net>
26 * @copyright 2011 StatusNet, Inc.
27 * @license http://www.fsf.org/licensing/licenses/agpl-3.0.html GNU Affero General Public License version 3.0
28 * @link http://status.net/
31 if (!defined('STATUSNET')) {
36 * Helper class for getting the settings for a particular site profile
41 * Returns the config settings for a site profile by name
43 * @param string $name name of a site profile
44 * @return array config settings
46 static public function getSettings($name)
48 $sprofileClass = ucfirst($name) . "Site";
50 if (class_exists($sprofileClass)) {
51 return call_user_func(array($sprofileClass, 'getSettings'));
55 "Unknown site profile '{$name}' specified in config file.",
64 * Site profile settings contain the list of the default settings (and
65 * possibly other information for a particular flavor of StatusNet
66 * installation). These will overwrite base defaults in $config global.
68 * @category Installation
70 * @author Zach Copley <zach@status.net>
71 * @license http://www.fsf.org/licensing/licenses/agpl-3.0.html GNU Affero General Public License version 3.0
72 * @link http://status.net/
74 abstract class SiteProfileSettings
76 abstract static function getSettings();
80 * Settings for a 'public' site
82 class PublicSite extends SiteProfileSettings
85 * Get the settings for this site profile
87 * @return type array an array of settings
89 static function getSettings() {
92 // We only want to change these values, not replace entire 'site' array
93 'site' => array_merge(
94 $config['site'], array(
95 'inviteonly' => false,
103 'ClientSideShorten' => null,
106 'ExtendedProfile' => null,
114 'StrictTransportSecurity' => null,
118 'discovery' => array('cors' => true) // Allow Cross-Origin Resource Sharing for service discovery (host-meta, XRD, etc.)
124 * Settings for a 'private' site
126 * // XXX Too business oriented?
128 class PrivateSite extends SiteProfileSettings
131 * Get the settings for this site profile
133 * @return type array an array of settings
135 static function getSettings() {
138 // We only want to change these values, not replace entire 'site' array
139 'site' => array_merge(
140 $config['site'], array(
141 'inviteonly' => true,
148 'ClientSideShorten' => null,
151 'ExtendedProfile' => null,
152 'EmailRegistration' => null,
156 'MobileProfile' => null,
161 'StrictTransportSecurity' => null,
165 'profile' => array('delete' => 'true'),
166 'license' => array('type' => 'private'),
167 'attachments' => array(
168 // Only allow uploads of pictures and MS Office files
169 'supported' => array(
175 'application/msword',
176 'application/vnd.ms-office',
177 'application/vnd.ms-excel',
178 'application/vnd.ms-powerpoint',
182 'discovery' => array('cors' => false) // Allow Cross-Origin Resource Sharing for service discovery (host-meta, XRD, etc.)
188 * Settings for a 'community' site
190 class CommunitySite extends SiteProfileSettings
193 * Get the settings for this site profile
195 * @return type array an array of settings
197 static function getSettings() {
200 // We only want to change these values, not replace entire 'site' array
201 'site' => array_merge(
202 $config['site'], array(
210 'ClientSideShorten' => null,
220 'StrictTransportSecurity' => null,
224 'discovery' => array('cors' => true) // Allow Cross-Origin Resource Sharing for service discovery (host-meta, XRD, etc.)
231 * Settings for a 'singleuser' site
233 class SingleuserSite extends SiteProfileSettings
236 * Get the settings for this site profile
238 * @return type array an array of settings
240 static function getSettings() {
243 'singleuser' => array('enabled' => true),
244 // We only want to change these values, not replace entire 'site' array
245 'site' => array_merge(
246 $config['site'], array(
254 'ClientSideShorten' => null,
258 'MobileProfile' => null,
264 'StrictTransportSecurity' => null,
266 'TwitterBridge' => null,
267 'FacebookBridge' => null,
270 'discovery' => array('cors' => true) // Allow Cross-Origin Resource Sharing for service discovery (host-meta, XRD, etc.)