diff -r dc04a3c2c557 -r bb1c8a7b774c src/org/sonews/storage/impl/DrupalDatabase.java --- a/src/org/sonews/storage/impl/DrupalDatabase.java Sun Oct 23 23:37:39 2011 +0200 +++ b/src/org/sonews/storage/impl/DrupalDatabase.java Wed Dec 31 12:07:40 2014 +0100 @@ -401,10 +401,8 @@ */ @Override public void addArticle(Article article) throws StorageBackendException { - if (article.getAuthenticatedUser() == null) { - log.log(Level.SEVERE, "User was not authenticated, so his article was rejected."); - throw new StorageBackendException("User must be authenticated to post articles"); - } else { + if (article.getUser() != null && article.getUser().isAuthenticated()) { + try { DrupalMessage m = new DrupalMessage(article); @@ -426,12 +424,16 @@ } } - insertArticle(article.getAuthenticatedUser(), subject, text, parentID, groupID); - log.log(Level.INFO, "User ''{0}'' has posted an article", article.getAuthenticatedUser()); + insertArticle(article.getUser().getUserName(), subject, text, parentID, groupID); + log.log(Level.INFO, "User ''{0}'' has posted an article", article.getUser().getUserName()); } } catch (Exception e) { throw new StorageBackendException(e); } + + } else { + log.log(Level.SEVERE, "User was not authenticated, so his article was rejected."); + throw new StorageBackendException("User must be authenticated to post articles"); } }