3 # Copyright 2012 Paul Hänsch
4 # This file is part of Busy
6 # Busy is free software: you can redistribute it and/or modify
7 # it under the terms of the GNU Affero General Public License as published by
8 # the Free Software Foundation, either version 3 of the License, or
9 # (at your option) any later version.
11 # Busy is distributed in the hope that it will be useful,
12 # but WITHOUT ANY WARRANTY; without even the implied warranty of
13 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 # GNU Affero General Public License for more details.
16 # You should have received a copy of the GNU Affero General Public License
17 # along with Busy. If not, see <http://www.gnu.org/licenses/>.
19 metafile="../project.meta"
21 [ "$HTTPS" = "on" ] && proto=https || proto=http
22 . ../auth/permissions.sh
23 $ACL_ADMIN || echo "Location: ${proto}://${HTTP_HOST}/?p=Error&i=noaccess\n\n"
26 if [ -n "${CONTENT_LENGTH}" -a "${CONTENT_LENGTH}" -gt 0 ]; then
27 (head -c "${CONTENT_LENGTH}"; echo)|sed 's/&/\n/g' \
28 |sed -rn '/^((appName|appSlogan|svnRepo|gitRepo|flattrThingURL|paypalAddress|btcAddress|btcAdAddress)=.*|repoType=(svn|git)|(useFlattr|usePaypal|useBitcoin|btcAdGamble|btcAdErotic)=yes|advertise=(btcAd|no))$/{
29 s:\+: :g;s:%:\\x:g;p}' \
30 |while line="$(line)"; do
31 eval "$(echo -e "$line" |sed -r 's:[\n\r'\'']::g;s:^([a-zA-Z0-9_+-]+)=(.*)$:\1='"'\2'"':;')"
35 [ "$btcAdGamble" = yes -a "$btcAdErotic" = yes ] && btcAdContent=1
36 [ "$btcAdGamble" != yes -a "$btcAdErotic" = yes ] && btcAdContent=2
37 [ "$btcAdGamble" = yes -a "$btcAdErotic" != yes ] && btcAdContent=3
38 [ "$btcAdGamble" != yes -a "$btcAdErotic" != yes ] && btcAdContent=4
47 flattrThingURL=$flattrThingURL
49 paypalAddress=$paypalAddress
50 useBitcoin=$useBitcoin
51 btcAddress=$btcAddress
53 btcAdAddress=$btcAdAddress
54 btcAdContent=$btcAdContent
57 echo -n "Location: ${proto}://${HTTP_HOST}/?p=Admin\n\n"