From fc5efe2d6a79caffb810ab11070710e29b217409 Mon Sep 17 00:00:00 2001 From: Benjamin Kellermann Date: Wed, 18 May 2011 15:04:52 +0200 Subject: remove apache-utils dependency (thanks to Johannes Schauer) --- access_control.rb | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) (limited to 'access_control.rb') diff --git a/access_control.rb b/access_control.rb index 701dcb9..1eb717e 100755 --- a/access_control.rb +++ b/access_control.rb @@ -22,6 +22,7 @@ if __FILE__ == $0 load "../dudle.rb" +require "digest" $d = Dudle.new @@ -63,12 +64,8 @@ HTACCESS end end def add_to_htdigest(user,password) - fork { - IO.popen("htdigest .htdigest dudle #{user} 2>/dev/null","w+"){|htdigest| - htdigest.sync - htdigest.puts(password) - htdigest.puts(password) - } + File.open(".htdigest","a"){|f| + f << "#{user}:dudle:#{Digest::MD5.hexdigest("#{user}:dudle:#{password}")}\n" } end -- cgit v1.2.3