Eliminate deprecated Bugzilla::DB routines from userprefs.cgi

RESOLVED FIXED in Bugzilla 2.22

Status

()

Bugzilla
Bugzilla-General
RESOLVED FIXED
13 years ago
13 years ago

People

(Reporter: wicked, Assigned: wicked)

Tracking

2.21
Bugzilla 2.22
Bug Flags:
approval +

Details

Attachments

(1 attachment)

(Assignee)

Description

13 years ago
These lines need to rewritten to use DBI:

userprefs.cgi:48:    SendSQL("SELECT realname FROM profiles WHERE userid =
$userid");
userprefs.cgi:49:    $vars->{'realname'} = FetchSQLData();
userprefs.cgi:52:        SendSQL("SELECT tokentype, issuedate + " .
$dbh->sql_interval('3 DAY') .
userprefs.cgi:58:        if(MoreSQLData()) {
userprefs.cgi:59:            my ($tokentype, $change_date, $eventdata) =
&::FetchSQLData();
userprefs.cgi:79:        my $old = SqlQuote($cgi->param('Bugzilla_password'));
userprefs.cgi:80:        SendSQL("SELECT cryptpassword FROM profiles WHERE
userid = $userid");
userprefs.cgi:81:        my $oldcryptedpwd = FetchOneColumn();
userprefs.cgi:96:            my $cryptedpassword = SqlQuote(bz_crypt($pwd1));
userprefs.cgi:97:            SendSQL("UPDATE profiles
userprefs.cgi:133:    SendSQL("UPDATE profiles SET " .
userprefs.cgi:134:            "realname = " .
SqlQuote(trim($cgi->param('realname'))) .
userprefs.cgi:313:    SendSQL("SELECT DISTINCT name, description FROM groups " .
userprefs.cgi:319:    while (MoreSQLData()) {
userprefs.cgi:320:        my ($nam, $desc) = FetchSQLData();
userprefs.cgi:324:    SendSQL("SELECT DISTINCT name, description FROM groups " .
userprefs.cgi:326:    while (MoreSQLData()) {
userprefs.cgi:327:        my ($nam, $desc) = FetchSQLData();
(Assignee)

Updated

13 years ago
Assignee: general → wicked
(Assignee)

Comment 1

13 years ago
Created attachment 199131 [details] [diff] [review]
Rewrite deprecated SQL code, V1
Attachment #199131 - Flags: review?

Comment 2

13 years ago
Comment on attachment 199131 [details] [diff] [review]
Rewrite deprecated SQL code, V1

>+    my $groups = $dbh->selectall_arrayref(
>+               "SELECT DISTINCT name, description FROM groups WHERE id IN (" . 
>+               Bugzilla->user->groups_as_string . ") ORDER BY name");

Nit: maybe SELECT ...
	     FROM ...
	    WHERE ...
	 ORDER BY ...

would have been cleaner. But that's a nit. r=LpSolit
Attachment #199131 - Flags: review? → review+

Updated

13 years ago
Status: NEW → ASSIGNED
Flags: approval?
Target Milestone: --- → Bugzilla 2.22
Flags: approval? → approval+

Comment 3

13 years ago
Checking in userprefs.cgi;
/cvsroot/mozilla/webtools/bugzilla/userprefs.cgi,v  <--  userprefs.cgi
new revision: 1.88; previous revision: 1.87
done
Status: ASSIGNED → RESOLVED
Last Resolved: 13 years ago
Resolution: --- → FIXED
You need to log in before you can comment on or make changes to this bug.