Skip to content

Commit

Permalink
added security checks on logs and account list
Browse files Browse the repository at this point in the history
  • Loading branch information
geek-at committed Dec 1, 2023
1 parent 4c603a2 commit 0858fcb
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions web/inc/OpenTrashmailBackend.class.php
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ public function run(){
case 'read':
return $this->readMail($_REQUEST['email']?:$this->url[2],$_REQUEST['id']?:$this->url[3]);
case 'listaccounts':
if($this->settings['SHOW_ACCOUNT_LIST'])
if($this->settings['SHOW_ACCOUNT_LIST'] && (($this->settings['ADMIN_PASSWORD'] != "" && $_SESSION['admin'])|| !$this->settings['ADMIN_PASSWORD']))
return $this->listAccounts();
else return '403 Forbidden';
case 'raw-html':
Expand All @@ -36,7 +36,7 @@ public function run(){
case 'deleteaccount':
return $this->deleteAccount($_REQUEST['email']?:$this->url[2]);
case 'logs':
if($this->settings['SHOW_LOGS'])
if($this->settings['SHOW_LOGS'] && (($this->settings['ADMIN_PASSWORD'] != "" && $_SESSION['admin'])|| !$this->settings['ADMIN_PASSWORD']))
return $this->renderTemplate('logs.html',[
'lines' => (is_numeric($this->url[2])&&$this->url[2]>0)?$this->url[2]:100,
'mailserverlogfile'=>ROOT.DS.'../logs'.DS.'mailserver.log',
Expand Down

0 comments on commit 0858fcb

Please sign in to comment.