diff --git a/.gitignore b/.gitignore index 8aca927bd..1c3f2170f 100644 --- a/.gitignore +++ b/.gitignore @@ -8,4 +8,7 @@ atlassian-ide-plugin.xml /dist/md5sums /dist/output.txt /dist/updates.xml -log.txt \ No newline at end of file +log.txt +.project +.settings/ +.classpath diff --git a/Dockerfile b/Dockerfile new file mode 100644 index 000000000..ff4b0e6d6 --- /dev/null +++ b/Dockerfile @@ -0,0 +1,13 @@ +FROM maven:3-jdk-8-alpine as builder +VOLUME /root/.m2 +COPY . /source +WORKDIR /source +RUN cp -r repository /root/.m2/ && \ + mvn org.apache.maven.plugins:maven-install-plugin:3.0.0-M1:install-file -Dfile=repository/nl/tecon/scalahighcharts/highcharts/1.7/highcharts-1.7.jar && \ + mvn install -Pprod -Dmaven.test.skip=true -DskipTests + +FROM openjdk:8 +COPY --from=0 /source/eHour-standalone/target/ehour-1.4.4-SNAPSHOT-standalone/ehour-1.4.4-SNAPSHOT/ /ehour +WORKDIR /ehour +ENV EHOUR_HOME=/ehour +CMD java -cp "lib/*" net.rrm.ehour.EhourServerRunner diff --git a/eHour-common/src/main/java/net/rrm/ehour/appconfig/EhourSystemConfig.java b/eHour-common/src/main/java/net/rrm/ehour/appconfig/EhourSystemConfig.java index 3a384a121..343f7240f 100644 --- a/eHour-common/src/main/java/net/rrm/ehour/appconfig/EhourSystemConfig.java +++ b/eHour-common/src/main/java/net/rrm/ehour/appconfig/EhourSystemConfig.java @@ -30,6 +30,36 @@ public class EhourSystemConfig { @Value("${ehour.disableAuth:false}") private boolean disableAuth = false; + @Value("${ehour.enableOAuth:false}") + private boolean enableOAuth; + + @Value("${ehour.oauth2.callbackURI}") + private String oauthCallbackURI; + + @Value("${ehour.oauth2.hostURL}") + private String oauthHostURL; + + @Value("${ehour.oauth2.name}") + private String oauthName; + + @Value("${ehour.oauth2.userAuthorizationUri}") + private String oauthAuthURL; + + @Value("${ehour.oauth2.accessTokenUri}") + private String oauthTokenURI; + + @Value("${ehour.oauth2.clientID}") + private String oauthClientID; + + @Value("${ehour.oauth2.clientSecret}") + private String oauthClientSecuret; + + @Value("${ehour.oauth2.scope}") + private String oauthScope; + + @Value("${ehour.disableIndividualReport}") + private boolean disableIndividualReport = false; + public EhourSystemConfig() { } @@ -66,4 +96,45 @@ public String getEhourHome() { public String getTranslationsDir() { return translationsDir; } + + public boolean isEnableOAuth() { + return enableOAuth; + } + + public String getOauthCallbackURI() { + return oauthCallbackURI; + } + + public String getOauthHostURL() { + return oauthHostURL; + } + + public String getOauthName() { + return oauthName; + } + + public String getOauthAuthURL() { + return oauthAuthURL; + } + + public String getOauthClientID() { + return oauthClientID; + } + + public String getOauthClientSecuret() { + return oauthClientSecuret; + } + + public String getOauthScope() { + return oauthScope; + } + + public String getOauthTokenURI() { + return oauthTokenURI; + } + + public boolean isDisableIndividualReport() { + return disableIndividualReport; + } + } diff --git a/eHour-common/src/main/java/net/rrm/ehour/domain/User.java b/eHour-common/src/main/java/net/rrm/ehour/domain/User.java index 311df74b7..c21fbb807 100644 --- a/eHour-common/src/main/java/net/rrm/ehour/domain/User.java +++ b/eHour-common/src/main/java/net/rrm/ehour/domain/User.java @@ -47,20 +47,20 @@ public class User extends DomainObject { private Integer userId; @NotNull - @Column(name = "USERNAME", length = 64) + @Column(name = "USERNAME", length = 1024) private String username; @NotNull - @Column(name = "PASSWORD", nullable = false, length = 128) + @Column(name = "PASSWORD", nullable = false, length = 1024) private String password; - @Column(name = "FIRST_NAME", length = 64) + @Column(name = "FIRST_NAME", length = 1024) private String firstName; - @Column(name = "LAST_NAME", nullable = false, length = 64) + @Column(name = "LAST_NAME", nullable = false, length = 1024) private String lastName; - @Column(name = "EMAIL", length = 128) + @Column(name = "EMAIL", length = 1024) private String email; @Column(name = "ACTIVE") diff --git a/eHour-persistence/pom.xml b/eHour-persistence/pom.xml index f22720971..93d828991 100644 --- a/eHour-persistence/pom.xml +++ b/eHour-persistence/pom.xml @@ -108,11 +108,11 @@ eHour-common - - net.rrm.ehour - eHour-common - test-jar - + + + + + cglib diff --git a/eHour-persistence/src/main/resources/query/common/Project.queries.hbm.xml b/eHour-persistence/src/main/resources/query/common/Project.queries.hbm.xml index 2ddeab659..ecc32af8c 100644 --- a/eHour-persistence/src/main/resources/query/common/Project.queries.hbm.xml +++ b/eHour-persistence/src/main/resources/query/common/Project.queries.hbm.xml @@ -34,7 +34,8 @@ FROM Project prj - WHERE prj.customer IN (:customers) AND + WHERE + prj.customer IN (:customers) AND prj.active is true ORDER BY prj.name @@ -47,4 +48,4 @@ - \ No newline at end of file + diff --git a/eHour-persistence/src/main/resources/query/common/Report.queries.hbm.xml b/eHour-persistence/src/main/resources/query/common/Report.queries.hbm.xml index ed7b88a63..f317bd40d 100644 --- a/eHour-persistence/src/main/resources/query/common/Report.queries.hbm.xml +++ b/eHour-persistence/src/main/resources/query/common/Report.queries.hbm.xml @@ -102,4 +102,4 @@ (pa.dateEnd IS NULL or pa.dateEnd > :dateStart)]]> - \ No newline at end of file + diff --git a/eHour-service/pom.xml b/eHour-service/pom.xml index a691d480a..68bc18eea 100644 --- a/eHour-service/pom.xml +++ b/eHour-service/pom.xml @@ -59,13 +59,13 @@ eHour-common - - net.rrm.ehour - eHour-common - ${project.version} - test - tests - + + + + + + + org.springframework diff --git a/eHour-service/src/test/resources/i18n/EhourWebApplication.properties b/eHour-service/src/test/resources/i18n/EhourWebApplication.properties index 574558b5d..31e214394 100644 --- a/eHour-service/src/test/resources/i18n/EhourWebApplication.properties +++ b/eHour-service/src/test/resources/i18n/EhourWebApplication.properties @@ -446,6 +446,7 @@ login.login.failed=invalid username or password login.login.username=username login.login.password=password `login.login.submit=Sign in +login.login.slack=Sign in with slack login.login.rememberMe=remember me on this computer login.sessionexpired=you have been automatically logged out login.demoMode=Demo mode, 'save' and 'delete' are disabled. diff --git a/eHour-standalone/src/test/resources/home/conf/log4j.properties b/eHour-standalone/src/test/resources/home/conf/log4j.properties index 8f321e134..577cf9f17 100644 --- a/eHour-standalone/src/test/resources/home/conf/log4j.properties +++ b/eHour-standalone/src/test/resources/home/conf/log4j.properties @@ -24,4 +24,8 @@ log4j.appender.CONSOLE.layout.ConversionPattern=%d{ISO8601} %-5p %c - %m%n log4j.appender.FILE=org.apache.log4j.FileAppender log4j.appender.FILE.File=ehour.log log4j.appender.FILE.layout=org.apache.log4j.PatternLayout -log4j.appender.FILE.layout.ConversionPattern=%d{ISO8601} %-5p %c - %m%n \ No newline at end of file +log4j.appender.FILE.layout.ConversionPattern=%d{ISO8601} %-5p %c - %m%n + + +log4j.logger.org.hibernate.SQL=DEBUG +#log4j.logger.org.hibernate.type=TRACE \ No newline at end of file diff --git a/eHour-wicketweb/pom.xml b/eHour-wicketweb/pom.xml index 05235e2be..f375219f4 100644 --- a/eHour-wicketweb/pom.xml +++ b/eHour-wicketweb/pom.xml @@ -60,12 +60,12 @@ eHour-common - - net.rrm.ehour - eHour-common - test - tests - + + + + + + javax.servlet @@ -78,13 +78,13 @@ eHour-service - - net.rrm.ehour - eHour-service - ${project.version} - test - tests - + + + + + + + nl.tecon.scalahighcharts diff --git a/eHour-wicketweb/src/main/java/net/rrm/ehour/ui/EhourWebApplication.java b/eHour-wicketweb/src/main/java/net/rrm/ehour/ui/EhourWebApplication.java index e3c7ad7f2..43de71565 100644 --- a/eHour-wicketweb/src/main/java/net/rrm/ehour/ui/EhourWebApplication.java +++ b/eHour-wicketweb/src/main/java/net/rrm/ehour/ui/EhourWebApplication.java @@ -27,6 +27,7 @@ import net.rrm.ehour.ui.common.session.EhourWebSession; import net.rrm.ehour.ui.login.page.Login; import net.rrm.ehour.ui.login.page.Logout; +import net.rrm.ehour.ui.login.page.OAuthCallback; import net.rrm.ehour.ui.login.page.SessionExpiredPage; import net.rrm.ehour.ui.manage.assignment.AssignmentManagePage; import net.rrm.ehour.ui.manage.customer.CustomerManagePage; @@ -65,6 +66,7 @@ import org.apache.wicket.request.resource.caching.version.IResourceVersion; import org.apache.wicket.spring.injection.annot.SpringComponentInjector; import org.apache.wicket.util.time.Duration; +import org.springframework.beans.factory.annotation.Value; import org.springframework.security.authentication.AuthenticationManager; import java.util.Comparator; @@ -186,6 +188,9 @@ public RuntimeConfigurationType getConfigurationType() { protected void mountPages() { mountPage("/login", Login.class); mountPage("/logout", Logout.class); + if (ehourSystemConfig.isEnableOAuth()){ + mountPage(ehourSystemConfig.getOauthCallbackURI(), OAuthCallback.class); + } mountPage("/admin", MainConfigPage.class); mountPage("/admin/employee", UserManagePage.class); diff --git a/eHour-wicketweb/src/main/java/net/rrm/ehour/ui/common/session/EhourWebSession.java b/eHour-wicketweb/src/main/java/net/rrm/ehour/ui/common/session/EhourWebSession.java index 61a4f2cb0..3fb49b82d 100644 --- a/eHour-wicketweb/src/main/java/net/rrm/ehour/ui/common/session/EhourWebSession.java +++ b/eHour-wicketweb/src/main/java/net/rrm/ehour/ui/common/session/EhourWebSession.java @@ -29,6 +29,7 @@ import net.rrm.ehour.ui.EhourWebApplication; import net.rrm.ehour.ui.common.authorization.AuthUser; import net.rrm.ehour.ui.common.util.WebUtils; +import net.rrm.ehour.user.service.UserService; import net.rrm.ehour.util.DateUtil; import org.apache.log4j.Logger; import org.apache.wicket.Session; @@ -44,6 +45,7 @@ import org.springframework.security.core.AuthenticationException; import org.springframework.security.core.GrantedAuthority; import org.springframework.security.core.context.SecurityContextHolder; +import org.springframework.security.web.authentication.preauth.PreAuthenticatedAuthenticationToken; import java.util.Calendar; import java.util.Collection; @@ -63,9 +65,13 @@ public class EhourWebSession extends AuthenticatedWebSession { @SpringBean private AuditService auditService; + @SpringBean + private UserService userService; + private Calendar navCalendar; private UserSelectedCriteria userSelectedCriteria; private Boolean hideInactiveSelections = true; + private boolean isOauth = false; private Optional impersonatingAuthUser = Optional.absent(); @@ -157,8 +163,16 @@ public boolean authenticate(String username, String password) { String u = username == null ? "" : username; String p = password == null ? "" : password; - UsernamePasswordAuthenticationToken authRequest = new UsernamePasswordAuthenticationToken(u, p); + if (isOauth) { + // TODO: verify + User user = userService.getUser(username); + AuthUser authUser = new AuthUser(user); + PreAuthenticatedAuthenticationToken auth = new PreAuthenticatedAuthenticationToken(authUser, null, user.getUserRoles()); + setAuthentication(auth); + return true; + } + Authentication authRequest = new UsernamePasswordAuthenticationToken(u, p); // Attempt authentication. try { AuthenticationManager authenticationManager = ((EhourWebApplication) getApplication()).getAuthenticationManager(); @@ -169,7 +183,6 @@ public boolean authenticate(String username, String password) { Authentication authResult = authenticationManager.authenticate(authRequest); setAuthentication(authResult); - User user = ((AuthUser) authResult.getPrincipal()).getUser(); auditService.doAudit(new Audit() @@ -368,4 +381,12 @@ public void setUserSelectedCriteria(UserSelectedCriteria userSelectedCriteria) { } private static final long serialVersionUID = 93189812483240412L; + + public boolean isOauth() { + return isOauth; + } + + public void setOauth(boolean oauth) { + isOauth = oauth; + } } diff --git a/eHour-wicketweb/src/main/java/net/rrm/ehour/ui/login/page/Login.html b/eHour-wicketweb/src/main/java/net/rrm/ehour/ui/login/page/Login.html index 8f2630170..702ada8b9 100644 --- a/eHour-wicketweb/src/main/java/net/rrm/ehour/ui/login/page/Login.html +++ b/eHour-wicketweb/src/main/java/net/rrm/ehour/ui/login/page/Login.html @@ -80,8 +80,6 @@ - -
+ + Login with slack + diff --git a/eHour-wicketweb/src/main/java/net/rrm/ehour/ui/login/page/Login.java b/eHour-wicketweb/src/main/java/net/rrm/ehour/ui/login/page/Login.java index 0e5a2bce5..0ea405e10 100644 --- a/eHour-wicketweb/src/main/java/net/rrm/ehour/ui/login/page/Login.java +++ b/eHour-wicketweb/src/main/java/net/rrm/ehour/ui/login/page/Login.java @@ -16,6 +16,7 @@ package net.rrm.ehour.ui.login.page; +import net.rrm.ehour.appconfig.EhourSystemConfig; import net.rrm.ehour.ui.EhourWebApplication; import net.rrm.ehour.ui.common.session.EhourWebSession; import net.rrm.ehour.ui.common.util.AuthUtil; @@ -25,16 +26,18 @@ import org.apache.wicket.markup.head.JavaScriptHeaderItem; import org.apache.wicket.markup.html.WebPage; import org.apache.wicket.markup.html.basic.Label; -import org.apache.wicket.markup.html.form.PasswordTextField; -import org.apache.wicket.markup.html.form.RequiredTextField; -import org.apache.wicket.markup.html.form.StatelessForm; -import org.apache.wicket.markup.html.form.TextField; +import org.apache.wicket.markup.html.form.*; +import org.apache.wicket.markup.html.link.ExternalLink; import org.apache.wicket.markup.html.panel.FeedbackPanel; import org.apache.wicket.model.CompoundPropertyModel; import org.apache.wicket.model.ResourceModel; import org.apache.wicket.spring.injection.annot.SpringBean; import java.io.Serializable; +import java.io.UnsupportedEncodingException; +import java.net.MalformedURLException; +import java.net.URL; +import java.net.URLEncoder; import static net.rrm.ehour.ui.common.util.AuthUtil.Homepage; @@ -48,6 +51,9 @@ public class Login extends WebPage { @SpringBean private AuthUtil authUtil; + @SpringBean + private EhourSystemConfig config; + @Override protected void onInitialize() { super.onInitialize(); @@ -75,6 +81,33 @@ protected void onInitialize() { add(new Label("version", version)); + if (config.isEnableOAuth()) { + // http://sso-dex:5556/dex/auth? + // client_id=example-app& + // redirect_uri=http%3A%2F%2Ftest.knight.com%3A5555%2Fcallback& + // response_type=code& + // scope=openid+profile+email+offline_access& + // state=I+wish+to+wash+my+irish+wristwatch + String url = config.getOauthAuthURL(); + url += "?"; + try { + url += "client_id=" + URLEncoder.encode(config.getOauthClientID(), "UTF-8") + "&" + + "redirect_uri=" + URLEncoder.encode(config.getOauthHostURL() + config.getOauthCallbackURI(), "UTF-8") + "&" + + "response_type=code&" + + "scope=" + URLEncoder.encode(config.getOauthScope(), "UTF-8") + "&" + + "state=ehour"; + } catch (UnsupportedEncodingException e) { + throw new RuntimeException(e); + } + + ExternalLink oauthLink = new ExternalLink("loginOAuth", url, "Sign in with "+config.getOauthName()); + add(oauthLink); + } else { + ExternalLink oauthLink = new ExternalLink("loginOAuth", ""); + add(oauthLink); + oauthLink.setVisible(false); + } + super.onBeforeRender(); } @@ -114,6 +147,8 @@ public SignInForm(String id, SimpleUser model) { password.setOutputMarkupId(true); add(password); + Button signInWith = new Button("SignInWith"); + Label demoMode = new Label("demoMode", new ResourceModel("login.demoMode")); add(demoMode); demoMode.setVisible(EhourWebSession.getEhourConfig().isInDemoMode()); diff --git a/eHour-wicketweb/src/main/java/net/rrm/ehour/ui/login/page/OAuthCallback.html b/eHour-wicketweb/src/main/java/net/rrm/ehour/ui/login/page/OAuthCallback.html new file mode 100644 index 000000000..be64af39c --- /dev/null +++ b/eHour-wicketweb/src/main/java/net/rrm/ehour/ui/login/page/OAuthCallback.html @@ -0,0 +1,11 @@ + + + + + OAuth callback + + +Message goes here + + + \ No newline at end of file diff --git a/eHour-wicketweb/src/main/java/net/rrm/ehour/ui/login/page/OAuthCallback.java b/eHour-wicketweb/src/main/java/net/rrm/ehour/ui/login/page/OAuthCallback.java new file mode 100644 index 000000000..567ba43ed --- /dev/null +++ b/eHour-wicketweb/src/main/java/net/rrm/ehour/ui/login/page/OAuthCallback.java @@ -0,0 +1,149 @@ +package net.rrm.ehour.ui.login.page; + +import net.rrm.ehour.appconfig.EhourSystemConfig; +import net.rrm.ehour.domain.User; +import net.rrm.ehour.domain.UserRole; +import net.rrm.ehour.exception.ObjectNotUniqueException; +import net.rrm.ehour.ui.common.session.EhourWebSession; +import net.rrm.ehour.ui.common.util.AuthUtil; +import net.rrm.ehour.user.service.UserService; +import org.apache.http.HttpEntity; +import org.apache.http.HttpResponse; +import org.apache.http.NameValuePair; +import org.apache.http.client.HttpClient; +import org.apache.http.client.entity.UrlEncodedFormEntity; +import org.apache.http.client.methods.HttpPost; +import org.apache.http.impl.client.HttpClients; +import org.apache.http.message.BasicNameValuePair; +import org.apache.log4j.Logger; +import org.apache.wicket.ajax.json.JSONException; +import org.apache.wicket.ajax.json.JSONObject; +import org.apache.wicket.markup.html.WebPage; +import org.apache.wicket.markup.html.basic.Label; +import org.apache.wicket.request.mapper.parameter.PageParameters; +import org.apache.wicket.spring.injection.annot.SpringBean; +import org.apache.wicket.util.string.StringValue; + +import java.io.BufferedReader; +import java.io.IOException; +import java.io.InputStream; +import java.io.InputStreamReader; +import java.util.ArrayList; +import java.util.List; + +public class OAuthCallback extends WebPage { + + private static final Logger LOGGER = Logger.getLogger(OAuthCallback.class); + + @SpringBean + private EhourSystemConfig config; + + @SpringBean + private UserService userService; + + @SpringBean + private AuthUtil authUtil; + + public OAuthCallback(PageParameters parameters) { + + StringValue error = parameters.get("error"); + StringValue errorDescription = parameters.get("error_description"); + + if (!error.isEmpty()) { + add(new Label("message", "Error: " + error + "; description: " + errorDescription)); + } else { + StringValue code = parameters.get("code"); + + try { + String result = exchange(code.toString()); + User user = saveOauthUser(result); + + EhourWebSession session = (EhourWebSession) EhourWebSession.get(); + + session.setOauth(true); + if (session.signIn(user.getUsername(), "")) { + add(new Label("message", "redirecting...")); + redirectToHomepage(session); + } else { + throw new RuntimeException("unable to login"); + } + } catch (IOException | JSONException | ObjectNotUniqueException e) { + add(new Label("message", e.getMessage())); + e.printStackTrace(); + } + } + } + + private String exchange(String code) throws IOException, JSONException, ObjectNotUniqueException { + + String clientID = config.getOauthClientID(); + String clientSecret = config.getOauthClientSecuret(); + + String url = config.getOauthTokenURI(); + HttpClient httpclient = HttpClients.createDefault(); + HttpPost httppost = new HttpPost(url); + + List params = new ArrayList(2); + params.add(new BasicNameValuePair("client_id", clientID)); + params.add(new BasicNameValuePair("client_secret", clientSecret)); + params.add(new BasicNameValuePair("code", code)); + params.add(new BasicNameValuePair("grant_type", "authorization_code")); + params.add(new BasicNameValuePair("redirect_uri", config.getOauthHostURL() + config.getOauthCallbackURI())); + + httppost.setEntity(new UrlEncodedFormEntity(params, "UTF-8")); + + HttpResponse response = httpclient.execute(httppost); + HttpEntity entity = response.getEntity(); + + if (entity != null) { + InputStream in = entity.getContent(); + try { + BufferedReader rd = new BufferedReader(new InputStreamReader(in)); + + StringBuilder result = new StringBuilder(); + String line; + while ((line = rd.readLine()) != null) { + result.append(line); + } + return result.toString(); + } finally { + in.close(); + } + } + + throw new RuntimeException("no response"); + } + + private User saveOauthUser(String result) throws JSONException, ObjectNotUniqueException { + + JSONObject jsonResponse = new JSONObject(result); + + boolean success = jsonResponse.getBoolean("ok"); + + if (!success) { + LOGGER.error(result); + throw new RuntimeException("exchange token failed, check log"); + } + + JSONObject user = jsonResponse.getJSONObject("user"); + String name = user.getString("name"); + String email = user.getString("email"); + User u = userService.getUser(email); + if (u == null) { + u = new User(); + u.setLastName(name); + u.setEmail(email); + u.setUsername(email); + u.addUserRole(UserRole.USER); +// u.addUserRole(UserRole.REPORT); + userService.persistNewUser(u, email); + } + return u; + } + + + private void redirectToHomepage(EhourWebSession session) { + AuthUtil.Homepage homepage = authUtil.getHomepageForRole(session.getRoles()); + setResponsePage(homepage.homePage, homepage.parameters); + } +} diff --git a/eHour-wicketweb/src/main/java/net/rrm/ehour/ui/manage/user/UserFormPanel.java b/eHour-wicketweb/src/main/java/net/rrm/ehour/ui/manage/user/UserFormPanel.java index 7ea946b9a..64247a2e4 100644 --- a/eHour-wicketweb/src/main/java/net/rrm/ehour/ui/manage/user/UserFormPanel.java +++ b/eHour-wicketweb/src/main/java/net/rrm/ehour/ui/manage/user/UserFormPanel.java @@ -163,7 +163,7 @@ private void createNameInput(Form form) { private void createUsernameInput(Form form) { RequiredTextField usernameField = new RequiredTextField<>("user.username"); form.add(usernameField); - usernameField.add(new StringValidator(0, 32)); + usernameField.add(new StringValidator(0, 1024)); usernameField.add(new DuplicateUsernameValidator()); usernameField.setLabel(new ResourceModel("admin.user.username")); usernameField.add(new ValidatingFormComponentAjaxBehavior()); diff --git a/eHour-wicketweb/src/main/java/net/rrm/ehour/ui/report/page/ReportPage.java b/eHour-wicketweb/src/main/java/net/rrm/ehour/ui/report/page/ReportPage.java index 9e34ce35c..420463055 100644 --- a/eHour-wicketweb/src/main/java/net/rrm/ehour/ui/report/page/ReportPage.java +++ b/eHour-wicketweb/src/main/java/net/rrm/ehour/ui/report/page/ReportPage.java @@ -18,6 +18,7 @@ import com.google.common.base.Optional; import com.google.common.collect.Lists; +import net.rrm.ehour.appconfig.EhourSystemConfig; import net.rrm.ehour.domain.UserRole; import net.rrm.ehour.report.criteria.ReportCriteria; import net.rrm.ehour.report.criteria.UserSelectedCriteria; @@ -59,6 +60,10 @@ public class ReportPage extends AbstractReportPage { @SpringBean private ReportTabs reportTabs; + @SpringBean + private EhourSystemConfig config; + + public ReportPage() { super(new ResourceModel("report.global.title")); } @@ -93,15 +98,18 @@ private void reset() { List tabList = new ArrayList<>(); - tabList.add(new AbstractTab(getReportTitle(reportCriteria.getUserSelectedCriteria())) { - private static final long serialVersionUID = 1L; + if (getEhourWebSession().isReporter() || !config.isDisableIndividualReport()) { - @SuppressWarnings("unchecked") - @Override - public Panel getPanel(String panelId) { - return new ReportCriteriaPanel(panelId, model); - } - }); + tabList.add(new AbstractTab(getReportTitle(reportCriteria.getUserSelectedCriteria())) { + private static final long serialVersionUID = 1L; + + @SuppressWarnings("unchecked") + @Override + public Panel getPanel(String panelId) { + return new ReportCriteriaPanel(panelId, model); + } + }); + } tabPanel = new ReportTabbedPanel("reportContainer", tabList); addOrReplace(tabPanel); diff --git a/pom.xml b/pom.xml index 392509692..6591bf730 100644 --- a/pom.xml +++ b/pom.xml @@ -36,20 +36,21 @@ 1.4.4-SNAPSHOT - - - nexus - eHour Maven Repository Group - https://nexus.te-con.com/repository/maven-public - default - - true - never - - - true - always - - - + + + + + + + + + + + + + + + + + diff --git a/repository/nl/tecon/ehour/eHour-parent/1.2/_remote.repositories b/repository/nl/tecon/ehour/eHour-parent/1.2/_remote.repositories new file mode 100644 index 000000000..ea4711b3a --- /dev/null +++ b/repository/nl/tecon/ehour/eHour-parent/1.2/_remote.repositories @@ -0,0 +1,4 @@ +#NOTE: This is a Maven Resolver internal implementation file, its format can be changed without prior notice. +#Thu Mar 05 10:12:17 GMT 2020 +eHour-parent-1.2.pom>nexus= +eHour-parent-1.2.pom>= diff --git a/repository/nl/tecon/ehour/eHour-parent/1.2/eHour-parent-1.2.pom b/repository/nl/tecon/ehour/eHour-parent/1.2/eHour-parent-1.2.pom new file mode 100644 index 000000000..ab6600bcc --- /dev/null +++ b/repository/nl/tecon/ehour/eHour-parent/1.2/eHour-parent-1.2.pom @@ -0,0 +1,904 @@ + + + 4.0.0 + nl.tecon.ehour + 1.2 + eHour-parent + + pom + eHour + http://www.getehour.com/ + + + Parent POM file of eHour + + + + http://github.com/te-con/ehourparent.git + scm:git:ssh://git@github.com/te-con/ehourparent.git + scm:git:ssh://git@github.com/te-con/ehourparent.git + eHour-parent-1.2 + + + + eHour bugtracker + https://jira.ehour.nl/ + + + + bamboo + http://ci.te-con.nl/ + + + +
thies@te-con.nl
+
+
+
+
+ + + + thies + Thies Edeling + thies@te-con.nl + + Project Manager + Developer + + + + + + 1.4.2-SNAPSHOT + + 4.2.4.RELEASE + 6.21.0 + 8.1.16.v20140903 + 10.12.1.1 + 1.8.4 + 1.6.4 + 4.3.11.Final + 4.3.2.Final + 2.11 + 4 + ${scala.major.version}.${scala.minor.version} + + UTF-8 + 3.2.4.RELEASE + + UTF-8 + java + 3.13 + + + + + + org.scala-lang + scala-library + ${scala.version} + + + + org.scalatest + scalatest_${scala.major.version} + 2.2.0 + test + + + org.scala-lang + scala-reflect + + + + + + javax.servlet + javax.servlet-api + 3.0.1 + + + + org.mockito + mockito-core + 1.10.19 + test + + + org.hamcrest + hamcrest-core + + + + + + org.slf4j + slf4j-api + ${slf4j.version} + + + + org.slf4j + slf4j-log4j12 + ${slf4j.version} + + + org.apache.poi + poi + ${poi.version} + + + org.apache.poi + poi-ooxml + ${poi.version} + + + org.springframework + spring-web + ${spring.version} + + + org.apache.sanselan + sanselan + 0.97-incubator + + + org.apache.derby + derby + ${derbydb.version} + + + org.eclipse.jetty + jetty-servlet + ${jetty.version} + + + org.eclipse.jetty + jetty-plus + ${jetty.version} + + + org.eclipse.jetty.orbit + javax.transaction + + + + + org.eclipse.jetty + jetty-deploy + ${jetty.version} + + + org.apache.ddlutils + ddlutils + 1.0 + + + commons-dbcp + commons-dbcp + + + commons-logging + commons-logging + + + commons-logging + commons-logging-api + + + commons-codec + commons-codec + + + xerces + xercesImpl + + + stax + stax-api + + + commons-pool + commons-pool + + + dom4j + dom4j + + + + + + stax + stax + 1.2.0 + + + + mysql + mysql-connector-java + 5.1.35 + + + + org.postgresql + postgresql + 9.4-1201-jdbc41 + + + + org.hibernate + hibernate-validator + ${hibernate.validator.version} + + + org.slf4j + slf4j-api + + + org.slf4j + slf4j-log4j12 + + + + + + + org.hibernate + hibernate-core + ${hibernate.version} + + + + org.hibernate + hibernate-ehcache + ${hibernate.version} + + + + org.dbunit + dbunit + 2.4.9 + + + org.apache.poi + poi + + + junit-addons + junit-addons + + + org.slf4j + slf4j-nop + + + test + + + + org.apache.httpcomponents + httpclient + 4.3.1 + + + commons-codec + commons-codec + + + + + + commons-lang + commons-lang + 2.6 + + + commons-dbcp + commons-dbcp + 1.4 + + + commons-configuration + commons-configuration + 1.10 + + + xerces + xercesImpl + + + xalan + xalan + + + javax.servlet + servlet-api + + + xml-apis + xml-apis + + + commons-logging + commons-logging + + + commons-pool + commons-pool + + + dom4j + dom4j + + + + + cglib + cglib-nodep + 3.1 + + + javax.mail + mail + 1.4 + + + + net.sf.ehcache + ehcache-core + 2.6.9 + + + + org.aspectj + aspectjweaver + ${aspectj.version} + + + javax.servlet + jsp-api + 2.0 + compile + + + junit + junit + 4.11 + test + + + org.hamcrest + hamcrest-core + + + + + + org.hamcrest + hamcrest-library + 1.3 + test + + + + log4j + log4j + 1.2.17 + + + com.sun.jmx + jmxri + + + javax.mail + mail + + + javax.jms + jms + + + com.sun.jdmk + jmxtools + + + com.sun.jmx + jmxri + + + + + + javax.annotation + jsr250-api + 1.0 + + + + + commons-collections + commons-collections + 3.2.2 + + + xerces + xercesImpl + 2.8.1 + + + + + net.rrm.ehour + eHour-persistence + ${ehour.version} + + + + net.rrm.ehour + eHour-persistence + ${ehour.version} + test-jar + test + + + + net.rrm.ehour + eHour-persistence-mysql + ${ehour.version} + + + + net.rrm.ehour + eHour-persistence-postgresql + ${ehour.version} + + + + net.rrm.ehour + eHour-common + ${ehour.version} + + + + net.rrm.ehour + eHour-standalone + ${ehour.version} + + + + net.rrm.ehour + eHour-common + ${ehour.version} + test-jar + test + + + + net.rrm.ehour + eHour-service + ${ehour.version} + + + + net.rrm.ehour + eHour-service-port + ${ehour.version} + + + + net.rrm.ehour + eHour-wicketweb + ${ehour.version} + + + + net.rrm.ehour + eHour-jetty + ${ehour.version} + + + + net.rrm.ehour + eHour-wicketweb + ${ehour.version} + test-jar + test + + + + net.rrm.ehour + eHour-audit + ${ehour.version} + + + + net.rrm.ehour + eHour-common + ${ehour.version} + test + tests + + + + commons-io + commons-io + 2.0 + + + + com.google.guava + guava + 18.0 + + + + org.springframework + spring-framework-bom + ${spring.version} + pom + import + + + + org.springframework.security + spring-security-core + ${spring-security.version} + + + org.springframework + spring-beans + + + org.springframework + spring-expression + + + + + + org.springframework.security + spring-security-web + ${spring-security.version} + + + org.springframework + spring-tx + + + + + + org.springframework.security + spring-security-config + ${spring-security.version} + + + + org.jadira.usertype + usertype.core + 3.2.0.GA + + + + + + + + com.google.code.findbugs + jsr305 + 2.0.2 + + + + org.mockito + mockito-core + + + junit + junit + + + org.hamcrest + hamcrest-library + + + log4j + log4j + + + + xerces + xercesImpl + + + org.springframework + spring-context + + + org.springframework + spring-core + + + org.springframework + spring-aop + + + org.aspectj + aspectjweaver + + + javax.annotation + jsr250-api + + + + joda-time + joda-time + 2.5 + + + + com.github.nscala-time + nscala-time_2.11 + 1.4.0 + + + + commons-collections + commons-collections + + + + + + + false + src/main/resources + + + + false + src/main/java + + ** + + + **/*.java + + + + + + + false + src/test/java + + ** + + + **/*.java + + + + + false + src/test/resources + + ** + + + + + + + org.apache.maven.plugins + maven-scm-plugin + 1.9.2 + + + org.apache.maven.scm + maven-scm-provider-gitexe + 1.9.2 + + + + + + maven-source-plugin + 2.4 + + + attach-sources + verify + + jar + + + + + + + maven-compiler-plugin + 2.5.1 + + 1.7 + 1.7 + + + + compile + + compile + + + + + + + maven-surefire-plugin + 2.12 + + + **/*Test.java + **/*Test.scala + **/*Spec.java + **/*Spec.scala + + both + 6 + + + + + + + + maven-jar-plugin + 2.5 + + + + test-jar + + + + + + + maven-assembly-plugin + 2.5.2 + + + + net.alchim31.maven + scala-maven-plugin + 3.2.2 + + + scala-compile-first + process-resources + + add-source + compile + + + + scala-test-compile + process-test-resources + + testCompile + + + + + ${scala.version} + incremental + true + + -XX:+TieredCompilation + -XX:CICompilerCount=4 + + + -deprecation + -unchecked + + + + + + maven-release-plugin + 2.5.1 + + + + org.codehaus.mojo + sonar-maven-plugin + 2.4 + + + + + + + + + + prod + + + + true + org.apache.maven.plugins + 2.4 + maven-compiler-plugin + + false + true + + + + + + + + clover + + + + com.atlassian.maven.plugins + maven-clover2-plugin + 4.0.0 + + ${user.home}/.clover/${project.groupId}-${project.artifactId}/clover.snapshot + + true + + + + clover + + setup + optimize + snapshot + + + + + + + + + + + + eHour + eHour Maven Repository Group + http://nexus.te-con.nl/content/groups/public + default + + true + never + + + true + always + + + + + + + nexus + https://nexus.te-con.com/repository/maven-releases/ + + + + nexus + https://nexus.te-con.com/repository/maven-snapshots/ + + +
diff --git a/repository/nl/tecon/ehour/eHour-parent/1.2/eHour-parent-1.2.pom.sha1 b/repository/nl/tecon/ehour/eHour-parent/1.2/eHour-parent-1.2.pom.sha1 new file mode 100644 index 000000000..12c89dc5a --- /dev/null +++ b/repository/nl/tecon/ehour/eHour-parent/1.2/eHour-parent-1.2.pom.sha1 @@ -0,0 +1 @@ +d218302eab75ee85e130c24fd99d47052f610672 \ No newline at end of file diff --git a/repository/nl/tecon/ehour/eHour-parent/maven-metadata-local.xml b/repository/nl/tecon/ehour/eHour-parent/maven-metadata-local.xml new file mode 100644 index 000000000..a0aeccf07 --- /dev/null +++ b/repository/nl/tecon/ehour/eHour-parent/maven-metadata-local.xml @@ -0,0 +1,12 @@ + + + nl.tecon.ehour + eHour-parent + + 1.2 + + 1.2 + + 20200305101217 + + diff --git a/repository/nl/tecon/scalahighcharts/highcharts/1.7/_remote.repositories b/repository/nl/tecon/scalahighcharts/highcharts/1.7/_remote.repositories new file mode 100644 index 000000000..c16a7d35d --- /dev/null +++ b/repository/nl/tecon/scalahighcharts/highcharts/1.7/_remote.repositories @@ -0,0 +1,4 @@ +#NOTE: This is an Aether internal implementation file, its format can be changed without prior notice. +#Tue Oct 09 10:08:32 BST 2018 +highcharts-1.7.jar>nexus= +highcharts-1.7.pom>nexus= diff --git a/repository/nl/tecon/scalahighcharts/highcharts/1.7/highcharts-1.7.jar b/repository/nl/tecon/scalahighcharts/highcharts/1.7/highcharts-1.7.jar new file mode 100644 index 000000000..5c60e23af Binary files /dev/null and b/repository/nl/tecon/scalahighcharts/highcharts/1.7/highcharts-1.7.jar differ diff --git a/repository/nl/tecon/scalahighcharts/highcharts/1.7/highcharts-1.7.jar.sha1 b/repository/nl/tecon/scalahighcharts/highcharts/1.7/highcharts-1.7.jar.sha1 new file mode 100644 index 000000000..c5203fc9b --- /dev/null +++ b/repository/nl/tecon/scalahighcharts/highcharts/1.7/highcharts-1.7.jar.sha1 @@ -0,0 +1 @@ +ef31b6fbeb2baf492b6c582851e2c30cfe2bb0f5 \ No newline at end of file diff --git a/repository/nl/tecon/scalahighcharts/highcharts/1.7/highcharts-1.7.pom b/repository/nl/tecon/scalahighcharts/highcharts/1.7/highcharts-1.7.pom new file mode 100644 index 000000000..25a080cb4 --- /dev/null +++ b/repository/nl/tecon/scalahighcharts/highcharts/1.7/highcharts-1.7.pom @@ -0,0 +1,197 @@ + + 4.0.0 + + nl.tecon.scalahighcharts + highcharts + jar + 1.7 + Scala HighCharts + + + UTF-8 + 2.11 + 12 + ${scala.major.version}.${scala.minor.version} + 3.3.1 + + + + + + joda-time + joda-time + 1.6.2 + + + + org.scala-lang + scala-library + ${scala.version} + + + + net.liftweb + lift-json-ext_${scala.major.version} + 2.6.3 + + + + net.liftweb + lift-json_${scala.major.version} + 2.6.3 + + + org.scala-lang + scala-compiler + + + + + + junit + junit + 4.11 + test + + + + org.scalatest + scalatest_${scala.major.version} + 2.2.2 + test + + + + + + + src/main/resources + false + + + + + org.apache.maven.plugins + maven-source-plugin + 2.1.2 + + + attach-sources + verify + + jar + + + + + + maven-compiler-plugin + 2.3.2 + + 1.6 + 1.6 + + + + maven-surefire-plugin + 2.10 + + + **/*Test.java + + methods + 10 + + + + + + net.alchim31.maven + scala-maven-plugin + ${scala-maven-plugin.version} + + + scala-compile-first + process-resources + + add-source + compile + + + + scala-test-compile + process-test-resources + + testCompile + + + + + ${scala.version} + incremental + true + + -XX:+TieredCompilation + -XX:CICompilerCount=4 + + + -deprecation + -unchecked + + + + + maven-release-plugin + 2.3.1 + + + + org.apache.maven.plugins + maven-scm-plugin + 1.7 + + + org.apache.maven.scm + maven-scm-provider-gitexe + 1.7 + + + + + + + + + nexus + http://nexus.te-con.nl/content/groups/public/ + + true + + + true + + + + + + + scm:git:git@github.com:tedeling/HighCharts-with-Scala.git + scm:git:git@github.com:tedeling/HighCharts-with-Scala.git + scm:git:git@github.com:tedeling/HighCharts-with-Scala.git + HEAD + + + + + nexus + https://nexus.te-con.com/repository/maven-releases + + + + nexus + https://nexus.te-con.com/repository/maven-snapshots + + + + diff --git a/repository/nl/tecon/scalahighcharts/highcharts/1.7/highcharts-1.7.pom.sha1 b/repository/nl/tecon/scalahighcharts/highcharts/1.7/highcharts-1.7.pom.sha1 new file mode 100644 index 000000000..df7133dda --- /dev/null +++ b/repository/nl/tecon/scalahighcharts/highcharts/1.7/highcharts-1.7.pom.sha1 @@ -0,0 +1 @@ +0077cd3d883e6bb808afd0deaecfbf3e1f0ac3f8 \ No newline at end of file