Compare commits

..

42 commits

Author SHA1 Message Date
6a5a389d01 Modified checkout URL for Antville 1.2.1 branch 2011-01-21 20:18:17 +00:00
573e90b732 Fixed regular expression in gettext_macro() causing artefacts of line endings in Windows package 2011-01-21 19:31:31 +00:00
cba12bbae7 Created branch for release of version 1.2.1 2011-01-20 23:34:07 +00:00
bd96bf8388 Removed test file 2011-01-20 20:44:43 +00:00
900470348b test pls ignore 2011-01-20 20:44:07 +00:00
4486f2d238 Added CSS code to prevent linebreaks in the date column of top stories table 2011-01-20 19:04:40 +00:00
31f249fc79 Removed spambot honeypot input fields for good. Fixes issue 131. 2011-01-20 19:01:10 +00:00
ff62e260cf Corrected CSS font-family value 2011-01-17 01:07:27 +00:00
347cb98020 Fixed CSS font-family value accprding to report at http://help.antville.org/stories/2040619/#2040813 2011-01-17 01:02:46 +00:00
516babe96f Fixed spelling of “Galerien” 2011-01-16 10:52:50 +00:00
bc98042790 Added code to convert notification modes in the database to lowercase. Fixes issue 136. 2011-01-15 22:17:31 +00:00
a5e6c8b596 Added some more comments to patch files 2011-01-12 19:34:35 +00:00
791e099ade Removed support_macro() from compatibility layer because it was never released, anyway 2011-01-07 18:13:40 +00:00
0af26a4e7b Moved contents of Root’s $Root#main skin to Site#main 2011-01-07 16:05:37 +00:00
c0adce4ea8 Added global version_macro() method and display of version string in $Root#status skin 2011-01-07 15:43:51 +00:00
20f0be8868 Modified Root.VERSION string in compatibility layer to only append additional version information 2011-01-07 15:35:31 +00:00
94ac026e76 Increased Root.VERSION string to 1.2.1 2011-01-07 15:07:17 +00:00
ca2f3a87b5 Removed obsolete code from Skins.getOutline() method 2011-01-07 15:06:49 +00:00
6584f1dd7d Simplified Skins.getOutline() method and fixed it to retrieve the skins from files in res.skinpath instead of from the code directory 2011-01-07 14:55:24 +00:00
6c80b3f2e9 Added fallback value for the e-mailä sender address in sendMail() method 2011-01-06 17:16:26 +00:00
828b85ba4c Prevent any href processing in Site.processHref() method when called from localhost 2011-01-06 16:10:54 +00:00
4a16d91deb Do not try to map domain.*, the default domain property 2011-01-06 16:08:47 +00:00
d221466d4a Changed order of options for rewriting URL output and added comment to make it clearer what needs to be enabled for mapping individual domains 2011-01-05 19:12:57 +00:00
f2db3263d9 Slightly changed way individual domains are mapped to the sites by introducing the domain.* property which defines the default domain 2011-01-05 19:00:37 +00:00
b8791d0887 Enable automatic updates of custom domains by default 2011-01-05 12:48:47 +00:00
df20ca2efc Separately add/reset the Site skin of root 2011-01-04 16:04:16 +00:00
57c6322c1e * Added check to maintain skin inheritance when targeting the Site skin of root. Fixes bug preventing modification of the root site’s main and navigation skins.
* Added Skin.getSubskin() method for convenience.
2011-01-04 15:30:57 +00:00
1f16ce5377 Renamed updater app’s Root.skin to ~Root.skin to prevent it from overwriting the skins in the main app 2011-01-04 15:19:20 +00:00
cd50b46cba Added helper method User.rename() for renaming a user account; currently without GUI representation. 2010-12-21 18:54:10 +00:00
69ff389353 Removed obsolete debug method and unnecessary semicolons. 2010-12-21 17:31:12 +00:00
192f133ba6 Fixed unquoted <br /> element in macro preventing voting in a poll. 2010-12-21 17:29:54 +00:00
a0c7ee608e Check if temporary directory exists before trying to remove it in Layout.import_action() 2010-12-21 14:15:17 +00:00
5b0ba00ba9 Check for User.REGULAR role when subscribing to a site in Site.getPermission(). Fixes issue 134. 2010-12-21 14:13:42 +00:00
3b7d2e577b Start session by logging in user account if available in Api.getUser() 2010-12-21 14:11:15 +00:00
1d27d412c8 * Removed obsolete modSorua code
* Removed redundant setting of res.handlers.sender in Members.add_action(); will be already done in Membership.notify()
2010-12-21 14:08:47 +00:00
9410d97946 Removed redundant semicolon 2010-12-21 14:07:02 +00:00
2b35e1ddf4 * Added patch to prevent locales and timezones from being set to wrong values in modified dropdown menus.
* Commented out client-side code hiding “Etc” timezones in the preferences’ dropdown to prevent wrong settings.
 * Added localized timezone name in dropdown menu (only visible in JavaScript-disabled clients).

