From: INOPIAE Date: Thu, 15 Feb 2018 10:38:52 +0000 (+0100) Subject: chg: restructure code for better readability X-Git-Url: https://code.wpia.club/?p=gigi.git;a=commitdiff_plain;h=30d927a45f76ad0e28cae6e12a850be61ca22ebc chg: restructure code for better readability Change-Id: If161d9176ac23edc0c5f19524c0dc2a157443ba2 --- diff --git a/src/club/wpia/gigi/pages/admin/support/SupportUserDetailsForm.java b/src/club/wpia/gigi/pages/admin/support/SupportUserDetailsForm.java index aaa4a43a..7445c52c 100644 --- a/src/club/wpia/gigi/pages/admin/support/SupportUserDetailsForm.java +++ b/src/club/wpia/gigi/pages/admin/support/SupportUserDetailsForm.java @@ -46,7 +46,13 @@ public class SupportUserDetailsForm extends Form { throw new GigiApiException("No ticket number set."); } - if ((req.getParameter("detailupdate") != null ? 1 : 0) + (req.getParameter("addGroup") != null ? 1 : 0) + (req.getParameter("removeGroup") != null ? 1 : 0) + (req.getParameter("resetPass") != null ? 1 : 0) != 1) { + int numActions = 0; + numActions += req.getParameter("detailupdate") != null ? 1 : 0; + numActions += req.getParameter("addGroup") != null ? 1 : 0; + numActions += req.getParameter("removeGroup") != null ? 1 : 0; + numActions += req.getParameter("resetPass") != null ? 1 : 0; + + if (numActions != 1) { throw new GigiApiException("More than one action requested!"); }