Merge branch 'develop' into feature/fauxEditing

This commit is contained in:
Jim Blake 2014-12-10 17:41:37 -05:00
commit d48d6f63ec
2 changed files with 14 additions and 2 deletions

View file

@ -46,6 +46,13 @@ public class VitroApiServlet extends HttpServlet {
Authenticator auth = Authenticator.getInstance(req); Authenticator auth = Authenticator.getInstance(req);
UserAccount account = auth.getAccountForInternalAuth(email); UserAccount account = auth.getAccountForInternalAuth(email);
if (auth.accountRequiresEditing(account)) {
log.debug("Account " + email + " requires editing.");
throw new AuthException("user account must include first and "
+ "last names and a valid email address.");
}
if (!auth.isCurrentPassword(account, password)) { if (!auth.isCurrentPassword(account, password)) {
log.debug("Invalid: '" + email + "'/'" + password + "'"); log.debug("Invalid: '" + email + "'/'" + password + "'");
throw new AuthException("email/password combination is not valid"); throw new AuthException("email/password combination is not valid");
@ -57,6 +64,11 @@ public class VitroApiServlet extends HttpServlet {
throw new AuthException("Account is not authorized"); throw new AuthException("Account is not authorized");
} }
if (account.isPasswordChangeRequired()) {
log.debug("Account " + email + " requires a new password.");
throw new AuthException("user account requires a new password.");
}
log.debug("Authorized for '" + email + "'"); log.debug("Authorized for '" + email + "'");
} }

View file

@ -34,8 +34,8 @@ public class ContextNodeFields implements DocumentModifier, ContextModelsUser{
protected List<String> queries = new ArrayList<String>(); protected List<String> queries = new ArrayList<String>();
protected boolean shutdown = false; protected boolean shutdown = false;
protected Log log = LogFactory.getLog(ContextNodeFields.class); protected Log log = LogFactory.getLog(ContextNodeFields.class);
//Subclasses may want to utilize rdfService directly (for example, to execute queries that yielding multiple variables mapped to different fields)
private RDFService rdfService; protected RDFService rdfService;
@Override @Override
public void setContextModels(ContextModelAccess models) { public void setContextModels(ContextModelAccess models) {