X-Git-Url: https://git.plutz.net/?a=blobdiff_plain;f=handlers%2F60_move_rename_delete.sh;h=d27fb3937c103f564e30bd6e0e1e05a874b9a512;hb=4f6786c2be70200b3ff43db68d0f536fcaedad3f;hp=33f79d00270f381636c1f110765de79f6277444d;hpb=2ad6da3df5555069e13d2c5c6f39b5d3a4d8071d;p=shellwiki diff --git a/handlers/60_move_rename_delete.sh b/handlers/60_move_rename_delete.sh index 33f79d0..d27fb39 100755 --- a/handlers/60_move_rename_delete.sh +++ b/handlers/60_move_rename_delete.sh @@ -1,5 +1,19 @@ #!/bin/sh +# Copyright 2022 - 2023 Paul Hänsch +# +# Permission to use, copy, modify, and/or distribute this software for any +# purpose with or without fee is hereby granted, provided that the above +# copyright notice and this permission notice appear in all copies. +# +# THE SOFTWARE IS PROVIDED “AS IS” AND THE AUTHOR DISCLAIMS ALL WARRANTIES +# WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF +# MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY +# SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES +# WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN +# ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR +# IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. + l10n_immutablepage >/dev/null 2>&1 \ || l10n_immutablepage(){ #TRANSLATION cat <<-EOF @@ -124,7 +138,7 @@ if [ "$action" = rename -a "$newname" ]; then if [ -d "$_DATA/pages/$newname" ]; then printf 'Refresh: %i\r\n' 4 - export ERRORMSG="A location of that name already exists." + export ERROR_MSG="A location of that name already exists." theme_error 400 return 0 elif ! acl_write "$oldname" || ! acl_write "$newname"; then @@ -148,12 +162,12 @@ elif [ "$action" = move -a "$newlocation" ]; then if [ -d "$_DATA/pages/$newname" ]; then printf 'Refresh: %i\r\n' 4 - export ERRORMSG="A page of that name already exists at the given location." + export ERROR_MSG="A page of that name already exists at the given location." theme_error 400 return 0 elif [ ! -d "$_DATA/pages/$newlocation" ]; then printf 'Refresh: %i\r\n' 4 - export ERRORMSG="The given location does not exist." + export ERROR_MSG="The given location does not exist." theme_error 400 return 0 elif ! acl_write "$oldname" || ! acl_write "$newname"; then @@ -192,7 +206,7 @@ elif [ "$action" = cancel ]; then REDIRECT ./ elif [ "$action" ]; then printf 'Refresh: %i\r\n' 4 - export ERRORMSG="Missing parameters." + export ERROR_MSG="Missing parameters." theme_error 400 return 0 fi