X-Git-Url: https://git.mxchange.org/?a=blobdiff_plain;ds=inline;f=mod%2Ffriendica.php;h=28807b5b509f677fe589a5661ab6a35582ea5cf0;hb=4832bc74f55e7d3e6f66d281f5de3a071fe1e071;hp=d5dad94484729a43bd8fc78e5ea71add81125ba7;hpb=5bd4f62210c9672dd7d502cf8a74ee34727536fc;p=friendica.git diff --git a/mod/friendica.php b/mod/friendica.php old mode 100755 new mode 100644 index d5dad94484..28807b5b50 --- a/mod/friendica.php +++ b/mod/friendica.php @@ -4,8 +4,12 @@ function friendica_init(&$a) { if ($a->argv[1]=="json"){ $register_policy = Array('REGISTER_CLOSED', 'REGISTER_APPROVE', 'REGISTER_OPEN'); + $sql_extra = ''; + if(x($a->config,'admin_nickname')) { + $sql_extra = sprintf(" AND nickname = '%s' ",dbesc($a->config['admin_nickname'])); + } if (isset($a->config['admin_email']) && $a->config['admin_email']!=''){ - $r = q("SELECT username, nickname FROM user WHERE email='%s'", $a->config['admin_email']); + $r = q("SELECT username, nickname FROM user WHERE email='%s' $sql_extra", dbesc($a->config['admin_email'])); $admin = array( 'name' => $r[0]['username'], 'profile'=> $a->get_baseurl().'/profile/'.$r[0]['nickname'], @@ -14,10 +18,18 @@ function friendica_init(&$a) { $admin = false; } + $visible_plugins = array(); + if(is_array($a->plugins) && count($a->plugins)) { + $r = q("select * from addon where hidden = 0"); + if(count($r)) + foreach($r as $rr) + $visible_plugins[] = $rr['name']; + } + $data = Array( 'version' => FRIENDICA_VERSION, 'url' => z_root(), - 'plugins' => $a->plugins, + 'plugins' => $visible_plugins, 'register_policy' => $register_policy[$a->config['register_policy']], 'admin' => $admin, 'site_name' => $a->config['sitename'], @@ -50,9 +62,18 @@ function friendica_content(&$a) { $o .= '
'; - if(count($a->plugins)) { + $visible_plugins = array(); + if(is_array($a->plugins) && count($a->plugins)) { + $r = q("select * from addon where hidden = 0"); + if(count($r)) + foreach($r as $rr) + $visible_plugins[] = $rr['name']; + } + + + if(count($visible_plugins)) { $o .= '' . t('Installed plugins/addons/apps:') . '
'; - $sorted = $a->plugins; + $sorted = $visible_plugins; $s = ''; sort($sorted); foreach($sorted as $p) {