X-Git-Url: http://git.plutz.net/?a=blobdiff_plain;f=write%2Fwikimeta.cgi;h=af72eab5300b92882c250606863b4c0dc2ace3a3;hb=904730d1782749bfac15b0344fe5782433f3099b;hp=fe234aee772299a229bdde77c35fd2d122a33558;hpb=7799a762ca2dfbd022f7f8425fc207c8211e3ef7;p=busy diff --git a/write/wikimeta.cgi b/write/wikimeta.cgi index fe234ae..af72eab 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/permissions.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