|
|
@ -225,7 +225,7 @@ public class Rest extends HttpServlet { |
|
|
|
|
|
|
|
|
|
|
|
private Map<String, Object> listMembers(MailingList list, User user) { |
|
|
|
private Map<String, Object> listMembers(MailingList list, User user) { |
|
|
|
if (list == null) return Map.of(ERROR,"Keine Listen-Email übertragen!"); |
|
|
|
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 { |
|
|
|
try { |
|
|
|
var members = list.members() |
|
|
|
var members = list.members() |
|
|
|
.stream() |
|
|
|
.stream() |
|
|
@ -233,17 +233,17 @@ public class Rest extends HttpServlet { |
|
|
|
.toList(); |
|
|
|
.toList(); |
|
|
|
return Map.of(MEMBERS,members); |
|
|
|
return Map.of(MEMBERS,members); |
|
|
|
} catch (SQLException e) { |
|
|
|
} catch (SQLException e) { |
|
|
|
LOG.error("Failed to load member list: ",e); |
|
|
|
LOG.error("Laden der Mitglieder-Liste fehlgeschlagen: ",e); |
|
|
|
return Map.of(ERROR,t("Failed to load member list '{}'",list.email())); |
|
|
|
return Map.of(ERROR,t("Laden der Mitglieder-Liste von '{}' fehlgeschlagen!",list.email())); |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
private Map testList(MailingList list, User user) { |
|
|
|
private Map testList(MailingList list, User user) { |
|
|
|
if (list == null) return Map.of(ERROR,"Keine Listen-Email übertragen!"); |
|
|
|
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 { |
|
|
|
try { |
|
|
|
list.test(user); |
|
|
|
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) { |
|
|
|
} catch (Exception e) { |
|
|
|
LOG.warn("Senden der Test-Email fehlgeschlagen",e); |
|
|
|
LOG.warn("Senden der Test-Email fehlgeschlagen",e); |
|
|
|
return Map.of(ERROR,t("Senden der Test-Email an {} fehlgeschlagen",user.email())); |
|
|
|
return Map.of(ERROR,t("Senden der Test-Email an {} fehlgeschlagen",user.email())); |
|
|
|