HSAdmin Backend Domains, E-Mail, Datenbanken
Peter Hormanns
2013-07-15 5637091ea21fbf40139941e2f962bf7c1541ae1b
logout button for password-only users
5 files modified
47 ■■■■■ changed files
hsarweb/src/de/hsadmin/web/AbstractModule.java 29 ●●●●● patch | view | raw | blame | history
hsarweb/src/de/hsadmin/web/HomeModule.java 5 ●●●● patch | view | raw | blame | history
hsarweb/src/de/hsadmin/web/MainApplication.java 7 ●●●● patch | view | raw | blame | history
hsarweb/src/texts/home.properties 3 ●●●● patch | view | raw | blame | history
hsarweb/src/texts/home_de.properties 3 ●●●● patch | view | raw | blame | history
hsarweb/src/de/hsadmin/web/AbstractModule.java
@@ -116,24 +116,29 @@
            toolbar.addComponent(space);
            toolbar.setExpandRatio(space, 1.0f);
            createRunAsSelect(toolbar);
            Button btLogout = new Button(localeConfig.getText("logout"));
            btLogout.addListener(new ClickListener() {
                private static final long serialVersionUID = 1L;
                @Override
                public void buttonClick(ClickEvent event) {
                    ExternalResource logoutLink = new ExternalResource("logout");
                    application.getMainWindow().open(logoutLink);
                }
            });
            toolbar.addComponent(btLogout);
            ThemeResource icon = new ThemeResource("../runo/icons/16/cancel.png");
            btLogout.setIcon(icon);
            createLogoutButton(toolbar, localeConfig.getText("logout"));
            layout.addComponent(toolbar);
        }
        layout.addComponent(component);
        layout.setExpandRatio(component, 1.0f);
    }
    protected void createLogoutButton(HorizontalLayout toolbar,
            final String buttonText) {
        Button btLogout = new Button(buttonText);
        btLogout.addListener(new ClickListener() {
            private static final long serialVersionUID = 1L;
            @Override
            public void buttonClick(ClickEvent event) {
                ExternalResource logoutLink = new ExternalResource("logout");
                application.getMainWindow().open(logoutLink);
            }
        });
        toolbar.addComponent(btLogout);
        ThemeResource icon = new ThemeResource("../runo/icons/16/cancel.png");
        btLogout.setIcon(icon);
    }
    private void createRunAsSelect(HorizontalLayout toolbar) throws UnsupportedOperationException, HsarwebException {
        selRunAs = new Select();
        selRunAs.setWidth(100.0f, Sizeable.UNITS_PIXELS);
hsarweb/src/de/hsadmin/web/HomeModule.java
@@ -91,6 +91,7 @@
    public Object initComponent() throws HsarwebException {
        final Module thisModule = this;
        VerticalLayout layout = new VerticalLayout();
        HorizontalLayout toolbar = new HorizontalLayout();
        Button button = new Button(moduleConfig.getLabel("change_password"));
        ThemeResource icon = new ThemeResource(moduleConfig.getLabel("change_password_icon"));
        button.setIcon(icon);
@@ -166,7 +167,9 @@
                application.getMainWindow().addWindow(childWindow);
            }
        });
        layout.addComponent(button);
        toolbar.addComponent(button);
        createLogoutButton(toolbar, moduleConfig.getLabel("logout"));
        layout.addComponent(toolbar);
        return layout;
    }
hsarweb/src/de/hsadmin/web/MainApplication.java
@@ -33,8 +33,11 @@
        HttpServletRequestListener, TabSheet.SelectedTabChangeListener {
    private static final long serialVersionUID = 1L;
    private static final String LOGIN_URL = "https://login.hostsharing.net:443/cas/v1/tickets";
    private static boolean isTestEnvironment = false;
    private static final String TEST_LOGIN = "aaa00";
    static {
        Config config = Config.getInstance();
@@ -167,12 +170,12 @@
                @Override
                public String getName() {
                    return "ad";
                    return TEST_LOGIN;
                }
                @Override
                public String getProxyTicketFor(String arg0) {
                    return "user:ad";
                    return "user:" + TEST_LOGIN;
                }
                @SuppressWarnings("rawtypes")
hsarweb/src/texts/home.properties
@@ -15,4 +15,5 @@
change_password=change password
update=change password
save=save password
abort=abort
abort=abort
logout=logout
hsarweb/src/texts/home_de.properties
@@ -14,4 +14,5 @@
change_password=Passwort √§ndern
update=Passwort √§ndern
save=Passwort speichern
abort=abbrechen
abort=abbrechen
logout=abmelden