4 use Friendica\Core\Config;
6 function friendica_init(App $a) {
7 if ($a->argv[1] == "json"){
8 $register_policy = Array('REGISTER_CLOSED', 'REGISTER_APPROVE', 'REGISTER_OPEN');
11 if (x($a->config,'admin_nickname')) {
12 $sql_extra = sprintf(" AND `nickname` = '%s' ", dbesc($a->config['admin_nickname']));
14 if (isset($a->config['admin_email']) && $a->config['admin_email']!='') {
15 $adminlist = explode(",", str_replace(" ", "", $a->config['admin_email']));
17 $r = q("SELECT `username`, `nickname` FROM `user` WHERE `email` = '%s' $sql_extra", dbesc($adminlist[0]));
19 'name' => $r[0]['username'],
20 'profile'=> App::get_baseurl() . '/profile/' . $r[0]['nickname'],
26 $visible_plugins = array();
27 if (is_array($a->plugins) && count($a->plugins)) {
28 $r = q("SELECT * FROM `addon` WHERE `hidden` = 0");
29 if (dbm::is_result($r)) {
31 $visible_plugins[] = $rr['name'];
36 Config::load('feature_lock');
37 $locked_features = array();
38 if (is_array($a->config['feature_lock']) && count($a->config['feature_lock'])) {
39 foreach ($a->config['feature_lock'] as $k => $v) {
40 if ($k === 'config_loaded') {
44 $locked_features[$k] = intval($v);
49 'version' => FRIENDICA_VERSION,
51 'plugins' => $visible_plugins,
52 'locked_features' => $locked_features,
53 'register_policy' => $register_policy[$a->config['register_policy']],
55 'site_name' => $a->config['sitename'],
56 'platform' => FRIENDICA_PLATFORM,
57 'info' => ((x($a->config,'info')) ? $a->config['info'] : ''),
58 'no_scrape_url' => App::get_baseurl().'/noscrape'
61 echo json_encode($data);
66 function friendica_content(App $a) {
67 $o = '<h1>Friendica</h1>' . PHP_EOL;
69 $o .= t('This is Friendica, version') . ' <strong>' . FRIENDICA_VERSION . '</strong> ';
70 $o .= t('running at web location') . ' ' . z_root();
71 $o .= '</p>' . PHP_EOL;
74 $o .= t('Please visit <a href="http://friendica.com">Friendica.com</a> to learn more about the Friendica project.') . PHP_EOL;
75 $o .= '</p>' . PHP_EOL;
78 $o .= t('Bug reports and issues: please visit') . ' ' . '<a href="https://github.com/friendica/friendica/issues?state=open">'.t('the bugtracker at github').'</a>';
79 $o .= '</p>' . PHP_EOL;
81 $o .= t('Suggestions, praise, donations, etc. - please email "Info" at Friendica - dot com');
82 $o .= '</p>' . PHP_EOL;
84 $visible_plugins = array();
85 if (is_array($a->plugins) && count($a->plugins)) {
86 $r = q("SELECT * FROM `addon` WHERE `hidden` = 0");
87 if (dbm::is_result($r)) {
89 $visible_plugins[] = $rr['name'];
94 if (count($visible_plugins)) {
95 $o .= '<p>' . t('Installed plugins/addons/apps:') . '</p>' . PHP_EOL;
96 $sorted = $visible_plugins;
99 foreach ($sorted as $p) {
107 $o .= '<div style="margin-left: 25px; margin-right: 25px;">' . $s . '</div>' . PHP_EOL;
109 $o .= '<p>' . t('No installed plugins/addons/apps') . '</p>' . PHP_EOL;
112 $blocklist = Config::get('system', 'blocklist');
113 if (count($blocklist)) {
114 $o .= '<div id="about_blocklist"><p>' . t('On this server the following remote servers are blocked.') . '</p>' . PHP_EOL;
115 $o .= '<table class="table"><thead><tr><th>' . t('Blocked domain') . '</th><th>' . t('Reason for the block') . '</th></thead><tbody>' . PHP_EOL;
116 foreach ($blocklist as $b) {
117 $o .= '<tr><td>' . $b['domain'] .'</td><td>' . $b['reason'] . '</td></tr>' . PHP_EOL;
119 $o .= '</tbody></table></div>' . PHP_EOL;
122 call_hooks('about_hook', $o);