]> git.plutz.net Git - busy/commitdiff
changed filename acl.sh to permissions.sh since we dont really do ACLs
authorpaul <paul@plutz.net>
Mon, 26 Mar 2012 20:15:21 +0000 (20:15 +0000)
committerpaul <paul@plutz.net>
Mon, 26 Mar 2012 20:15:21 +0000 (20:15 +0000)
svn path=/trunk/; revision=34

Wiki.page
auth/permissions.sh [moved from auth/acl.sh with 85% similarity]
index.cgi

index c8034897b2bce641e788fe81ec0bf3453af648c5..07055b3c15f2a78d8f9cdd37b23a08414a0f8386 100755 (executable)
--- a/Wiki.page
+++ b/Wiki.page
@@ -6,8 +6,6 @@ rev="$(egrep -o '(^|&)(r=)[0-9]{10}(&|$)' <<<"${QUERY_STRING}" |tr -d '&r=')"
 search="$(egrep -o '(^|&)(s=).+(&|$)' <<<"${QUERY_STRING}" |sed -r 's:^&?s=::;s:\+: :g;s:%:\\x:g')"
 search="$(echo -e "${search}" |sed 's:\t: :g;s:\r::g;s:\\:\\\\:g' |head -n1)"
 
 search="$(egrep -o '(^|&)(s=).+(&|$)' <<<"${QUERY_STRING}" |sed -r 's:^&?s=::;s:\+: :g;s:%:\\x:g')"
 search="$(echo -e "${search}" |sed 's:\t: :g;s:\r::g;s:\\:\\\\:g' |head -n1)"
 
-[ -z "$ACL_WIKIEDIT" ] && ACL_WIKIEDIT=false
-
 [ -n "$rev" ] && rev=".$rev"
 if [ -n "$search" ]; then
   info=''
 [ -n "$rev" ] && rev=".$rev"
 if [ -n "$search" ]; then
   info=''
similarity index 85%
rename from auth/acl.sh
rename to auth/permissions.sh
index ba0d44774b3e8e37b1312af092f64677d6cae9a4..f943be303c4bd8e34e9aaf39be02f2973687e80a 100755 (executable)
@@ -1,3 +1,4 @@
+ANL_ADMIN="paul"
 ANL_EDITINTRO="paul"
 ANL_ADDNEWS="paul"
 ANL_EDITNEWS="paul"
 ANL_EDITINTRO="paul"
 ANL_ADDNEWS="paul"
 ANL_EDITNEWS="paul"
@@ -5,6 +6,7 @@ ANL_CREATETASK=".*"
 ANL_WIKIEDIT="paul"
 
 [ -n "$REMOTE_USER" ] && USER="$REMOTE_USER" || USER="#NONE#"
 ANL_WIKIEDIT="paul"
 
 [ -n "$REMOTE_USER" ] && USER="$REMOTE_USER" || USER="#NONE#"
+egrep -xq "$ANL_ADMIN"      <<<"$USER" && ACL_ADMIN=true      || ACL_ADMIN=false
 egrep -xq "$ANL_EDITINTRO"  <<<"$USER" && ACL_EDITINTRO=true  || ACL_EDITINTRO=false
 egrep -xq "$ANL_ADDNEWS"    <<<"$USER" && ACL_ADDNEWS=true    || ACL_ADDNEWS=false
 egrep -xq "$ANL_EDITNEWS"   <<<"$USER" && ACL_EDITNEWS=true   || ACL_EDITNEWS=false
 egrep -xq "$ANL_EDITINTRO"  <<<"$USER" && ACL_EDITINTRO=true  || ACL_EDITINTRO=false
 egrep -xq "$ANL_ADDNEWS"    <<<"$USER" && ACL_ADDNEWS=true    || ACL_ADDNEWS=false
 egrep -xq "$ANL_EDITNEWS"   <<<"$USER" && ACL_EDITNEWS=true   || ACL_EDITNEWS=false
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"
 
 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=,,')
 
 
 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>
     <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">
     <!--
     <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>
+    
+    <!-- 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">
   </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>')
                     <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">
     </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>
     </div>
     <div id="MENU">
       <a href='/?p=Home'>Home</a>