Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
bugzilla
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
etersoft
bugzilla
Commits
32aa48ea
Commit
32aa48ea
authored
Jul 08, 2005
by
mkanat%kerio.com
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Bug 298659: setting authentication to LDAP,DB fails
Patch By A. Karl Kornel <karl@kornel.name> r=glob, a=justdave
parent
b4e43c11
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
22 additions
and
16 deletions
+22
-16
Auth.pm
Bugzilla/Auth.pm
+20
-14
CGI.pm
Bugzilla/Auth/Login/WWW/CGI.pm
+2
-2
No files found.
Bugzilla/Auth.pm
View file @
32aa48ea
...
...
@@ -107,13 +107,15 @@ sub authenticate {
my
@args
=
@_
;
my
@firstresult
=
();
my
@result
=
();
my
$current_verify_method
;
for
my
$method
(
split
/,\s*/
,
Param
(
"user_verify_class"
))
{
$current_verify_method
=
$method
;
$method
=
"Bugzilla::Auth::Verify::"
.
$method
;
@result
=
$method
->
authenticate
(
@args
);
@firstresult
=
@result
unless
@firstresult
;
if
((
$result
[
0
]
!=
AUTH_NODATA
)
&&
(
$result
[
0
]
!=
AUTH_LOGINFAILED
))
{
$current_verify_class
=
$method
;
unshift
@result
,
(
$current_verify_method
)
;
return
@result
;
}
}
...
...
@@ -123,13 +125,16 @@ sub authenticate {
# see if we can set $current to the first verify method that
# will allow a new login
my
$chosen_verify_method
;
for
my
$method
(
split
/,\s*/
,
Param
(
"user_verify_class"
))
{
$current_verify_method
=
$method
;
$method
=
"Bugzilla::Auth::Verify::"
.
$method
;
if
(
$method
->
can_edit
(
'new'
))
{
$c
urrent_verify_class
=
$method
;
$c
hosen_verify_method
=
$method
;
}
}
unshift
@result
,
$chosen_verify_method
;
return
@result
;
}
...
...
@@ -222,16 +227,17 @@ This method is passed a username and a password, and returns a list
containing up to four return values, depending on the results of the
authentication.
The first return value is one of the status codes defined in
L<Bugzilla::Constants|Bugzilla::Constants> and described below. The
rest of the return values are status code-specific and are explained in
the status code descriptions.
The first return value is the name of the class that generated the results
constined in the remaining return values. The second return value is one of
the status codes defined in L<Bugzilla::Constants|Bugzilla::Constants> and
described below. The rest of the return values are status code-specific
and are explained in the status code descriptions.
=over 4
=item C<AUTH_OK>
Authentication succeeded. The
secon
d variable is the userid of the new
Authentication succeeded. The
thir
d variable is the userid of the new
user.
=item C<AUTH_NODATA>
...
...
@@ -241,11 +247,11 @@ cases, such as cookie authentication when the cookie is not present.
=item C<AUTH_ERROR>
An error occurred when trying to use the login mechanism. The
secon
d return
An error occurred when trying to use the login mechanism. The
thir
d return
value may contain the Bugzilla userid, but will probably be C<undef>,
signifiying that the userid is unknown. The
third
value is a tag describing
signifiying that the userid is unknown. The
fourth
value is a tag describing
the error used by the authentication error templates to print a description
to the user. The optional f
our
th argument is a hashref of values used as part
to the user. The optional f
if
th argument is a hashref of values used as part
of the tag's error descriptions.
This error template must have a name/location of
...
...
@@ -255,22 +261,22 @@ I<account/auth/C<lc(authentication-type)>-error.html.tmpl>.
An incorrect username or password was given. Note that for security reasons,
both cases return the same error code. However, in the case of a valid
username, the
secon
d argument may be the userid. The authentication
username, the
thir
d argument may be the userid. The authentication
mechanism may not always be able to discover the userid if the password is
not known, so whether or not this argument is present is implementation
specific. For security reasons, the presence or lack of a userid value should
not be communicated to the user.
The
third
argument is an optional tag from the authentication server
The
fourth
argument is an optional tag from the authentication server
describing the error. The tag can be used by a template to inform the user
about the error. Similar to C<AUTH_ERROR>, an optional hashref may be
present as a f
our
th argument, to be used by the tag to give more detailed
present as a f
if
th argument, to be used by the tag to give more detailed
information.
=item C<AUTH_DISABLED>
The user successfully logged in, but their account has been disabled.
The
second argument in the returned array is the userid, and the third
The
third argument in the returned array is the userid, and the fourth
is some text explaining why the account was disabled. This text would
typically come from the C<disabledtext> field in the C<profiles> table.
Note that this argument is a string, not a tag.
...
...
Bugzilla/Auth/Login/WWW/CGI.pm
View file @
32aa48ea
...
...
@@ -53,8 +53,8 @@ sub login {
$cgi
->
delete
(
'Bugzilla_login'
,
'Bugzilla_password'
);
my
$authmethod
=
Param
(
"user_verify_class"
);
my
(
$authres
,
$userid
,
$extra
,
$info
)
=
# Perform the actual authentication, get the method name from the class name
my
(
$auth
method
,
$auth
res
,
$userid
,
$extra
,
$info
)
=
Bugzilla::
Auth
->
authenticate
(
$username
,
$passwd
);
if
(
$authres
==
AUTH_OK
)
{
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment