]> git.plutz.net Git - busy/blobdiff - index.cgi
upgraded to fit new shcgi revision, slightly better input validation, switched to...
[busy] / index.cgi
deleted file mode 100755 (executable)
index 482a747467827e34bf9fdf667bd5abab27866bbf..0000000000000000000000000000000000000000
--- a/index.cgi
+++ /dev/null
@@ -1,112 +0,0 @@
-#!/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 <http://www.gnu.org/licenses/>.
-
-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 <<END_index.cgi
-<!DOCTYPE HTML>
-<!-- DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd" -->
-
-<html>
-  <head>
-    <title>$(sed -rn 's:^name=(.*)$:\1:p' project.meta) - Busy</title>
-    <meta http-equiv="Content-Type" content="text/html;charset=utf-8">
-    <link rel="stylesheet" type="text/css" href="busy.css">
-    <link rel="stylesheet" type="text/css" href="wikitext.css">
-    $([ -r "${page}.css" ] && echo '<link rel="stylesheet" type="text/css" href="'"$page"'.css">')
-    <style type="text/css"><!-- --></style>
-
-    <script type="text/javascript">
-    <!--
-      function show_screen(id){
-        document.getElementById(id).style.display = "inline";
-      }
-      function hide_screen(id){
-        document.getElementById(id).style.display = "none";
-      }
-    -->
-    </script>
-    
-    <!-- Script for Flattr Button -->
-    <script type="text/javascript">
-    /* <![CDATA[ */
-        (function() {
-            var s = document.createElement('script'), t = document.getElementsByTagName('script')[0];
-            s.type = 'text/javascript';
-            s.async = true;
-            s.src = 'http://api.flattr.com/js/0.6/load.js?mode=auto';
-            t.parentNode.insertBefore(s, t);
-        })();
-    /* ]]> */</script>
-
-  </head>
-  <body onload="init();">
-    <div id="TITLE">
-      <h1 id="NAME">$(egrep '^name=.*$' project.meta |cut -d= -f2-)</h1>
-      <span id="SLOGAN">$(egrep '^slogan=.*$' project.meta |cut -d= -f2-)</span>
-    </div>
-    <div id="USERMENU">
-$( $LOGIN || echo '<form action="https://'${HTTP_HOST}'/login.cgi?'${QUERY_STRING:gs/&/&amp;/}'" method="post" accept-charset="UTF-8">
-                    Login:<br>
-                    <input type="text" name="user" value placeholder="Username"><br>
-                    <input type="password" name="pass" value placeholder="Password"><br>
-                    <input type="submit" value="Go!">
-                  </form>')
-$( $LOGIN && echo "You are loggeed in as <b>${REMOTE_USER}</b><br>")
-$( $LOGIN && $ACL_ADMIN && echo '<a href="?p=Admin">Admin</a><br>')
-$( $LOGIN && echo '<a href="?p=Settings">My Settings</a><br>')
-    </div>
-    <div id="ACCOUNTING">
-      $(grep -q 'useFlattr=yes' project.meta && echo '
-       <a class="FlattrButton" style="display:none;" href="http://'${HTTP_HOST}'"></a>
-       <noscript> <a href="'$(sed -rn 's:^flattrThingURL=(.*)$:\1:p' project.meta)'" target="_blank">
-         <img src="http://api.flattr.com/button/flattr-badge-large.png" alt="Flattr this" title="Flattr this" border="0" />
-        </a></noscript>
-      ')
-    </div>
-    <div id="MENU">
-      <a href='/?p=Home'>Home</a>
-      <a href='/?p=Wiki'>Wiki</a>
-      <a href='/?p=Subversion'>Code</a>
-      <a href='/?p=Tasks'>Tasks</a>
-    </div>
-      $(if [ -r "./${page}.page" ]; then
-       . "./${page}.page"
-        else
-       echo '<h2>Page not found or nevermore</h2>'
-       echo 'Quoth the Raven: 404'
-        fi
-      )
-  </body>
-</html>
-END_index.cgi
-
new file mode 120000 (symlink)
index 0000000000000000000000000000000000000000..410e699d63ab9fc7348d1ad94344a7d904bbd060
--- /dev/null
+++ b/index.cgi
@@ -0,0 +1 @@
+shcgi/index.cgi
\ No newline at end of file