From 47988b9d4bccb0b6145e1d2cf7462879576f6521 Mon Sep 17 00:00:00 2001 From: Benjamin Kellermann Date: Fri, 20 Nov 2009 10:31:24 +0100 Subject: changed interface to many tabs --- access_control.rb | 163 ++++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 163 insertions(+) create mode 100755 access_control.rb (limited to 'access_control.rb') diff --git a/access_control.rb b/access_control.rb new file mode 100755 index 0000000..7251bdc --- /dev/null +++ b/access_control.rb @@ -0,0 +1,163 @@ +#!/usr/bin/env ruby + +################################ +# Author: Benjamin Kellermann # +# License: CC-by-sa 3.0 # +# see License # +################################ + +require "cgi" + +if __FILE__ == $0 + +$cgi = CGI.new + +load "../html.rb" + +acusers = {} + +File.open(".htdigest","r").each_line{|l| + user,realm = l.scan(/^(.*):(.*):.*$/).flatten + acusers[user] = realm +} + +def writehtaccess(acusers) + File.open(".htaccess","w"){|htaccess| + if acusers.values.include?("config") + htaccess << < +AuthType digest +AuthName "config" +AuthUserFile "#{File.expand_path(".").gsub('"','\\\\"')}/.htdigest" +Require valid-user + +HTACCESS + end + if acusers.values.include?("vote") + htaccess << <" +$html << Dudle::tabs("Access Control") + +$html << < +TABLE + +# ACCESS CONTROL +$accesslevels = { "vote" => "Vote Interface", "config" => "Config Interface" } +$html << < +

Change Access Control Settings

+
+
+ + + +ACL +acusers.each{|user,action| + $html << < + + + + + + +USER +} + +$html << < + + + + + + +ACL + +$html << < + + #{usercreatenotice} + +ACL + +$html << "" + +$html.out($cgi) +end + -- cgit v1.2.3
Access toUsernamePasswordPassword (repeat)
#{$accesslevels[action]}#{user}********************************** + +
+ + +