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 $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 'inviteonly' => false,
99 'ClientSideShorten' => null,
102 'ExtendedProfile' => null,
110 'StrictTransportSecurity' => null,
114 array('cors' => true) // Allow Cross-Origin Resource Sharing for service discovery (host-meta, XRD, etc.)
121 * Settings for a 'private' site
123 * // XXX Too business oriented?
125 class PrivateSite extends SiteProfileSettings
128 * Get the settings for this site profile
130 * @return type array an array of settings
132 static function getSettings() {
135 'inviteonly' => true,
142 'ClientSideShorten' => null,
145 'ExtendedProfile' => null,
146 'EmailRegistration' => null,
150 'MobileProfile' => null,
155 'StrictTransportSecurity' => null,
159 'profile' => array('delete' => 'true'),
160 'license' => array('type' => 'private'),
161 'attachments' => array(
162 // Only allow uploads of pictures and MS Office files
163 'supported' => array(
169 'application/msword',
170 'application/vnd.ms-office',
171 'application/vnd.ms-excel',
172 'application/vnd.ms-powerpoint',
176 'discovery' => array('cors' => false) // Allow Cross-Origin Resource Sharing for service discovery (host-meta, XRD, etc.)
182 * Settings for a 'community' site
184 class CommunitySite extends SiteProfileSettings
187 * Get the settings for this site profile
189 * @return type array an array of settings
191 static function getSettings() {
194 'inviteonly' => true,
201 'ClientSideShorten' => null,
211 'StrictTransportSecurity' => null,
215 array('cors' => true) // Allow Cross-Origin Resource Sharing for service discovery (host-meta, XRD, etc.)
223 * Settings for a 'singleuser' site
225 class SingleuserSite extends SiteProfileSettings
228 * Get the settings for this site profile
230 * @return type array an array of settings
232 static function getSettings() {
234 'singleuser' => array('enabled' => true),
243 'ClientSideShorten' => null,
247 'MobileProfile' => null,
253 'StrictTransportSecurity' => null,
255 'TwitterBridge' => null,
256 'FacebookBridge' => null
259 array('cors' => true) // Allow Cross-Origin Resource Sharing for service discovery (host-meta, XRD, etc.)