Fix botched earlier CVS merge with HEAD

git-svn-id: svn://10.0.0.236/branches/Bugzilla_Groups_Branch@112498 18797224-902f-48f8-a5cc-f745e15eee43
This commit is contained in:
dkl%redhat.com
2002-01-21 20:37:24 +00:00
parent 87fd19faa5
commit 53b2d9abb7
14 changed files with 76 additions and 73 deletions

View File

@@ -865,6 +865,21 @@ sub confirm_login {
exit;
}
# if no password was provided, then fail the authentication
# while it may be valid to not have an LDAP password, when you
# bind without a password (regardless of the binddn value), you
# will get an anonymous bind. I do not know of a way to determine
# whether a bind is anonymous or not without making changes to the
# LDAP access control settings
if ( ! $::FORM{"LDAP_password"} ) {
print "Content-type: text/html\n\n";
PutHeader("Login Failed");
print "You did not provide a password.\n";
print "Please click <b>Back</b> and try again.\n";
PutFooter();
exit;
}
# We've got our anonymous bind; let's look up this user.
my $dnEntry = $LDAPconn->search(Param("LDAPBaseDN"),"subtree","uid=".$::FORM{"LDAP_login"});
if(!$dnEntry) {
@@ -1274,13 +1289,7 @@ sub DumpBugActivity {
sub GetCommandMenu {
my $loggedin = quietly_check_login();
my $userid = 0;
if ( $::COOKIE{'Bugzilla_login'} ) {
$userid = DBname_to_id($::COOKIE{'Bugzilla_login'});
} else {
$userid = 0;
}
my $userid = quietly_check_login() || 0;
if (!defined $::anyvotesallowed) {
GetVersionTable();
}
@@ -1302,12 +1311,12 @@ Actions:
<INPUT NAME="id" SIZE="6">
| <a href="reports.cgi">Reports</a>
};
if ($loggedin) {
if ($userid) {
if ($::anyvotesallowed) {
$html .= " | <A HREF=\"showvotes.cgi\">My votes</A>\n";
}
}
if ($loggedin) {
if ($userid) {
#a little mandatory SQL, used later on
SendSQL("SELECT mybugslink, userid FROM profiles " .
"WHERE login_name = " . SqlQuote($::COOKIE{'Bugzilla_login'}));

View File

@@ -32,7 +32,7 @@ sub bug_form_pl_sillyness {
my $zz;
$zz = %::FORM;
$zz = %::components;
# $zz = %::proddesc;
$zz = %::proddesc;
$zz = %::prodmaxvotes;
$zz = %::versions;
$zz = @::legal_keywords;
@@ -187,7 +187,8 @@ if (1 < @prodlist) {
"</SELECT>";
}
else {
$product_popup = $bug{'product'};
$product_popup = $bug{'product'} .
"<INPUT TYPE=\"HIDDEN\" NAME=\"product\" VALUE=\"$bug{'product'}\">";
}
print "

View File

@@ -55,7 +55,7 @@ my $serverpush = 0;
ConnectToDatabase();
#print "Content-type: text/plain\n\n"; # Handy for debugging.
# $::FORM{'debug'} = 1;
#$::FORM{'debug'} = 1;
if (grep(/^cmd-/, keys(%::FORM))) {

View File

@@ -565,9 +565,9 @@ if ($action eq 'del') {
CheckUser($user);
# display some data about the user
SendSQL("SELECT realname FROM profiles
SendSQL("SELECT userid, realname FROM profiles
WHERE login_name=" . SqlQuote($user));
my $realname = FetchOneColumn();
my ($theuserid, $realname) = FetchSQLData();
$realname ||= "<FONT COLOR=\"red\">missing</FONT>";
print "<TABLE BORDER=1 CELLPADDING=4 CELLSPACING=0>\n";
@@ -587,7 +587,9 @@ if ($action eq 'del') {
print " <TD VALIGN=\"top\">Group set:</TD>\n";
print " <TD VALIGN=\"top\">";
SendSQL("SELECT name
FROM groups
FROM groups, user_group_map
WHERE groups.group_id = user_group_map.group_id
AND user_group_map.user_id = $theuserid
ORDER BY isbuggroup, name");
my $found = 0;
while ( MoreSQLData() ) {

View File

@@ -126,6 +126,33 @@ if ( Param("strictvaluechecks") ) {
ConnectToDatabase();
#
# This function checks if there is a comment required for a specific
# function and tests, if the comment was given.
# If comments are required for functions is defined by params.
#
sub CheckonComment( $ ) {
my ($function) = (@_);
# Param is 1 if comment should be added !
my $ret = Param( "commenton" . $function );
# Allow without comment in case of undefined Params.
$ret = 0 unless ( defined( $ret ));
if( $ret ) {
if (!defined $::FORM{'comment'} || $::FORM{'comment'} =~ /^\s*$/) {
# No comment - sorry, action not allowed !
PuntTryAgain("You have to specify a <b>comment</b> on this " .
"change. Please give some words " .
"on the reason for your change.");
} else {
$ret = 0;
}
}
return( ! $ret ); # Return val has to be inverted
}
# Figure out whether or not the user is trying to change the product
# (either the "product" variable is not set to "don't change" or the
# user is changing a single bug and has changed the bug's product),
@@ -135,8 +162,9 @@ if ( $::FORM{'id'} ) {
SendSQL("SELECT product FROM bugs WHERE bug_id = $::FORM{'id'}");
$::oldproduct = FetchSQLData();
}
if ( ($::FORM{'id'} && $::FORM{'product'} ne $::oldproduct)
|| (!$::FORM{'id'} && $::FORM{'product'} ne $::dontchange) ) {
if ((($::FORM{'id'} && $::FORM{'product'} ne $::oldproduct)
|| (!$::FORM{'id'} && $::FORM{'product'} ne $::dontchange))
&& CheckonComment( "reassignbycomponent" )) {
if ( Param("strictvaluechecks") ) {
CheckFormField(\%::FORM, 'product', \@::legal_product);
}
@@ -510,33 +538,6 @@ sub ChangeResolution {
}
}
#
# This function checks if there is a comment required for a specific
# function and tests, if the comment was given.
# If comments are required for functions is defined by params.
#
sub CheckonComment( $ ) {
my ($function) = (@_);
# Param is 1 if comment should be added !
my $ret = Param( "commenton" . $function );
# Allow without comment in case of undefined Params.
$ret = 0 unless ( defined( $ret ));
if( $ret ) {
if (!defined $::FORM{'comment'} || $::FORM{'comment'} =~ /^\s*$/) {
# No comment - sorry, action not allowed !
PuntTryAgain("You have to specify a <b>comment</b> on this " .
"change. Please give some words " .
"on the reason for your change.");
} else {
$ret = 0;
}
}
return( ! $ret ); # Return val has to be inverted
}
foreach my $field ("rep_platform", "priority", "bug_severity",
"summary", "component", "bug_file_loc", "short_desc",
"product", "version", "op_sys",
@@ -898,6 +899,8 @@ sub LogDependencyActivity {
# Figure out what's really different...
my ($removed, $added) = DiffStrings($oldstr, $newstr);
LogActivityEntry($i,$target,$removed,$added);
# update timestamp on target bug so midairs will be triggered
SendSQL("UPDATE bugs SET delta_ts=NOW() WHERE bug_id=$i");
return 1;
}
return 0;
@@ -1213,7 +1216,7 @@ The changes made were:
if (
# the user wants to add the bug to the new product's group;
($::FORM{'addtonewgroup'} eq 'yes' || ($::FORM{'addtonewgroup'} eq 'yesifinold'))
# && GroupNameToId($oldhash{'product'}) & $oldhash{'groupset'}))
&& GroupNameToId($oldhash{'product'})
# the new product is associated with a group;
&& GroupExists($::FORM{'product'})

View File

@@ -1,4 +1,4 @@
#!/usr/bonsaitools/bin/perl -wT
#!/usr/bonsaitools/bin/perl -w
# -*- Mode: perl; indent-tabs-mode: nil -*-
#
# The contents of this file are subject to the Mozilla Public
@@ -655,8 +655,6 @@ sub NewProcessOnePerson ($$$$$$$$$$$$) {
return;
}
detaint_natural($person);
SendSQL("SELECT userid FROM profiles WHERE login_name = " . SqlQuote($person));
my ($userid) = FetchOneColumn();
@@ -680,7 +678,7 @@ sub NewProcessOnePerson ($$$$$$$$$$$$) {
my $save_id = $dep_id;
detaint_natural($dep_id) || warn("Unexpected Error: \@depbugs contains a non-numeric value: '$save_id'")
&& return;
return unless CanSeeBug($dep_id, $userid, $groupset);
return unless CanSeeBug($dep_id, $userid);
}
my %mailhead = %defmailhead;

View File

@@ -247,7 +247,7 @@ foreach my $p (@::legal_product) {
# If we're using bug groups to restrict entry on products, and
# this product has a bug group, and the user is not in that
# group, we don't want to include that product in this list.
next if (Param("usebuggroups") && GroupExists($p) && !UserInGroup($p, $userid));
next if (Param("usebuggroups") && GroupExists($p) && !UserInGroup($userid, $p));
# We build up boolean hashes in the "-set" hashes for each of these things
# before making a list because there may be duplicates names across products.

View File

@@ -18,10 +18,8 @@ you may prefer <a href="quicksearchhack.html">this form</a>.
Type in one or more words (or word fragments) to search for:
<!-- The name of the form must be "f" (used in "quicksearch.js"). -->
<form name="f" action="show_bug.cgi" method="get"
onsubmit="QuickSearch(); return false;">
onsubmit="QuickSearch(f.id.value); return false;">
<table>
<tr>
<td><input type="text" size="40" name="id"/></td>

View File

@@ -603,8 +603,7 @@ function unique_id () {
return (new Date()).getTime();
}
function ShowURL(mode) {
var input = document.f.id.value;
function ShowURL(mode,input) {
var searchURL = make_query_URL(bugzilla+"buglist.cgi", input, false);
if (searchURL != no_result) {
var pieces = searchURL.replace(/[\?]/g,"\n?").replace(/[\&]/g,"\n&");
@@ -687,7 +686,7 @@ function Search(url, input, searchLong) {
// derived from http://www.cs.hmc.edu/~jruderma/s/bugz.html
// QuickSearch combines lookup-by-bug-number and search
// in a single textbox. It's name must be document.f.id .
// in a single textbox.
//
// type nothing:
// --> go to bugzilla front page
@@ -729,9 +728,7 @@ function QuickSearch ()
return;
}
function LoadQuery() {
var input = document.f.id.value;
function LoadQuery(input) {
//remove leading and trailing whitespace
input = input.replace(/^[\s]+/,"").replace(/[\s]+$/,"");

View File

@@ -12,16 +12,14 @@
Type in one or more words (or word fragments) to search for:
<!-- The name of the form must be "f" (used in "quicksearch.js"). -->
<form name="f" action="show_bug.cgi" method="get"
onsubmit="QuickSearch(); return false;">
onsubmit="QuickSearch(f.id.value); return false;">
<table>
<tr>
<td><input type="text" size="40" name="id"/></td>
<td align=left><input type="submit" name="run" value="Search"/></td>
<td align=left><input type="button" name="load" value="Load Query"
onclick="LoadQuery();" />
onclick="LoadQuery(f.id.value);" />
</td>
</tr>
</table>

View File

@@ -33,6 +33,11 @@ Set-Cookie: Bugzilla_logincookie= ; path=$cookiepath; expires=Sun, 30-Jun-80 00:
Content-type: text/html
";
# delete the cookie before dumping the header so that it shows the user
# as logged out if %commandmenu% is in the header
delete $::COOKIE{"Bugzilla_login"};
PutHeader ("Relogin");
print "<B>Your login has been forgotten</B>.</P>
@@ -41,8 +46,6 @@ do an action that requires a login, you will be prompted for it.
<p>
";
delete $::COOKIE{"Bugzilla_login"};
PutFooter();
exit;

View File

@@ -40,11 +40,6 @@ my $template = Template->new(
# Allow templates to be specified with relative paths.
RELATIVE => 1,
POST_CHOMP =>1,
# Functions for processing text within templates
FILTERS =>
{
url => \&url_quote,
},
}
);

View File

@@ -60,8 +60,7 @@ my $template = Template->new(
# actually have to function in this test, just be defined.
FILTERS =>
{
url => sub { return $_ } ,
}
},
}
);

View File

@@ -100,7 +100,7 @@ function normal_keypress_handler( aEvent ) {
[% END %]
[% FOREACH name = namedqueries %]
<text class="text-link" onclick="load_relative_url('buglist.cgi?cmdtype=runnamed&amp;namedcmd=[% name FILTER url %]')" value="[% name FILTER html %]"/>
<text class="text-link" onclick="load_relative_url('buglist.cgi?cmdtype=runnamed&amp;namedcmd=[% name FILTER uri %]')" value="[% name FILTER html %]"/>
[% END %]
[% IF NOT username %]