From b1f4cf8bdc4b49c02ebebbee2553202bc46ab720 Mon Sep 17 00:00:00 2001 From: "mkanat%bugzilla.org" <> Date: Tue, 4 Jul 2006 04:26:20 +0000 Subject: Bug 342869: Use Bugzilla->params everywhere except templates Patch By Max Kanat-Alexander r=LpSolit, a=justdave --- Bugzilla/Auth/Login/CGI.pm | 6 ++++-- Bugzilla/Auth/Login/Env.pm | 6 +++--- Bugzilla/Auth/Persist/Cookie.pm | 6 +++--- Bugzilla/Auth/Verify/LDAP.pm | 18 ++++++++++-------- 4 files changed, 20 insertions(+), 16 deletions(-) (limited to 'Bugzilla/Auth') diff --git a/Bugzilla/Auth/Login/CGI.pm b/Bugzilla/Auth/Login/CGI.pm index e6fa7d590..d0c29d8aa 100644 --- a/Bugzilla/Auth/Login/CGI.pm +++ b/Bugzilla/Auth/Login/CGI.pm @@ -60,8 +60,10 @@ sub fail_nodata { my $template = Bugzilla->template; # Redirect to SSL if required - if (Param('sslbase') ne '' and Param('ssl') ne 'never') { - $cgi->require_https(Param('sslbase')); + if (Bugzilla->params->{'sslbase'} ne '' + and Bugzilla->params->{'ssl'} ne 'never') + { + $cgi->require_https(Bugzilla->params->{'sslbase'}); } print $cgi->header(); $template->process("account/auth/login.html.tmpl", diff --git a/Bugzilla/Auth/Login/Env.pm b/Bugzilla/Auth/Login/Env.pm index ade192ea0..f9837b3e6 100644 --- a/Bugzilla/Auth/Login/Env.pm +++ b/Bugzilla/Auth/Login/Env.pm @@ -36,9 +36,9 @@ sub get_login_info { my ($self) = @_; my $dbh = Bugzilla->dbh; - my $env_id = $ENV{Param("auth_env_id")} || ''; - my $env_email = $ENV{Param("auth_env_email")} || ''; - my $env_realname = $ENV{Param("auth_env_realname")} || ''; + my $env_id = $ENV{Bugzilla->params->{"auth_env_id"}} || ''; + my $env_email = $ENV{Bugzilla->params->{"auth_env_email"}} || ''; + my $env_realname = $ENV{Bugzilla->params->{"auth_env_realname"}} || ''; return { failure => AUTH_NODATA } if !$env_email; diff --git a/Bugzilla/Auth/Persist/Cookie.pm b/Bugzilla/Auth/Persist/Cookie.pm index 7d1209a0e..3d8599c18 100644 --- a/Bugzilla/Auth/Persist/Cookie.pm +++ b/Bugzilla/Auth/Persist/Cookie.pm @@ -52,7 +52,7 @@ sub persist_login { my $ip_addr = $cgi->remote_addr; unless ($cgi->param('Bugzilla_restrictlogin') || - Param('loginnetmask') == 32) + Bugzilla->params->{'loginnetmask'} == 32) { $ip_addr = get_netaddr($ip_addr); } @@ -70,8 +70,8 @@ sub persist_login { # Remember cookie only if admin has told so # or admin didn't forbid it and user told to remember. - if ( Param('rememberlogin') eq 'on' || - (Param('rememberlogin') ne 'off' && + if ( Bugzilla->params->{'rememberlogin'} eq 'on' || + (Bugzilla->params->{'rememberlogin'} ne 'off' && $cgi->param('Bugzilla_remember') && $cgi->param('Bugzilla_remember') eq 'on') ) { diff --git a/Bugzilla/Auth/Verify/LDAP.pm b/Bugzilla/Auth/Verify/LDAP.pm index 2ee5247ec..713619589 100644 --- a/Bugzilla/Auth/Verify/LDAP.pm +++ b/Bugzilla/Auth/Verify/LDAP.pm @@ -85,7 +85,7 @@ sub check_credentials { my $user_entry = $detail_result->shift_entry; - my $mail_attr = Param("LDAPmailattribute"); + my $mail_attr = Bugzilla->params->{"LDAPmailattribute"}; if ($mail_attr) { if (!$user_entry->exists($mail_attr)) { return { failure => AUTH_ERROR, @@ -106,17 +106,19 @@ sub check_credentials { sub _bz_search_params { my ($username) = @_; - return (base => Param("LDAPBaseDN"), + return (base => Bugzilla->params->{"LDAPBaseDN"}, scope => "sub", - filter => '(&(' . Param("LDAPuidattribute") . "=$username)" - . Param("LDAPfilter") . ')'); + filter => '(&(' . Bugzilla->params->{"LDAPuidattribute"} + . "=$username)" + . Bugzilla->params->{"LDAPfilter"} . ')'); } sub _bind_ldap_anonymously { my ($self) = @_; my $bind_result; - if (Param("LDAPbinddn")) { - my ($LDAPbinddn,$LDAPbindpass) = split(":",Param("LDAPbinddn")); + if (Bugzilla->params->{"LDAPbinddn"}) { + my ($LDAPbinddn,$LDAPbindpass) = + split(":",Bugzilla->params->{"LDAPbinddn"}); $bind_result = $self->ldap->bind($LDAPbinddn, password => $LDAPbindpass); } @@ -136,7 +138,7 @@ sub ldap { my ($self) = @_; return $self->{ldap} if $self->{ldap}; - my $server = Param("LDAPserver"); + my $server = Bugzilla->params->{"LDAPserver"}; ThrowCodeError("ldap_server_not_defined") unless $server; my $port = DEFAULT_PORT; @@ -166,7 +168,7 @@ sub ldap { || ThrowCodeError("ldap_connect_failed", { server => $conn_string }); # try to start TLS if needed - if (Param("LDAPstarttls")) { + if (Bugzilla->params->{"LDAPstarttls"}) { my $mesg = $self->{ldap}->start_tls(); ThrowCodeError("ldap_start_tls_failed", { error => $mesg->error() }) if $mesg->code(); -- cgit v1.2.3-24-g4f1b