Fixes issue 128.
2010-12-09 01:43:26 +00:00
3f602c6d5b Display each language in its corresponding locale instead of all languages in the one currently selected. 2010-12-09 00:56:21 +00:00
5a1b4cf2e3 Removed debugging symbols 2010-12-09 00:50:35 +00:00
4db44c389b Exclude deleted (aka hidden) comments from being displayed in list of recent updates as well as in RSS output. Fixes #125. 2010-12-08 23:51:06 +00:00
Christoph Leutner
9776619fb4 Corrected text in Site Preferences - cf. issue 127. 2010-11-30 02:43:20 +00:00
47deac6732 Prevent anyone from searching a restricted site. Fixes issue 123. 2010-08-28 17:42:43 +00:00
32 changed files with 248 additions and 228 deletions

View file

@ -23,10 +23,10 @@
<target name="init">
<property name="name" value="antville" />
<property name="year" value="1998-${year}" />
<property name="version" value="1.2" />
<property name="version" value="1.2.1" />
<property name="package.name" value="${name}-${version}" />
<property name="antville.src" value="http://antville.googlecode.com/svn/trunk" />
<property name="antville.src" value="http://antville.googlecode.com/svn/branches/release_1_2_1" />
<property name="helma.src" value="http://dev.helma.org/svn/helma/helma/trunk" />
<property name="apps.src" value="http://dev.helma.org/svn/apps" />

View file

