- don't publish news if empty or equal page is submitted in wiki

git-svn-id: https://svn.berlios.de/svnroot/repos/yacy/trunk@3451 6c8d7289-2bf4-0310-a012-ef5d649a1542
pull/1/head
karlchenofhell 18 years ago
parent dcc13abd59
commit de1b4a1731

@ -106,6 +106,8 @@ public class Wiki {
}
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")) {
@ -122,17 +124,18 @@ public class Wiki {
} 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

Loading…
Cancel
Save