diff -r dc04a3c2c557 -r f5b57e221e38 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 Thu Jul 05 13:19:19 2012 +0200 @@ -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"); } }