Search in sources :

Example 1 with LdapConfig

use of org.apache.openmeetings.db.entity.server.LdapConfig in project openmeetings by apache.

the class LdapConfigDao method get.

public List<LdapConfig> get() {
    // Add localhost Domain
    LdapConfig ldapConfig = new LdapConfig();
    ldapConfig.setName("local DB [internal]");
    ldapConfig.setId(-1L);
    List<LdapConfig> result = new ArrayList<>();
    result.add(ldapConfig);
    result.addAll(getActive());
    return result;
}
Also used : LdapConfig(org.apache.openmeetings.db.entity.server.LdapConfig) ArrayList(java.util.ArrayList)

Example 2 with LdapConfig

use of org.apache.openmeetings.db.entity.server.LdapConfig in project openmeetings by apache.

the class LdapForm method onNewSubmit.

@Override
protected void onNewSubmit(AjaxRequestTarget target, Form<?> form) {
    this.setModelObject(new LdapConfig());
    target.add(this);
    reinitJs(target);
}
Also used : LdapConfig(org.apache.openmeetings.db.entity.server.LdapConfig)

Example 3 with LdapConfig

use of org.apache.openmeetings.db.entity.server.LdapConfig in project openmeetings by apache.

the class LdapForm method onDeleteSubmit.

@Override
protected void onDeleteSubmit(AjaxRequestTarget target, Form<?> form) {
    ldapDao.delete(getModelObject(), WebSession.getUserId());
    this.setModelObject(new LdapConfig());
    target.add(listContainer);
    target.add(this);
    reinitJs(target);
}
Also used : LdapConfig(org.apache.openmeetings.db.entity.server.LdapConfig)

Example 4 with LdapConfig

use of org.apache.openmeetings.db.entity.server.LdapConfig in project openmeetings by apache.

the class UserForm method updateDomain.

public void updateDomain(AjaxRequestTarget target) {
    User u = getModelObject();
    final Map<Long, String> values = new HashMap<>();
    List<Long> ids = new ArrayList<>();
    if (u.getType() == Type.ldap) {
        for (LdapConfig c : ldapDao.getActive()) {
            ids.add(c.getId());
            values.put(c.getId(), c.getName());
        }
    }
    if (u.getType() == Type.oauth) {
        for (OAuthServer s : oauthDao.getActive()) {
            ids.add(s.getId());
            values.put(s.getId(), s.getName());
        }
    }
    domainId.setChoices(ids);
    domainId.setChoiceRenderer(new ChoiceRenderer<Long>() {

        private static final long serialVersionUID = 1L;

        @Override
        public Object getDisplayValue(Long object) {
            return values.get(object);
        }

        @Override
        public String getIdValue(Long object, int index) {
            return "" + object;
        }
    });
    domain.setVisible(u.getType() == Type.ldap || u.getType() == Type.oauth);
    if (target != null) {
        target.add(domain);
    }
}
Also used : User(org.apache.openmeetings.db.entity.user.User) HashMap(java.util.HashMap) ArrayList(java.util.ArrayList) OAuthServer(org.apache.openmeetings.db.entity.server.OAuthServer) LdapConfig(org.apache.openmeetings.db.entity.server.LdapConfig)

Example 5 with LdapConfig

use of org.apache.openmeetings.db.entity.server.LdapConfig in project openmeetings by apache.

the class BackupImport method importLdap.

/*
	 * ##################### Import LDAP Configs
	 */
private Long importLdap(File f, Serializer simpleSerializer) throws Exception {
    log.info("Groups import complete, starting LDAP config import");
    Long defaultLdapId = cfgDao.getLong(CONFIG_DEFAULT_LDAP_ID, null);
    List<LdapConfig> list = readList(simpleSerializer, f, "ldapconfigs.xml", "ldapconfigs", LdapConfig.class);
    for (LdapConfig c : list) {
        if (!"local DB [internal]".equals(c.getName())) {
            c.setId(null);
            c = ldapConfigDao.update(c, null);
            if (defaultLdapId == null) {
                defaultLdapId = c.getId();
            }
        }
    }
    return defaultLdapId;
}
Also used : LdapConfig(org.apache.openmeetings.db.entity.server.LdapConfig)

Aggregations

LdapConfig (org.apache.openmeetings.db.entity.server.LdapConfig)7 ArrayList (java.util.ArrayList)2 HashMap (java.util.HashMap)1 LdapConfigDao (org.apache.openmeetings.db.dao.server.LdapConfigDao)1 OAuthServer (org.apache.openmeetings.db.entity.server.OAuthServer)1 User (org.apache.openmeetings.db.entity.user.User)1 SearchableDataView (org.apache.openmeetings.web.admin.SearchableDataView)1 PagedEntityListPanel (org.apache.openmeetings.web.common.PagedEntityListPanel)1 DataViewContainer (org.apache.openmeetings.web.data.DataViewContainer)1 OmOrderByBorder (org.apache.openmeetings.web.data.OmOrderByBorder)1 AjaxEventBehavior (org.apache.wicket.ajax.AjaxEventBehavior)1 AjaxRequestTarget (org.apache.wicket.ajax.AjaxRequestTarget)1 Label (org.apache.wicket.markup.html.basic.Label)1 Item (org.apache.wicket.markup.repeater.Item)1