api/statusnet/config.xml

This commit is contained in:
Friendika 2011-07-28 21:56:56 -07:00
parent 8e30f6a2f4
commit f47d582736
2 changed files with 36 additions and 10 deletions

View File

@ -550,3 +550,30 @@
} }
api_register_func('api/account/rate_limit_status','api_account_rate_limit_status',true); api_register_func('api/account/rate_limit_status','api_account_rate_limit_status',true);
function api_statusnet_config(&$a,$type) {
$name = $a->config['sitename'];
$server = $a->get_hostname();
$logo = $a->get_baseurl() . '/images/friendika-64.png';
$email = $a->config['admin_email'];
$closed = (($a->config['register_policy'] == REGISTER_CLOSED) ? 'true' : 'false');
$private = (($a->config['system']['block_public']) ? 'true' : 'false');
$textlimit = (($a->config['max_import_size']) ? $a->config['max_import_size'] : '200000');
$ssl = (($a->config['system']['have_ssl']) ? 'true' : 'false');
$sslserver = (($ssl === 'true') ? str_replace('http:','https:',$a->get_baseurl()) : '');
$config = array(
'site' => array('name' => $name,'server' => $server, 'theme' => 'default', 'path' => '',
'logo' => $logo, 'fancy' => 'true', 'language' => 'en', 'email' => $email, 'broughtby' => '',
'broughtbyurl' => '', 'timezone' => 'UTC', 'closed' => $closed, 'inviteonly' => 'false',
'private' => $private, 'textlimit' => $textlimit, 'sslserver' => $sslserver, 'ssl' => $ssl,
'shorturllength' => '30'
),
);
return api_apply_template('config', $type, array('$config' => $config));
}
api_register_func('api/statusnet/config','api_statusnet_config',true);

View File

@ -1,25 +1,24 @@
<?xml version="1.0" encoding="UTF-8"?>
<config> <config>
<site> <site>
<name>$sitedesc</name> <name>$config.site.name</name>
<server>$sitename</server> <server>$config.site.server</server>
<theme>default</theme> <theme>default</theme>
<path></path> <path></path>
<logo>$sitelogo</logo> <logo>$config.site.logo</logo>
<fancy>true</fancy> <fancy>true</fancy>
<language>en</language> <language>en</language>
<email>$adminemail</email> <email>$config.site.email</email>
<broughtby></broughtby> <broughtby></broughtby>
<broughtbyurl></broughtbyurl> <broughtbyurl></broughtbyurl>
<timezone>UTC</timezone> <timezone>UTC</timezone>
<closed>$siteclosed</closed> <closed>$config.site.closed</closed>
<inviteonly>false</inviteonly> <inviteonly>false</inviteonly>
<private>$siteprivate</private> <private>$config.site.private</private>
<textlimit>$textlimit</textlimit> <textlimit>$config.site.textlimit</textlimit>
<ssl>$has_ssl</ssl> <ssl>$config.site.ssl</ssl>
<sslserver>$ssl_server</sslserver> <sslserver>$config.site.sslserver</sslserver>
<shorturllength>30</shorturllength> <shorturllength>30</shorturllength>
</site> </site>