# END EDIT SCRIPT, continue in index.cgi
elif [ "$edit_action" = update ]; then
- mkdir -p -- "${edit_file%/#page.md}"
-
- if S_LOCK "$edit_file"; then
+ if mkdir -p -- "${edit_file%/#page.md}" \
+ && S_LOCK "$edit_file"; then
POST pagetext >"$edit_file"
S_RELEASE "$edit_file"
REDIRECT "${_BASE}${PATH_INFO%\[edit\]}"
S_RELEASE "$edit_file"
REDIRECT "${_BASE}${PATH_INFO%\[edit\]}"
-elif mkdir -p -- "${edit_file%/#page.md}" && S_LOCK "$edit_file"; then
- # Display editor page
- SESSION_COOKIE
+elif ! acl_write "$edit_page"; then
+ theme_403
+
+elif mkdir -p -- "${edit_file%/#page.md}" \
+ && S_LOCK "$edit_file"; then
theme_editor "$edit_page"
else
- export ERRMSG="ERR_NOLOCK"
- theme_page "$edit_page"
+ printf 'Refresh: %i; url=%s\r\n' 4 ../
+ export ERROR_MSG="Unable to lock page for editing"
+ theme_409
fi