working on permissions
This commit is contained in:
@@ -6,6 +6,7 @@ import de.srsoftware.widerhall.Util;
|
||||
import de.srsoftware.widerhall.data.ListMember;
|
||||
import de.srsoftware.widerhall.data.MailingList;
|
||||
import de.srsoftware.widerhall.data.User;
|
||||
import org.antlr.runtime.MismatchedTokenException;
|
||||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
import org.stringtemplate.v4.STGroup;
|
||||
@@ -146,8 +147,8 @@ public class Web extends HttpServlet {
|
||||
if (token== null || token.isBlank()) return t("Invalid or missing token!");
|
||||
var user = ListMember.confirm(token);
|
||||
if (user != null) return loadTemplate(INDEX,Map.of(USER,user.safeMap(),NOTES,"Confirmed list subscription!"),resp);
|
||||
return t("Unknown user");
|
||||
} catch (SQLException e) {
|
||||
return t("Unknown user or token");
|
||||
} catch (Exception e) {
|
||||
LOG.debug("Failed to confirm list membership:",e);
|
||||
return t("Confirmation of list membership failed!");
|
||||
}
|
||||
@@ -400,7 +401,11 @@ public class Web extends HttpServlet {
|
||||
|
||||
try {
|
||||
list.requestSubscription(user,skipConfirmation);
|
||||
data.put(NOTES,t("Successfully subscribed '{}' to '{}'.",user.email(),list.email()));
|
||||
if (skipConfirmation) {
|
||||
data.put(NOTES, t("Successfully subscribed '{}' to '{}'.", user.email(), list.email()));
|
||||
} else {
|
||||
data.put(NOTES, t("Sent confirmation mail to '{}.", user.email()));
|
||||
}
|
||||
return loadTemplate(INDEX,data,resp);
|
||||
} catch (SQLException sqle) {
|
||||
LOG.debug("List subscription failed: ",sqle);
|
||||
|
||||
Reference in New Issue
Block a user