From 292b66448acfb98e290781c908cb30f850f37aa9 Mon Sep 17 00:00:00 2001 From: Benjamin Kellermann Date: Tue, 24 Nov 2009 17:13:31 +0100 Subject: make removal of users more save --- access_control.rb | 31 +++++++++++++++++-------------- 1 file changed, 17 insertions(+), 14 deletions(-) (limited to 'access_control.rb') diff --git a/access_control.rb b/access_control.rb index 1776ab7..40a4757 100755 --- a/access_control.rb +++ b/access_control.rb @@ -80,7 +80,7 @@ def add_to_htdigest(user,type,password) } end -def createform(userarray,hint,acusers,newuser) +def createform(userarray,hint,acusers) ret = <
@@ -100,10 +100,10 @@ FORM " } @@ -111,16 +111,20 @@ PASS ret += < - +
PASS - if newuser - ret += "" - else + if acusers.include?(userarray[0]) ret += PASSWORDSTAR*14 + else + ret += "" end ret += "
#{newuser ? hint : ""}#{acusers.include?(userarray[0]) ? "" : hint}
FORM - if newuser - ret += "" + if acusers.include?(userarray[0]) + if userarray[0] == "admin" && acusers.include?("participant") + ret += "
You have to remove the participant user before you can remove the administrator.
" + else + ret += "" + end else - ret += "" + ret += "" end ret += <