diff options
author | Benjamin Kellermann <Benjamin.Kellermann@gmx.de> | 2011-05-18 15:04:52 +0200 |
---|---|---|
committer | Benjamin Kellermann <Benjamin.Kellermann@gmx.de> | 2011-05-18 15:04:52 +0200 |
commit | fc5efe2d6a79caffb810ab11070710e29b217409 (patch) | |
tree | 0b6df9136b1a1a3ab876afb72349a430b3e0a930 /access_control.rb | |
parent | fcc56dd878add0f1c215ff5522bf38f08fcf8b57 (diff) |
remove apache-utils dependency (thanks to Johannes Schauer)
Diffstat (limited to '')
-rwxr-xr-x | access_control.rb | 9 |
1 files changed, 3 insertions, 6 deletions
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 |