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
|
echo "DOMAINS=localhost" >> /var/www/opentrashmail/config.ini
|
||||||
fi
|
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
|
if [ "$ADMIN" != "" ]; then
|
||||||
echo "ADMIN=$ADMIN" >> /var/www/opentrashmail/config.ini
|
echo "ADMIN=$ADMIN" >> /var/www/opentrashmail/config.ini
|
||||||
echo " [i] Set admin to: $ADMIN"
|
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)
|
; 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
|
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
|
; 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
|
; The email doesn't really have to exist or have mail but must look like an email address
|
||||||
;ADMIN=some@random.email
|
;ADMIN=some@random.email
|
||||||
|
|
10
web/api.php
10
web/api.php
|
@ -141,8 +141,16 @@ switch($action)
|
||||||
$o = array('status'=>'ok','emails'=>$data);
|
$o = array('status'=>'ok','emails'=>$data);
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
|
case 'show-list':
|
||||||
|
$settings = loadSettings();
|
||||||
|
$o = $settings['SHOW_ACCOUNT_LIST'];
|
||||||
|
break;
|
||||||
case 'list-addresses':
|
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;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -16,6 +16,11 @@ $( document ).ready(function() {
|
||||||
domains = data;
|
domains = data;
|
||||||
else $("#btn-gen-random").hide();
|
else $("#btn-gen-random").hide();
|
||||||
},"json")
|
},"json")
|
||||||
|
|
||||||
|
$.get("api.php?a=show-list",function(data){
|
||||||
|
if (!data)
|
||||||
|
$("#btn-list-addresses").hide();
|
||||||
|
},"json")
|
||||||
});
|
});
|
||||||
|
|
||||||
function loadMail(email,id)
|
function loadMail(email,id)
|
||||||
|
|
Loading…
Reference in a new issue