Skip to content

Commit

Permalink
- don't publish news if empty or equal page is submitted in wiki
Browse files Browse the repository at this point in the history
git-svn-id: https://svn.berlios.de/svnroot/repos/yacy/trunk@3451 6c8d7289-2bf4-0310-a012-ef5d649a1542
  • Loading branch information
karlchenofhell committed Mar 8, 2007
1 parent dcc13ab commit de1b4a1
Showing 1 changed file with 7 additions and 4 deletions.
11 changes: 7 additions & 4 deletions htroot/Wiki.java
Expand Up @@ -106,6 +106,8 @@ public static serverObjects respond(httpHeader header, serverObjects post, serve
}
if (access.equals("admin")) prop.put("mode_access", 0);
if (access.equals("all")) prop.put("mode_access", 1);

wikiBoard.entry page = switchboard.wikiDB.read(pagename);

if (post.containsKey("submit")) {

Expand All @@ -122,17 +124,18 @@ public static serverObjects respond(httpHeader header, serverObjects post, serve
} catch (UnsupportedEncodingException e) {
content = post.get("content", "").getBytes();
}
switchboard.wikiDB.write(switchboard.wikiDB.newEntry(pagename, author, ip, post.get("reason", "edit"), content));
wikiBoard.entry newEntry = switchboard.wikiDB.newEntry(pagename, author, ip, post.get("reason", "edit"), content);
switchboard.wikiDB.write(newEntry);
// create a news message
HashMap map = new HashMap();
map.put("page", pagename);
map.put("author", author.replace(',', ' '));
yacyCore.newsPool.publishMyNews(new yacyNewsRecord("wiki_upd", map));
if (!page.page().equals(content))
yacyCore.newsPool.publishMyNews(new yacyNewsRecord("wiki_upd", map));
page = newEntry;
prop.put("LOCATION", "/Wiki.html?page=" + pagename);
}

wikiBoard.entry page = switchboard.wikiDB.read(pagename);

if (post.containsKey("edit")) {
if ((access.equals("admin") && (!switchboard.verifyAuthentication(header, true)))) {
// check access right for admin
Expand Down

0 comments on commit de1b4a1

Please sign in to comment.