]> git.plutz.net Git - busy/blobdiff - index.cgi
changed filename acl.sh to permissions.sh since we dont really do ACLs
[busy] / index.cgi
index dac2f6b2898ac9cee16fc1faef658872593ccf54..482a747467827e34bf9fdf667bd5abab27866bbf 100755 (executable)
--- a/index.cgi
+++ b/index.cgi
@@ -18,7 +18,7 @@
 
 umask=002
 alias _wiki="stx2any --no-template --link-abbrevs --quote -T html"
-. auth/acl.sh
+. auth/permissions.sh
 
 page=$(egrep -o '(^|&)p=[a-zA-Z0-9/_-]+(&|$)' <<<"${QUERY_STRING}" |sed 's,&,,g;s,p=,,')
 
@@ -44,16 +44,30 @@ cat <<END_index.cgi
     <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";
-}
+      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">
@@ -67,8 +81,17 @@ $( $LOGIN || echo '<form action="https://'${HTTP_HOST}'/login.cgi?'${QUERY_STRIN
                     <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>