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;
}
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);
}
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);
}
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);
}
}
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;
}
Aggregations