@ -229,7 +229,7 @@ PoParser.prototype.writeToFile = function(output) {
buf.append(' * Messages for locale "' + this.localeKey + '"\n');
buf.append(' */\n');
var fname = objPath + "." + this.localeKey + ".js";
objPath += "xxx['" + this.localeKey + "']";
objPath += "['" + this.localeKey + "']";
buf.append('global.' + objPath + ' = {\n');
// write messages
for (var i=0;i<this.messages.length; i++) {

View file

@ -363,7 +363,7 @@ Admin.updateHealth = function() {
Admin.updateDomains = function() {
res.push();
for (var key in app.properties) {
if (key.startsWith("domain.")) {
if (key.startsWith("domain.") && !key.endsWith("*")) {
res.writeln(getProperty(key) + "\t\t" + key.substr(7));
}
}

View file

@ -57,6 +57,7 @@ Api.getUser = function(name, password) {
} else if (user.status === User.BLOCKED) {
throw Error("The user account " + name + " is currently blocked");
}
session.login(user);
return user;
}

View file

@ -218,7 +218,7 @@ function scheduler() {
Admin.commitEntries();
Admin.commitRequests();
Admin.invokeCallbacks();
//Admin.updateDomains();
Admin.updateDomains();
Admin.updateHealth();
return 5000;
}
@ -785,7 +785,7 @@ function sendMail(recipient, subject, body, options) {
}
var mail = new helma.Mail(getProperty("smtp", "localhost"),
getProperty("smtp.port", "25"));
mail.setFrom(root.replyTo);
mail.setFrom(root.replyTo || "root@localhost");
if (recipient instanceof Array) {
for (var i in recipient) {
mail.addBCC(recipient[i]);
@ -817,16 +817,16 @@ function getLocale(language) {
* @returns {Object[]} A sorted array containing the corresponding locales
*/
function getLocales(language) {
var result = [], locale;
var displayLocale = getLocale(language);
var result = [], locale, localeString;
var locales = java.util.Locale.getAvailableLocales();
for (var i in locales) {
locale = locales[i].toString();
if (!locale.toString().contains("_")) {
locale = locales[i];
localeString = locale.toString();
if (!localeString.contains("_")) {
result.push({
value: locale,
display: locales[i].getDisplayName(displayLocale),
"class": jala.i18n.getCatalog(jala.i18n.getLocale(locale)) ? "translated" : ""
value: localeString,
display: locale.getDisplayName(locale),
"class": jala.i18n.getCatalog(jala.i18n.getLocale(localeString)) ? "translated" : ""
});
}
}
@ -851,8 +851,8 @@ function getTimeZones(language) {
offset = timeZone.getRawOffset();
result.push({
value: zone,
display: /* timeZone.getDisplayName(timeZone.inDaylightTime(now),
java.util.TimeZone.LONG, locale) */ " (UTC" + (offset /
display: timeZone.getDisplayName(timeZone.inDaylightTime(now),
java.util.TimeZone.LONG, locale) + " (UTC" + (offset /
Date.ONEHOUR).format("+00;-00") + ":" + (Math.abs(offset %
Date.ONEHOUR) / Date.ONEMINUTE).format("00") + ")"
});
@ -1202,3 +1202,24 @@ var wait = function(millis) {
}
return;
}
/**
*
* @param {Object} param
* @param {String} type
*/
function version_macro(param, type) {
var version = Root.VERSION.split("-");
var number = version[0];
switch (type) {
case "major":
res.write(number.split(".")[0]);
break;
case "minor":
res.write(number);
break;
default:
res.write(Root.VERSION);
}
return;
}

View file

@ -95,8 +95,8 @@ function gettext_macro(param, text /*, value1, value2, ...*/) {
if (!text) {
return;
}
var re = /(\s*)(?:\r|\n)\s*/g;
var args = [text.replace(re, "$1")];
var re = /\s+/g;
var args = [text.replace(re, String.SPACE)];
for (var i=2; i<arguments.length; i+=1) {
args.push(arguments[i]);
}
@ -118,8 +118,8 @@ function ngettext_macro(param, singular, plural /*, value1, value2, ...*/) {
if (!singular || !plural) {
return;
}
var re = /(\s*)(?:\r|\n)\s*/g;
var args = [singular.replace(re, "$1"), plural.replace(re, "$1")];
var re = /\s+/g;
var args = [singular.replace(re, String.SPACE), plural.replace(re, String.SPACE)];
for (var i=3; i<arguments.length; i+=1) {
args.push(arguments[i]);
}

View file

@ -229,7 +229,7 @@ Layout.prototype.reset_action = function() {
Layout.prototype.export_action = function() {
res.contentType = "application/zip";
var zip = this.getArchive(res.skinpath);
res.setHeader("Content-Disposition",
res.setHeader("Content-Disposition",
"attachment; filename=" + this.site.name + "-layout.zip");
res.writeBinary(zip.getData());
return;
@ -268,7 +268,7 @@ Layout.prototype.import_action = function() {
} catch (ex) {
res.message = ex;
app.log(ex);
temp.removeDirectory();
temp && temp.removeDirectory();
res.redirect(this.href(req.action));
}
res.redirect(this.href());
@ -326,17 +326,26 @@ Layout.prototype.getSkinPath = function() {
*/
Layout.prototype.reset = function() {
var skinFiles = app.getSkinfilesInPath([app.dir]);
var content, file;
var content, dir, file;
for (var name in skinFiles) {
if (content = skinFiles[name][name]) {
var dir = this.getFile(name);
var file = new helma.File(dir, name + ".skin");
dir = this.getFile(name);
file = new helma.File(dir, name + ".skin");
dir.makeDirectory();
file.open();
file.write(content);
file.close();
}
}
// FIXME: Reset the Site skin of root separately
content = skinFiles.Root.Site;
file = new helma.File(this.getFile("Root"), "Site.skin");
dir.makeDirectory();
file.open();
file.write(content);
file.close()
this.touch();
return;
}
@ -358,6 +367,10 @@ Layout.prototype.getArchive = function(skinPath) {
}
}
// FIXME: Add the Site skin of root separately
file = new helma.File(this.getFile("Root"), "Site.skin");
file.exists() && zip.add(file, "Root");
var data = new HopObject;
data.images = new HopObject;
this.images.forEach(function() {

View file

@ -40,12 +40,6 @@ $(function() {
<input type="hidden" name="digest" id="digest" />
<table border="0" cellspacing="0" cellpadding="3">
<tr>
<td class="small"><% gettext "Activation Code" suffix=":" %></td>
<td><input type="text" name="activation" id="activation"
value="<% request.activation encoding="form" %>" /></td>
<td colspan="2"></td>
</tr>
<tr>
<td class="small"><% gettext "Username" suffix=":" %></td>
<td><input type="text" name="name" id="name" tabindex="1" size="20"
value="<% request.name encoding="form" %>" /></td>
@ -104,11 +98,6 @@ $(function() {
<input type="hidden" name="hash" id="hash" />
<table border="0" cellspacing="0" cellpadding="3">
<tr>
<td class="small"><% gettext "Activation Code" suffix=":" %></td>
<td><input type="text" name="activation" id="activation"
value="<% request.activation encoding="form" %>" /></td>
</tr>
<tr>
<td class="small"><% gettext Username suffix=: %></td>
<td><input type="text" name="name" size="30"
value="<% request.name encoding="form" %>" /></td>

View file

@ -92,10 +92,6 @@ Members.prototype.main_action = function() {
Members.prototype.register_action = function() {
if (req.postParams.register) {
if (req.postParams.activation) {
app.log("Detected form submit with completed honeypot field: " + req.data);
res.redirect(root.href());
}
try {
var title = res.handlers.site.title;
var user = User.register(req.postParams);
@ -178,10 +174,6 @@ Members.prototype.reset_action = function() {
Members.prototype.login_action = function() {
if (req.postParams.login) {
if (req.postParams.activation) {
app.log("Detected form submit with completed honeypot field: " + req.data);
res.redirect(root.href());
}
try {
var user = User.login(req.postParams);
res.message = gettext('Welcome to {0}, {1}. Have fun!',
@ -339,7 +331,6 @@ Members.prototype.add_action = function() {
}
} else if (req.postParams.add) {
try {
res.handlers.sender = User.getMembership();
var membership = this.addMembership(req.postParams);
membership.notify(req.action, membership.creator.email,
gettext('[{0}] Notification of membership change', root.title));
@ -404,65 +395,3 @@ Members.prototype.addMembership = function(data) {
this.add(membership);
return membership;
}
Members.prototype.modSorua_action = function() {
if (!app.data.modSorua) app.data.modSorua = new Array();
var returnUrl = req.data["sorua-return-url"];
var failUrl = req.data["sorua-fail-url"];
var userID = req.data["sorua-user"];
var action = req.data["sorua-action"];
if (action == "authenticate") { // authenticate-action
if (session.user && (userID == null || userID == "" || session.user.name == userID)) {
// store returnUrl + timestamp + userID
app.data.modSorua[returnUrl] = {time: new Date(), userID: session.user.name};
res.redirect(returnUrl);
} else if (failUrl) {
res.redirect(failUrl);
} else {
session.data.modSorua = {returnUrl: returnUrl,
userID: userID};
res.redirect(this.href("modSoruaLoginForm"));
}
} else if (action == "verify") {
// first remove outdated entries
var now = new Date();
var arr = new Array();
for (var i in app.data.modSorua) {
if (app.data.modSorua[i] && app.data.modSorua[i].time &&
now.valueOf() - app.data.modSorua[i].time.valueOf() < 1000 * 60)
arr[i] = app.data.modSorua[i];
}
app.data.modSorua = arr;
// now check whether returnUrl has been used recently
if (app.data.modSorua[returnUrl]) {
res.status = 200;
res.write("user:" + app.data.modSorua[returnUrl].userID);
return;
} else {
res.status = 403;
return;
}
} else { // handle wrong call of AuthURI
res.redirect(root.href("main"));
}
}
Members.prototype.modSoruaLoginForm_action = function() {
if (!session.data.modSorua || !session.data.modSorua.returnUrl)
res.redirect(root.href()); // should not happen anyways
if (req.data.login) {
try {
res.message = this.evalLogin(req.data.name, req.data.password);
var returnUrl = session.data.modSorua.returnUrl;
app.data.modSorua[returnUrl] = {time: new Date(), userID: req.data.name};
res.redirect(returnUrl);
} catch (err) {
res.message = err.toString();
}
}
res.data.action = this.href("modSoruaLoginForm");
this.renderSkin("modSorua");
}

View file

@ -10,7 +10,7 @@
</p>
<% #main %>
<% if <% param.header %> is true then <% poll.skin #header suffix=<br /> %> else
<% if <% param.header %> is true then <% poll.skin #header suffix="<br />" %> else
<% poll.question prefix='<div class="pollTitle">' suffix="</div> %> %>
<form method="post" action="<% poll.href %>">
<table border="0" cellspacing="2" cellpadding="2">

View file

@ -1,22 +1,3 @@
<% #main %>
<p><% gettext 'Antville is an open source project aimed at the development of a
simple site hosting system with many advanced
<a href="http://code.google.com/p/antville/wiki/AntvilleFeatures">features</a>.' %></p>
<p><% gettext 'One Antville installation can easily host up to several thousands
of <a href="{0}">sites</a>.' <% site.href sites %> %></p>
<p><% site.link create <% gettext "Create a site. It only takes a few clicks." %> %></p>
<p>
<% gettext "Total sites hosted here" suffix=: %> <% root.size %><br />
<% gettext "Number of public sites" suffix=: %> <% root.sites.size %>
</p>
<table border="0" cellpadding="1" cellspacing="0">
<colgroup>
<col width="150" />
<col width="*" />
</colgroup>
<% root.loop updates skin=$Site#listItem limit=25 %>
</table>
<% #create %>
<p class="storyTitle"><% response.title %></p>
<div>
@ -150,6 +131,10 @@ alphabetical order." %></p>
<td class="small"><% gettext 'Queued Callbacks' %>:</td>
<td><% param.callbacks %></td>
</tr>
<tr>
<td class="small"><% gettext Version %>:</td>
<td><% version %></td>
</tr>
</table>
<% #stylesheet %>
@ -183,7 +168,7 @@ ul.skinmgrTree a.selected {
}
ul.skinmgrTree li div {
font-family:<% value "base font size" %>;
font-family:<% value "small font" %>;
font-size:<% value "small font size" %>;
color:<% value "base font color" %>;
}
@ -208,10 +193,6 @@ div.skin div.title {
white-space: nowrap;
}
.activation {
display: none;
}
.translated {
font-weight: bold;
}

View file

@ -27,7 +27,7 @@
*/
/** @constant */
Root.VERSION = "1.2";
Root.VERSION = "1.2.1";
this.handleMetadata("creationDelay");
this.handleMetadata("creationScope");

View file

@ -1,7 +1,21 @@
<% #main %>
<% root.skin Root#welcome %>
<% // Render the list of updated sites %>
<% root.skin $Root#main %>
<p><% gettext 'Antville is an open source project aimed at the development of a
simple site hosting system with many advanced
<a href="http://code.google.com/p/antville/wiki/AntvilleFeatures">features</a>.' %></p>
<p><% gettext 'One Antville installation can easily host up to several thousands
of <a href="{0}">sites</a>.' <% site.href sites %> %></p>
<p><% site.link create <% gettext "Create a site. It only takes a few clicks." %> %></p>
<p>
<% gettext "Total sites hosted here" suffix=: %> <% root.size %><br />
<% gettext "Number of public sites" suffix=: %> <% root.sites.size %>
</p>
<table border="0" cellpadding="1" cellspacing="0">
<colgroup>
<col width="150" />
<col width="*" />
</colgroup>
<% list updates 25 skin=$Site#listItem %>
</table>
<% #navigation %>
<div class="navigation">

View file

@ -186,7 +186,7 @@ referrers.push(new Antville.Referrer("<% param.referrer %>",
<tr>
<td class="small"><% gettext Paging suffix=: %></td>
<td><% site.input pageSize size="5" maxlength="2" %>
<% gettext "{0} per page" <% gettext "days" %> %></td>
<% gettext "{0} per page" <% gettext "stories" %> %></td>
<% // site.select pageMode %>
</tr>
<tr>

View file

@ -233,7 +233,6 @@ Site.prototype.getPermission = function(action) {
case "error":
case "notfound":
case "robots.txt":
case "search":
case "search.xml":
case "user.js":
return true;
@ -243,6 +242,7 @@ Site.prototype.getPermission = function(action) {
case "comments.xml":
case "rss.xml":
case "rss.xsl":
case "search":
case "stories.xml":
return Site.require(Site.PUBLIC) ||
(Site.require(Site.RESTRICTED) &&
@ -259,6 +259,7 @@ Site.prototype.getPermission = function(action) {
case "subscribe":
return Site.require(Site.PUBLIC) &&
User.require(User.REGULAR) &&
!Membership.require(Membership.SUBSCRIBER);
case "unsubscribe":
@ -914,12 +915,15 @@ Site.prototype.getDiskSpace = function(quota) {
* @param {String} href
*/
Site.prototype.processHref = function(href) {
var scheme = req.servletRequest ? req.servletRequest.scheme : "http";
var domain = getProperty("domain." + this.name);
if (domain) {
href = [scheme, "://", domain, href].join(String.EMPTY);
} else if (domain = getProperty("domain.www")) {
href = [scheme, "://", domain, "/", this.name, href].join(String.EMPTY);
if (["localhost", "127.0.0.1"].indexOf(req.data.http_host) > -1) {
var site = app.properties.hrefRootPrototype ? this.name : String.EMPTY;
return [app.appsProperties.mountPoint, "/", site, href].join(String.EMPTY);
}
var domain, scheme = req.servletRequest ? req.servletRequest.scheme : "http";
if (domain = getProperty("domain." + this.name)) {
return [scheme, "://", domain, href].join(String.EMPTY);
} else if (domain = getProperty("domain.*")) {
return [scheme, "://", this.name, ".", domain, href].join(String.EMPTY);
}
return href;
}

View file

@ -281,7 +281,7 @@ a:hover {text-decoration: underline;}
}
.dayHeader {
font-family: <% value "small font size" %>;
font-family: <% value "small font" %>;
font-size: <% value "small font size" %>;
color: <% value "small font color" %>;
font-weight: bold;

View file

@ -275,25 +275,29 @@ Skin.prototype.getFormValue = function(name) {
* @returns {String}
*/
Skin.prototype.getSource = function() {
var skinSet = app.getSkinfilesInPath(res.skinpath)[this.prototype];
if (skinSet) {
var mainSkin = skinSet[this.prototype];
if (mainSkin) {
var skin = createSkin(mainSkin).getSubskin(this.name);
if (skin) {
return skin.getSource();
}
var skin;
// FIXME: Maintain skin inheritance by checking if we target the Site skin of root
if (res.handlers.site === root && this.prototype === "Site") {
skin = this.getSubskin("Root");
if (skin) {
return skin.getSource();
}
}
return null; //String.EMPTY;
skin = this.getSubskin();
if (skin) {
return skin.getSource();
}
return null;
}
/**
*
*
* @param {String} source
*/
Skin.prototype.setSource = function(source) {
var skin = this.getMainSkin();
// FIXME: Maintain skin inheritance by checking if we target the Site skin of root
var prototype = (res.handlers.site === root && this.prototype === "Site") ? "Root" : this.prototype;
var skin = this.getMainSkin(prototype);
if (!skin) {
return;
}
@ -335,17 +339,36 @@ Skin.prototype.setSource = function(source) {
* @returns {java.io.File}
*/
Skin.prototype.getStaticFile = function() {
return new java.io.File(res.skinpath[0], this.prototype + "/" +
this.prototype + ".skin");
// FIXME: Maintain skin inheritance by checking if we target the Site skin of root
var prototype = (res.handlers.site === root && this.prototype === "Site") ? "Root" : this.prototype;
return new java.io.File(res.skinpath[0], prototype + "/" + this.prototype + ".skin");
}
/**
* @param {String} prototype
* @returns {Skin}
*/
Skin.prototype.getMainSkin = function() {
var skinSet = app.getSkinfilesInPath(res.skinpath)[this.prototype];
if (skinSet && skinSet[this.prototype]) {
return createSkin(skinSet[this.prototype]);
Skin.prototype.getMainSkin = function(prototype) {
var source, skinSet = app.getSkinfilesInPath(res.skinpath)[prototype || this.prototype];
if (skinSet) {
source = skinSet[this.prototype];
if (source !== null) {
return createSkin(source);
}
}
return null;
}
/**
*
* @param prototype
* @param name
* @returns {Skin}
*/
Skin.prototype.getSubskin = function(prototype, name) {
var mainSkin = this.getMainSkin(prototype);
if (mainSkin) {
return mainSkin.getSubskin(name || this.name);
}
return null;
}

View file

@ -169,32 +169,20 @@ Skins.prototype.getSkin = function(group, name) {
/**
*
* @param {String} type
* @returns {String}
*/
Skins.prototype.getOutline = function(type) {
var key = "outline:" + type;
var outline = this.cache[key];
if (outline) {
return outline;
}
var prototype, skin, subskins, names, skins = [];
Skins.prototype.getOutline = function() {
var skinfiles, prototype, skin, subskins, names, skins = [];
var options = Skin.getPrototypeOptions();
for each (var option in options) {
prototype = option.value;
names = [];
for (var name in app.skinfiles[prototype]) {
if (name === prototype && type !== "custom") {
skin = createSkin(app.skinfiles[prototype][name]);
subskins = skin.getSubskinNames();
for each (var subskin in subskins) {
names.push(subskin);
}
} else if (name !== prototype && type === "custom") {
names.push(name);
}
prototype = option.value;
skinfiles = app.getSkinfilesInPath(res.skinpath);
skin = createSkin(skinfiles[prototype][prototype]);
subskins = skin.getSubskinNames();
for each (var subskin in subskins) {
names.push(subskin);
}
names.sort();
skins.push([prototype, names]);
@ -221,5 +209,5 @@ Skins.prototype.getOutline = function(type) {
html.closeTag("li");
}
}
return this.cache[key] = res.pop();
return res.pop();
}

View file

@ -59,7 +59,7 @@ comments = collection(Comment)
comments.local = id
comments.foreign = site_id
comments.filter = story.id = content.story_id and story.status <> 'closed' and \
story.comment_mode <> 'disabled'
story.comment_mode <> 'disabled' and content.status <> 'deleted'
comments.filter.additionalTables = content as story
comments.order = content.modified desc
comments.maxSize = 100
@ -67,7 +67,7 @@ comments.maxSize = 100
union = collection(Story)
union.local = id
union.foreign = site_id
union.filter = status <> 'closed' and status <> 'pending'
union.filter = status <> 'closed' and status <> 'pending' and status <> 'deleted'
union.order = modified desc
union.maxSize = 100

View file

@ -2,7 +2,7 @@
<tr>
<td align="right" valign="baseline" class="small"><% param.position %></td>
<td align="right" valign="baseline"><% story.requests %></td>
<td valign="baseline"><% story.created "yyyy-MM-dd" %></td>
<td valign="baseline" style="white-space: nowrap"><% story.created "yyyy-MM-dd" %></td>
<td valign="baseline"><% story.title | default <% story.text | clip 5 %> | story.link %></td>
<td valign="baseline"><% story.creator %></td>
</tr>

View file

@ -64,7 +64,7 @@ User.getStatus = defineConstants(User, markgettext("Blocked"),
* @returns {String}
*/
User.getSalt = function() {
var salt = java.lang.reflect.Array.newInstance(java.lang.Byte.TYPE, 8);;
var salt = java.lang.reflect.Array.newInstance(java.lang.Byte.TYPE, 8);
var random = java.security.SecureRandom.getInstance("SHA1PRNG");
random.nextBytes(salt);
return Packages.sun.misc.BASE64Encoder().encode(salt);
@ -241,6 +241,22 @@ User.getLocation = function() {
return url;
}
/**
* Rename a user account.
* @param {String} currentName The current name of the user account.
* @param {String} newName The desired name of the user account.
*/
User.rename = function(currentName, newName) {
var user = User.getByName(currentName);
if (user) {
user.forEach(function() {
this.name = newName;
});
user.name = newName;
}
return;
}
/**
* A User object represents a login to Antville.
* @name User

View file

@ -50,11 +50,13 @@ cron.nightly.minute = 0
#sessionTimeout = 30
#requestTimeout = 10
## Options for rewriting URL output
## Options for rewriting URL output;
## enable the first three when mapping individual domains (see below)
#baseUri = /
#hrefSkin = $Site#href
#hrefFunction = processHref
#hrefRootPrototype = Site
#hrefSkin = $Site#href
## List of individual domain mappings
## List of default and individual domain mappings
#domain.* = antville.org
#domain.foo = bar.foo.org

View file

@ -209,8 +209,6 @@ function imageoftheday_macro(param) {
return image_macro(param);
}
var support_macro = new Function;
function renderColorAsString(c) {
return c && c.isHexColor() ? "#" + c : c;
}

View file

@ -22,7 +22,7 @@
// $URL$
//
Root.VERSION = "1.2-compatible";
Root.VERSION += "-compatible";
Root.prototype.rss_action = function() {
return res.redirect(root.href("rss.xml"));

View file

@ -57,7 +57,7 @@ Root.prototype.updater_action = function() {
}
return;
}, [], -1);
this.renderSkin("Root");
this.renderSkin("~Root");
return;
}
@ -83,7 +83,7 @@ Root.prototype.nonames_action = function() {
});
status("finished");
}, [], -1);
this.renderSkin("Root");
this.renderSkin("~Root");
return;
}
@ -105,7 +105,7 @@ Root.prototype.galleries_action = function() {
});
status("finished");
}, [], -1);
this.renderSkin("Root");
this.renderSkin("~Root");
return;
}

View file

@ -25,6 +25,8 @@
// Apply with enabled updater repository via ant patch -Dpatch.id=20100401
var sql = new Sql;
// Correct Image.contentLength property for some images
sql.retrieve("select id from image");
sql.traverse(function() {
var image = Image.getById(this.id);

View file

@ -28,6 +28,10 @@ var sql = new Sql;
var template;
// Remove MySQL-specific constraints (enum types)
// The database user needs ÒalterÓ permission for this patch:
// mysql -e "grant all on antville.* to 'antville'@'localhost'"
// Afterwards user permissions should be restored:
// mysql -e "grant select, insert, update, delete on antville.* to 'antville'@'localhost'"
if (app.getDbSource("antville").isMySQL()) {
template = "alter table $0 modify column $1 varchar(20) default null";
sql.execute(template, "account", "status");
@ -56,3 +60,10 @@ sql.execute(template, "subscriber", "Subscriber");
sql.execute(template, 'contributor', 'Contributor');
sql.execute(template, 'manager', 'Manager');
sql.execute(template, 'owner', 'Owner');
// Convert notification modes to lowercase
root.forEach(function() {
if (this.notificationMode !== null) {
this.notificationMode = this.notificationMode.toLowerCase()
}
});

View file

@ -0,0 +1,44 @@
//
// The Antville Project
// http://code.google.com/p/antville
//
// Copyright 2001-2007 by The Antville People
//
// Licensed under the Apache License, Version 2.0 (the ``License'');
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an ``AS IS'' BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
//
// $Revision$
// $LastChangedBy$
// $LastChangedDate$
// $URL$
//
// Apply with enabled updater repository via ant patch -Dpatch.id=20101209
root.forEach(function() {
var site = this;
var locale = site.locale;
// Update locales to new format
if (locale.contains("_")) {
site.locale = locale.substr(0, locale.lastIndexOf("_"));
}
// Update time zones to new format
var timeZone = site.timeZone;
switch (timeZone) {
case "CET":
site.timeZone = "Europe/Vienna";
break;
case "GMT":
site.timeZone = "Europe/London";
break;
}
});

View file

@ -26,7 +26,7 @@ msgstr ""
"Project-Id-Version: Antville-1.2-compatible\n"
"Report-Msgid-Bugs-To: mail@antville.org\n"
"POT-Creation-Date: 2010-06-05 09:16+0200\n"
"PO-Revision-Date: 2010-06-05 09:19+0100\n"
"PO-Revision-Date: 2011-01-06 18:15+0100\n"
"Last-Translator: Tobi Schäfer <interface@p3k.org>\n"
"Language-Team: \n"
"MIME-Version: 1.0\n"
@ -700,7 +700,7 @@ msgstr "Hauptseite"
#: /Users/tobi/Projects/helma/apps/antville/code/Root/Site.skin:10
#: /Users/tobi/Projects/helma/apps/antville/code/Site/Site.skin:17
msgid "Galleries"
msgstr "Gallerien"
msgstr "Galerien"
#: /Users/tobi/Projects/helma/apps/antville/code/Admin/$Admin.skin:269
#: /Users/tobi/Projects/helma/apps/antville/code/Site/$Site.skin:171
@ -1703,7 +1703,7 @@ msgstr "Website {0} wurde erfolgreich abonniert."
#: /Users/tobi/Projects/helma/apps/antville/code/Site/Site.js:629
#, java-format
msgid "Successfully unsubscribed from site {0}."
msgstr "Das Abonnement von Website {0} wurde erfolgreich storniert."
msgstr "Das Abonnement der Website {0} wurde erfolgreich storniert."
#: /Users/tobi/Projects/helma/apps/antville/code/Layout/Layout.js:151
msgid "Successfully updated the layout."

View file

@ -145,7 +145,7 @@ global.messages['de'] = {
"Free Memory": "Freier Speicher",
"Free Threads": "Freie Prozesse",
"Frontpage": "Hauptseite",
"Galleries": "Gallerien",
"Galleries": "Galerien",
"General": "Allgemein",
"Good bye, {0}! Looking forward to seeing you again!": "Auf Wiedersehen, {0}! Schauen Sie bald wieder vorbei!",
"Grace Period": "Gnadenfrist",

View file

@ -11,7 +11,7 @@ $(function() {
var zone = $(item);
var parts = zone.val().split("/");
if (parts.length > 1) {
if (parts[0].indexOf("Etc") === 0 ||
if (/* parts[0].indexOf("Etc") === 0 || */
parts[0].indexOf("SystemV") === 0) {
zone.remove();
return;
@ -68,22 +68,22 @@ jQuery.md5 = function (string) {
function FF(a,b,c,d,x,s,ac) {
a = AddUnsigned(a, AddUnsigned(AddUnsigned(F(b, c, d), x), ac));
return AddUnsigned(RotateLeft(a, s), b);
};
}
function GG(a,b,c,d,x,s,ac) {
a = AddUnsigned(a, AddUnsigned(AddUnsigned(G(b, c, d), x), ac));
return AddUnsigned(RotateLeft(a, s), b);
};
}
function HH(a,b,c,d,x,s,ac) {
a = AddUnsigned(a, AddUnsigned(AddUnsigned(H(b, c, d), x), ac));
return AddUnsigned(RotateLeft(a, s), b);
};
}
function II(a,b,c,d,x,s,ac) {
a = AddUnsigned(a, AddUnsigned(AddUnsigned(I(b, c, d), x), ac));
return AddUnsigned(RotateLeft(a, s), b);
};
}
function ConvertToWordArray(string) {
var lWordCount;
@ -106,7 +106,7 @@ jQuery.md5 = function (string) {
lWordArray[lNumberOfWords-2] = lMessageLength<<3;
lWordArray[lNumberOfWords-1] = lMessageLength>>>29;
return lWordArray;
};
}
function WordToHex(lValue) {
var WordToHexValue="",WordToHexValue_temp="",lByte,lCount;
@ -116,7 +116,7 @@ jQuery.md5 = function (string) {
WordToHexValue = WordToHexValue + WordToHexValue_temp.substr(WordToHexValue_temp.length-2,2);
}
return WordToHexValue;
};
}
function Utf8Encode(string) {
string = string.replace(/\r\n/g,"\n");
@ -142,7 +142,7 @@ jQuery.md5 = function (string) {
}
return utftext;
};
}
var x=Array();
var k,AA,BB,CC,DD,a,b,c,d;
@ -230,7 +230,7 @@ jQuery.md5 = function (string) {
}
var temp = WordToHex(a)+WordToHex(b)+WordToHex(c)+WordToHex(d);
return temp.toLowerCase();
};
}
Antville = {};
Antville.prefix = "Antville_";
@ -243,11 +243,11 @@ Antville.encode = function(str) {
str = str.replace(re, "&#" + c.charCodeAt() + ";");
}
return str;
};
}
Antville.decode = function(str) {
return str.replace(/&amp;/g, "&");
};
}
Antville.Referrer = function(url, text, count) {
this.url = url;
@ -263,7 +263,7 @@ Antville.Referrer = function(url, text, count) {
return this.text;
}
return this;
};
}
Antville.Query = function(str) {
if (str == undefined)
@ -285,7 +285,7 @@ Antville.Query = function(str) {
}
}
return this;
};
}
Antville.Filter = function(def, key) {
this.key = key;
@ -307,20 +307,4 @@ Antville.Filter = function(def, key) {
return false;
}
return this;
};
var app = {
clearCache: function() {
$.ajax({
async: true,
type: "POST",
url: '/helma/antville/debug',
data: "action=clearCache",
cache: false,
error: function() { /* ... */ },
success: function(str) {
console.log(str);
}
});
}
}