use of org.apache.openmeetings.db.entity.user.User.Type in project openmeetings by apache.
the class UserDTO method get.
public static UserDTO get(JSONObject o) {
if (o == null) {
return null;
}
UserDTO u = new UserDTO();
u.id = optLong(o, "id");
u.login = o.optString("login");
u.password = o.optString("password");
u.firstname = o.optString("firstname");
u.lastname = o.optString("lastname");
u.rights.addAll(optEnumList(Right.class, o.optJSONArray("rights")));
u.languageId = o.optLong("languageId");
JSONObject a = o.optJSONObject("address");
if (a != null) {
u.address.setId(optLong(a, "id"));
u.address.setCountry(a.optString("country"));
u.address.setEmail(a.optString("email"));
}
u.timeZoneId = o.optString("timeZoneId");
u.externalId = o.optString("externalId");
u.externalType = o.optString("externalType");
u.type = optEnum(Type.class, o, "type");
return u;
}
use of org.apache.openmeetings.db.entity.user.User.Type in project openmeetings by apache.
the class SignInDialog method onSubmit.
@Override
protected void onSubmit(AjaxRequestTarget target) {
if (domain.getAddDomainToUserName()) {
login = login + "@" + domain.getDomain();
}
OmAuthenticationStrategy strategy = getAuthenticationStrategy();
WebSession ws = WebSession.get();
Type type = domain.getId() > 0 ? Type.ldap : Type.user;
boolean signIn = false;
try {
signIn = ws.signIn(login, password, type, domain.getId());
} catch (OmException e) {
error(getString(e.getKey()));
target.add(feedback);
}
if (signIn) {
setResponsePage(Application.get().getHomePage());
if (rememberMe) {
strategy.save(login, password, type, domain.getId());
} else {
strategy.remove();
}
} else {
if (!hasErrorMessage()) {
error(getString("error.bad.credentials"));
target.add(feedback);
}
// add random timeout
try {
Thread.sleep(6 + (long) (10 * Math.random() * 1000));
} catch (InterruptedException e) {
log.error("Unexpected exception while sleeping", e);
}
strategy.remove();
shake(target);
}
}
Aggregations