]> git.plutz.net Git - busy/blobdiff - actions/projectmeta.sh
porting busy to confetti framework
[busy] / actions / projectmeta.sh
diff --git a/actions/projectmeta.sh b/actions/projectmeta.sh
new file mode 100755 (executable)
index 0000000..ac7e454
--- /dev/null
@@ -0,0 +1,48 @@
+#!/bin/zsh
+
+# Copyright 2012 Paul Hänsch
+# This file is part of Busy
+#
+# Busy is free software: you can redistribute it and/or modify
+# it under the terms of the GNU Affero General Public License as published by
+# the Free Software Foundation, either version 3 of the License, or
+# (at your option) any later version.
+#
+# Busy is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+# GNU Affero General Public License for more details.
+#
+# You should have received a copy of the GNU Affero General Public License
+# along with Busy.  If not, see <http://www.gnu.org/licenses/>.
+
+metafile="$_DATA/project.meta"
+
+$ACL_ADMIN || echo "Location: //${HTTP_HOST}/?p=Error&i=noaccess\n\n"
+$ACL_ADMIN || exit 0 
+
+cgi_post
+
+[ "$_POST[\"btcAdGamble\"]"  = yes -a "$_POST[\"btcAdErotic\"]" = yes ] && btcAdContent=1
+[ "$_POST[\"btcAdGamble\"]" != yes -a "$_POST[\"btcAdErotic\"]" = yes ] && btcAdContent=2
+[ "$_POST[\"btcAdGamble\"]"  = yes -a "$_POST[\"btcAdErotic\"]" != yes ] && btcAdContent=3
+[ "$_POST[\"btcAdGamble\"]" != yes -a "$_POST[\"btcAdErotic\"]" != yes ] && btcAdContent=4
+
+echo -E "\
+name=$_POST[\"appName\"]
+slogan=$_POST[\"appSlogan\"]
+repoType=$(echo -E "$_POST[\"repoType\"]" |grep -Ex 'svn|git')
+svnRepo=$_POST[\"svnRepo\"]
+gitRepo=$_POST[\"gitRepo\"]
+useFlattr=$(echo -E "$_POST[\"useFlattr\"]" |grep -Ex 'yes')
+flattrThingURL=$_POST[\"flattrThingURL\"]
+usePaypal=$(echo -E "$_POST[\"usePaypal\"]" |grep -Ex 'yes')
+paypalAddress=$_POST[\"paypalAddress\"]
+useBitcoin=$(echo -E "$_POST[\"useBitcoin\"]" |grep -Ex 'yes')
+btcAddress=$_POST[\"btcAddress\"]
+advertise=$(echo -E "$_POST[\"advertise\"]" |grep -Ex 'btcAd|no')
+btcAdAddress=$_POST[\"btcAdAddress\"]
+btcAdContent=$btcAdContent
+" >"$metafile"
+
+echo -n "Location: ${HTTP_REFERER}\n\n"