From 54dc222d0ed74a3f4cd887f457282afc64f7392d Mon Sep 17 00:00:00 2001 From: Christian Haschek Date: Wed, 9 Feb 2022 19:53:28 +0100 Subject: [PATCH] fixed admin email listings --- web/api.php | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/web/api.php b/web/api.php index 4c4f7c2..01f43b6 100644 --- a/web/api.php +++ b/web/api.php @@ -93,8 +93,9 @@ switch($action) break; case 'list': + $settings = loadSettings(); /* - $settings = loadSettings(); + if($settings['ADMIN'] && $settings['ADMIN']==$admincheck) { $o['status'] = 'ok'; @@ -118,10 +119,13 @@ switch($action) $o['emails']=$data; } - else */if(!is_dir($dir)) + else */ + + if(!is_dir($dir) && $settings['ADMIN']!=$admincheck) $o = array('status'=>'ok','emails'=>[]); else { + if(!$email) $email = $admincheck; $data = getEmailsOfEmail($email); $lastid = $_REQUEST['lastid']; if($lastid && is_numeric($lastid))