diff options
author | cyeh%bluemartini.com <> | 2000-09-16 01:35:16 +0000 |
---|---|---|
committer | cyeh%bluemartini.com <> | 2000-09-16 01:35:16 +0000 |
commit | 391664703db43356450e6e471e30f4053a2e62a2 (patch) | |
tree | ff6fea075afa01e5d49f464288c36d9b9fdbed13 /editusers.cgi | |
parent | put little comment in here about apostrophe's in enums (diff) | |
download | bugzilla-391664703db43356450e6e471e30f4053a2e62a2.tar.gz bugzilla-391664703db43356450e6e471e30f4053a2e62a2.tar.bz2 bugzilla-391664703db43356450e6e471e30f4053a2e62a2.zip |
fixes for 51184, 51185, 51186: allow for ldap authentication. patches
by jmrobins@tgix.com (Joe Robins). LDAP sections haven't been
tested yet, but the code is arranged such that it shouldn't disturb
existing user authentication system.
Diffstat (limited to 'editusers.cgi')
-rwxr-xr-x | editusers.cgi | 31 |
1 files changed, 25 insertions, 6 deletions
diff --git a/editusers.cgi b/editusers.cgi index 73ee8f131..3af80a86a 100755 --- a/editusers.cgi +++ b/editusers.cgi @@ -20,6 +20,7 @@ # # Contributor(s): Holger Schurig <holgerschurig@nikocity.de> # Dave Miller <dave@intrec.com> +# Joe Robins <jmrobins@tgix.com> # # Direct any questions on this source code to # @@ -109,8 +110,11 @@ sub EmitFormElements ($$$$$$$) if ($editall) { print "</TR><TR>\n"; print " <TH ALIGN=\"right\">Password:</TH>\n"; - print " <TD><INPUT TYPE=\"PASSWORD\" SIZE=16 MAXLENGTH=16 NAME=\"password\" VALUE=\"$password\"></TD>\n"; - + if(Param('useLDAP')) { + print " <TD><FONT COLOR=RED>This site is using LDAP for authentication!</FONT></TD>\n"; + } else { + print " <TD><INPUT TYPE=\"PASSWORD\" SIZE=16 MAXLENGTH=16 NAME=\"password\" VALUE=\"$password\"></TD>\n"; + } print "</TR><TR>\n"; print " <TH ALIGN=\"right\">Email notification:</TH>\n"; print qq{<TD><SELECT NAME="emailnotification">}; @@ -341,7 +345,7 @@ if ($action eq 'list') { } print "</TR>"; } - if ($editall) { + if ($editall && !Param('useLDAP')) { print "<TR>\n"; my $span = $candelete ? 3 : 2; print qq{ @@ -375,6 +379,13 @@ if ($action eq 'add') { exit; } + if(Param('useLDAP')) { + print "This site is using LDAP for authentication. To add a new user, "; + print "please contact the LDAP administrators."; + PutTrailer(); + exit; + } + print "<FORM METHOD=POST ACTION=editusers.cgi>\n"; print "<TABLE BORDER=0 CELLPADDING=4 CELLSPACING=0><TR>\n"; @@ -406,6 +417,13 @@ if ($action eq 'new') { exit; } + if(Param('useLDAP')) { + print "This site is using LDAP for authentication. To add a new user, "; + print "please contact the LDAP administrators."; + PutTrailer(); + exit; + } + # Cleanups and valididy checks my $realname = trim($::FORM{realname} || ''); my $password = trim($::FORM{password} || ''); @@ -667,7 +685,7 @@ if ($action eq 'edit') { print "</TR></TABLE>\n"; print "<INPUT TYPE=HIDDEN NAME=\"userold\" VALUE=\"$user\">\n"; - if ($editall) { + if ($editall && !Param('useLDAP')) { print "<INPUT TYPE=HIDDEN NAME=\"passwordold\" VALUE=\"$password\">\n"; } print "<INPUT TYPE=HIDDEN NAME=\"realnameold\" VALUE=\"$realname\">\n"; @@ -764,13 +782,14 @@ if ($action eq 'update') { WHERE login_name=" . SqlQuote($userold)); print "Updated email notification.<BR>\n"; } - - if ($editall && $password ne $passwordold) { + if(!Param('useLDAP')) { + if ($editall && $password ne $passwordold) { my $q = SqlQuote($password); SendSQL("UPDATE profiles SET password= $q, cryptpassword = ENCRYPT($q) WHERE login_name=" . SqlQuote($userold)); print "Updated password.<BR>\n"; + } } if ($editall && $realname ne $realnameold) { SendSQL("UPDATE profiles |