#!/bin/zsh # Copyright 2011 Paul Haensch # 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 . umask=002 alias _wiki="stx2any --no-template --link-abbrevs --quote -T html" . auth/permissions.sh page=$(egrep -o '(^|&)p=[a-zA-Z0-9/_-]+(&|$)' <<<"${QUERY_STRING}" |sed 's,&,,g;s,p=,,') [ -z "$LOGIN" ] && LOGIN=false [ -z "$page" ] && page=Home if (! $LOGIN && egrep -qx "https?://${HTTP_HOST}/(session.cgi\?|write/).*" <<<"${HTTP_REFERER}"); then echo -n "Location: https://${HTTP_HOST}/session.cgi?${QUERY_STRING}\n\n" exit 0 fi echo -n "Content-type: text/html\n\n" cat < $(sed -rn 's:^name=(.*)$:\1:p' project.meta) - Busy $([ -r "${page}.css" ] && echo '')

$(egrep '^name=.*$' project.meta |cut -d= -f2-)

$(egrep '^slogan=.*$' project.meta |cut -d= -f2-)
$( $LOGIN || echo '
Login:


') $( $LOGIN && echo "You are loggeed in as ${REMOTE_USER}
") $( $LOGIN && $ACL_ADMIN && echo 'Admin
') $( $LOGIN && echo 'My Settings
')
$(btcAddress="$(sed -rn 's:^btcAddress=(.*)$:\1:p' project.meta)" flattrThingURL=$(sed -rn 's:^flattrThingURL=(.*)$:\1:p' project.meta) grep -q 'useBitcoin=yes' project.meta && [ \! -f "QRcodes/bitcoin:${btcAddress}.png" ] &&\ qrencode -o "QRcodes/bitcoin:${btcAddress}.png" "bitcoin:$btcAddress" grep -q 'useBitcoin=yes' project.meta && echo ' ' grep -q 'useFlattr=yes' project.meta && echo ' ')
$(if [ -r "./${page}.page" ]; then . "./${page}.page" else echo '

Page not found or nevermore

' echo 'Quoth the Raven: 404' fi ) END_index.cgi