Beispiel #1
0
  private boolean handleUsernamePasswordParameters() {
    String iframeLoginUsername = RequestCycle.get().getRequest().getParameter("iframe_username");
    String iframeLoginPassword = RequestCycle.get().getRequest().getParameter("iframe_password");

    if (iframeLoginUsername != null && iframeLoginPassword != null) {
      boolean valid = ConstellioSession.get().signIn(iframeLoginUsername, iframeLoginPassword);
      if (valid) {
        ConstellioSession.get().signIn(iframeLoginUsername, iframeLoginPassword);
        WebRequestCycle.get().setResponsePage(SearchFormPage.class);
        return true;
      }
    }
    return false;
  }
Beispiel #2
0
  public LoginPage() {
    super();

    boolean logedIn = handleIFrameParameters();

    if (!logedIn) {
      ConstellioUser user = ConstellioSession.get().getUser();
      if (user != null) {
        PageFactoryPlugin pageFactoryPlugin = PluginFactory.getPlugin(PageFactoryPlugin.class);
        if (user.isAdmin()) {
          RequestCycle.get().setResponsePage(pageFactoryPlugin.getAdminPage());
        } else {
          RequestCycle.get().setResponsePage(pageFactoryPlugin.getSearchFormPage());
        }
      }
      ConstellioSignInPanel signInPanel = new ConstellioSignInPanel("signInPanel");
      add(signInPanel);
    }
  }
Beispiel #3
0
 private void handlePortletParameter() {
   boolean portlet = "true".equals(RequestCycle.get().getRequest().getParameter("portlet"));
   ConstellioSession.get().setPortletMode(portlet);
 }