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) --- README | 1 - access_control.rb | 9 +++------ 2 files changed, 3 insertions(+), 7 deletions(-) diff --git a/README b/README index ef3a921..0c1cb1d 100644 --- a/README +++ b/README @@ -4,7 +4,6 @@ Requirements: * ruby >=1.8 * git >=1.6.5 (preferred and default setting) or bzr * libgettext-ruby (for localization) - * htdigest command line tool (sudo aptitude install apache2-utils) License: GNU AGPL v3 or higher see file License 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