From: paul Date: Wed, 8 Feb 2017 14:09:26 +0000 (+0000) Subject: send reference to return page for various actions X-Git-Url: https://git.plutz.net/?a=commitdiff_plain;h=9554fea689ec1519a572888aae9dc37ae140cd57;p=serve0 send reference to return page for various actions svn path=/trunk/; revision=174 --- diff --git a/actions/multitag.sh b/actions/multitag.sh index 91a787b..3c9848e 100755 --- a/actions/multitag.sh +++ b/actions/multitag.sh @@ -64,4 +64,5 @@ done rm "${_DATA}"/cache/\?* 2>/dev/null [ -n "${_POST[tags]}" ] && rm "${_DATA}"/cache/taglist_set "${_DATA}"/cache/taglist_filter 2>/dev/null -redirect "?o=$order&s=$search&f=$filter&pn=$page" +#redirect "?o=$order&s=$search&f=$filter&pn=$page" +redirect "${_POST[page]}" diff --git a/actions/watch.sh b/actions/watch.sh index b7fad86..546654c 100755 --- a/actions/watch.sh +++ b/actions/watch.sh @@ -9,13 +9,9 @@ search="${_POST[s]}" filter="${_POST[f]}" page="${_POST[pn]}" -watch_link='' +watch_link="${_POST[page]}&" [ -n "$location" ] && watch_link="l=$(urlsafe "${location}")&" [ -n "$info" ] && watch_link="i=$(urlsafe "${info}")&" -[ -n "$order" ] && watch_link="${watch_link}o=${order}&" -[ -n "$search" ] && watch_link="${watch_link}s=${search}&" -[ -n "$filter" ] && watch_link="${watch_link}f=${filter}&" -[ -n "$page" ] && watch_link="${watch_link}pn=${page}" meta="${_DATA}/meta/$info.meta" head -n1 "$meta" |read length width height filename @@ -31,6 +27,7 @@ if [ "${_COOKIE[fakemp4]}" = yes ] && [ "${info##*.}" != mp4 ]; then elif [ -n "$foreign" ]; then _COOKIE[watch]=server videourl="${_GET[url]}" + watch_link="${_POST[return]}" elif [ -z "$info" ]; then videourl="$(urlsafe "${location#/}")" else @@ -39,8 +36,8 @@ fi case "$_COOKIE[watch]" in raspi) - rpiaddr="http://atoemchen.helmchyn.no-ip.biz/?action=watch&url=" - redirect "${rpiaddr}$(urlsafe "http://${HTTP_HOST}/${videourl}")" + rpiaddr="http://atoemchen.helmchyn.no-ip.biz/?action=watch" + redirect "${rpiaddr}&url=$(urlsafe "http://${HTTP_HOST}/${videourl}")&return=$(urlsafe "http://${HTTP_HOST}/?${_POST[page]}")" ;; 480p) [ $height -gt 480 ] && redirect "?action=transcode&i=${linkinfo}&t=480" \ diff --git a/pages/browse.sh b/pages/browse.sh index adde4d8..eba470b 100755 --- a/pages/browse.sh +++ b/pages/browse.sh @@ -17,15 +17,15 @@ # You should have received a copy of the GNU Affero General Public License # along with Serve0. If not, see . +directory="$(invalidate "${_GET[d]}" '(.*/)?\.\.(/.*)?|' /)" +page_link="p=browse&d=$(urlsafe "$directory")&" + . $_EXEC/pages/common.sh -directory="$(invalidate "${_GET[d]}" '(.*/)?\.\.(/.*)?|' /)" [ -d "${treeroot%/}${directory%/}/.index" ] && indexed=true || indexed=false filters="${_GET[f]}" debug "FILTERS: $filters" -page_link="p=browse&d=$(urlsafe "$directory")&${page_link}" - present_filter(){ printf %s\\n "$*" \ | sed -r 's;(^|!|\^|\|)([^!\^\|:]+:);\1;g;s;\^;\n;g' \ diff --git a/pages/common.sh b/pages/common.sh index ba4cf27..7532055 100755 --- a/pages/common.sh +++ b/pages/common.sh @@ -24,8 +24,8 @@ page="${_GET[pn]}" #validated pagesize="${_COOKIE[pagesize]}" #validated pagecount=0 -page_link='' -[ -n "$info" ] && page_link="i=$(urlsafe "$info")&" +#page_link='' +[ -n "$info" ] && page_link="${page_link}i=$(urlsafe "$info")&" [ -n "$order" ] && page_link="${page_link}o=${order}&" [ -n "$search" ] && page_link="${page_link}s=${search}&" [ -n "$filter" ] && page_link="${page_link}f=${filter}&" diff --git a/pages/list.sh b/pages/list.sh index 37f764e..757d541 100755 --- a/pages/list.sh +++ b/pages/list.sh @@ -1,6 +1,6 @@ #!/bin/zsh -# Copyright 2014 - 2016 Paul Hänsch +# Copyright 2014 - 2017 Paul Hänsch # # This file is part of Serve0. # @@ -17,6 +17,8 @@ # You should have received a copy of the GNU Affero General Public License # along with Serve0. If not, see . +page_link="p=list&" + . $_EXEC/pages/common.sh LF=' diff --git a/templates/browse.html.sh b/templates/browse.html.sh index ff1944e..eae9ce9 100755 --- a/templates/browse.html.sh +++ b/templates/browse.html.sh @@ -47,6 +47,7 @@ cat <
+ diff --git a/templates/list.html.sh b/templates/list.html.sh index ed41b3a..28ce6c5 100755 --- a/templates/list.html.sh +++ b/templates/list.html.sh @@ -47,6 +47,7 @@ cat < +