Add configuration option to enable list of accounts - defaults to hidden
This commit is contained in:
parent
1bf2920a50
commit
0fb9b4a7c0
|
@ -28,6 +28,11 @@ else
|
|||
echo "DOMAINS=localhost" >> /var/www/opentrashmail/config.ini
|
||||
fi
|
||||
|
||||
if [ "$SHOW_ACCOUNT_LIST" != "" ]; then
|
||||
echo "SHOW_ACCOUNT_LIST=$SHOW_ACCOUNT_LIST" >> /var/www/opentrashmail/config.ini
|
||||
echo " [i] Set show account list to: $SHOW_ACCOUNT_LIST"
|
||||
fi
|
||||
|
||||
if [ "$ADMIN" != "" ]; then
|
||||
echo "ADMIN=$ADMIN" >> /var/www/opentrashmail/config.ini
|
||||
echo " [i] Set admin to: $ADMIN"
|
||||
|
|
|
@ -5,6 +5,9 @@
|
|||
; pro tip: Use a wildcard domain like *.yourdomain.com to auto-generate the subdomains (you'll need to add a wildcard dns record too)
|
||||
DOMAINS=yourdomain,sub.yourdomain,*.mydom.com
|
||||
|
||||
; Enable to show a list of all existing accounts with mail
|
||||
;SHOW_ACCOUNT_LIST=true
|
||||
|
||||
; Enter the admin email address. If you choose this email on the website you will see all emails from all users
|
||||
; The email doesn't really have to exist or have mail but must look like an email address
|
||||
;ADMIN=some@random.email
|
||||
|
|
10
web/api.php
10
web/api.php
|
@ -141,8 +141,16 @@ switch($action)
|
|||
$o = array('status'=>'ok','emails'=>$data);
|
||||
}
|
||||
break;
|
||||
case 'show-list':
|
||||
$settings = loadSettings();
|
||||
$o = $settings['SHOW_ACCOUNT_LIST'];
|
||||
break;
|
||||
case 'list-addresses':
|
||||
$o = array('status'=>'ok','addresses'=>listEmailAdresses());
|
||||
$settings = loadSettings();
|
||||
$o = array('status'=>'ok','addresses'=>[]);
|
||||
|
||||
if ($settings['SHOW_ACCOUNT_LIST'])
|
||||
$o['addresses'] = listEmailAdresses();
|
||||
break;
|
||||
}
|
||||
|
||||
|
|
|
@ -16,6 +16,11 @@ $( document ).ready(function() {
|
|||
domains = data;
|
||||
else $("#btn-gen-random").hide();
|
||||
},"json")
|
||||
|
||||
$.get("api.php?a=show-list",function(data){
|
||||
if (!data)
|
||||
$("#btn-list-addresses").hide();
|
||||
},"json")
|
||||
});
|
||||
|
||||
function loadMail(email,id)
|
||||
|
|
Loading…
Reference in a new issue