aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBenjamin Kellermann <Benjamin.Kellermann@gmx.de>2011-05-18 15:04:52 +0200
committerBenjamin Kellermann <Benjamin.Kellermann@gmx.de>2011-05-18 15:04:52 +0200
commitfc5efe2d6a79caffb810ab11070710e29b217409 (patch)
tree0b6df9136b1a1a3ab876afb72349a430b3e0a930
parentfcc56dd878add0f1c215ff5522bf38f08fcf8b57 (diff)
remove apache-utils dependency (thanks to Johannes Schauer)
-rw-r--r--README1
-rwxr-xr-xaccess_control.rb9
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