X-Git-Url: http://git.plutz.net/?p=busy;a=blobdiff_plain;f=write%2Fwikimeta.cgi;h=e032d910d28eeff2edfffbab042c0de92a008e49;hp=fe234aee772299a229bdde77c35fd2d122a33558;hb=470dbac80eb2334fdb04a85e448d6194140d250d;hpb=7d60f1ac8a996344f14edfcf751d965818df43d7 diff --git a/write/wikimeta.cgi b/write/wikimeta.cgi index fe234ae..e032d91 100755 --- a/write/wikimeta.cgi +++ b/write/wikimeta.cgi @@ -15,6 +15,12 @@ # You should have received a copy of the GNU Affero General Public License # along with Busy. If not, see . +[ "$HTTPS" = "on" ] && proto=https || proto=http +. ../auth/acl.sh +env >../debug +$ACL_WIKIEDIT || echo "Location: ${proto}://${HTTP_HOST}/?p=Error&i=noaccess\n\n" +$ACL_WIKIEDIT || exit 0 + info="$(egrep -o '(^|&)i=[0-9]{10}_[0-9]{3}(&|$)' <<<"${QUERY_STRING}" |tr -d '&i=')" [ -z "$info" ] && info="$(date +%s)_$(apg -M N -a 1 -n 1 -m 3 -x 3)" @@ -45,12 +51,12 @@ if [ -z "$cancel" -a -n "$comment" ]; then touch "../Wiki/$info" echo -e "author=${REMOTE_USER}" > "$commfile" echo -e "${comment}" >> "$commfile" - echo -n "Location: https://${HTTP_HOST}/?p=Wiki&i=$info\n\n" + echo -n "Location: ${proto}://${HTTP_HOST}/?p=Wiki&i=$info\n\n" elif [ -z "$cancel" -a -n "$description" ]; then touch "../Wiki/$info" echo -e "title=${title}" > "$descfile" echo -e "description=${description}" >> "$descfile" - echo -n "Location: https://${HTTP_HOST}/?p=Wiki#$anchor\n\n" + echo -n "Location: ${proto}://${HTTP_HOST}/?p=Wiki#$anchor\n\n" elif [ -n "$cancel" ]; then - echo -n "Location: https://${HTTP_HOST}/?p=Wiki#$anchor\n\n" + echo -n "Location: ${proto}://${HTTP_HOST}/?p=Wiki#$anchor\n\n" fi