forked from GNUsocial/gnu-social
Merge branch '1.0.x' of gitorious.org:statusnet/mainline into 1.0.x
This commit is contained in:
commit
a2ea31bc80
@ -981,7 +981,7 @@ class User extends Managed_DataObject
|
|||||||
return $user->nickname;
|
return $user->nickname;
|
||||||
} catch (Exception $e) {
|
} catch (Exception $e) {
|
||||||
if (common_config('singleuser', 'enabled') && common_config('singleuser', 'nickname')) {
|
if (common_config('singleuser', 'enabled') && common_config('singleuser', 'nickname')) {
|
||||||
common_log(LOG_WARN, "Warning: code attempting to pull single-user nickname when the account does not exist. If this is not setup time, this is probably a bug.");
|
common_log(LOG_WARNING, "Warning: code attempting to pull single-user nickname when the account does not exist. If this is not setup time, this is probably a bug.");
|
||||||
return common_config('singleuser', 'nickname');
|
return common_config('singleuser', 'nickname');
|
||||||
}
|
}
|
||||||
throw $e;
|
throw $e;
|
||||||
|
@ -257,6 +257,7 @@ class WebInstaller extends Installer
|
|||||||
<option value="private">Private</option>
|
<option value="private">Private</option>
|
||||||
<option value="community">Community</option>
|
<option value="community">Community</option>
|
||||||
<option value ="public">Public</option>
|
<option value ="public">Public</option>
|
||||||
|
<option value ="singleuser">Single User</option>
|
||||||
</select>
|
</select>
|
||||||
<p class="form_guide">Initial access settings for your site</p>
|
<p class="form_guide">Initial access settings for your site</p>
|
||||||
</li>
|
</li>
|
||||||
|
@ -414,7 +414,8 @@ abstract class Installer
|
|||||||
'path' => $this->path,
|
'path' => $this->path,
|
||||||
'db_database' => $this->db['database'],
|
'db_database' => $this->db['database'],
|
||||||
'db_type' => $this->db['type'],
|
'db_type' => $this->db['type'],
|
||||||
'site_profile' => $this->siteProfile
|
'site_profile' => $this->siteProfile,
|
||||||
|
'nickname' => $this->adminNick
|
||||||
));
|
));
|
||||||
|
|
||||||
// assemble configuration file in a string
|
// assemble configuration file in a string
|
||||||
@ -437,7 +438,13 @@ abstract class Installer
|
|||||||
"\$config['db']['type'] = {$vals['db_type']};\n\n".
|
"\$config['db']['type'] = {$vals['db_type']};\n\n".
|
||||||
|
|
||||||
// site profile
|
// site profile
|
||||||
"\$config['site']['profile'] = {$vals['site_profile']};\n\n";
|
"\$config['site']['profile'] = {$vals['site_profile']};\n";
|
||||||
|
|
||||||
|
if ($this->siteProfile == "singleuser") {
|
||||||
|
$cfg .= "\$config['singleuser']['nickname'] = {$vals['nickname']};\n\n";
|
||||||
|
} else {
|
||||||
|
$cfg .= "\n";
|
||||||
|
}
|
||||||
|
|
||||||
// Normalize line endings for Windows servers
|
// Normalize line endings for Windows servers
|
||||||
$cfg = str_replace("\n", PHP_EOL, $cfg);
|
$cfg = str_replace("\n", PHP_EOL, $cfg);
|
||||||
|
@ -87,10 +87,15 @@ class PublicSite extends SiteProfileSettings
|
|||||||
* @return type array an array of settings
|
* @return type array an array of settings
|
||||||
*/
|
*/
|
||||||
static function getSettings() {
|
static function getSettings() {
|
||||||
|
global $config;
|
||||||
return array(
|
return array(
|
||||||
'site' => array(
|
// We only want to change these values, not replace entire 'site' array
|
||||||
|
'site' => array_replace(
|
||||||
|
$config['site'], array(
|
||||||
'inviteonly' => false,
|
'inviteonly' => false,
|
||||||
'private' => false
|
'private' => false,
|
||||||
|
'closed' => false
|
||||||
|
)
|
||||||
),
|
),
|
||||||
'plugins' => array(
|
'plugins' => array(
|
||||||
'default' => array(
|
'default' => array(
|
||||||
@ -109,10 +114,9 @@ class PublicSite extends SiteProfileSettings
|
|||||||
'SearchSub' => null,
|
'SearchSub' => null,
|
||||||
'StrictTransportSecurity' => null,
|
'StrictTransportSecurity' => null,
|
||||||
'TagSub' => null
|
'TagSub' => null
|
||||||
),
|
|
||||||
'discovery' =>
|
|
||||||
array('cors' => true) // Allow Cross-Origin Resource Sharing for service discovery (host-meta, XRD, etc.)
|
|
||||||
)
|
)
|
||||||
|
),
|
||||||
|
'discovery' => array('cors' => true) // Allow Cross-Origin Resource Sharing for service discovery (host-meta, XRD, etc.)
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -130,10 +134,14 @@ class PrivateSite extends SiteProfileSettings
|
|||||||
* @return type array an array of settings
|
* @return type array an array of settings
|
||||||
*/
|
*/
|
||||||
static function getSettings() {
|
static function getSettings() {
|
||||||
|
global $config;
|
||||||
return array(
|
return array(
|
||||||
'site' => array(
|
// We only want to change these values, not replace entire 'site' array
|
||||||
|
'site' => array_replace(
|
||||||
|
$config['site'], array(
|
||||||
'inviteonly' => true,
|
'inviteonly' => true,
|
||||||
'private' => true
|
'private' => true,
|
||||||
|
)
|
||||||
),
|
),
|
||||||
'plugins' => array(
|
'plugins' => array(
|
||||||
'default' => array(
|
'default' => array(
|
||||||
@ -189,10 +197,14 @@ class CommunitySite extends SiteProfileSettings
|
|||||||
* @return type array an array of settings
|
* @return type array an array of settings
|
||||||
*/
|
*/
|
||||||
static function getSettings() {
|
static function getSettings() {
|
||||||
|
global $config;
|
||||||
return array(
|
return array(
|
||||||
'site' => array(
|
// We only want to change these values, not replace entire 'site' array
|
||||||
'inviteonly' => true,
|
'site' => array_replace(
|
||||||
'private' => false
|
$config['site'], array(
|
||||||
|
'private' => false,
|
||||||
|
'closed' => false
|
||||||
|
)
|
||||||
),
|
),
|
||||||
'plugins' => array(
|
'plugins' => array(
|
||||||
'default' => array(
|
'default' => array(
|
||||||
@ -210,10 +222,9 @@ class CommunitySite extends SiteProfileSettings
|
|||||||
'SearchSub' => null,
|
'SearchSub' => null,
|
||||||
'StrictTransportSecurity' => null,
|
'StrictTransportSecurity' => null,
|
||||||
'TagSub' => null
|
'TagSub' => null
|
||||||
),
|
|
||||||
'discovery' =>
|
|
||||||
array('cors' => true) // Allow Cross-Origin Resource Sharing for service discovery (host-meta, XRD, etc.)
|
|
||||||
)
|
)
|
||||||
|
),
|
||||||
|
'discovery' => array('cors' => true) // Allow Cross-Origin Resource Sharing for service discovery (host-meta, XRD, etc.)
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -230,11 +241,15 @@ class SingleuserSite extends SiteProfileSettings
|
|||||||
* @return type array an array of settings
|
* @return type array an array of settings
|
||||||
*/
|
*/
|
||||||
static function getSettings() {
|
static function getSettings() {
|
||||||
|
global $config;
|
||||||
return array(
|
return array(
|
||||||
'singleuser' => array('enabled' => true),
|
'singleuser' => array('enabled' => true),
|
||||||
'site' => array(
|
// We only want to change these values, not replace entire 'site' array
|
||||||
|
'site' => array_replace(
|
||||||
|
$config['site'], array(
|
||||||
'private' => false,
|
'private' => false,
|
||||||
'closed' => true,
|
'closed' => true,
|
||||||
|
)
|
||||||
),
|
),
|
||||||
'plugins' => array(
|
'plugins' => array(
|
||||||
'default' => array(
|
'default' => array(
|
||||||
@ -253,11 +268,10 @@ class SingleuserSite extends SiteProfileSettings
|
|||||||
'StrictTransportSecurity' => null,
|
'StrictTransportSecurity' => null,
|
||||||
'TagSub' => null,
|
'TagSub' => null,
|
||||||
'TwitterBridge' => null,
|
'TwitterBridge' => null,
|
||||||
'FacebookBridge' => null
|
'FacebookBridge' => null,
|
||||||
),
|
|
||||||
'discovery' =>
|
|
||||||
array('cors' => true) // Allow Cross-Origin Resource Sharing for service discovery (host-meta, XRD, etc.)
|
|
||||||
)
|
)
|
||||||
|
),
|
||||||
|
'discovery' => array('cors' => true) // Allow Cross-Origin Resource Sharing for service discovery (host-meta, XRD, etc.)
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -310,7 +310,7 @@ class StatusNet
|
|||||||
{
|
{
|
||||||
global $config;
|
global $config;
|
||||||
$settings = SiteProfile::getSettings($name);
|
$settings = SiteProfile::getSettings($name);
|
||||||
$config = array_replace_recursive($config, $settings);
|
$config = array_replace($config, $settings);
|
||||||
}
|
}
|
||||||
|
|
||||||
protected function _sn_to_path($sn)
|
protected function _sn_to_path($sn)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user