]> git.plutz.net Git - busy/blob - actions/projectmeta.sh
9ee642f3f34a1c5e592d53ce95fac77a72a90582
[busy] / actions / projectmeta.sh
1 #!/bin/zsh
2
3 # Copyright 2012 Paul Hänsch
4 # This file is part of Busy
5 #
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.
10 #
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.
15 #
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/>.
18
19 metafile="$_DATA/project.meta"
20
21 $ACL_ADMIN || echo "Location: ?p=Error&i=noaccess\n\n"
22 $ACL_ADMIN || exit 0 
23
24 cgi_post
25
26 [ "$_POST[\"btcAdGamble\"]"  = yes -a "$_POST[\"btcAdErotic\"]" = yes ] && btcAdContent=1
27 [ "$_POST[\"btcAdGamble\"]" != yes -a "$_POST[\"btcAdErotic\"]" = yes ] && btcAdContent=2
28 [ "$_POST[\"btcAdGamble\"]"  = yes -a "$_POST[\"btcAdErotic\"]" != yes ] && btcAdContent=3
29 [ "$_POST[\"btcAdGamble\"]" != yes -a "$_POST[\"btcAdErotic\"]" != yes ] && btcAdContent=4
30
31 echo -E "\
32 name=$_POST[\"appName\"]
33 slogan=$_POST[\"appSlogan\"]
34 repoType=$(echo -E "$_POST[\"repoType\"]" |grep -Ex 'svn|git')
35 svnRepo=$_POST[\"svnRepo\"]
36 gitRepo=$_POST[\"gitRepo\"]
37 useFlattr=$(echo -E "$_POST[\"useFlattr\"]" |grep -Ex 'yes')
38 flattrThingURL=$_POST[\"flattrThingURL\"]
39 usePaypal=$(echo -E "$_POST[\"usePaypal\"]" |grep -Ex 'yes')
40 paypalAddress=$_POST[\"paypalAddress\"]
41 useBitcoin=$(echo -E "$_POST[\"useBitcoin\"]" |grep -Ex 'yes')
42 btcAddress=$_POST[\"btcAddress\"]
43 advertise=$(echo -E "$_POST[\"advertise\"]" |grep -Ex 'btcAd|no')
44 btcAdAddress=$_POST[\"btcAdAddress\"]
45 btcAdContent=$btcAdContent
46 " >"$metafile"
47
48 echo -n "Location: ${HTTP_REFERER}\n\n"