user = m_coreContext.loadUserByExtension(userId); if (user == null) { return null; }
return null;
    public User checkCredentials(String userId, String password) {        User user = m_coreContext.loadUserByUserName(userId);        if (user == null) {            // The userId might be the user's extension rather than userName, see if that works.            user = m_coreContext.loadUserByExtension(userId);            if (user == null) {                return null;            }        }        String pintoken = user.getPintoken();        String encodedPassword = Md5Encoder.digestPassword(userId, m_coreContext                .getAuthorizationRealm(), password);                // Real match        if (encodedPassword.equals(pintoken)) {            return user;        }                // Special case: if the password is empty and the pintoken is empty, then declare a match.        // We have publicized the ability for admins to reset users to have an empty password by        // zeroing out the pintoken entry in the database.        if (password.length() == 0 && pintoken.length() == 0) {            return user;        }        return null;    }