#!/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
Access toUsernamePasswordPassword (repeat)
#{$accesslevels[action]} #{user} ***************** *****************