<mkdir dir="${build.javadoc}"/>
</target>
- <target name="prepare-binary-distribution">
+ <target name="prepare-distribution">
<mkdir dir="${distribution.home}"/>
- <delete dir="${build}/binarydist"/>
- <mkdir dir="${build}/binarydist"/>
+ <delete dir="${build}/dist"/>
+ <mkdir dir="${build}/dist"/>
</target>
- <target name="binary-distribution" depends="prepare-binary-distribution">
+ <target name="distribution" depends="prepare-distribution">
<antcall target="generate-deployment-tree">
- <param name="destination" value="${build}/binarydist"/>
+ <param name="destination" value="${build}/dist"/>
</antcall>
- <zip zipfile="${distribution.home}/binary.zip" >
- <fileset dir="${build}/binarydist" includes="**/*" />
- </zip>
+ <tar tarfile="${distribution.home}/mir-${version}.tar.gz" compression="gzip">
+ <tarfileset dir="${build}/binarydist" includes="**/*" />
+ </tar>
</target>
<target name="prepare-source-distribution">
########## admin ##########
# language: english
-# $Id: admin_en.properties,v 1.48.2.25 2005/01/16 00:16:22 zapata Exp $
+# $Id: admin_en.properties,v 1.48.2.26 2005/11/09 14:08:56 zapata Exp $
languagename=English
media.icon=icon
media.nr_of_media=Number of Media Items (max 20)
media.nr_of_media.submit=define number
-media.comments=Comments
+media.comments=Comments
media.articles=Articles
medialist.search_text_in=Search text in
comment.creator=Author
comment.article=Article
comment.html=HTML
-comment.status=Status
+comment.status=Status
comment.language=Language
comment.allcomments=All comments
comment.comment=Internal Comment
abuse.log.address=IP number
abuse.log.object=Object
abuse.log.browser=Browser
-abuse.log.filtertype=Filter type
-abuse.log.filterexpression=Expression
+abuse.log.filtertag = Filter tag
abuse.filters = Filters
filters.movedown = down
filter.type = Type
filter.expression = Expression
-filter.articleaction = Article
-filter.commentaction = Comment
+filter.articleaction = Article
+filter.commentaction = Comment
filter.comment = Comments (internal usage)
filter.last_hit = Last hit
filter.htmltitle = Edit filter
<table cellpadding="30" cellspacing="0" border="0" width="80%"><tr><td>
<table border="0" cellpadding="2" cellspacing="0" width="100%"><tr><td bgcolor="#669999">
<!--#include virtual="/languagebar/${article.to_original.date.formatted.yyyy}/${article.to_original.date.formatted.MM}/${article.to_original.id}.shtml"-->
- </td></tr></table>
+ </td></tr></table>
<br>
<table border="0" cellpadding="2" cellspacing="0" width="100%"><tr><td bgcolor="#669999">
<a href="${config.openAction}?do=opensession&sessiontype=translation&to_content=${article.to_original.id}"><font color="#dddddd">${lang("general.addtranslation")} >></font></a>
import mircoders.entity.EntityComment;
import mircoders.entity.EntityContent;
import mircoders.localizer.MirAdminInterfaceLocalizer;
+import mircoders.module.ModuleContent;
+import mircoders.module.ModuleComment;
import org.apache.commons.collections.ExtendedProperties;
private static String cookieName = MirGlobal.config().getString("Abuse.CookieName");
private static int cookieMaxAge = 60 * 60 * MirGlobal.config().getInt("Abuse.CookieMaxAge");
+ private EntityAdapterModel model;
public Abuse(EntityAdapterModel aModel) {
logger = new LoggerWrapper("Global.Abuse");
filterEngine = new FilterEngine(aModel);
+ model = aModel;
log = new ArrayList();
}
public List getLog() {
+ ModuleContent contentModule = new ModuleContent();
+ ModuleComment commentModule = new ModuleComment();
+
synchronized (log) {
try {
List result = new ArrayList();
entry.put("ip", logEntry.getIpNumber());
entry.put("id", logEntry.getId());
entry.put("timestamp", new GeneratorFormatAdapters.DateFormatAdapter(logEntry.getTimeStamp(), MirPropertiesConfiguration.instance().getString("Mir.DefaultTimezone")));
- if (logEntry.getIsArticle())
+
+ if (logEntry.getIsArticle()) {
entry.put("type", "content");
- else
+ entry.put("object",
+ model.makeEntityAdapter("content", contentModule.getById(logEntry.getId())));
+ }
+ else {
entry.put("type", "comment");
+ entry.put("object",
+ model.makeEntityAdapter("comment", commentModule.getById(logEntry.getId())));
+ }
+
entry.put("browser", logEntry.getBrowserString());
entry.put("filtertag", logEntry.getMatchingFilterTag());
ServletHelper.redirect(aResponse, returnUrlString);
}
+ public void operation(HttpServletRequest aRequest, HttpServletResponse aResponse) throws ServletModuleExc {
+ String type = aRequest.getParameter("objecttype");
+ String id = aRequest.getParameter("id");
+ String operation = aRequest.getParameter("operation");
+ String returnUrl = aRequest.getParameter("returnurl");
+
+
+ if ("comment".equals(type)) {
+ performCommentOperation(aRequest, id, operation);
+ }
+ else {
+ performArticleOperation(aRequest, id, operation);
+ }
+
+ ServletHelper.redirect(aResponse, returnUrl);
+ }
+
public void commentoperationbatch(HttpServletRequest aRequest, HttpServletResponse aResponse) throws ServletModuleExc {
String returnUrlString = aRequest.getParameter("returnurl");
ServletHelper.redirect(aResponse, returnUrlString);
}
+ public void operationbatch(HttpServletRequest aRequest, HttpServletResponse aResponse) throws ServletModuleExc {
+ String returnUrlString = aRequest.getParameter("returnurl");
+
+ String[] operations = aRequest.getParameterValues("operation");
+
+ if (operations!=null) {
+ for (int i = 0; i < operations.length; i++) {
+ if (operations[i].length() > 0) {
+ List parts = StringRoutines.splitString(operations[i], ";");
+
+ if (parts.size() != 3) {
+ getLogger().error("commentoperationbatch: operation string invalid: " +
+ operations[i]);
+ }
+ else {
+ String type = (String) parts.get(0);
+ String id = (String) parts.get(1);
+ String operationString = (String) parts.get(2);
+
+ if ("comment".equals(type)) {
+ performCommentOperation(aRequest, id, operationString);
+ }
+ else {
+ performArticleOperation(aRequest, id, operationString);
+ }
+ }
+ }
+ }
+ }
+
+ ServletHelper.redirect(aResponse, returnUrlString);
+ }
public void performArticleOperation(HttpServletRequest aRequest, String anId, String anOperation) {
EntityContent entity;
</table>
</function>
+<function showCommentAttachment(aComment, aReturnUrl)>
+ <call showAttachment(0, aComment, "1", aReturnUrl)>
+</function>
+
+<function showAttachment(anIsArticle, anObject, aCanEdit, aReturnUrl)>
+ <assign objectKey="commentid">
+ <assign objectModule="Comment">
+ <list anObject.to_all_media_images as m>
+ <a href="${config.actionRoot}?module=Images&do=getMedia&id=${m["id"]}">
+ <img src="${config.actionRoot}?module=Images&do=getIcon&id=${m["id"]}"
+ alt="edit" border="0">
+ </a>
+ </list>
+ <list anObject.to_all_media_audio as m>
+ <img src="${config.docRoot}/img/${m["big_icon"]}" alt="edit" border="0">
+ </list>
+ <list anObject.to_all_media_video as m>
+ <img src="${config.docRoot}/img/${m["big_icon"]}" alt="edit" border="0">
+ </list>
+ <list anObject.to_all_media_other as m>
+ <img src="${config.docRoot}/img/${m["big_icon"]}" alt="edit" border="0">
+ </list>
+</function>
+
<body marginwidth="0" marginheight="0" topmargin="0" leftmargin="0">
<include "head.template">
-
+
<p>
<a class="link-box" href="${config.actionRoot}?module=Abuse"> [ < ] ${lang("back")}</a>
<a class="link-box" href="${config.actionRoot}?module=Abuse&do=showfilterconfiguration">${lang("abuse.showfilterconfiguration")}</a>
<br>
</p>
+ <if config["Mir.Localizer.Admin.ListOperationsFlavor"]!="0">
+ <form method="post" action="${config.actionRoot}">
+ <input type="hidden" name="module" value="Localizer">
+ <input type="hidden" name="do" value="operationbatch">
+ <input type="hidden" name="returnurl" value="${utility.encodeHTML(thisurl)}">
+ <p class="box">
+ <input type="submit" class="majorbutton" name="save" value="${lang("save")}">
+ </p>
+ </if>
+
+
<table border="0" cellpadding="2" cellspacing="3">
<tr class="darkgrey">
<td class="table-head">${lang("abuse.log.time")}</td>
<td class="table-head">${lang("abuse.log.address")}</td>
<td class="table-head">${lang("abuse.log.object")}</td>
+ <td class="table-head"></td>
<td class="table-head">${lang("abuse.log.browser")}</td>
- <td class="table-head">${lang("abuse.log.filtertype")}</td>
- <td class="table-head">${lang("abuse.log.filterexpression")}</td>
+ <td class="table-head">${lang("abuse.log.filtertag")}</td>
</tr>
-
- <assign grey="0">
+
+ <assign grey="0">
<list log as l>
<if grey=="1"><assign grey="0"><tr class="listrow1"><else><tr class="listrow2"><assign grey="1"> </if>
<td>${l.timestamp.format(config["Mir.DefaultDateTimeFormat"])}</td>
<a href="${config.actionRoot}?module=Comment&do=edit&id=${l.id}&returnurl=${utility.encodeURI(thisurl)}">Comment</a>
</if>
</td>
+ <td>
+ <if config["Mir.Localizer.Admin.ListOperationsFlavor"]=="0">
+ <list l.object.operations as op>
+ [ <a href="${config.actionRoot}?module=Localizer&do=operation&objectype=${l.type}&operation=${op}&id=${l.object.id}&returnurl=${utility.encodeURI(thisurl + "#" + l.object.id)}">${lang(l.type+".operation."+op)}</a> ]
+ </list>
+ </if>
+ <if config["Mir.Localizer.Admin.ListOperationsFlavor"]=="1">
+ <list l.object.operations as op>
+ <input type="checkbox" name="operation" value="${l.type};${l.object.id};${op}">${lang(l.type+".operation."+op)}
+ </list>
+ </if>
+ <if config["Mir.Localizer.Admin.ListOperationsFlavor"]=="2">
+ <select name="operation">
+ <option value="" selected> </option>
+ <list l.object.operations as op>
+ <option value="${l.type};${l.object.id};${op}">${lang(l.type+".operation."+op)}</option>
+ </list>
+ </select>
+ </if>
+ </td>
<td>${utility.encodeHTML(l.browser)}</td>
- <td><if l.hitfiltertype>${lang("abuse.filtertype."+l.hitfiltertype)}</if></td>
- <td>${utility.encodeHTML(l.hitfilterexpression)}</td>
+ <td><if l.filtertag>${l.filtertag}</if></td>
</tr>
</list>
<tr>
<td colspan="6" class="table-foot"> </td>
</tr>
</table>
+ <if config["Mir.Localizer.Admin.ListOperationsFlavor"]!="0">
+ </form>
+ </if>
<p>
<a class="link-box" href="${config.actionRoot}?module=Abuse"> [ < ] ${lang("back")}</a>
</if>
<br>
${utility.prettyEncodeHTML(utility.subString(entry.description, 0, config["Mir.Admin.ListTextLengthLimit"]))}
+
+ <br>
+ <if entry.to_all_media_images><call showCommentAttachment(entry, thisurl)></if>
+ <if entry.to_all_media_audio><call showCommentAttachment(entry, thisurl)></if>
+ <if entry.to_all_media_video><call showCommentAttachment(entry, thisurl)></if>
+ <if entry.to_all_media_other><call showCommentAttachment(entry, thisurl)></if>
+ <br>
<if entry.main_url><br>URL: ${utility.encodeHTML(entry.main_url)}</if>
<br>
</if>
<if entry.operations> | </if>
<a href="${config.actionRoot}?module=Comment&do=edit&id=${entry.id}">${lang("edit")}</a>
- <if entry.to_all_media_images>IMAGES</if>
</td>
<td valign="top">