]> git.plutz.net Git - serve0/blob - actions/preferences.sh
introduced player preferences
[serve0] / actions / preferences.sh
1 #!/bin/zsh
2
3 cgi_post
4 cgi_cookie
5
6 fakemp4="$(printf %s "${_POST[fakemp4]}" |sed -rn '/^yes$/{p;q};ano' )"
7 watch="$(printf %s   "${_POST[watch]}"   |sed -rn '/^(240p|480p|download|raspi|player)$/{p;q};aplayer' )"
8
9 debug '== Setting Preferences =='
10 debug "fakemp4 = $fakemp4"
11 debug "watch   = $watch"
12
13 set_cookie '+ 1 month' "fakemp4=${fakemp4}" HttpOnly
14 set_cookie '+ 1 month' "watch=${watch}" HttpOnly
15
16 redirect "$HTTP_REFERER"