Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
B
bugzilla
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Service Desk
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Operations
Operations
Incidents
Environments
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Lysator
bugzilla
Commits
f297f575
Commit
f297f575
authored
Jul 11, 2014
by
Per Cederqvist
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Imported Bugzilla 4.3.3.
parent
de18a0d1
Changes
178
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
178 changed files
with
1507 additions
and
18846 deletions
+1507
-18846
.bzr/checkout/dirstate
.bzr/checkout/dirstate
+0
-0
.htaccess
.htaccess
+4
-1
Bugzilla/Auth/Verify/LDAP.pm
Bugzilla/Auth/Verify/LDAP.pm
+2
-0
Bugzilla/Bug.pm
Bugzilla/Bug.pm
+20
-15
Bugzilla/CGI.pm
Bugzilla/CGI.pm
+27
-13
Bugzilla/Classification.pm
Bugzilla/Classification.pm
+51
-1
Bugzilla/Constants.pm
Bugzilla/Constants.pm
+5
-1
Bugzilla/DB/Oracle.pm
Bugzilla/DB/Oracle.pm
+55
-13
Bugzilla/DB/Schema.pm
Bugzilla/DB/Schema.pm
+22
-4
Bugzilla/DB/Schema/Oracle.pm
Bugzilla/DB/Schema/Oracle.pm
+48
-16
Bugzilla/DB/Schema/Pg.pm
Bugzilla/DB/Schema/Pg.pm
+10
-0
Bugzilla/Hook.pm
Bugzilla/Hook.pm
+16
-0
Bugzilla/Install/DB.pm
Bugzilla/Install/DB.pm
+67
-4
Bugzilla/Report.pm
Bugzilla/Report.pm
+134
-0
Bugzilla/Search.pm
Bugzilla/Search.pm
+64
-18
Bugzilla/Search/Quicksearch.pm
Bugzilla/Search/Quicksearch.pm
+4
-3
Bugzilla/Search/Saved.pm
Bugzilla/Search/Saved.pm
+1
-1
Bugzilla/Status.pm
Bugzilla/Status.pm
+2
-2
Bugzilla/Template.pm
Bugzilla/Template.pm
+14
-0
Bugzilla/Token.pm
Bugzilla/Token.pm
+6
-8
Bugzilla/User.pm
Bugzilla/User.pm
+32
-0
Bugzilla/User/Setting.pm
Bugzilla/User/Setting.pm
+10
-15
Bugzilla/UserAgent.pm
Bugzilla/UserAgent.pm
+1
-0
Bugzilla/WebService/Bug.pm
Bugzilla/WebService/Bug.pm
+8
-2
Bugzilla/WebService/Product.pm
Bugzilla/WebService/Product.pm
+6
-1
Bugzilla/WebService/User.pm
Bugzilla/WebService/User.pm
+28
-39
Bugzilla/WebService/Util.pm
Bugzilla/WebService/Util.pm
+14
-5
buglist.cgi
buglist.cgi
+5
-2
config.cgi
config.cgi
+12
-0
describecomponents.cgi
describecomponents.cgi
+2
-1
docs/bugzilla.ent
docs/bugzilla.ent
+2
-2
docs/bugzilla.ent.tmpl
docs/bugzilla.ent.tmpl
+2
-2
docs/en/html/Bugzilla-Guide.html
docs/en/html/Bugzilla-Guide.html
+42
-41
docs/en/html/about.html
docs/en/html/about.html
+1
-1
docs/en/html/administration.html
docs/en/html/administration.html
+1
-1
docs/en/html/api/Bugzilla/Classification.html
docs/en/html/api/Bugzilla/Classification.html
+21
-0
docs/en/html/api/Bugzilla/Hook.html
docs/en/html/api/Bugzilla/Hook.html
+18
-0
docs/en/html/api/Bugzilla/Report.html
docs/en/html/api/Bugzilla/Report.html
+59
-0
docs/en/html/api/Bugzilla/User.html
docs/en/html/api/Bugzilla/User.html
+13
-0
docs/en/html/api/Bugzilla/WebService/Bug.html
docs/en/html/api/Bugzilla/WebService/Bug.html
+1
-1
docs/en/html/api/Bugzilla/WebService/Product.html
docs/en/html/api/Bugzilla/WebService/Product.html
+3
-1
docs/en/html/api/Bugzilla/WebService/User.html
docs/en/html/api/Bugzilla/WebService/User.html
+7
-14
docs/en/html/api/Bugzilla/WebService/Util.html
docs/en/html/api/Bugzilla/WebService/Util.html
+4
-0
docs/en/html/api/index.html
docs/en/html/api/index.html
+33
-29
docs/en/html/attachments.html
docs/en/html/attachments.html
+1
-1
docs/en/html/bug_page.html
docs/en/html/bug_page.html
+1
-1
docs/en/html/bug_status_workflow.html
docs/en/html/bug_status_workflow.html
+1
-1
docs/en/html/bugreports.html
docs/en/html/bugreports.html
+1
-1
docs/en/html/classifications.html
docs/en/html/classifications.html
+1
-1
docs/en/html/cmdline-bugmail.html
docs/en/html/cmdline-bugmail.html
+1
-1
docs/en/html/cmdline.html
docs/en/html/cmdline.html
+1
-1
docs/en/html/components.html
docs/en/html/components.html
+1
-1
docs/en/html/configuration.html
docs/en/html/configuration.html
+15
-14
docs/en/html/conventions.html
docs/en/html/conventions.html
+1
-1
docs/en/html/copyright.html
docs/en/html/copyright.html
+1
-1
docs/en/html/credits.html
docs/en/html/credits.html
+1
-1
docs/en/html/cust-change-permissions.html
docs/en/html/cust-change-permissions.html
+2
-2
docs/en/html/cust-skins.html
docs/en/html/cust-skins.html
+1
-1
docs/en/html/cust-templates.html
docs/en/html/cust-templates.html
+1
-1
docs/en/html/custom-fields.html
docs/en/html/custom-fields.html
+2
-2
docs/en/html/customization.html
docs/en/html/customization.html
+1
-1
docs/en/html/disclaimer.html
docs/en/html/disclaimer.html
+1
-1
docs/en/html/edit-values.html
docs/en/html/edit-values.html
+1
-1
docs/en/html/extensions.html
docs/en/html/extensions.html
+1
-1
docs/en/html/extraconfig.html
docs/en/html/extraconfig.html
+2
-2
docs/en/html/flags-overview.html
docs/en/html/flags-overview.html
+1
-1
docs/en/html/flags.html
docs/en/html/flags.html
+1
-1
docs/en/html/general-advice.html
docs/en/html/general-advice.html
+1
-1
docs/en/html/gfdl-0.html
docs/en/html/gfdl-0.html
+1
-1
docs/en/html/gfdl-1.html
docs/en/html/gfdl-1.html
+1
-1
docs/en/html/gfdl-10.html
docs/en/html/gfdl-10.html
+1
-1
docs/en/html/gfdl-2.html
docs/en/html/gfdl-2.html
+1
-1
docs/en/html/gfdl-3.html
docs/en/html/gfdl-3.html
+1
-1
docs/en/html/gfdl-4.html
docs/en/html/gfdl-4.html
+1
-1
docs/en/html/gfdl-5.html
docs/en/html/gfdl-5.html
+1
-1
docs/en/html/gfdl-6.html
docs/en/html/gfdl-6.html
+1
-1
docs/en/html/gfdl-7.html
docs/en/html/gfdl-7.html
+1
-1
docs/en/html/gfdl-8.html
docs/en/html/gfdl-8.html
+1
-1
docs/en/html/gfdl-9.html
docs/en/html/gfdl-9.html
+1
-1
docs/en/html/gfdl-howto.html
docs/en/html/gfdl-howto.html
+1
-1
docs/en/html/gfdl.html
docs/en/html/gfdl.html
+1
-1
docs/en/html/glossary.html
docs/en/html/glossary.html
+1
-1
docs/en/html/groups.html
docs/en/html/groups.html
+2
-2
docs/en/html/hintsandtips.html
docs/en/html/hintsandtips.html
+2
-2
docs/en/html/index.html
docs/en/html/index.html
+4
-4
docs/en/html/install-perlmodules-manual.html
docs/en/html/install-perlmodules-manual.html
+1
-1
docs/en/html/installation.html
docs/en/html/installation.html
+1
-1
docs/en/html/installing-bugzilla.html
docs/en/html/installing-bugzilla.html
+1
-1
docs/en/html/integration.html
docs/en/html/integration.html
+1
-1
docs/en/html/keywords.html
docs/en/html/keywords.html
+2
-2
docs/en/html/lifecycle.html
docs/en/html/lifecycle.html
+1
-1
docs/en/html/milestones.html
docs/en/html/milestones.html
+1
-1
docs/en/html/modules-manual-download.html
docs/en/html/modules-manual-download.html
+1
-1
docs/en/html/modules-manual-instructions.html
docs/en/html/modules-manual-instructions.html
+1
-1
docs/en/html/modules-manual-optional.html
docs/en/html/modules-manual-optional.html
+1
-1
docs/en/html/multiple-bz-dbs.html
docs/en/html/multiple-bz-dbs.html
+1
-1
docs/en/html/myaccount.html
docs/en/html/myaccount.html
+1
-1
docs/en/html/newversions.html
docs/en/html/newversions.html
+2
-2
docs/en/html/nonroot.html
docs/en/html/nonroot.html
+9
-9
docs/en/html/os-specific.html
docs/en/html/os-specific.html
+1
-1
docs/en/html/parameters.html
docs/en/html/parameters.html
+1
-1
docs/en/html/paranoid-security.html
docs/en/html/paranoid-security.html
+1
-1
docs/en/html/patches.html
docs/en/html/patches.html
+1
-1
docs/en/html/products.html
docs/en/html/products.html
+1
-1
docs/en/html/query.html
docs/en/html/query.html
+1
-1
docs/en/html/quips.html
docs/en/html/quips.html
+1
-1
docs/en/html/reporting.html
docs/en/html/reporting.html
+2
-2
docs/en/html/sanitycheck.html
docs/en/html/sanitycheck.html
+2
-2
docs/en/html/security-bugzilla.html
docs/en/html/security-bugzilla.html
+1
-1
docs/en/html/security-os.html
docs/en/html/security-os.html
+1
-1
docs/en/html/security-webserver.html
docs/en/html/security-webserver.html
+1
-1
docs/en/html/security.html
docs/en/html/security.html
+1
-1
docs/en/html/timetracking.html
docs/en/html/timetracking.html
+1
-1
docs/en/html/trbl-dbdSponge.html
docs/en/html/trbl-dbdSponge.html
+1
-1
docs/en/html/trbl-index.html
docs/en/html/trbl-index.html
+1
-1
docs/en/html/trbl-passwd-encryption.html
docs/en/html/trbl-passwd-encryption.html
+1
-1
docs/en/html/trbl-perlmodule.html
docs/en/html/trbl-perlmodule.html
+1
-1
docs/en/html/trbl-relogin-everyone.html
docs/en/html/trbl-relogin-everyone.html
+1
-1
docs/en/html/trbl-testserver.html
docs/en/html/trbl-testserver.html
+1
-1
docs/en/html/troubleshooting.html
docs/en/html/troubleshooting.html
+1
-1
docs/en/html/upgrade.html
docs/en/html/upgrade.html
+2
-2
docs/en/html/useradmin.html
docs/en/html/useradmin.html
+1
-1
docs/en/html/userpreferences.html
docs/en/html/userpreferences.html
+2
-2
docs/en/html/using-intro.html
docs/en/html/using-intro.html
+1
-1
docs/en/html/using.html
docs/en/html/using.html
+1
-1
docs/en/html/versions.html
docs/en/html/versions.html
+1
-1
docs/en/html/voting.html
docs/en/html/voting.html
+1
-1
docs/en/html/whining.html
docs/en/html/whining.html
+3
-3
docs/en/pdf/Bugzilla-Guide.pdf
docs/en/pdf/Bugzilla-Guide.pdf
+0
-18156
docs/en/txt/Bugzilla-Guide.txt
docs/en/txt/Bugzilla-Guide.txt
+21
-21
docs/en/xml/administration.xml
docs/en/xml/administration.xml
+3
-3
docs/en/xml/bugzilla.ent
docs/en/xml/bugzilla.ent
+2
-2
docs/en/xml/customization.xml
docs/en/xml/customization.xml
+1
-1
docs/en/xml/installation.xml
docs/en/xml/installation.xml
+7
-6
docs/en/xml/using.xml
docs/en/xml/using.xml
+2
-2
editparams.cgi
editparams.cgi
+1
-1
email_in.pl
email_in.pl
+25
-0
enter_bug.cgi
enter_bug.cgi
+1
-20
extensions/Example/Extension.pm
extensions/Example/Extension.pm
+58
-52
js/custom-search.js
js/custom-search.js
+8
-0
js/field.js
js/field.js
+1
-1
lib/CGI.pm
lib/CGI.pm
+13
-9
lib/CGI/Cookie.pm
lib/CGI/Cookie.pm
+1
-1
quips.cgi
quips.cgi
+4
-0
report.cgi
report.cgi
+63
-16
reports.cgi
reports.cgi
+6
-8
show_bug.cgi
show_bug.cgi
+12
-12
skins/contrib/Dusk/global.css
skins/contrib/Dusk/global.css
+6
-6
skins/standard/IE-fixes.css
skins/standard/IE-fixes.css
+4
-0
skins/standard/global.css
skins/standard/global.css
+4
-4
skins/standard/reports.css
skins/standard/reports.css
+25
-0
skins/standard/show_bug.css
skins/standard/show_bug.css
+1
-1
template/en/default/account/auth/login-small.html.tmpl
template/en/default/account/auth/login-small.html.tmpl
+4
-5
template/en/default/account/auth/login.html.tmpl
template/en/default/account/auth/login.html.tmpl
+1
-0
template/en/default/admin/fieldvalues/confirm-delete.html.tmpl
...ate/en/default/admin/fieldvalues/confirm-delete.html.tmpl
+1
-1
template/en/default/admin/groups/create.html.tmpl
template/en/default/admin/groups/create.html.tmpl
+11
-4
template/en/default/bug/comments.html.tmpl
template/en/default/bug/comments.html.tmpl
+2
-1
template/en/default/bug/create/create.html.tmpl
template/en/default/bug/create/create.html.tmpl
+24
-23
template/en/default/bug/dependency-tree.html.tmpl
template/en/default/bug/dependency-tree.html.tmpl
+1
-1
template/en/default/bug/edit.html.tmpl
template/en/default/bug/edit.html.tmpl
+25
-20
template/en/default/bug/field.html.tmpl
template/en/default/bug/field.html.tmpl
+7
-7
template/en/default/bug/knob.html.tmpl
template/en/default/bug/knob.html.tmpl
+2
-2
template/en/default/bug/show-multiple.html.tmpl
template/en/default/bug/show-multiple.html.tmpl
+1
-1
template/en/default/config.rdf.tmpl
template/en/default/config.rdf.tmpl
+3
-0
template/en/default/filterexceptions.pl
template/en/default/filterexceptions.pl
+0
-2
template/en/default/flag/list.html.tmpl
template/en/default/flag/list.html.tmpl
+1
-3
template/en/default/global/common-links.html.tmpl
template/en/default/global/common-links.html.tmpl
+2
-2
template/en/default/global/messages.html.tmpl
template/en/default/global/messages.html.tmpl
+9
-0
template/en/default/global/useful-links.html.tmpl
template/en/default/global/useful-links.html.tmpl
+12
-1
template/en/default/global/user-error.html.tmpl
template/en/default/global/user-error.html.tmpl
+26
-8
template/en/default/list/edit-multiple.html.tmpl
template/en/default/list/edit-multiple.html.tmpl
+2
-2
template/en/default/list/list.html.tmpl
template/en/default/list/list.html.tmpl
+3
-0
template/en/default/list/quips.html.tmpl
template/en/default/list/quips.html.tmpl
+1
-1
template/en/default/list/table.html.tmpl
template/en/default/list/table.html.tmpl
+1
-1
template/en/default/pages/release-notes.html.tmpl
template/en/default/pages/release-notes.html.tmpl
+41
-0
template/en/default/reports/report.html.tmpl
template/en/default/reports/report.html.tmpl
+43
-60
template/en/default/search/search-advanced.html.tmpl
template/en/default/search/search-advanced.html.tmpl
+11
-1
token.cgi
token.cgi
+5
-0
No files found.
.bzr/checkout/dirstate
View file @
f297f575
No preview for this file type
.htaccess
View file @
f297f575
# Don't allow people to retrieve non-cgi executable files or our private data
<
FilesMatch
^(.*\.pm|.*\.pl|.*
localconfig.*)$
>
<
FilesMatch
(\.pm|\.pl|\.tmpl|
localconfig.*)$
>
deny
from
all
</
FilesMatch
>
Options
-Indexes
<
IfModule
mod_expires.c
>
<
IfModule
mod_headers.c
>
<
IfModule
mod_env.c
>
...
...
Bugzilla/Auth/Verify/LDAP.pm
View file @
f297f575
...
...
@@ -18,6 +18,7 @@ use Bugzilla::User;
use
Bugzilla::
Util
;
use
Net::
LDAP
;
use
Net::LDAP::
Util
qw(escape_filter_value)
;
use
constant
admin_can_create_account
=>
0
;
use
constant
user_can_create_account
=>
0
;
...
...
@@ -121,6 +122,7 @@ sub check_credentials {
sub
_bz_search_params
{
my
(
$username
)
=
@_
;
$username
=
escape_filter_value
(
$username
);
return
(
base
=>
Bugzilla
->
params
->
{"
LDAPBaseDN
"},
scope
=>
"
sub
",
filter
=>
'
(&(
'
.
Bugzilla
->
params
->
{"
LDAPuidattribute
"}
...
...
Bugzilla/Bug.pm
View file @
f297f575
...
...
@@ -358,12 +358,14 @@ sub check {
# Bugzilla::Bug throws lots of special errors, so we don't call
# SUPER::check, we just call our new and do our own checks.
my
$self
=
$class
->
new
(
trim
(
$id
));
# For error messages, use the id that was returned by new(), because
# it's cleaned up.
$id
=
$self
->
id
;
$id
=
trim
(
$id
);
my
$self
=
$class
->
new
(
$id
);
if
(
$self
->
{
error
})
{
# For error messages, use the id that was returned by new(), because
# it's cleaned up.
$id
=
$self
->
id
;
if
(
$self
->
{
error
}
eq
'
NotFound
')
{
ThrowUserError
("
bug_id_does_not_exist
",
{
bug_id
=>
$id
});
}
...
...
@@ -375,7 +377,7 @@ sub check {
}
unless
(
$field
&&
$field
=~
/^(dependson|blocked|dup_id)$/
)
{
$self
->
check_is_visible
;
$self
->
check_is_visible
(
$id
)
;
}
return
$self
;
}
...
...
@@ -391,16 +393,19 @@ sub check_for_edit {
}
sub
check_is_visible
{
my
$self
=
shift
;
my
(
$self
,
$input_id
)
=
@_
;
$input_id
||=
$self
->
id
;
my
$user
=
Bugzilla
->
user
;
if
(
!
$user
->
can_see_bug
(
$self
->
id
))
{
# The error the user sees depends on whether or not they are
# logged in (i.e. $user->id contains the user's positive integer ID).
# If we are validating an alias, then use it in the error message
# instead of its corresponding bug ID, to not disclose it.
if
(
$user
->
id
)
{
ThrowUserError
("
bug_access_denied
",
{
bug_id
=>
$
self
->
id
});
ThrowUserError
("
bug_access_denied
",
{
bug_id
=>
$
input_
id
});
}
else
{
ThrowUserError
("
bug_access_query
",
{
bug_id
=>
$
self
->
id
});
ThrowUserError
("
bug_access_query
",
{
bug_id
=>
$
input_
id
});
}
}
}
...
...
@@ -1471,9 +1476,7 @@ sub _check_dependencies {
:
split
(
/[\s,]+/
,
$deps_in
{
$type
});
# Eliminate nulls.
@bug_ids
=
grep
{
$_
}
@bug_ids
;
# We do this up here to make sure all aliases are converted to IDs.
@bug_ids
=
map
{
$invocant
->
check
(
$_
,
$type
)
->
id
}
@bug_ids
;
my
@check_access
=
@bug_ids
;
# When we're updating a bug, only added or removed bug_ids are
# checked for whether or not we can see/edit those bugs.
...
...
@@ -1503,7 +1506,8 @@ sub _check_dependencies {
}
}
}
# Replace all aliases by their corresponding bug ID.
@bug_ids
=
map
{
$_
=~
/^(\d+)$/
?
$
1
:
$invocant
->
check
(
$_
,
$type
)
->
id
}
@bug_ids
;
$deps_in
{
$type
}
=
\
@bug_ids
;
}
...
...
@@ -1520,8 +1524,9 @@ sub _check_dependencies {
sub
_check_dup_id
{
my
(
$self
,
$dupe_of
)
=
@_
;
my
$dbh
=
Bugzilla
->
dbh
;
$dupe_of
=
trim
(
$dupe_of
);
# Store the bug ID/alias passed by the user for visibility checks.
my
$orig_dupe_of
=
$dupe_of
=
trim
(
$dupe_of
);
$dupe_of
||
ThrowCodeError
('
undefined_field
',
{
field
=>
'
dup_id
'
});
# Validate the bug ID. The second argument will force check() to only
# make sure that the bug exists, and convert the alias to the bug ID
...
...
@@ -1534,7 +1539,7 @@ sub _check_dup_id {
# If we come here, then the duplicate is new. We have to make sure
# that we can view/change it (issue A on bug 96085).
$dupe_of_bug
->
check_is_visible
;
$dupe_of_bug
->
check_is_visible
(
$orig_dupe_of
)
;
# Make sure a loop isn't created when marking this bug
# as duplicate.
...
...
Bugzilla/CGI.pm
View file @
f297f575
...
...
@@ -16,15 +16,6 @@ use Bugzilla::Search::Recent;
use
File::
Basename
;
BEGIN
{
if
(
ON_WINDOWS
)
{
# Help CGI find the correct temp directory as the default list
# isn't Windows friendly (Bug 248988)
$ENV
{'
TMPDIR
'}
=
$ENV
{'
TEMP
'}
||
$ENV
{'
TMP
'}
||
"
$ENV
{'WINDIR'}
\\
TEMP
";
}
*AUTOLOAD
=
\
&
CGI::
AUTOLOAD
;
}
sub
_init_bz_cgi_globals
{
my
$invocant
=
shift
;
# We need to disable output buffering - see bug 179174
...
...
@@ -59,14 +50,27 @@ sub new {
# Path-Info is of no use for Bugzilla and interacts badly with IIS.
# Moreover, it causes unexpected behaviors, such as totally breaking
# the rendering of pages. Skip it!
print
$self
->
redirect
(
$self
->
url
(
-
path
=>
0
,
-
query
=>
1
))
if
$self
->
path_info
;
# the rendering of pages.
my
$script
=
basename
(
$
0
);
if
(
my
$path_info
=
$self
->
path_info
)
{
my
@whitelist
;
Bugzilla::Hook::
process
('
path_info_whitelist
',
{
whitelist
=>
\
@whitelist
});
if
(
!
grep
(
$_
eq
$script
,
@whitelist
))
{
# IIS includes the full path to the script in PATH_INFO,
# so we have to extract the real PATH_INFO from it,
# else we will be redirected outside Bugzilla.
my
$script_name
=
$self
->
script_name
;
$path_info
=~
s/^\Q$script_name\E//
;
if
(
$path_info
)
{
print
$self
->
redirect
(
$self
->
url
(
-
path
=>
0
,
-
query
=>
1
));
}
}
}
# Send appropriate charset
$self
->
charset
(
Bugzilla
->
params
->
{'
utf8
'}
?
'
UTF-8
'
:
'');
# Redirect to urlbase/sslbase if we are not viewing an attachment.
my
$script
=
basename
(
$
0
);
if
(
$self
->
url_is_attachment_base
and
$script
ne
'
attachment.cgi
')
{
$self
->
redirect_to_urlbase
();
}
...
...
@@ -158,6 +162,16 @@ sub clean_search_url {
# Delete leftovers from the login form
$self
->
delete
('
Bugzilla_remember
',
'
GoAheadAndLogIn
');
# Delete the token if we're not performing an action which needs it
unless
((
defined
$self
->
param
('
remtype
')
&&
(
$self
->
param
('
remtype
')
eq
'
asdefault
'
||
$self
->
param
('
remtype
')
eq
'
asnamed
'))
||
(
defined
$self
->
param
('
remaction
')
&&
$self
->
param
('
remaction
')
eq
'
forget
'))
{
$self
->
delete
("
token
");
}
foreach
my
$num
(
1
,
2
,
3
)
{
# If there's no value in the email field, delete the related fields.
if
(
!
$self
->
param
("
email
$num
"))
{
...
...
@@ -344,7 +358,7 @@ sub param {
sub
_fix_utf8
{
my
$input
=
shift
;
# The is_utf8 is here in case CGI gets smart about utf8 someday.
utf8::
decode
(
$input
)
if
defined
$input
&&
!
utf8::
is_utf8
(
$input
);
utf8::
decode
(
$input
)
if
defined
$input
&&
!
ref
$input
&&
!
utf8::
is_utf8
(
$input
);
return
$input
;
}
...
...
Bugzilla/Classification.pm
View file @
f297f575
...
...
@@ -15,7 +15,8 @@ use Bugzilla::Util;
use
Bugzilla::
Error
;
use
Bugzilla::
Product
;
use
base
qw(Bugzilla::Field::ChoiceInterface Bugzilla::Object)
;
use
base
qw(Bugzilla::Field::ChoiceInterface Bugzilla::Object Exporter)
;
@
Bugzilla::Classification::
EXPORT
=
qw(sort_products_by_classification)
;
###############################
#### Initialization ####
...
...
@@ -152,6 +153,38 @@ sub products {
sub
description
{
return
$_
[
0
]
->
{'
description
'};
}
sub
sortkey
{
return
$_
[
0
]
->
{'
sortkey
'};
}
###############################
#### Helpers ####
###############################
# This function is a helper to sort products to be listed
# in global/choose-product.html.tmpl.
sub
sort_products_by_classification
{
my
$products
=
shift
;
my
$list
;
if
(
Bugzilla
->
params
->
{'
useclassification
'})
{
my
$class
=
{};
# Get all classifications with at least one product.
foreach
my
$product
(
@$products
)
{
$class
->
{
$product
->
classification_id
}
->
{'
object
'}
||=
new
Bugzilla::
Classification
(
$product
->
classification_id
);
# Nice way to group products per classification, without querying
# the DB again.
push
(
@
{
$class
->
{
$product
->
classification_id
}
->
{'
products
'}},
$product
);
}
$list
=
[
sort
{
$a
->
{'
object
'}
->
sortkey
<=>
$b
->
{'
object
'}
->
sortkey
||
lc
(
$a
->
{'
object
'}
->
name
)
cmp
lc
(
$b
->
{'
object
'}
->
name
)}
(
values
%$class
)];
}
else
{
$list
=
[{
object
=>
undef
,
products
=>
$products
}];
}
return
$list
;
}
1
;
__END__
...
...
@@ -208,4 +241,21 @@ A Classification is a higher-level grouping of Products.
=back
=head1 SUBROUTINES
=over
=item C<sort_products_by_classification>
Description: This is a helper which returns a list of products sorted
by classification in a form suitable to be passed to the
global/choose-product.html.tmpl template.
Params: An arrayref of product objects.
Returns: An arrayref of hashes suitable to be passed to
global/choose-product.html.tmpl.
=back
=cut
Bugzilla/Constants.pm
View file @
f297f575
...
...
@@ -161,6 +161,7 @@ use Memoize;
MAX_BUG_URL_LENGTH
MAX_POSSIBLE_DUPLICATES
MAX_ATTACH_FILENAME_LENGTH
MAX_QUIP_LENGTH
PASSWORD_DIGEST_ALGORITHM
PASSWORD_SALT_LENGTH
...
...
@@ -181,7 +182,7 @@ use Memoize;
# CONSTANTS
#
# Bugzilla version
use
constant
BUGZILLA_VERSION
=>
"
4.3.
2
";
use
constant
BUGZILLA_VERSION
=>
"
4.3.
3
";
# Location of the remote and local XML files to track new releases.
use
constant
REMOTE_FILE
=>
'
http://updates.bugzilla.org/bugzilla-update.xml
';
...
...
@@ -556,6 +557,9 @@ use constant MAX_POSSIBLE_DUPLICATES => 25;
# necessary schema changes to store longer names.
use
constant
MAX_ATTACH_FILENAME_LENGTH
=>
255
;
# Maximum length of a quip.
use
constant
MAX_QUIP_LENGTH
=>
512
;
# This is the name of the algorithm used to hash passwords before storing
# them in the database. This can be any string that is valid to pass to
# Perl's "Digest" module. Note that if you change this, it won't take
...
...
Bugzilla/DB/Oracle.pm
View file @
f297f575
...
...
@@ -294,6 +294,9 @@ sub adjust_statement {
my
$is_select
=
(
$part
=~
m/^\s*SELECT\b/io
);
my
$has_from
=
(
$part
=~
m/\bFROM\b/io
)
if
$is_select
;
# Oracle includes the time in CURRENT_DATE.
$part
=~
s/\bCURRENT_DATE\b/TRUNC(CURRENT_DATE)/io
;
# Oracle use SUBSTR instead of SUBSTRING
$part
=~
s/\bSUBSTRING\b/SUBSTR/io
;
...
...
@@ -322,6 +325,9 @@ sub adjust_statement {
$has_from
=
(
$nonstring
=~
m/\bFROM\b/io
)
if
(
$is_select
and
!
$has_from
);
# Oracle includes the time in CURRENT_DATE.
$nonstring
=~
s/\bCURRENT_DATE\b/TRUNC(CURRENT_DATE)/io
;
# Oracle use SUBSTR instead of SUBSTRING
$nonstring
=~
s/\bSUBSTRING\b/SUBSTR/io
;
...
...
@@ -610,11 +616,25 @@ sub bz_setup_database {
$self
->
SUPER::
bz_setup_database
(
@
_
);
my
$sth
=
$self
->
prepare
("
SELECT OBJECT_NAME FROM USER_OBJECTS WHERE OBJECT_NAME = ?
");
my
@tables
=
$self
->
bz_table_list_real
();
foreach
my
$table
(
@tables
)
{
my
@columns
=
$self
->
bz_table_columns_real
(
$table
);
foreach
my
$column
(
@columns
)
{
my
$def
=
$self
->
bz_column_info
(
$table
,
$column
);
# bz_add_column() before Bugzilla 4.2.3 didn't handle primary keys
# correctly (bug 731156). We have to add missing sequences and
# triggers ourselves.
if
(
$def
->
{
TYPE
}
=~
/SERIAL/i
)
{
my
$sequence
=
"
${table}
_
${column}
_SEQ
";
my
$exists
=
$self
->
selectrow_array
(
$sth
,
undef
,
$sequence
);
if
(
!
$exists
)
{
my
@sql
=
$self
->
_get_create_seq_ddl
(
$table
,
$column
);
$self
->
do
(
$_
)
foreach
@sql
;
}
}
if
(
$def
->
{
REFERENCES
})
{
my
$references
=
$def
->
{
REFERENCES
};
my
$update
=
$references
->
{
UPDATE
}
||
'
CASCADE
';
...
...
@@ -628,15 +648,13 @@ sub bz_setup_database {
$to_table
=
'
tag
';
}
if
(
$update
=~
/CASCADE/i
){
my
$trigger_name
=
uc
(
$fk_name
.
"
_UC
");
my
$exist_trigger
=
$self
->
selectcol_arrayref
(
"
SELECT OBJECT_NAME FROM USER_OBJECTS
WHERE OBJECT_NAME = ?
",
undef
,
$trigger_name
);
my
$trigger_name
=
uc
(
$fk_name
.
"
_UC
");
my
$exist_trigger
=
$self
->
selectcol_arrayref
(
$sth
,
undef
,
$trigger_name
);
if
(
@$exist_trigger
)
{
$self
->
do
("
DROP TRIGGER
$trigger_name
");
}
my
$tr_str
=
"
CREATE OR REPLACE TRIGGER
$trigger_name
"
my
$tr_str
=
"
CREATE OR REPLACE TRIGGER
$trigger_name
"
.
"
AFTER UPDATE OF
$to_column
ON
$to_table
"
.
"
REFERENCING
"
.
"
NEW AS NEW
"
...
...
@@ -647,22 +665,46 @@ sub bz_setup_database {
.
"
SET
$column
= :NEW.
$to_column
"
.
"
WHERE
$column
= :OLD.
$to_column
;
"
.
"
END
$trigger_name
;
";
$self
->
do
(
$tr_str
);
}
}
}
}
$self
->
do
(
$tr_str
);
}
}
}
}
# Drop the trigger which causes bug 541553
my
$trigger_name
=
"
PRODUCTS_MILESTONEURL
";
my
$exist_trigger
=
$self
->
selectcol_arrayref
(
"
SELECT OBJECT_NAME FROM USER_OBJECTS
WHERE OBJECT_NAME = ?
",
undef
,
$trigger_name
);
my
$exist_trigger
=
$self
->
selectcol_arrayref
(
$sth
,
undef
,
$trigger_name
);
if
(
@$exist_trigger
)
{
$self
->
do
("
DROP TRIGGER
$trigger_name
");
}
}
# These two methods have been copied from Bugzilla::DB::Schema::Oracle.
sub
_get_create_seq_ddl
{
my
(
$self
,
$table
,
$column
)
=
@_
;
my
$seq_name
=
"
${table}
_
${column}
_SEQ
";
my
$seq_sql
=
"
CREATE SEQUENCE
$seq_name
INCREMENT BY 1 START WITH 1
"
.
"
NOMAXVALUE NOCYCLE NOCACHE
";
my
$trigger_sql
=
$self
->
_get_create_trigger_ddl
(
$table
,
$column
,
$seq_name
);
return
(
$seq_sql
,
$trigger_sql
);
}
sub
_get_create_trigger_ddl
{
my
(
$self
,
$table
,
$column
,
$seq_name
)
=
@_
;
my
$trigger_sql
=
"
CREATE OR REPLACE TRIGGER
${table}
_
${column}
_TR
"
.
"
BEFORE INSERT ON
$table
"
.
"
FOR EACH ROW
"
.
"
BEGIN
"
.
"
SELECT
${seq_name}
.NEXTVAL
"
.
"
INTO :NEW.
$column
FROM DUAL;
"
.
"
END;
";
return
$trigger_sql
;
}
############################################################################
package
Bugzilla::DB::Oracle::
st
;
use
base
qw(DBI::st)
;
...
...
Bugzilla/DB/Schema.pm
View file @
f297f575
...
...
@@ -341,7 +341,7 @@ use constant ABSTRACT_SCHEMA => {
COLUMN
=>
'
id
'}},
added
=>
{
TYPE
=>
'
varchar(255)
'},
removed
=>
{
TYPE
=>
'
varchar(255)
'},
comment_id
=>
{
TYPE
=>
'
INT
3
',
comment_id
=>
{
TYPE
=>
'
INT
4
',
REFERENCES
=>
{
TABLE
=>
'
longdescs
',
COLUMN
=>
'
comment_id
',
DELETE
=>
'
CASCADE
'}},
...
...
@@ -376,7 +376,7 @@ use constant ABSTRACT_SCHEMA => {
longdescs
=>
{
FIELDS
=>
[
comment_id
=>
{
TYPE
=>
'
MEDIUM
SERIAL
',
NOTNULL
=>
1
,
comment_id
=>
{
TYPE
=>
'
INT
SERIAL
',
NOTNULL
=>
1
,
PRIMARYKEY
=>
1
},
bug_id
=>
{
TYPE
=>
'
INT3
',
NOTNULL
=>
1
,
REFERENCES
=>
{
TABLE
=>
'
bugs
',
...
...
@@ -416,7 +416,8 @@ use constant ABSTRACT_SCHEMA => {
DELETE
=>
'
CASCADE
'}},
],
INDEXES
=>
[
dependencies_blocked_idx
=>
['
blocked
'],
dependencies_blocked_idx
=>
{
FIELDS
=>
[
qw(blocked dependson)
],
TYPE
=>
'
UNIQUE
'},
dependencies_dependson_idx
=>
['
dependson
'],
],
},
...
...
@@ -1025,6 +1026,23 @@ use constant ABSTRACT_SCHEMA => {
],
},
reports
=>
{
FIELDS
=>
[
id
=>
{
TYPE
=>
'
MEDIUMSERIAL
',
NOTNULL
=>
1
,
PRIMARYKEY
=>
1
},
user_id
=>
{
TYPE
=>
'
INT3
',
NOTNULL
=>
1
,
REFERENCES
=>
{
TABLE
=>
'
profiles
',
COLUMN
=>
'
userid
',
DELETE
=>
'
CASCADE
'}},
name
=>
{
TYPE
=>
'
varchar(64)
',
NOTNULL
=>
1
},
query
=>
{
TYPE
=>
'
LONGTEXT
',
NOTNULL
=>
1
},
],
INDEXES
=>
[
reports_user_id_idx
=>
{
FIELDS
=>
[
qw(user_id name)
],
TYPE
=>
'
UNIQUE
'},
],
},
component_cc
=>
{
FIELDS
=>
[
...
...
@@ -1466,7 +1484,7 @@ use constant ABSTRACT_SCHEMA => {
REFERENCES
=>
{
TABLE
=>
'
profiles
',
COLUMN
=>
'
userid
',
DELETE
=>
'
SET NULL
'}},
quip
=>
{
TYPE
=>
'
MEDIUMTEXT
',
NOTNULL
=>
1
},
quip
=>
{
TYPE
=>
'
varchar(512)
',
NOTNULL
=>
1
},
approved
=>
{
TYPE
=>
'
BOOLEAN
',
NOTNULL
=>
1
,
DEFAULT
=>
'
TRUE
'},
],
...
...
Bugzilla/DB/Schema/Oracle.pm
View file @
f297f575
...
...
@@ -184,6 +184,31 @@ sub _get_fk_name {
return
$fk_name
;
}
sub
get_add_column_ddl
{
my
$self
=
shift
;
my
(
$table
,
$column
,
$definition
,
$init_value
)
=
@_
;
my
@sql
;
# Create sequences and triggers to emulate SERIAL datatypes.
if
(
$definition
->
{
TYPE
}
=~
/SERIAL/i
)
{
# Clone the definition to not alter the original one.
my
%def
=
%$definition
;
# Oracle requires to define the column is several steps.
my
$pk
=
delete
$def
{
PRIMARYKEY
};
my
$notnull
=
delete
$def
{
NOTNULL
};
@sql
=
$self
->
SUPER::
get_add_column_ddl
(
$table
,
$column
,
\
%def
,
$init_value
);
push
(
@sql
,
$self
->
_get_create_seq_ddl
(
$table
,
$column
));
push
(
@sql
,
"
UPDATE
$table
SET
$column
=
${table}
_
${column}
_SEQ.NEXTVAL
");
push
(
@sql
,
"
ALTER TABLE
$table
MODIFY
$column
NOT NULL
")
if
$notnull
;
push
(
@sql
,
"
ALTER TABLE
$table
ADD PRIMARY KEY (
$column
)
")
if
$pk
;
}
else
{
@sql
=
$self
->
SUPER::
get_add_column_ddl
(
@
_
);
}
return
@sql
;
}
sub
get_alter_column_ddl
{
my
(
$self
,
$table
,
$column
,
$new_def
,
$set_nulls_to
)
=
@_
;
...
...
@@ -349,6 +374,29 @@ sub get_rename_column_ddl {
return
@sql
;
}
sub
get_drop_column_ddl
{
my
$self
=
shift
;
my
(
$table
,
$column
)
=
@_
;
my
@sql
;
push
(
@sql
,
$self
->
SUPER::
get_drop_column_ddl
(
@
_
));
my
$dbh
=
Bugzilla
->
dbh
;
my
$trigger_name
=
uc
(
$table
.
"
_
"
.
$column
);
my
$exist_trigger
=
$dbh
->
selectcol_arrayref
(
"
SELECT OBJECT_NAME FROM USER_OBJECTS
WHERE OBJECT_NAME = ?
",
undef
,
$trigger_name
);
if
(
@$exist_trigger
)
{
push
(
@sql
,
"
DROP TRIGGER
$trigger_name
");
}
# If this column is of type SERIAL, we need to drop the sequence
# and trigger that went along with it.
my
$def
=
$self
->
get_column_abstract
(
$table
,
$column
);
if
(
$def
->
{
TYPE
}
=~
/SERIAL/i
)
{
push
(
@sql
,
"
DROP SEQUENCE
${table}
_
${column}
_SEQ
");
push
(
@sql
,
"
DROP TRIGGER
${table}
_
${column}
_TR
");
}
return
@sql
;
}
sub
get_rename_table_sql
{
my
(
$self
,
$old_name
,
$new_name
)
=
@_
;
if
(
lc
(
$old_name
)
eq
lc
(
$new_name
))
{
...
...
@@ -450,20 +498,4 @@ sub get_set_serial_sql {
return
@sql
;
}
sub
get_drop_column_ddl
{
my
$self
=
shift
;
my
(
$table
,
$column
)
=
@_
;
my
@sql
;
push
(
@sql
,
$self
->
SUPER::
get_drop_column_ddl
(
@
_
));
my
$dbh
=
Bugzilla
->
dbh
;
my
$trigger_name
=
uc
(
$table
.
"
_
"
.
$column
);
my
$exist_trigger
=
$dbh
->
selectcol_arrayref
(
"
SELECT OBJECT_NAME FROM USER_OBJECTS
WHERE OBJECT_NAME = ?
",
undef
,
$trigger_name
);
if
(
@$exist_trigger
)
{
push
(
@sql
,
"
DROP TRIGGER
$trigger_name
");
}
return
@sql
;
}
1
;
Bugzilla/DB/Schema/Pg.pm
View file @
f297f575
...
...
@@ -74,6 +74,16 @@ sub _initialize {
}
#eosub--_initialize
#--------------------------------------------------------------------
sub
get_create_database_sql
{
my
(
$self
,
$name
)
=
@_
;
# We only create as utf8 if we have no params (meaning we're doing
# a new installation) or if the utf8 param is on.
my
$create_utf8
=
Bugzilla
->
params
->
{'
utf8
'}
||
!
defined
Bugzilla
->
params
->
{'
utf8
'};
my
$charset
=
$create_utf8
?
"
ENCODING 'UTF8' TEMPLATE template0
"
:
'';
return
("
CREATE DATABASE
$name
$charset
");
}
sub
get_rename_column_ddl
{
my
(
$self
,
$table
,
$old_name
,
$new_name
)
=
@_
;
if
(
lc
(
$old_name
)
eq
lc
(
$new_name
))
{
...
...
Bugzilla/Hook.pm
View file @
f297f575
...
...
@@ -1289,6 +1289,22 @@ your template.
=back
=head2 path_info_whitelist