From 30d927a45f76ad0e28cae6e12a850be61ca22ebc Mon Sep 17 00:00:00 2001 From: INOPIAE Date: Thu, 15 Feb 2018 11:38:52 +0100 Subject: [PATCH] chg: restructure code for better readability Change-Id: If161d9176ac23edc0c5f19524c0dc2a157443ba2 --- .../gigi/pages/admin/support/SupportUserDetailsForm.java | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) 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!"); } -- 2.39.2