provide a way to specify an admin account for siteinfo if more than one have admin email address
This commit is contained in:
parent
5921dc6f16
commit
75f778a504
|
@ -4,8 +4,12 @@ function friendica_init(&$a) {
|
||||||
if ($a->argv[1]=="json"){
|
if ($a->argv[1]=="json"){
|
||||||
$register_policy = Array('REGISTER_CLOSED', 'REGISTER_APPROVE', 'REGISTER_OPEN');
|
$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']!=''){
|
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(
|
$admin = array(
|
||||||
'name' => $r[0]['username'],
|
'name' => $r[0]['username'],
|
||||||
'profile'=> $a->get_baseurl().'/profile/'.$r[0]['nickname'],
|
'profile'=> $a->get_baseurl().'/profile/'.$r[0]['nickname'],
|
||||||
|
|
Loading…
Reference in New Issue
Block a user