X-Git-Url: http://git.plutz.net/?a=blobdiff_plain;f=write%2Fprojectmeta.cgi;fp=write%2Fprojectmeta.cgi;h=7f95dfd609a9288c07c0994120c2eea66d0caa74;hb=ec6bd59a03d7106ca41605b9477b05c34265f348;hp=0000000000000000000000000000000000000000;hpb=df48ee8dcf49374dca18f0807a636358cef9877a;p=busy diff --git a/write/projectmeta.cgi b/write/projectmeta.cgi new file mode 100755 index 0000000..7f95dfd --- /dev/null +++ b/write/projectmeta.cgi @@ -0,0 +1,49 @@ +#!/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 . + +metafile="../project.meta" + +[ "$HTTPS" = "on" ] && proto=https || proto=http +. ../auth/permissions.sh +$ACL_ADMIN || echo "Location: ${proto}://${HTTP_HOST}/?p=Error&i=noaccess\n\n" +$ACL_ADMIN || exit 0 + +if [ -n "${CONTENT_LENGTH}" -a "${CONTENT_LENGTH}" -gt 0 ]; then +(head -c "${CONTENT_LENGTH}"; echo)|sed 's/&/\n/g' \ + |sed -rn '/^((appName|appSlogan|svnRepo|gitRepo|flattrThingURL|paypalAddress|btcAddress)=.*|repoType=(svn|git)|(useFlattr|usePaypal|useBitcoin)=yes)$/{ + s:\+: :g;s:%:\\x:g;s:^([a-zA-Z0-9_+-]+)=(.*)$:\1='"'\2'"':;p}' \ + |while line="$(line)"; do + eval "$(echo -e "$line" |tr -d '\n\r')" + done +fi + +echo "\ +name=$appName +slogan=$appSlogan +repoType=$repoType +svnRepo=$svnRepo +gitRepo=$gitRepo +useFlattr=$useFlattr +flattrThingURL=$flattrThingURL +usePaypal=$usePaypal +paypalAddress=$paypalAddress +useBitcoin=$useBitcoin +btcAddress=$btcAddress +" >"$metafile" + +echo -n "Location: ${proto}://${HTTP_HOST}/?p=Admin\n\n"