X-Git-Url: https://code.wpia.club/?a=blobdiff_plain;f=src%2Fclub%2Fwpia%2Fgigi%2Fpages%2Forga%2FAffiliationForm.java;h=1fd1c010ff09eb102f23263aba1a610500e06638;hb=ce95db23bb9c9d7573ecf565220235f2692f7138;hp=5ac524042c78c17c7be30131b1f719fcd11c5f00;hpb=bccd4cc0dba0f89aa045b113bac46eb8cc1dab4e;p=gigi.git diff --git a/src/club/wpia/gigi/pages/orga/AffiliationForm.java b/src/club/wpia/gigi/pages/orga/AffiliationForm.java index 5ac52404..1fd1c010 100644 --- a/src/club/wpia/gigi/pages/orga/AffiliationForm.java +++ b/src/club/wpia/gigi/pages/orga/AffiliationForm.java @@ -9,8 +9,8 @@ import javax.servlet.http.HttpServletRequest; import club.wpia.gigi.GigiApiException; import club.wpia.gigi.dbObjects.Organisation; -import club.wpia.gigi.dbObjects.User; import club.wpia.gigi.dbObjects.Organisation.Affiliation; +import club.wpia.gigi.dbObjects.User; import club.wpia.gigi.localisation.Language; import club.wpia.gigi.output.template.Form; import club.wpia.gigi.output.template.IterableDataset; @@ -38,7 +38,10 @@ public class AffiliationForm extends Form { } } else if (req.getParameter("do_affiliate") != null) { User byEmail = User.getByEmail(req.getParameter("email")); - if (byEmail != null && byEmail.canAssure()) { + if (byEmail == null) { + throw new GigiApiException("To add an admin, the email address needs to be known to the system."); + } + if (byEmail.canVerify()) { o.addAdmin(byEmail, LoginPage.getUser(req), req.getParameter("master") != null); return new RedirectResult(ViewOrgPage.DEFAULT_PATH + "/" + o.getId()); } else {