Merge Pull Request #95 into develop

master
Eugene E. Kashpureff Jr 8 years ago
commit 7ee79f7468
  1. 9
      libresonic-main/src/main/java/org/libresonic/player/command/AdvancedSettingsCommand.java
  2. 2
      libresonic-main/src/main/java/org/libresonic/player/controller/AdvancedSettingsController.java
  3. 2
      libresonic-main/src/main/java/org/libresonic/player/controller/MultiController.java
  4. 10
      libresonic-main/src/main/java/org/libresonic/player/service/SettingsService.java
  5. 11
      libresonic-main/src/main/resources/org/libresonic/player/i18n/ResourceBundle_en.properties
  6. 3
      libresonic-main/src/main/resources/org/libresonic/player/i18n/ResourceBundle_nl.properties
  7. 25
      libresonic-main/src/main/webapp/WEB-INF/jsp/advancedSettings.jsp

@ -45,6 +45,7 @@ public class AdvancedSettingsCommand {
private String smtpPort;
private String smtpUser;
private String smtpPassword;
private String smtpFrom;
public String getDownloadLimit() {
return downloadLimit;
@ -173,4 +174,12 @@ public class AdvancedSettingsCommand {
public void setSmtpPassword(String smtpPassword) {
this.smtpPassword = smtpPassword;
}
public String getSmtpFrom() {
return smtpFrom;
}
public void setSmtpFrom(String smtpFrom) {
this.smtpFrom = smtpFrom;
}
}

@ -51,6 +51,7 @@ public class AdvancedSettingsController extends SimpleFormController {
command.setSmtpEncryption(settingsService.getSmtpEncryption());
command.setSmtpPort(settingsService.getSmtpPort());
command.setSmtpUser(settingsService.getSmtpUser());
command.setSmtpFrom(settingsService.getSmtpFrom());
return command;
}
@ -83,6 +84,7 @@ public class AdvancedSettingsController extends SimpleFormController {
settingsService.setSmtpEncryption(command.getSmtpEncryption());
settingsService.setSmtpPort(command.getSmtpPort());
settingsService.setSmtpUser(command.getSmtpUser());
settingsService.setSmtpFrom(command.getSmtpFrom());
if (StringUtils.isNotEmpty(command.getSmtpPassword())) {
settingsService.setSmtpPassword(command.getSmtpPassword());

@ -168,7 +168,7 @@ public class MultiController extends MultiActionController {
try {
Message message = new MimeMessage(session);
message.setFrom(new InternetAddress("libresonic@libresonic.org"));
message.setFrom(new InternetAddress(settingsService.getSmtpFrom()));
message.setRecipients(Message.RecipientType.TO, InternetAddress.parse(email));
message.setSubject("Libresonic Password");
message.setText("Hi there!\n\n" +

@ -149,6 +149,7 @@ public class SettingsService {
private static final String KEY_SMTP_PORT = "SmtpPort";
private static final String KEY_SMTP_USER = "SmtpUser";
private static final String KEY_SMTP_PASSWORD = "SmtpPassword";
private static final String KEY_SMTP_FROM = "SmtpFrom";
// Default values.
private static final String DEFAULT_INDEX_STRING = "A B C D E F G H I J K L M N O P Q R S T U V W X-Z(XYZ)";
@ -223,6 +224,7 @@ public class SettingsService {
private static final String DEFAULT_SMTP_PORT = "25";
private static final String DEFAULT_SMTP_USER = null;
private static final String DEFAULT_SMTP_PASSWORD = null;
private static final String DEFAULT_SMTP_FROM = "libresonic@libresonic.org";
// Array of obsolete keys. Used to clean property file.
private static final List<String> OBSOLETE_KEYS = Arrays.asList("PortForwardingPublicPort", "PortForwardingLocalPort",
@ -1508,4 +1510,12 @@ public class SettingsService {
}
properties.setProperty(KEY_SMTP_PASSWORD, smtpPassword);
}
public String getSmtpFrom() {
return properties.getProperty(KEY_SMTP_FROM, DEFAULT_SMTP_FROM);
}
public void setSmtpFrom(String smtpFrom) {
setString(KEY_SMTP_FROM, smtpFrom);
}
}

@ -343,12 +343,13 @@ advancedsettings.ldapmanagerpassword = Password
advancedsettings.ldapautoshadowing = Automatically create users in {0}
advancedsettings.smtpPort = SMTP port
advancedsettings.smtpServer = SMTP server
advancedsettings.smtpEncryption = SMTP encryption method
advancedsettings.smtpEncryption = SMTP encryption
advancedsettings.smtpUser = SMTP username
advancedsettings.smtpPassword = SMTP password
advancedsettings.smtpPassword = Password
advancedsettings.smtpEncryption.none = None
advancedsettings.smtpEncryption.starttls = STARTTLS
advancedsettings.smtpEncryption.ssl = SSL/TLS
advancedsettings.smtpFrom = Mail sender
# personalSettings.jsp
personalsettings.title = Personal settings for {0}
@ -823,10 +824,12 @@ helppopup.smtpServer.text = <p>The hostname of the SMTP server. This server will
who have requested a password reset.</p>
helppopup.smtpPort.title = SMTP Port
helppopup.smtpPort.text = <p>The server's port that should be connected to for SMTP traffic.</p>
helppopup.smtpUser.title = SMTP User
helppopup.smtpUser.text = <p>The username to be used to authenticate with the server. Leave empty to connect without authentication.</p>
helppopup.smtpCredentials.title = SMTP Credentials
helppopup.smtpCredentials.text = <p>The credentials to be used to connect to the SMTP server. Leave empty to connect without authentication.</p>
helppopup.smtpEncryption.title = SMTP Encryption
helppopup.smtpEncryption.text = <p>The encryption method to be used to connect to the SMTP server. Choose "None" for no encryption.</p>
helppopup.smtpFrom.title = From address
helppopup.smtpFrom.text = <p>The sender address for mails originating from the Libresonic server. Must be a valid e-mail address.</p>
# wap/index.jsp
wap.index.missing = No music found

@ -343,8 +343,9 @@ advancedsettings.smtpPort = SMTP poort
advancedsettings.smtpServer = SMTP server
advancedsettings.smtpEncryption = SMTP versleutelingsmethode
advancedsettings.smtpUser = SMTP gebruikersnaam
advancedsettings.smtpPassword = SMTP wachtwoord
advancedsettings.smtpPassword = Wachtwoord
advancedsettings.smtpEncryption.none = Geen
advancedsettings.smtpFrom = Afzender
# personalsettings.jsp
personalsettings.title = Persoonlijke instellingen voor {0}

@ -41,7 +41,15 @@
</tr>
</table>
<table style="white-space:nowrap" class="indent">
<table class="indent">
<tr>
<td><fmt:message key="advancedsettings.smtpFrom"/></td>
<td>
<form:input path="smtpFrom" size="50"/>
<c:import url="helpToolTip.jsp"><c:param name="topic" value="smtpFrom"/></c:import>
</td>
</tr>
<tr>
<td><fmt:message key="advancedsettings.smtpServer"/></td>
<td>
@ -61,7 +69,7 @@
<tr>
<td><fmt:message key="advancedsettings.smtpEncryption"/></td>
<td>
<form:select path="smtpEncryption" cssStyle="width:20em">
<form:select path="smtpEncryption" cssStyle="width:8em">
<fmt:message key="advancedsettings.smtpEncryption.none" var="none"/>
<fmt:message key="advancedsettings.smtpEncryption.starttls" var="starttls"/>
<fmt:message key="advancedsettings.smtpEncryption.ssl" var="ssl"/>
@ -77,15 +85,10 @@
<tr>
<td><fmt:message key="advancedsettings.smtpUser"/></td>
<td>
<form:input path="smtpUser" size="40"/>
<c:import url="helpToolTip.jsp"><c:param name="topic" value="smtpUser"/></c:import>
</td>
</tr>
<tr>
<td><fmt:message key="advancedsettings.smtpPassword"/></td>
<td>
<form:password path="smtpPassword" size="40"/>
<form:input path="smtpUser" size="20"/>
<fmt:message key="advancedsettings.smtpPassword"/>
<form:password path="smtpPassword" size="20"/>
<c:import url="helpToolTip.jsp"><c:param name="topic" value="smtpCredentials"/></c:import>
</td>
</tr>

Loading…
Cancel
Save