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
10cc520e
Commit
10cc520e
authored
Jan 27, 2014
by
Gervase Markham
Committed by
Gervase Markham
Jan 27, 2014
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Bug 939838 - Kill Bugzilla::User::user_id_to_login function. r=LpSolit, a=justdave.
parent
eb7d562c
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
7 additions
and
24 deletions
+7
-24
Bug.pm
Bugzilla/Bug.pm
+2
-2
BugMail.pm
Bugzilla/BugMail.pm
+1
-1
User.pm
Bugzilla/User.pm
+1
-18
Extension.pm
extensions/Voting/Extension.pm
+3
-3
No files found.
Bugzilla/Bug.pm
View file @
10cc520e
...
...
@@ -2187,8 +2187,8 @@ sub _set_global_validator {
my
$can
=
$self
->
check_can_change_field
(
$field
,
$current
,
$value
,
\
$privs
);
if
(
!
$can
)
{
if
(
$field
eq
'assigned_to'
||
$field
eq
'qa_contact'
)
{
$value
=
user_id_to_login
(
$value
)
;
$current
=
user_id_to_login
(
$current
)
;
$value
=
Bugzilla::
User
->
new
(
$value
)
->
login
;
$current
=
Bugzilla::
User
->
new
(
$current
)
->
login
;
}
ThrowUserError
(
'illegal_change'
,
{
field
=>
$field
,
oldvalue
=>
$current
,
...
...
Bugzilla/BugMail.pm
View file @
10cc520e
...
...
@@ -344,7 +344,7 @@ sub sendMail {
my
@watchingrel
=
map
{
$relationships
{
$_
}
}
@reasons_watch
;
push
(
@headerrel
,
'None'
)
unless
@headerrel
;
push
(
@watchingrel
,
'None'
)
unless
@watchingrel
;
push
@watchingrel
,
map
{
user_id_to_login
(
$_
)
}
@$watchingRef
;
push
@watchingrel
,
map
{
Bugzilla::
User
->
new
(
$_
)
->
login
}
@$watchingRef
;
my
@changedfields
=
uniq
map
{
$_
->
{
field_name
}
}
@display_diffs
;
...
...
Bugzilla/User.pm
View file @
10cc520e
...
...
@@ -28,7 +28,7 @@ use URI::QueryParam;
use
parent
qw(Bugzilla::Object Exporter)
;
@
Bugzilla::User::
EXPORT
=
qw(is_available_username
login_to_id
user_id_to_login
validate_password
login_to_id validate_password
USER_MATCH_MULTIPLE USER_MATCH_FAILED USER_MATCH_SUCCESS
MATCH_SKIP_CONFIRM
)
;
...
...
@@ -2193,17 +2193,6 @@ sub login_to_id {
}
}
sub
user_id_to_login
{
my
$user_id
=
shift
;
my
$dbh
=
Bugzilla
->
dbh
;
return
''
unless
(
$user_id
&&
detaint_natural
(
$user_id
));
my
$login
=
$dbh
->
selectrow_array
(
'SELECT login_name FROM profiles
WHERE userid = ?'
,
undef
,
$user_id
);
return
$login
||
''
;
}
sub
validate_password
{
my
(
$password
,
$matchpassword
)
=
@_
;
...
...
@@ -2831,12 +2820,6 @@ of a user, but you don't want the full weight of Bugzilla::User.
However, consider using a Bugzilla::User object instead of this function
if you need more information about the user than just their ID.
=item C<user_id_to_login($user_id)>
Returns the login name of the user account for the given user ID. If no
valid user ID is given or the user has no entry in the profiles table,
we return an empty string.
=item C<validate_password($passwd1, $passwd2)>
Returns true if a password is valid (i.e. meets Bugzilla's
...
...
extensions/Voting/Extension.pm
View file @
10cc520e
...
...
@@ -656,8 +656,8 @@ sub _modify_bug_votes {
# If some votes are removed, _remove_votes() returns a list
# of messages to send to voters.
push
(
@msgs
,
_remove_votes
(
$id
,
$who
,
'votes_too_many_per_bug'
));
my
$name
=
user_id_to_login
(
$who
)
;
my
$name
=
Bugzilla::
User
->
new
(
$who
)
->
login
;
push
(
@toomanyvotes_list
,
{
id
=>
$id
,
name
=>
$name
});
}
}
...
...
@@ -697,12 +697,12 @@ sub _modify_bug_votes {
AND votes.who = ?'
,
undef
,
$product
->
id
,
$who
);
my
$name
=
Bugzilla::
User
->
new
(
$who
)
->
login
;
foreach
my
$bug_id
(
@$bug_ids
)
{
# _remove_votes returns a list of messages to send
# in case some voters had too many votes.
push
(
@msgs
,
_remove_votes
(
$bug_id
,
$who
,
'votes_too_many_per_user'
));
my
$name
=
user_id_to_login
(
$who
);
push
(
@toomanytotalvotes_list
,
{
id
=>
$bug_id
,
name
=>
$name
});
}
...
...
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