json call for list addresses now need the password as GET/POST parameter

This commit is contained in:
Chris 2023-12-02 09:51:46 +01:00
parent 0858fcbbf9
commit f8578d62b5

View file

@ -78,7 +78,7 @@ class OpenTrashmailBackend{
header("Content-Type: application/json; charset=UTF8");
if($this->url[1]=='listaccounts')
{
if($this->settings['SHOW_ACCOUNT_LIST'])
if($this->settings['SHOW_ACCOUNT_LIST'] && (($this->settings['ADMIN_PASSWORD'] != "" && $_REQUEST['password']==$this->settings['ADMIN_PASSWORD'])|| !$this->settings['ADMIN_PASSWORD']))
return json_encode(listEmailAdresses());
else exit(json_encode(['error'=>'403 Forbidden']));
}