Finally introduced Helma’s uploadSoftfail property to Antville – see http://groups.google.com/group/helma/msg/4455deb2e24e5d8a

This commit is contained in:
Tobi Schäfer 2011-02-23 18:21:43 +00:00
parent 8a2e33329b
commit 4a9017e251
3 changed files with 20 additions and 7 deletions

View file

@ -20,8 +20,8 @@
# limitations under the License. # limitations under the License.
# #
# $Revision$ # $Revision$
# $LastChangedBy$ # $Author$
# $LastChangedDate$ # $Date$
# $URL$ # $URL$
# #
@ -37,4 +37,5 @@ antville.repository.1 = ./apps/antville/db/h2.compat
antville.mountpoint = / antville.mountpoint = /
antville.static = ./apps/antville/static antville.static = ./apps/antville/static
antville.staticMountpoint = /static antville.staticMountpoint = /static
antville.uploadLimit = 10240 antville.uploadLimit = 10000
antville.uploadSoftfail = true

View file

@ -19,8 +19,8 @@
// limitations under the License. // limitations under the License.
// //
// $Revision$ // $Revision$
// $LastChangedBy$ // $Author$
// $LastChangedDate$ // $Date$
// $URL$ // $URL$
/** /**
@ -60,6 +60,12 @@ Files.prototype.getPermission = function(action) {
} }
Files.prototype.create_action = function() { Files.prototype.create_action = function() {
if (req.data.helma_upload_error) {
res.message = gettext("Sorry, the file exceeds the maximum upload limit of {0} kB.",
formatNumber(app.appsProperties.uploadLimit));
res.redirect(this.href(req.action));
}
if (this._parent.getDiskSpace() < 0) { if (this._parent.getDiskSpace() < 0) {
res.message = gettext("Sorry, there is no disk space left. Please try to delete some files or images first."); res.message = gettext("Sorry, there is no disk space left. Please try to delete some files or images first.");
res.redirect(this.href()); res.redirect(this.href());

View file

@ -19,8 +19,8 @@
// limitations under the License. // limitations under the License.
// //
// $Revision$ // $Revision$
// $LastChangedBy$ // $Author$
// $LastChangedDate$ // $Date$
// $URL$ // $URL$
/** /**
@ -91,6 +91,12 @@ Images.prototype.main_action = function() {
} }
Images.prototype.create_action = function() { Images.prototype.create_action = function() {
if (req.data.helma_upload_error) {
res.message = gettext("Sorry, the file exceeds the maximum upload limit of {0} kB.",
formatNumber(app.appsProperties.uploadLimit));
res.redirect(this.href(req.action));
}
if (res.handlers.site.getDiskSpace() < 0) { if (res.handlers.site.getDiskSpace() < 0) {
res.message = gettext("Sorry, there is no disk space left. Please try to delete some files or images first."); res.message = gettext("Sorry, there is no disk space left. Please try to delete some files or images first.");
res.redirect(this.href()); res.redirect(this.href());