]> git.plutz.net Git - serve0/commitdiff
submit page locators via post instead of relying on referrer
authorpaul <paul@plutz.net>
Wed, 25 May 2016 11:01:11 +0000 (11:01 +0000)
committerpaul <paul@plutz.net>
Wed, 25 May 2016 11:01:11 +0000 (11:01 +0000)
svn path=/trunk/; revision=133

actions/multitag.sh
actions/watch.sh
pages/list.sh
static/common.css
templates/list.html.sh

index 767f289e85665df68b91d7c5e781ffb72049939a..91a787b4a896130d17b414625dd4631d7bbfe995 100755 (executable)
 # You should have received a copy of the GNU Affero General Public License
 # along with Serve0  If not, see <http://www.gnu.org/licenses/>.
 
-filter="${_GET[f]}"
-search="${_GET[s]}"
-order=$(validate "${_GET[o]}" 'Name|Date|Length' Name)
-page=$(validate "${_GET[pn]}" '[0-9]+' 1)
+filter="${_POST[f]}"
+search="${_POST[s]}"
+order=$(validate "${_POST[o]}" 'Name|Date|Length' Name)
+page=$(validate "${_POST[pn]}" '[0-9]+' 1)
 
 addtag(){
   meta="$1"
index 01de7d57555739c2bae3a6035cd68dda458a7408..60d29db336b26b9649b5078bf7a0a3aa81474ada 100755 (executable)
@@ -3,10 +3,10 @@
 cgi_refdata
 info="${_GET[i]}"
 location="$(invalidate "${_GET[l]}" '(.*/)?\.\.(/.*)?|' /)"
-order="${_REF[o]}"
-search="${_REF[s]}"
-filter="${_REF[f]}"
-page="${_REF[pn]}"
+order="${_POST[o]}"
+search="${_POST[s]}"
+filter="${_POST[f]}"
+page="${_POST[pn]}"
 
 watch_link=''
 [ -n "$location" ] && watch_link="l=$(urlsafe "${location}")&"
@@ -71,18 +71,20 @@ case "${_COOKIE[watch]}" in
       "${_EXEC}"/helpers/genmeta.sh "$playuri" "$playmeta" >/dev/null
     fi
 
-    DISPLAY=:0 XDG_RUNTIME_DIR=/run/user/1006 \
-      nohup /usr/bin/mplayer -ao pulse \
+    export DISPLAY=":0"
+    uid="$(id |sed -rn '1s;.*uid=([0-9]+)[^0-9].*;1;p')"
+    export XDG_RUNTIME_DIR="/run/user/$uid"  # required for Pulseaudio
+
+    nohup /usr/bin/mplayer -ao pulse \
       -slave -input file="$fifofile" \
       -volume "$volume" \
       "$playuri" >"$statusfile" 2>/dev/null &
 
     # # MPlayer2:
-    # DISPLAY=:0 XDG_RUNTIME_DIR=/run/user/1006 \
-    #   nohup /usr/bin/mplayer -ao pulse --quiet \
+    # nohup /usr/bin/mplayer -ao pulse \
     #   --slave --input=file="$fifofile" \
     #   --volume="$volume" \
-    #   "$playuri" >/dev/null 2>/dev/null &
+    #   "$playuri" >"$statusfile" 2>/dev/null &
 
     redirect "?p=playctl&${watch_link}"
   ;;
index 0ee2282bb32eece0369c3ad68e681c85c4c92702..7b68f29098e9463ca90edc50875a4d589e2a0724 100755 (executable)
@@ -78,9 +78,9 @@ _printVideo(){
 
     tee "$cache" <<VIDEOend
       <li class="thumb">
-        <a class="watchlink" name="${linkinfo}" href="?action=watch&i=${linkinfo}">
+        <button class="watchlink" name="${linkinfo}" formaction="?action=watch&i=${linkinfo}">
           <img src="$thumb" alt="Preview not yet available">
-        </a>
+        </button>
         <h2>${htmlinfo}</h2>
         
         <input type="checkbox" name="tagsel" value="${htmlinfo}">
index 9b32b52cdccfa7759de017e8656e4b2d4b2ea57e..f0912f873ad63c3d3be5164d6fd24dcaece567ed 100644 (file)
@@ -292,18 +292,20 @@ p.quicklinks input:checked + a { display: none;}
 
 #thumblist .thumb img {
   width: 100%;
+  margin: 0; padding: 0;
 }
 #thumblist .thumb h2 {
   font-size: 1em;
   font-weight: normal;
   margin: 0;
 }
-#thumblist .thumb a {
+#thumblist .thumb button {
   display: block;
-}
-#thumblist .thumb a.alt {
-  display: inline-block;
-  margin-top: .3em;
+  width: 100%;
+  margin: 0; padding: 0;
+  border: none;
+  line-height: 0;
+  background-color: transparent;
 }
 #thumblist input {
   margin: .75em .5em;
index 0d6d65409300e88e91c8352a55adb70ea1304af5..b5b1ef6800535b27135a2229bac23e11eb13a013 100755 (executable)
@@ -56,7 +56,12 @@ cat <<EOF
     </div>
   </form>
 
-  <form action="?action=multitag&${page_this}" method="post" accept-charset="UTF-8">
+  <form action="?action=multitag" method="post" accept-charset="UTF-8">
+    <input type="hidden" name="o" value="${order}">
+    <input type="hidden" name="s" value="${search}">
+    <input type="hidden" name="f" value="${filter}">
+    <input type="hidden" name="pn" value="${page}">
+
     <ul id="thumblist">
 EOF