3 use \Friendica\Core\Config;
5 function friendica_init(App $a) {
6 if ($a->argv[1] == "json"){
7 $register_policy = Array('REGISTER_CLOSED', 'REGISTER_APPROVE', 'REGISTER_OPEN');
10 if (x($a->config,'admin_nickname')) {
11 $sql_extra = sprintf(" AND `nickname` = '%s' ", dbesc($a->config['admin_nickname']));
13 if (isset($a->config['admin_email']) && $a->config['admin_email']!='') {
14 $adminlist = explode(",", str_replace(" ", "", $a->config['admin_email']));
16 $r = q("SELECT `username`, `nickname` FROM `user` WHERE `email` = '%s' $sql_extra", dbesc($adminlist[0]));
18 'name' => $r[0]['username'],
19 'profile'=> App::get_baseurl() . '/profile/' . $r[0]['nickname'],
25 $visible_plugins = array();
26 if (is_array($a->plugins) && count($a->plugins)) {
27 $r = q("SELECT * FROM `addon` WHERE `hidden` = 0");
28 if (dbm::is_result($r)) {
30 $visible_plugins[] = $rr['name'];
35 Config::load('feature_lock');
36 $locked_features = array();
37 if (is_array($a->config['feature_lock']) && count($a->config['feature_lock'])) {
38 foreach ($a->config['feature_lock'] as $k => $v) {
39 if ($k === 'config_loaded') {
43 $locked_features[$k] = intval($v);
48 'version' => FRIENDICA_VERSION,
50 'plugins' => $visible_plugins,
51 'locked_features' => $locked_features,
52 'register_policy' => $register_policy[$a->config['register_policy']],
54 'site_name' => $a->config['sitename'],
55 'platform' => FRIENDICA_PLATFORM,
56 'info' => ((x($a->config,'info')) ? $a->config['info'] : ''),
57 'no_scrape_url' => App::get_baseurl().'/noscrape'
60 echo json_encode($data);
65 function friendica_content(App $a) {
66 $o = '<h1>Friendica</h1>' . PHP_EOL;
68 $o .= t('This is Friendica, version') . ' <strong>' . FRIENDICA_VERSION . '</strong> ';
69 $o .= t('running at web location') . ' ' . z_root();
70 $o .= '</p>' . PHP_EOL;
73 $o .= t('Please visit <a href="http://friendica.com">Friendica.com</a> to learn more about the Friendica project.') . PHP_EOL;
74 $o .= '</p>' . PHP_EOL;
77 $o .= t('Bug reports and issues: please visit') . ' ' . '<a href="https://github.com/friendica/friendica/issues?state=open">'.t('the bugtracker at github').'</a>';
78 $o .= '</p>' . PHP_EOL;
80 $o .= t('Suggestions, praise, donations, etc. - please email "Info" at Friendica - dot com');
81 $o .= '</p>' . PHP_EOL;
83 $visible_plugins = array();
84 if (is_array($a->plugins) && count($a->plugins)) {
85 $r = q("SELECT * FROM `addon` WHERE `hidden` = 0");
86 if (dbm::is_result($r)) {
88 $visible_plugins[] = $rr['name'];
93 if (count($visible_plugins)) {
94 $o .= '<p>' . t('Installed plugins/addons/apps:') . '</p>' . PHP_EOL;
95 $sorted = $visible_plugins;
98 foreach ($sorted as $p) {
106 $o .= '<div style="margin-left: 25px; margin-right: 25px;">' . $s . '</div>' . PHP_EOL;
108 $o .= '<p>' . t('No installed plugins/addons/apps') . '</p>' . PHP_EOL;
111 $blocklist = Config::get('system', 'blocklist');
112 if (count($blocklist)) {
113 $o .= '<div id="about_blocklist"><p>' . t('On this server the following remote servers are blocked.') . '</p>' . PHP_EOL;
114 $o .= '<table class="table"><thead><tr><th>' . t('Blocked domain') . '</th><th>' . t('Reason for the block') . '</th></thead><tbody>' . PHP_EOL;
115 foreach ($blocklist as $b) {
116 $o .= '<tr><td>' . $b['domain'] .'</td><td>' . $b['reason'] . '</td></tr>' . PHP_EOL;
118 $o .= '</tbody></table></div>' . PHP_EOL;
121 call_hooks('about_hook', $o);