From f15f6511d4f6f50302ea593a3719143b2173688c Mon Sep 17 00:00:00 2001 From: paul Date: Mon, 26 Mar 2012 20:15:21 +0000 Subject: [PATCH] changed filename acl.sh to permissions.sh since we dont really do ACLs svn path=/trunk/; revision=34 --- Wiki.page | 2 -- auth/{acl.sh => permissions.sh} | 2 ++ index.cgi | 37 ++++++++++++++++++++++++++------- 3 files changed, 32 insertions(+), 9 deletions(-) rename auth/{acl.sh => permissions.sh} (85%) diff --git a/Wiki.page b/Wiki.page index c803489..07055b3 100755 --- 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)" -[ -z "$ACL_WIKIEDIT" ] && ACL_WIKIEDIT=false - [ -n "$rev" ] && rev=".$rev" if [ -n "$search" ]; then info='' diff --git a/auth/acl.sh b/auth/permissions.sh similarity index 85% rename from auth/acl.sh rename to auth/permissions.sh index ba0d447..f943be3 100755 --- a/auth/acl.sh +++ b/auth/permissions.sh @@ -1,3 +1,4 @@ +ANL_ADMIN="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#" +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 diff --git a/index.cgi b/index.cgi index dac2f6b..482a747 100755 --- 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 < $([ -r "${page}.css" ] && echo '') + + + + +
@@ -67,8 +81,17 @@ $( $LOGIN || echo '

') +$( $LOGIN && echo "You are loggeed in as ${REMOTE_USER}
") +$( $LOGIN && $ACL_ADMIN && echo 'Admin
') +$( $LOGIN && echo 'My Settings
')
+ $(grep -q 'useFlattr=yes' project.meta && echo ' + + + ')