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
022510ad
Commit
022510ad
authored
May 28, 2012
by
Koosha Khajeh Moogahi
Committed by
Frédéric Buclin
May 28, 2012
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Bug 555829: Refactor userprefs.cgi to use Bugzilla::User everywhere possible
r/a=LpSolit
parent
5fb38bd7
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
8 additions
and
12 deletions
+8
-12
userprefs.cgi
userprefs.cgi
+8
-12
No files found.
userprefs.cgi
View file @
022510ad
...
...
@@ -32,8 +32,7 @@ sub DoAccount {
my
$dbh
=
Bugzilla
->
dbh
;
my
$user
=
Bugzilla
->
user
;
(
$vars
->
{
'realname'
})
=
$dbh
->
selectrow_array
(
"SELECT realname FROM profiles WHERE userid = ?"
,
undef
,
$user
->
id
);
$vars
->
{
'realname'
}
=
$user
->
name
;
if
(
Bugzilla
->
params
->
{
'allowemailchange'
}
&&
$user
->
authorizer
->
can_change_email
)
...
...
@@ -64,6 +63,9 @@ sub DoAccount {
sub
SaveAccount
{
my
$cgi
=
Bugzilla
->
cgi
;
my
$dbh
=
Bugzilla
->
dbh
;
$dbh
->
bz_start_transaction
;
my
$user
=
Bugzilla
->
user
;
my
$oldpassword
=
$cgi
->
param
(
'old_password'
);
...
...
@@ -86,12 +88,7 @@ sub SaveAccount {
validate_password
(
$pwd1
,
$pwd2
);
if
(
$oldpassword
ne
$pwd1
)
{
my
$cryptedpassword
=
bz_crypt
(
$pwd1
);
$dbh
->
do
(
q{UPDATE profiles
SET cryptpassword = ?
WHERE userid = ?}
,
undef
,
(
$cryptedpassword
,
$user
->
id
));
$user
->
set_password
(
$pwd1
);
# Invalidate all logins except for the current one
Bugzilla
->
logout
(
LOGOUT_KEEP_CURRENT
);
}
...
...
@@ -121,10 +118,9 @@ sub SaveAccount {
}
}
my
$realname
=
trim
(
$cgi
->
param
(
'realname'
));
trick_taint
(
$realname
);
# Only used in a placeholder
$dbh
->
do
(
"UPDATE profiles SET realname = ? WHERE userid = ?"
,
undef
,
(
$realname
,
$user
->
id
));
$user
->
set_name
(
$cgi
->
param
(
'realname'
));
$user
->
update
({
keep_session
=>
1
,
keep_tokens
=>
1
});
$dbh
->
bz_commit_transaction
;
}
...
...
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