Prevent using localhost on auxiliary IMAP accounts

pull/228/head
Francis Lachapelle 2016-12-05 16:12:16 -05:00
parent 68ddcd7045
commit c663f7ab4c
4 changed files with 10 additions and 1 deletions

3
NEWS
View File

@ -1,6 +1,9 @@
3.2.5 (2016-12-DD)
------------------
Enhancements
- [web] prevent using localhost on additional IMAP accounts
Bug fixes
- [web] fixed confusion between owner and active user in ACLs management of Administration module
- [web] fixed JavaScript exception after renaming an address book

View File

@ -194,6 +194,7 @@
"Please enter your signature below" = "Please enter your signature below";
"Please specify a valid sender address." = "Please specify a valid sender address.";
"Please specify a valid reply-to address." = "Please specify a valid reply-to address.";
"Specify a hostname other than the local host" = "Specify a hostname other than the local host";
/* Additional Parameters */
"Additional Parameters" = "Additional Parameters";

View File

@ -27,9 +27,13 @@
<div layout="row">
<md-input-container class="md-block md-flex">
<label><var:string label:value="Server Name"/></label>
<input type="text" required="required"
<input name="serverName" type="text" required="required"
ng-pattern="$AccountDialogController.hostnameRE"
ng-disabled="$AccountDialogController.accountId == 0"
ng-model="$AccountDialogController.account.serverName"/>
<div ng-messages="accountForm.serverName.$error" role="alert">
<div ng-message="pattern"><var:string label:value="Specify a hostname other than the local host"/></div>
</div>
</md-input-container>
<md-input-container class="md-block" flex="30">

View File

@ -18,6 +18,7 @@
vm.customFromIsReadonly = customFromIsReadonly;
vm.cancel = cancel;
vm.save = save;
vm.hostnameRE = accountId > 0 ? /^(?!(127\.0\.0\.1|localhost(?:\.localdomain)?)$)/ : /./;
if (!vm.account.encryption)
vm.account.encryption = "none";