diff options
author | gerv%gerv.net <> | 2003-11-09 05:49:18 +0000 |
---|---|---|
committer | gerv%gerv.net <> | 2003-11-09 05:49:18 +0000 |
commit | 5f61a3d84eef44c09244996a5787bfc24621f60c (patch) | |
tree | 4d979bc6f3b04b47e0018a4929d544d0e972d782 /userprefs.cgi | |
parent | ef05aed5674b707b85233a6670edb500fd70b77d (diff) | |
download | bugs-5f61a3d84eef44c09244996a5787bfc24621f60c.tar bugs-5f61a3d84eef44c09244996a5787bfc24621f60c.tar.gz bugs-5f61a3d84eef44c09244996a5787bfc24621f60c.tar.bz2 bugs-5f61a3d84eef44c09244996a5787bfc24621f60c.tar.xz bugs-5f61a3d84eef44c09244996a5787bfc24621f60c.zip |
Bug 179339 - Simplify and improve the stored query mechanism. Patch by gerv; r,a=myk.
Diffstat (limited to 'userprefs.cgi')
-rwxr-xr-x | userprefs.cgi | 68 |
1 files changed, 0 insertions, 68 deletions
diff --git a/userprefs.cgi b/userprefs.cgi index 857665f7c..017c7c94d 100755 --- a/userprefs.cgi +++ b/userprefs.cgi @@ -30,13 +30,6 @@ require "CGI.pl"; use RelationSet; -# Shut up misguided -w warnings about "used only once". "use vars" just -# doesn't work for me. -sub sillyness { - my $zz; - $zz = $::defaultqueryname; -} - # Use global template variables. use vars qw($template $vars $userid); @@ -269,61 +262,6 @@ sub SaveEmail { } -sub DoFooter { - SendSQL("SELECT mybugslink FROM profiles " . - "WHERE userid = $userid"); - $vars->{'mybugslink'} = FetchSQLData(); - - SendSQL("SELECT name, linkinfooter FROM namedqueries " . - "WHERE userid = $userid"); - - my @queries; - while (MoreSQLData()) { - my ($name, $footer) = (FetchSQLData()); - next if ($name eq $::defaultqueryname); - - push (@queries, { name => $name, footer => $footer }); - } - - $vars->{'queries'} = \@queries; -} - -sub SaveFooter { - my %old; - SendSQL("SELECT name, linkinfooter FROM namedqueries " . - "WHERE userid = $userid"); - while (MoreSQLData()) { - my ($name, $footer) = (FetchSQLData()); - $old{$name} = $footer; - } - - for (my $c = 0; $c < $::FORM{'numqueries'}; $c++) { - my $name = $::FORM{"name-$c"}; - if (exists $old{$name}) { - my $new = $::FORM{"query-$c"}; - if ($new ne $old{$name}) { - detaint_natural($new); - SendSQL("UPDATE namedqueries SET linkinfooter = $new " . - "WHERE userid = $userid " . - "AND name = " . SqlQuote($name)); - } - } else { - ThrowUserError("missing_query", {queryname => $name}); - } - } - SendSQL("UPDATE profiles SET mybugslink = " . - SqlQuote($::FORM{'mybugslink'}) . " WHERE userid = $userid"); - - # Make sure that cached queries in the user object are invalidated - # so that the footer is correct - my $user = Bugzilla->user; - $user->flush_queries_cache(); - - # Also need to update showmybugslink - $user->{showmybugslink} = $::FORM{'mybugslink'} ? 1 : 0; -} - - sub DoPermissions { my (@has_bits, @set_bits); @@ -385,11 +323,6 @@ SWITCH: for ($current_tab_name) { DoEmail(); last SWITCH; }; - /^footer$/ && do { - SaveFooter() if $::FORM{'dosave'}; - DoFooter(); - last SWITCH; - }; /^permissions$/ && do { DoPermissions(); last SWITCH; @@ -402,4 +335,3 @@ SWITCH: for ($current_tab_name) { print $cgi->header(); $template->process("account/prefs/prefs.html.tmpl", $vars) || ThrowTemplateError($template->error()); - |