|
|
|
@ -225,7 +225,7 @@ public class Rest extends HttpServlet {
@@ -225,7 +225,7 @@ public class Rest extends HttpServlet {
|
|
|
|
|
|
|
|
|
|
private Map<String, Object> listMembers(MailingList list, User user) { |
|
|
|
|
if (list == null) return Map.of(ERROR,"Keine Listen-Email übertragen!"); |
|
|
|
|
if (!list.membersMayBeListedBy(user)) Map.of(ERROR,t("You are not allowed to list members of '{}'",list.email())); |
|
|
|
|
if (!list.membersMayBeListedBy(user)) Map.of(ERROR,t("Es ist dir nicht gestattet, die Mitglieder von '{}' aufzulisten",list.email())); |
|
|
|
|
try { |
|
|
|
|
var members = list.members() |
|
|
|
|
.stream() |
|
|
|
@ -233,17 +233,17 @@ public class Rest extends HttpServlet {
@@ -233,17 +233,17 @@ public class Rest extends HttpServlet {
|
|
|
|
|
.toList(); |
|
|
|
|
return Map.of(MEMBERS,members); |
|
|
|
|
} catch (SQLException e) { |
|
|
|
|
LOG.error("Failed to load member list: ",e); |
|
|
|
|
return Map.of(ERROR,t("Failed to load member list '{}'",list.email())); |
|
|
|
|
LOG.error("Laden der Mitglieder-Liste fehlgeschlagen: ",e); |
|
|
|
|
return Map.of(ERROR,t("Laden der Mitglieder-Liste von '{}' fehlgeschlagen!",list.email())); |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
private Map testList(MailingList list, User user) { |
|
|
|
|
if (list == null) return Map.of(ERROR,"Keine Listen-Email übertragen!"); |
|
|
|
|
if (!list.mayBeTestedBy(user)) Map.of(ERROR,t("You are not allowed to test '{}'",list.email())); |
|
|
|
|
if (!list.mayBeTestedBy(user)) Map.of(ERROR,t("Es ist dir nicht gestattet, '{}' zu testen",list.email())); |
|
|
|
|
try { |
|
|
|
|
list.test(user); |
|
|
|
|
return Map.of(SUCCESS,t("Sent test email to {}",user.email())); |
|
|
|
|
return Map.of(SUCCESS,t("Test-Email an {} versendet",user.email())); |
|
|
|
|
} catch (Exception e) { |
|
|
|
|
LOG.warn("Senden der Test-Email fehlgeschlagen",e); |
|
|
|
|
return Map.of(ERROR,t("Senden der Test-Email an {} fehlgeschlagen",user.email())); |
|
|
|
|