]> git.mxchange.org Git - friendica.git/commitdiff
provide a way to specify an admin account for siteinfo if more than one have admin...
authorfriendica <info@friendica.com>
Fri, 30 Mar 2012 01:22:20 +0000 (18:22 -0700)
committerfriendica <info@friendica.com>
Fri, 30 Mar 2012 01:22:20 +0000 (18:22 -0700)
mod/friendica.php

index d5dad94484729a43bd8fc78e5ea71add81125ba7..52a064224a559ef15eb872754b5e2bcc51961b9e 100755 (executable)
@@ -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'],