From 200d60ec4ddf40e11361f99b2d789a2597caf9d7 Mon Sep 17 00:00:00 2001 From: "bzrmirror%bugzilla.org" Date: Wed, 3 Dec 2014 22:02:31 +0000 Subject: [PATCH] Remove docs changes by jwilmoth@starbucks.com. git-svn-id: svn://10.0.0.236/trunk@265700 18797224-902f-48f8-a5cc-f745e15eee43 --- mozilla/webtools/bugzilla/.bzrrev | 2 +- mozilla/webtools/bugzilla/.gitrev | 2 +- mozilla/webtools/bugzilla/.htaccess | 1 - mozilla/webtools/bugzilla/.travis.yml | 31 +- mozilla/webtools/bugzilla/Bugzilla.pm | 47 +- .../webtools/bugzilla/Bugzilla/Attachment.pm | 45 +- .../Bugzilla/Attachment/PatchReader.pm | 87 +- mozilla/webtools/bugzilla/Bugzilla/Auth.pm | 5 +- .../webtools/bugzilla/Bugzilla/Auth/Login.pm | 2 - .../bugzilla/Bugzilla/Auth/Login/APIKey.pm | 53 - .../bugzilla/Bugzilla/Auth/Login/CGI.pm | 1 - .../bugzilla/Bugzilla/Auth/Login/Cookie.pm | 18 +- .../bugzilla/Bugzilla/Auth/Login/Env.pm | 2 +- .../bugzilla/Bugzilla/Auth/Login/Stack.pm | 1 - .../bugzilla/Bugzilla/Auth/Persist/Cookie.pm | 2 - .../webtools/bugzilla/Bugzilla/Auth/Verify.pm | 2 - .../bugzilla/Bugzilla/Auth/Verify/DB.pm | 18 +- .../bugzilla/Bugzilla/Auth/Verify/LDAP.pm | 1 - .../bugzilla/Bugzilla/Auth/Verify/RADIUS.pm | 1 - .../bugzilla/Bugzilla/Auth/Verify/Stack.pm | 1 - mozilla/webtools/bugzilla/Bugzilla/Bug.pm | 197 +--- mozilla/webtools/bugzilla/Bugzilla/BugMail.pm | 1 - mozilla/webtools/bugzilla/Bugzilla/BugUrl.pm | 1 - .../bugzilla/Bugzilla/BugUrl/Bugzilla.pm | 1 - .../Bugzilla/BugUrl/Bugzilla/Local.pm | 1 - .../bugzilla/Bugzilla/BugUrl/Debian.pm | 1 - .../bugzilla/Bugzilla/BugUrl/GitHub.pm | 5 +- .../bugzilla/Bugzilla/BugUrl/Google.pm | 1 - .../webtools/bugzilla/Bugzilla/BugUrl/JIRA.pm | 1 - .../bugzilla/Bugzilla/BugUrl/Launchpad.pm | 1 - .../bugzilla/Bugzilla/BugUrl/MantisBT.pm | 1 - .../bugzilla/Bugzilla/BugUrl/SourceForge.pm | 22 +- .../webtools/bugzilla/Bugzilla/BugUrl/Trac.pm | 1 - .../bugzilla/Bugzilla/BugUserLastVisit.pm | 10 - mozilla/webtools/bugzilla/Bugzilla/CGI.pm | 17 +- mozilla/webtools/bugzilla/Bugzilla/Chart.pm | 8 +- .../bugzilla/Bugzilla/Classification.pm | 1 - mozilla/webtools/bugzilla/Bugzilla/Comment.pm | 19 - .../bugzilla/Bugzilla/Comment/TagWeights.pm | 1 - .../webtools/bugzilla/Bugzilla/Component.pm | 1 - mozilla/webtools/bugzilla/Bugzilla/Config.pm | 128 +-- .../bugzilla/Bugzilla/Config/Admin.pm | 1 - .../bugzilla/Bugzilla/Config/Advanced.pm | 1 - .../bugzilla/Bugzilla/Config/Attachment.pm | 9 - .../webtools/bugzilla/Bugzilla/Config/Auth.pm | 10 +- .../bugzilla/Bugzilla/Config/BugChange.pm | 1 - .../bugzilla/Bugzilla/Config/BugFields.pm | 1 - .../bugzilla/Bugzilla/Config/Common.pm | 32 +- .../webtools/bugzilla/Bugzilla/Config/Core.pm | 1 - .../Bugzilla/Config/DependencyGraph.pm | 3 +- .../bugzilla/Bugzilla/Config/General.pm | 1 - .../bugzilla/Bugzilla/Config/GroupSecurity.pm | 1 - .../webtools/bugzilla/Bugzilla/Config/LDAP.pm | 1 - .../webtools/bugzilla/Bugzilla/Config/MTA.pm | 15 +- .../bugzilla/Bugzilla/Config/Memcached.pm | 1 - .../bugzilla/Bugzilla/Config/PatchViewer.pm | 52 + .../bugzilla/Bugzilla/Config/Query.pm | 1 - .../bugzilla/Bugzilla/Config/RADIUS.pm | 1 - .../bugzilla/Bugzilla/Config/ShadowDB.pm | 1 - .../bugzilla/Bugzilla/Config/UserMatch.pm | 1 - .../webtools/bugzilla/Bugzilla/Constants.pm | 34 +- mozilla/webtools/bugzilla/Bugzilla/DB.pm | 21 +- .../webtools/bugzilla/Bugzilla/DB/Mysql.pm | 9 +- .../webtools/bugzilla/Bugzilla/DB/Oracle.pm | 2 - mozilla/webtools/bugzilla/Bugzilla/DB/Pg.pm | 4 - .../webtools/bugzilla/Bugzilla/DB/Schema.pm | 66 +- .../bugzilla/Bugzilla/DB/Schema/Mysql.pm | 1 - .../bugzilla/Bugzilla/DB/Schema/Oracle.pm | 1 - .../bugzilla/Bugzilla/DB/Schema/Pg.pm | 1 - .../bugzilla/Bugzilla/DB/Schema/Sqlite.pm | 1 - .../webtools/bugzilla/Bugzilla/DB/Sqlite.pm | 1 - mozilla/webtools/bugzilla/Bugzilla/Error.pm | 1 - .../webtools/bugzilla/Bugzilla/Extension.pm | 1 - mozilla/webtools/bugzilla/Bugzilla/Field.pm | 1 - .../bugzilla/Bugzilla/Field/Choice.pm | 1 - .../Bugzilla/Field/ChoiceInterface.pm | 1 - mozilla/webtools/bugzilla/Bugzilla/Flag.pm | 145 +-- .../webtools/bugzilla/Bugzilla/FlagType.pm | 20 +- mozilla/webtools/bugzilla/Bugzilla/Group.pm | 7 +- mozilla/webtools/bugzilla/Bugzilla/Hook.pm | 24 +- mozilla/webtools/bugzilla/Bugzilla/Install.pm | 17 +- .../bugzilla/Bugzilla/Install/CPAN.pm | 1 - .../webtools/bugzilla/Bugzilla/Install/DB.pm | 48 +- .../bugzilla/Bugzilla/Install/Filesystem.pm | 29 +- .../bugzilla/Bugzilla/Install/Localconfig.pm | 5 +- .../bugzilla/Bugzilla/Install/Requirements.pm | 51 +- .../bugzilla/Bugzilla/Install/Util.pm | 1 - .../webtools/bugzilla/Bugzilla/Job/BugMail.pm | 17 +- .../webtools/bugzilla/Bugzilla/Job/Mailer.pm | 21 +- .../webtools/bugzilla/Bugzilla/JobQueue.pm | 1 - .../bugzilla/Bugzilla/JobQueue/Runner.pm | 6 +- mozilla/webtools/bugzilla/Bugzilla/Keyword.pm | 1 - mozilla/webtools/bugzilla/Bugzilla/Mailer.pm | 173 +-- .../webtools/bugzilla/Bugzilla/Markdown.pm | 520 --------- .../webtools/bugzilla/Bugzilla/Memcached.pm | 14 +- mozilla/webtools/bugzilla/Bugzilla/Migrate.pm | 1 - .../bugzilla/Bugzilla/Migrate/Gnats.pm | 1 - .../webtools/bugzilla/Bugzilla/Milestone.pm | 1 - mozilla/webtools/bugzilla/Bugzilla/Object.pm | 1 - mozilla/webtools/bugzilla/Bugzilla/Product.pm | 1 - mozilla/webtools/bugzilla/Bugzilla/RNG.pm | 1 - mozilla/webtools/bugzilla/Bugzilla/Report.pm | 1 - mozilla/webtools/bugzilla/Bugzilla/Search.pm | 35 +- .../bugzilla/Bugzilla/Search/Clause.pm | 1 - .../bugzilla/Bugzilla/Search/ClauseGroup.pm | 1 - .../bugzilla/Bugzilla/Search/Condition.pm | 1 - .../bugzilla/Bugzilla/Search/Quicksearch.pm | 3 +- .../bugzilla/Bugzilla/Search/Recent.pm | 1 - .../bugzilla/Bugzilla/Search/Saved.pm | 1 - .../{Sender/Transport => Send}/Sendmail.pm | 48 +- mozilla/webtools/bugzilla/Bugzilla/Series.pm | 1 - mozilla/webtools/bugzilla/Bugzilla/Status.pm | 1 - .../webtools/bugzilla/Bugzilla/Template.pm | 133 +-- .../bugzilla/Bugzilla/Template/Context.pm | 1 - .../Bugzilla/Template/Plugin/Bugzilla.pm | 1 - .../bugzilla/Bugzilla/Template/Plugin/Hook.pm | 1 - mozilla/webtools/bugzilla/Bugzilla/Token.pm | 26 +- mozilla/webtools/bugzilla/Bugzilla/Update.pm | 1 - mozilla/webtools/bugzilla/Bugzilla/User.pm | 50 +- .../webtools/bugzilla/Bugzilla/User/APIKey.pm | 155 --- .../bugzilla/Bugzilla/User/Setting.pm | 42 +- .../bugzilla/Bugzilla/User/Setting/Lang.pm | 1 - .../bugzilla/Bugzilla/User/Setting/Skin.pm | 1 - .../Bugzilla/User/Setting/Timezone.pm | 1 - .../webtools/bugzilla/Bugzilla/UserAgent.pm | 2 - mozilla/webtools/bugzilla/Bugzilla/Util.pm | 22 +- mozilla/webtools/bugzilla/Bugzilla/Version.pm | 1 - .../webtools/bugzilla/Bugzilla/WebService.pm | 39 +- .../bugzilla/Bugzilla/WebService/Bug.pm | 211 +--- .../Bugzilla/WebService/BugUserLastVisit.pm | 16 +- .../bugzilla/Bugzilla/WebService/Bugzilla.pm | 1 - .../Bugzilla/WebService/Classification.pm | 1 - .../bugzilla/Bugzilla/WebService/Component.pm | 149 --- .../bugzilla/Bugzilla/WebService/Constants.pm | 63 +- .../bugzilla/Bugzilla/WebService/FlagType.pm | 1 - .../bugzilla/Bugzilla/WebService/Group.pm | 5 +- .../bugzilla/Bugzilla/WebService/Product.pm | 1 - .../bugzilla/Bugzilla/WebService/Server.pm | 1 - .../Bugzilla/WebService/Server/JSONRPC.pm | 5 +- .../Bugzilla/WebService/Server/REST.pm | 39 +- .../WebService/Server/REST/Resources/Bug.pm | 6 - .../Server/REST/Resources/Bugzilla.pm | 1 - .../Server/REST/Resources/Classification.pm | 1 - .../Server/REST/Resources/Component.pm | 48 - .../Server/REST/Resources/FlagType.pm | 1 - .../WebService/Server/REST/Resources/Group.pm | 1 - .../Server/REST/Resources/Product.pm | 1 - .../WebService/Server/REST/Resources/User.pm | 1 - .../Bugzilla/WebService/Server/XMLRPC.pm | 11 - .../bugzilla/Bugzilla/WebService/User.pm | 51 +- .../bugzilla/Bugzilla/WebService/Util.pm | 12 +- mozilla/webtools/bugzilla/Bugzilla/Whine.pm | 1 - .../webtools/bugzilla/Bugzilla/Whine/Query.pm | 1 - .../bugzilla/Bugzilla/Whine/Schedule.pm | 1 - mozilla/webtools/bugzilla/admin.cgi | 4 +- mozilla/webtools/bugzilla/attachment.cgi | 156 ++- mozilla/webtools/bugzilla/buglist.cgi | 46 +- mozilla/webtools/bugzilla/chart.cgi | 4 +- mozilla/webtools/bugzilla/checksetup.pl | 10 +- .../bugzilla/clean-bug-user-last-visit.pl | 2 +- mozilla/webtools/bugzilla/colchange.cgi | 4 +- mozilla/webtools/bugzilla/collectstats.pl | 4 +- mozilla/webtools/bugzilla/config.cgi | 4 +- mozilla/webtools/bugzilla/contrib/Bugzilla.pm | 1 - mozilla/webtools/bugzilla/contrib/README | 4 - .../bugzilla/contrib/bz_webservice_demo.pl | 5 +- mozilla/webtools/bugzilla/contrib/bzdbcopy.pl | 5 +- mozilla/webtools/bugzilla/contrib/console.pl | 6 +- .../bugzilla/contrib/convert-workflow.pl | 5 +- .../bugzilla/contrib/extension-convert.pl | 8 +- mozilla/webtools/bugzilla/contrib/fixperms.pl | 4 +- .../webtools/bugzilla/contrib/merge-users.pl | 13 +- .../bugzilla/contrib/mysqld-watcher.pl | 4 +- mozilla/webtools/bugzilla/contrib/recode.pl | 5 +- mozilla/webtools/bugzilla/contrib/replyrc | 30 - .../webtools/bugzilla/contrib/sendbugmail.pl | 4 +- .../bugzilla/contrib/sendunsentbugmail.pl | 4 +- mozilla/webtools/bugzilla/contrib/syncLDAP.pl | 4 +- mozilla/webtools/bugzilla/createaccount.cgi | 4 +- .../webtools/bugzilla/describecomponents.cgi | 4 +- .../webtools/bugzilla/describekeywords.cgi | 4 +- .../bugzilla/docs/en/rst/administration.rst | 4 +- mozilla/webtools/bugzilla/docs/en/rst/api.rst | 11 - .../docs/en/rst/api/core/v1/attachment.rst | 357 ------- .../rst/api/core/v1/bug-user-last-visit.rst | 111 -- .../bugzilla/docs/en/rst/api/core/v1/bug.rst | 991 ------------------ .../docs/en/rst/api/core/v1/bugzilla.rst | 302 ------ .../en/rst/api/core/v1/classification.rst | 80 -- .../docs/en/rst/api/core/v1/comment.rst | 248 ----- .../docs/en/rst/api/core/v1/component.rst | 65 -- .../docs/en/rst/api/core/v1/field.rst | 240 ----- .../docs/en/rst/api/core/v1/flagtype.rst | 373 ------- .../docs/en/rst/api/core/v1/general.rst | 255 ----- .../docs/en/rst/api/core/v1/group.rst | 278 ----- .../docs/en/rst/api/core/v1/index.rst | 18 - .../docs/en/rst/api/core/v1/product.rst | 416 -------- .../bugzilla/docs/en/rst/api/core/v1/user.rst | 380 ------- .../bugzilla/docs/en/rst/customization.rst | 6 +- .../bugzilla/docs/en/rst/extensions.rst | 3 +- .../webtools/bugzilla/docs/en/rst/index.rst | 1 - .../bugzilla/docs/en/rst/installation.rst | 23 - .../webtools/bugzilla/docs/en/rst/using.rst | 81 +- mozilla/webtools/bugzilla/docs/makedocs.pl | 52 +- mozilla/webtools/bugzilla/duplicates.cgi | 4 +- .../webtools/bugzilla/editclassifications.cgi | 4 +- mozilla/webtools/bugzilla/editcomponents.cgi | 4 +- mozilla/webtools/bugzilla/editfields.cgi | 4 +- mozilla/webtools/bugzilla/editflagtypes.cgi | 25 +- mozilla/webtools/bugzilla/editgroups.cgi | 11 +- mozilla/webtools/bugzilla/editkeywords.cgi | 4 +- mozilla/webtools/bugzilla/editmilestones.cgi | 4 +- mozilla/webtools/bugzilla/editparams.cgi | 4 +- mozilla/webtools/bugzilla/editproducts.cgi | 4 +- mozilla/webtools/bugzilla/editsettings.cgi | 5 +- mozilla/webtools/bugzilla/editusers.cgi | 8 +- mozilla/webtools/bugzilla/editvalues.cgi | 8 +- mozilla/webtools/bugzilla/editversions.cgi | 4 +- mozilla/webtools/bugzilla/editwhines.cgi | 4 +- mozilla/webtools/bugzilla/editworkflow.cgi | 4 +- mozilla/webtools/bugzilla/email_in.pl | 2 +- mozilla/webtools/bugzilla/enter_bug.cgi | 4 +- .../bugzilla/extensions/BmpConvert/Config.pm | 2 - .../extensions/BmpConvert/Extension.pm | 2 - .../bugzilla/extensions/Example/Config.pm | 2 - .../bugzilla/extensions/Example/Extension.pm | 14 +- .../Example/{docs/en/rst => doc}/example.rst | 1 + .../Example/docs/en/rst/api/v1/index.rst | 4 - .../extensions/Example/lib/Auth/Login.pm | 2 - .../extensions/Example/lib/Auth/Verify.pm | 2 - .../hook/search/tabs-search_tabs.html.tmpl | 6 +- .../bugzilla/extensions/MoreBugUrl/Config.pm | 1 - .../extensions/MoreBugUrl/Extension.pm | 2 - .../extensions/MoreBugUrl/lib/BitBucket.pm | 2 - .../MoreBugUrl/lib/GetSatisfaction.pm | 2 - .../bugzilla/extensions/MoreBugUrl/lib/PHP.pm | 2 - .../bugzilla/extensions/MoreBugUrl/lib/RT.pm | 2 - .../extensions/MoreBugUrl/lib/Redmine.pm | 2 - .../extensions/MoreBugUrl/lib/ReviewBoard.pm | 2 - .../extensions/MoreBugUrl/lib/Rietveld.pm | 2 - .../extensions/MoreBugUrl/lib/Savane.pm | 2 - .../bugzilla/extensions/OldBugMove/Config.pm | 2 - .../extensions/OldBugMove/Extension.pm | 2 - .../extensions/OldBugMove/lib/Params.pm | 1 - .../bugzilla/extensions/Voting/Config.pm | 1 - .../bugzilla/extensions/Voting/Extension.pm | 2 - .../webtools/bugzilla/extensions/create.pl | 4 +- mozilla/webtools/bugzilla/importxml.pl | 3 +- mozilla/webtools/bugzilla/index.cgi | 4 +- mozilla/webtools/bugzilla/install-module.pl | 2 +- mozilla/webtools/bugzilla/jobqueue.pl | 18 +- mozilla/webtools/bugzilla/js/bug.js | 10 +- .../webtools/bugzilla/js/comment-tagging.js | 19 +- mozilla/webtools/bugzilla/js/field.js | 63 +- mozilla/webtools/bugzilla/js/global.js | 45 +- .../webtools/bugzilla/js/jquery/jquery-min.js | 4 - .../js/jquery/plugins/cookie/cookie-min.js | 19 - .../ui-bg_diagonals-thick_18_b81900_40x40.png | Bin 418 -> 0 bytes .../ui-bg_diagonals-thick_20_666666_40x40.png | Bin 312 -> 0 bytes .../ui/images/ui-bg_flat_10_000000_40x100.png | Bin 205 -> 0 bytes .../images/ui-bg_glass_100_f6f6f6_1x400.png | Bin 262 -> 0 bytes .../images/ui-bg_glass_100_fdf5ce_1x400.png | Bin 348 -> 0 bytes .../ui/images/ui-bg_glass_65_ffffff_1x400.png | Bin 207 -> 0 bytes .../ui-bg_gloss-wave_35_f6a828_500x100.png | Bin 5815 -> 0 bytes .../ui-bg_highlight-soft_100_eeeeee_1x100.png | Bin 278 -> 0 bytes .../ui-bg_highlight-soft_75_ffe45c_1x100.png | Bin 328 -> 0 bytes .../ui/images/ui-icons_222222_256x240.png | Bin 6922 -> 0 bytes .../ui/images/ui-icons_228ef1_256x240.png | Bin 4549 -> 0 bytes .../ui/images/ui-icons_ef8c08_256x240.png | Bin 4549 -> 0 bytes .../ui/images/ui-icons_ffd27a_256x240.png | Bin 4549 -> 0 bytes .../ui/images/ui-icons_ffffff_256x240.png | Bin 6299 -> 0 bytes .../bugzilla/js/jquery/ui/jquery-ui-min.css | 7 - .../bugzilla/js/jquery/ui/jquery-ui-min.js | 13 - .../js/jquery/ui/jquery-ui-structure-min.css | 5 - .../js/jquery/ui/jquery-ui-theme-min.css | 5 - mozilla/webtools/bugzilla/jsonrpc.cgi | 4 +- mozilla/webtools/bugzilla/migrate.pl | 4 +- mozilla/webtools/bugzilla/mod_perl.pl | 4 +- mozilla/webtools/bugzilla/page.cgi | 4 +- mozilla/webtools/bugzilla/post_bug.cgi | 14 +- mozilla/webtools/bugzilla/process_bug.cgi | 48 +- mozilla/webtools/bugzilla/query.cgi | 4 +- mozilla/webtools/bugzilla/quips.cgi | 4 +- mozilla/webtools/bugzilla/relogin.cgi | 35 +- mozilla/webtools/bugzilla/report.cgi | 4 +- mozilla/webtools/bugzilla/reports.cgi | 4 +- mozilla/webtools/bugzilla/request.cgi | 4 +- mozilla/webtools/bugzilla/rest.cgi | 4 +- mozilla/webtools/bugzilla/runtests.pl | 4 +- mozilla/webtools/bugzilla/sanitycheck.cgi | 4 +- mozilla/webtools/bugzilla/sanitycheck.pl | 4 +- mozilla/webtools/bugzilla/search_plugin.cgi | 4 +- mozilla/webtools/bugzilla/show_activity.cgi | 4 +- mozilla/webtools/bugzilla/show_bug.cgi | 4 +- .../webtools/bugzilla/showdependencygraph.cgi | 4 +- .../webtools/bugzilla/showdependencytree.cgi | 4 +- .../bugzilla/skins/standard/admin.css | 35 - .../webtools/bugzilla/skins/standard/bug.css | 4 +- .../bugzilla/skins/standard/global.css | 17 +- mozilla/webtools/bugzilla/summarize_time.cgi | 4 +- mozilla/webtools/bugzilla/t/001compile.t | 6 +- mozilla/webtools/bugzilla/t/002goodperl.t | 102 +- mozilla/webtools/bugzilla/t/003safesys.t | 4 +- mozilla/webtools/bugzilla/t/004template.t | 5 +- mozilla/webtools/bugzilla/t/005whitespace.t | 2 - mozilla/webtools/bugzilla/t/006spellcheck.t | 45 +- mozilla/webtools/bugzilla/t/007util.t | 8 +- mozilla/webtools/bugzilla/t/008filter.t | 12 +- mozilla/webtools/bugzilla/t/009bugwords.t | 2 - mozilla/webtools/bugzilla/t/010dependencies.t | 3 - mozilla/webtools/bugzilla/t/011pod.t | 6 +- mozilla/webtools/bugzilla/t/012throwables.t | 3 - mozilla/webtools/bugzilla/t/013dbschema.t | 3 - mozilla/webtools/bugzilla/t/Support/Files.pm | 18 +- .../webtools/bugzilla/t/Support/Systemexec.pm | 5 - .../webtools/bugzilla/t/Support/Templates.pm | 35 +- .../account/auth/login-small.html.tmpl | 3 - .../en/default/account/prefs/apikey.html.tmpl | 84 -- .../en/default/account/prefs/prefs.html.tmpl | 5 +- .../template/en/default/admin/admin.html.tmpl | 6 - .../en/default/admin/groups/list.html.tmpl | 3 +- .../default/admin/params/attachment.html.tmpl | 28 +- .../en/default/admin/params/auth.html.tmpl | 6 - .../default/admin/params/memcached.html.tmpl | 2 +- .../en/default/admin/params/mta.html.tmpl | 12 +- .../admin/params/patchviewer.html.tmpl | 51 + .../en/default/admin/products/edit.html.tmpl | 6 +- .../default/admin/reports/job_queue.html.tmpl | 74 -- .../admin/users/confirm-delete.html.tmpl | 2 +- .../admin/users/responsibilities.html.tmpl | 14 +- .../en/default/attachment/diff-file.html.tmpl | 18 +- .../default/attachment/diff-header.html.tmpl | 32 +- .../template/en/default/bug/comment.html.tmpl | 12 +- .../en/default/bug/comments.html.tmpl | 56 +- .../en/default/bug/dependency-tree.html.tmpl | 7 +- .../template/en/default/bug/edit.html.tmpl | 147 +-- .../en/default/bug/field-label.html.tmpl | 11 +- .../template/en/default/bug/link.html.tmpl | 4 +- .../en/default/bug/process/midair.html.tmpl | 1 - .../en/default/bug/show-header.html.tmpl | 8 +- .../en/default/bug/show-multiple.html.tmpl | 7 +- .../template/en/default/config.rdf.tmpl | 14 +- .../en/default/email/bugmail.html.tmpl | 2 +- .../en/default/email/flagmail.txt.tmpl | 13 +- .../en/default/email/new-api-key.txt.tmpl | 33 - .../en/default/extensions/config.pm.tmpl | 1 - .../en/default/extensions/extension.pm.tmpl | 2 - .../en/default/extensions/util.pm.tmpl | 2 - .../template/en/default/filterexceptions.pl | 9 +- .../template/en/default/flag/list.html.tmpl | 13 - .../global/choose-classification.html.tmpl | 4 +- .../default/global/choose-product.html.tmpl | 4 +- .../en/default/global/header.html.tmpl | 170 ++- .../en/default/global/messages.html.tmpl | 2 +- .../en/default/global/setting-descs.none.tmpl | 3 +- .../default/global/site-navigation.html.tmpl | 75 ++ .../en/default/global/user-error.html.tmpl | 49 +- .../en/default/list/change-columns.html.tmpl | 2 +- .../en/default/list/edit-multiple.html.tmpl | 7 - .../template/en/default/list/list.html.tmpl | 54 +- .../en/default/pages/linked.html.tmpl | 4 +- .../en/default/pages/markdown.html.tmpl | 265 ----- .../en/default/pages/release-notes.html.tmpl | 6 +- .../en/default/reports/create-chart.html.tmpl | 2 - .../en/default/reports/report-table.csv.tmpl | 8 +- .../en/default/request/queue.html.tmpl | 3 +- .../default/search/boolean-charts.html.tmpl | 10 +- .../search/search-report-select.html.tmpl | 2 +- .../default/search/search-specific.html.tmpl | 2 +- .../template/en/default/setup/strings.txt.pl | 7 +- mozilla/webtools/bugzilla/testagent.cgi | 3 +- mozilla/webtools/bugzilla/testserver.pl | 6 +- mozilla/webtools/bugzilla/token.cgi | 11 +- mozilla/webtools/bugzilla/userprefs.cgi | 66 +- mozilla/webtools/bugzilla/view_job_queue.cgi | 121 --- mozilla/webtools/bugzilla/votes.cgi | 4 +- mozilla/webtools/bugzilla/whine.pl | 4 +- mozilla/webtools/bugzilla/whineatnews.pl | 4 +- mozilla/webtools/bugzilla/xmlrpc.cgi | 4 +- 378 files changed, 1473 insertions(+), 8967 deletions(-) delete mode 100644 mozilla/webtools/bugzilla/Bugzilla/Auth/Login/APIKey.pm create mode 100644 mozilla/webtools/bugzilla/Bugzilla/Config/PatchViewer.pm delete mode 100644 mozilla/webtools/bugzilla/Bugzilla/Markdown.pm rename mozilla/webtools/bugzilla/Bugzilla/{Sender/Transport => Send}/Sendmail.pm (64%) delete mode 100644 mozilla/webtools/bugzilla/Bugzilla/User/APIKey.pm delete mode 100644 mozilla/webtools/bugzilla/Bugzilla/WebService/Component.pm delete mode 100644 mozilla/webtools/bugzilla/Bugzilla/WebService/Server/REST/Resources/Component.pm delete mode 100644 mozilla/webtools/bugzilla/contrib/replyrc delete mode 100644 mozilla/webtools/bugzilla/docs/en/rst/api.rst delete mode 100644 mozilla/webtools/bugzilla/docs/en/rst/api/core/v1/attachment.rst delete mode 100644 mozilla/webtools/bugzilla/docs/en/rst/api/core/v1/bug-user-last-visit.rst delete mode 100644 mozilla/webtools/bugzilla/docs/en/rst/api/core/v1/bug.rst delete mode 100644 mozilla/webtools/bugzilla/docs/en/rst/api/core/v1/bugzilla.rst delete mode 100644 mozilla/webtools/bugzilla/docs/en/rst/api/core/v1/classification.rst delete mode 100644 mozilla/webtools/bugzilla/docs/en/rst/api/core/v1/comment.rst delete mode 100644 mozilla/webtools/bugzilla/docs/en/rst/api/core/v1/component.rst delete mode 100644 mozilla/webtools/bugzilla/docs/en/rst/api/core/v1/field.rst delete mode 100644 mozilla/webtools/bugzilla/docs/en/rst/api/core/v1/flagtype.rst delete mode 100644 mozilla/webtools/bugzilla/docs/en/rst/api/core/v1/general.rst delete mode 100644 mozilla/webtools/bugzilla/docs/en/rst/api/core/v1/group.rst delete mode 100644 mozilla/webtools/bugzilla/docs/en/rst/api/core/v1/index.rst delete mode 100644 mozilla/webtools/bugzilla/docs/en/rst/api/core/v1/product.rst delete mode 100644 mozilla/webtools/bugzilla/docs/en/rst/api/core/v1/user.rst rename mozilla/webtools/bugzilla/extensions/Example/{docs/en/rst => doc}/example.rst (99%) delete mode 100644 mozilla/webtools/bugzilla/extensions/Example/docs/en/rst/api/v1/index.rst delete mode 100644 mozilla/webtools/bugzilla/js/jquery/jquery-min.js delete mode 100644 mozilla/webtools/bugzilla/js/jquery/plugins/cookie/cookie-min.js delete mode 100644 mozilla/webtools/bugzilla/js/jquery/ui/images/ui-bg_diagonals-thick_18_b81900_40x40.png delete mode 100644 mozilla/webtools/bugzilla/js/jquery/ui/images/ui-bg_diagonals-thick_20_666666_40x40.png delete mode 100644 mozilla/webtools/bugzilla/js/jquery/ui/images/ui-bg_flat_10_000000_40x100.png delete mode 100644 mozilla/webtools/bugzilla/js/jquery/ui/images/ui-bg_glass_100_f6f6f6_1x400.png delete mode 100644 mozilla/webtools/bugzilla/js/jquery/ui/images/ui-bg_glass_100_fdf5ce_1x400.png delete mode 100644 mozilla/webtools/bugzilla/js/jquery/ui/images/ui-bg_glass_65_ffffff_1x400.png delete mode 100644 mozilla/webtools/bugzilla/js/jquery/ui/images/ui-bg_gloss-wave_35_f6a828_500x100.png delete mode 100644 mozilla/webtools/bugzilla/js/jquery/ui/images/ui-bg_highlight-soft_100_eeeeee_1x100.png delete mode 100644 mozilla/webtools/bugzilla/js/jquery/ui/images/ui-bg_highlight-soft_75_ffe45c_1x100.png delete mode 100644 mozilla/webtools/bugzilla/js/jquery/ui/images/ui-icons_222222_256x240.png delete mode 100644 mozilla/webtools/bugzilla/js/jquery/ui/images/ui-icons_228ef1_256x240.png delete mode 100644 mozilla/webtools/bugzilla/js/jquery/ui/images/ui-icons_ef8c08_256x240.png delete mode 100644 mozilla/webtools/bugzilla/js/jquery/ui/images/ui-icons_ffd27a_256x240.png delete mode 100644 mozilla/webtools/bugzilla/js/jquery/ui/images/ui-icons_ffffff_256x240.png delete mode 100644 mozilla/webtools/bugzilla/js/jquery/ui/jquery-ui-min.css delete mode 100644 mozilla/webtools/bugzilla/js/jquery/ui/jquery-ui-min.js delete mode 100644 mozilla/webtools/bugzilla/js/jquery/ui/jquery-ui-structure-min.css delete mode 100644 mozilla/webtools/bugzilla/js/jquery/ui/jquery-ui-theme-min.css delete mode 100644 mozilla/webtools/bugzilla/template/en/default/account/prefs/apikey.html.tmpl create mode 100644 mozilla/webtools/bugzilla/template/en/default/admin/params/patchviewer.html.tmpl delete mode 100644 mozilla/webtools/bugzilla/template/en/default/admin/reports/job_queue.html.tmpl delete mode 100644 mozilla/webtools/bugzilla/template/en/default/email/new-api-key.txt.tmpl create mode 100644 mozilla/webtools/bugzilla/template/en/default/global/site-navigation.html.tmpl delete mode 100644 mozilla/webtools/bugzilla/template/en/default/pages/markdown.html.tmpl delete mode 100755 mozilla/webtools/bugzilla/view_job_queue.cgi diff --git a/mozilla/webtools/bugzilla/.bzrrev b/mozilla/webtools/bugzilla/.bzrrev index 6ac14270261..ef1a7892e7f 100644 --- a/mozilla/webtools/bugzilla/.bzrrev +++ b/mozilla/webtools/bugzilla/.bzrrev @@ -1 +1 @@ -9229 \ No newline at end of file +9230 \ No newline at end of file diff --git a/mozilla/webtools/bugzilla/.gitrev b/mozilla/webtools/bugzilla/.gitrev index 880edd8631d..022b761ff58 100644 --- a/mozilla/webtools/bugzilla/.gitrev +++ b/mozilla/webtools/bugzilla/.gitrev @@ -1 +1 @@ -c0dbbc6e69bdefcb49fd9046f7e830880d3ac513 \ No newline at end of file +1d69e313176b3744e144d3fb8cc58664334cef17 \ No newline at end of file diff --git a/mozilla/webtools/bugzilla/.htaccess b/mozilla/webtools/bugzilla/.htaccess index 7ef20d8b69a..f8611f81ddc 100644 --- a/mozilla/webtools/bugzilla/.htaccess +++ b/mozilla/webtools/bugzilla/.htaccess @@ -29,6 +29,5 @@ Options -Indexes RewriteEngine On - RewriteOptions inherit RewriteRule ^rest/(.*)$ rest.cgi/$1 [NE] diff --git a/mozilla/webtools/bugzilla/.travis.yml b/mozilla/webtools/bugzilla/.travis.yml index eed86e0a300..1ed35cae34f 100644 --- a/mozilla/webtools/bugzilla/.travis.yml +++ b/mozilla/webtools/bugzilla/.travis.yml @@ -8,10 +8,7 @@ perl: env: - TEST_SUITE=sanity - TEST_SUITE=docs - - TEST_SUITE=webservices DB=mysql - - TEST_SUITE=selenium DB=mysql - - TEST_SUITE=webservices DB=pg - - TEST_SUITE=selenium DB=pg + - TEST_SUITE=checksetup DB=mysql matrix: exclude: @@ -22,32 +19,14 @@ matrix: - perl: 5.14 env: TEST_SUITE=docs - perl: 5.10 - env: TEST_SUITE=webservices DB=mysql - - perl: 5.10 - env: TEST_SUITE=webservices DB=pg - - perl: 5.10 - env: TEST_SUITE=selenium DB=mysql - - perl: 5.10 - env: TEST_SUITE=selenium DB=pg + env: TEST_SUITE=checksetup DB=mysql - perl: 5.12 - env: TEST_SUITE=webservices DB=mysql - - perl: 5.12 - env: TEST_SUITE=webservices DB=pg - - perl: 5.12 - env: TEST_SUITE=selenium DB=mysql - - perl: 5.12 - env: TEST_SUITE=selenium DB=pg + env: TEST_SUITE=checksetup DB=mysql - perl: 5.14 - env: TEST_SUITE=webservices DB=mysql - - perl: 5.14 - env: TEST_SUITE=webservices DB=pg - - perl: 5.14 - env: TEST_SUITE=selenium DB=mysql - - perl: 5.14 - env: TEST_SUITE=selenium DB=pg + env: TEST_SUITE=checksetup DB=mysql before_install: - - git clone https://github.com/bugzilla/qa.git -b master qa + - git clone https://github.com/bugzilla/qa.git -b 4.4 qa install: true diff --git a/mozilla/webtools/bugzilla/Bugzilla.pm b/mozilla/webtools/bugzilla/Bugzilla.pm index 46d6182cd46..271bd894bcf 100644 --- a/mozilla/webtools/bugzilla/Bugzilla.pm +++ b/mozilla/webtools/bugzilla/Bugzilla.pm @@ -9,7 +9,6 @@ package Bugzilla; use 5.10.1; use strict; -use warnings; # We want any compile errors to get to the browser, if possible. BEGIN { @@ -122,8 +121,8 @@ sub init_page { # # This code must go here. It cannot go anywhere in Bugzilla::CGI, because # it uses Template, and that causes various dependency loops. - if (!grep { $_ eq $script } SHUTDOWNHTML_EXEMPT - and Bugzilla->params->{'shutdownhtml'}) + if (Bugzilla->params->{"shutdownhtml"} + && !grep { $_ eq $script } SHUTDOWNHTML_EXEMPT) { # Allow non-cgi scripts to exit silently (without displaying any # message), if desired. At this point, no DBI call has been made @@ -397,13 +396,6 @@ sub logout_request { # there. Don't rely on it: use Bugzilla->user->login instead! } -sub markdown { - return if !Bugzilla->feature('markdown'); - - require Bugzilla::Markdown; - return $_[0]->request_cache->{markdown} ||= Bugzilla::Markdown->new(); -} - sub job_queue { require Bugzilla::JobQueue; return $_[0]->request_cache->{job_queue} ||= Bugzilla::JobQueue->new(); @@ -659,16 +651,13 @@ sub memcached { # Per-process cleanup. Note that this is a plain subroutine, not a method, # so we don't have $class available. sub _cleanup { - my $cache = Bugzilla->request_cache; - my $main = $cache->{dbh_main}; - my $shadow = $cache->{dbh_shadow}; + my $main = Bugzilla->request_cache->{dbh_main}; + my $shadow = Bugzilla->request_cache->{dbh_shadow}; foreach my $dbh ($main, $shadow) { next if !$dbh; $dbh->bz_rollback_transaction() if $dbh->bz_in_transaction; $dbh->disconnect; } - my $smtp = $cache->{smtp}; - $smtp->disconnect if $smtp; clear_request_cache(); # These are both set by CGI.pm but need to be undone so that @@ -760,7 +749,7 @@ If you ever need a L object while you're already processing a template, use this. Also use it if you want to specify the language to use. If no argument is passed, it uses the last language set. If the argument is "" (empty string), the language is -reset to the current one (the one used by Ctemplate>). +reset to the current one (the one used by Bugzilla->template). =item C @@ -878,8 +867,8 @@ specify this argument, all fields will be returned. =item C -Call either Cerror_mode(Bugzilla::Constants::ERROR_MODE_DIE)> -or Cerror_mode(Bugzilla::Constants::ERROR_MODE_DIE_SOAP_FAULT)> to +Call either Cerror_mode(Bugzilla::Constants::ERROR_MODE_DIE)> +or Cerror_mode(Bugzilla::Constants::ERROR_MODE_DIE_SOAP_FAULT)> to change this flag's default of C and to indicate that errors should be passed to error mode specific error handlers rather than being sent to a browser and finished with an exit(). @@ -888,24 +877,24 @@ This is useful, for example, to keep C blocks from producing wild HTML on errors, making it easier for you to catch them. (Remember to reset the error mode to its previous value afterwards, though.) -Cerror_mode> will return the current state of this flag. +Cerror_mode> will return the current state of this flag. -Note that Cerror_mode> is being called by Cusage_mode> on +Note that Cerror_mode> is being called by Cusage_mode> on usage mode changes. =item C -Call either Cusage_mode(Bugzilla::Constants::USAGE_MODE_CMDLINE)> -or Cusage_mode(Bugzilla::Constants::USAGE_MODE_XMLRPC)> near the +Call either Cusage_mode(Bugzilla::Constants::USAGE_MODE_CMDLINE)> +or Cusage_mode(Bugzilla::Constants::USAGE_MODE_XMLRPC)> near the beginning of your script to change this flag's default of C and to indicate that Bugzilla is being called in a non-interactive manner. This influences error handling because on usage mode changes, C -calls Cerror_mode> to set an error mode which makes sense for the +calls Cerror_mode> to set an error mode which makes sense for the usage mode. -Cusage_mode> will return the current state of this flag. +Cusage_mode> will return the current state of this flag. =item C @@ -944,9 +933,9 @@ Change the database object to refer to the main database. =item C -The current Parameters of Bugzilla, as a hashref. If C -does not exist, then we return an empty hashref. If C -is unreadable or is not valid, we C. +The current Parameters of Bugzilla, as a hashref. If C +does not exist, then we return an empty hashref. If C +is unreadable or is not valid perl, we C. =item C @@ -954,10 +943,6 @@ Returns the local timezone of the Bugzilla installation, as a DateTime::TimeZone object. This detection is very time consuming, so we cache this information for future references. -=item C - -The current L object, to be used for Markdown rendering. - =item C Returns a L that you can use for queueing jobs. diff --git a/mozilla/webtools/bugzilla/Bugzilla/Attachment.pm b/mozilla/webtools/bugzilla/Bugzilla/Attachment.pm index e165b139e60..19c10c8fea6 100644 --- a/mozilla/webtools/bugzilla/Bugzilla/Attachment.pm +++ b/mozilla/webtools/bugzilla/Bugzilla/Attachment.pm @@ -9,7 +9,6 @@ package Bugzilla::Attachment; use 5.10.1; use strict; -use warnings; =head1 NAME @@ -308,8 +307,7 @@ sub is_viewable { =item C -Returns the content of the attachment. -As a side-effect, sets $self->is_on_filesystem. +the content of the attachment =back @@ -326,16 +324,10 @@ sub data { undef, $self->id); - # Setting the property here is cheap, as opposed to making an extra - # query later, and hitting the filesystem to see if the file is - # still there. - $self->{is_on_filesystem} = 0; # If there's no attachment data in the database, the attachment is stored # in a local file, so retrieve it from there. if (length($self->{data}) == 0) { if (open(AH, $self->_get_local_filename())) { - # file is actually on disk. - $self->{is_on_filesystem} = 1; local $/; binmode AH; $self->{data} = ; @@ -348,36 +340,9 @@ sub data { =over -=item C - -Returns true if the attachment is stored on disk (via maxlocalattachment -parameter), as opposed to in the database. - -=back - -=cut - -# When the attachment is on the filesystem, you can let the backend -# (nginx, apache, lighttpd) serve it for you if it supports the X-Sendfile -# feature. This means that the attachment CGI script may have a reduced -# footprint. e.g. bug 906010 and bug 1073241. - -sub is_on_filesystem { - my $self = shift; - return $self->{is_on_filesystem} if exists $self->{is_on_filesystem}; - # In order to serve an attachment, you also send the datasize in the - # content-length header. Making additional queries which are exactly - # the same as found in the datasize code path is just wasteful. - my $datasize = $self->datasize; - return $self->{is_on_filesystem}; -} - -=over - =item C -Returns the length (in bytes) of the attachment content. -As a side-effect, sets $self->is_on_filesystem. +the length (in bytes) of the attachment content =back @@ -404,17 +369,11 @@ sub datasize { WHERE id = ?", undef, $self->id) || 0; - # Setting the property here is cheap, as opposed to making an extra - # query later, and hitting the filesystem to see if the file is - # still there. - $self->{is_on_filesystem} = 0; # If there's no attachment data in the database, either the attachment # is stored in a local file, and so retrieve its size from the file, # or the attachment has been deleted. unless ($self->{datasize}) { if (open(AH, $self->_get_local_filename())) { - # file is actually on disk. - $self->{is_on_filesystem} = 1; binmode AH; $self->{datasize} = (stat(AH))[7]; close(AH); diff --git a/mozilla/webtools/bugzilla/Bugzilla/Attachment/PatchReader.pm b/mozilla/webtools/bugzilla/Bugzilla/Attachment/PatchReader.pm index d0e22122028..c2ef53a65f2 100644 --- a/mozilla/webtools/bugzilla/Bugzilla/Attachment/PatchReader.pm +++ b/mozilla/webtools/bugzilla/Bugzilla/Attachment/PatchReader.pm @@ -9,7 +9,6 @@ package Bugzilla::Attachment::PatchReader; use 5.10.1; use strict; -use warnings; use Config; use IO::Select; @@ -23,18 +22,17 @@ use Bugzilla::Util; use constant PERLIO_IS_ENABLED => $Config{useperlio}; sub process_diff { - my ($attachment, $format) = @_; + my ($attachment, $format, $context) = @_; my $dbh = Bugzilla->dbh; my $cgi = Bugzilla->cgi; my $lc = Bugzilla->localconfig; my $vars = {}; - require PatchReader::Raw; - my $reader = new PatchReader::Raw; + my ($reader, $last_reader) = setup_patch_readers(undef, $context); if ($format eq 'raw') { require PatchReader::DiffPrinter::raw; - $reader->sends_data_to(new PatchReader::DiffPrinter::raw()); + $last_reader->sends_data_to(new PatchReader::DiffPrinter::raw()); # Actually print out the patch. print $cgi->header(-type => 'text/plain'); disable_utf8(); @@ -72,7 +70,7 @@ sub process_diff { $vars->{'description'} = $attachment->description; $vars->{'other_patches'} = \@other_patches; - setup_template_patch_reader($reader, $vars); + setup_template_patch_reader($last_reader, $format, $context, $vars); # The patch is going to be displayed in a HTML page and if the utf8 # param is enabled, we have to encode attachment data as utf8. if (Bugzilla->params->{'utf8'}) { @@ -84,13 +82,11 @@ sub process_diff { } sub process_interdiff { - my ($old_attachment, $new_attachment, $format) = @_; + my ($old_attachment, $new_attachment, $format, $context) = @_; my $cgi = Bugzilla->cgi; my $lc = Bugzilla->localconfig; my $vars = {}; - require PatchReader::Raw; - # Encode attachment data as utf8 if it's going to be displayed in a HTML # page using the UTF-8 encoding. if ($format ne 'raw' && Bugzilla->params->{'utf8'}) { @@ -180,11 +176,10 @@ sub process_interdiff { $warning = 'interdiff3'; } - my $reader = new PatchReader::Raw; - + my ($reader, $last_reader) = setup_patch_readers("", $context); if ($format eq 'raw') { require PatchReader::DiffPrinter::raw; - $reader->sends_data_to(new PatchReader::DiffPrinter::raw()); + $last_reader->sends_data_to(new PatchReader::DiffPrinter::raw()); # Actually print out the patch. print $cgi->header(-type => 'text/plain'); disable_utf8(); @@ -197,7 +192,7 @@ sub process_interdiff { $vars->{'newid'} = $new_attachment->id; $vars->{'new_desc'} = $new_attachment->description; - setup_template_patch_reader($reader, $vars); + setup_template_patch_reader($last_reader, $format, $context, $vars); } $reader->iterate_string('interdiff #' . $old_attachment->id . ' #' . $new_attachment->id, $stdout); @@ -212,6 +207,7 @@ sub get_unified_diff { # Bring in the modules we need. require PatchReader::Raw; + require PatchReader::FixPatchRoot; require PatchReader::DiffPrinter::raw; require PatchReader::PatchInfoGrabber; require File::Temp; @@ -223,6 +219,14 @@ sub get_unified_diff { my $reader = new PatchReader::Raw; my $last_reader = $reader; + # Fixes patch root (makes canonical if possible). + if (Bugzilla->params->{'cvsroot'}) { + my $fix_patch_root = + new PatchReader::FixPatchRoot(Bugzilla->params->{'cvsroot'}); + $last_reader->sends_data_to($fix_patch_root); + $last_reader = $fix_patch_root; + } + # Grabs the patch file info. my $patch_info_grabber = new PatchReader::PatchInfoGrabber(); $last_reader->sends_data_to($patch_info_grabber); @@ -269,8 +273,46 @@ sub warn_if_interdiff_might_fail { return undef; } +sub setup_patch_readers { + my ($diff_root, $context) = @_; + + # Parameters: + # format=raw|html + # context=patch|file|0-n + # collapsed=0|1 + # headers=0|1 + + # Define the patch readers. + # The reader that reads the patch in (whatever its format). + require PatchReader::Raw; + my $reader = new PatchReader::Raw; + my $last_reader = $reader; + # Fix the patch root if we have a cvs root. + if (Bugzilla->params->{'cvsroot'}) { + require PatchReader::FixPatchRoot; + $last_reader->sends_data_to(new PatchReader::FixPatchRoot(Bugzilla->params->{'cvsroot'})); + $last_reader->sends_data_to->diff_root($diff_root) if defined($diff_root); + $last_reader = $last_reader->sends_data_to; + } + + # Add in cvs context if we have the necessary info to do it + if ($context ne 'patch' && Bugzilla->localconfig->{cvsbin} + && Bugzilla->params->{'cvsroot_get'}) + { + require PatchReader::AddCVSContext; + # We need to set $cvsbin as global, because PatchReader::CVSClient + # needs it in order to find 'cvs'. + $main::cvsbin = Bugzilla->localconfig->{cvsbin}; + $last_reader->sends_data_to( + new PatchReader::AddCVSContext($context, Bugzilla->params->{'cvsroot_get'})); + $last_reader = $last_reader->sends_data_to; + } + + return ($reader, $last_reader); +} + sub setup_template_patch_reader { - my ($last_reader, $vars) = @_; + my ($last_reader, $format, $context, $vars) = @_; my $cgi = Bugzilla->cgi; my $template = Bugzilla->template; @@ -285,15 +327,22 @@ sub setup_template_patch_reader { } $vars->{'collapsed'} = $cgi->param('collapsed'); + $vars->{'context'} = $context; + $vars->{'do_context'} = Bugzilla->localconfig->{cvsbin} + && Bugzilla->params->{'cvsroot_get'} && !$vars->{'newid'}; # Print everything out. print $cgi->header(-type => 'text/html'); $last_reader->sends_data_to(new PatchReader::DiffPrinter::template($template, - 'attachment/diff-header.html.tmpl', - 'attachment/diff-file.html.tmpl', - 'attachment/diff-footer.html.tmpl', - $vars)); + "attachment/diff-header.$format.tmpl", + "attachment/diff-file.$format.tmpl", + "attachment/diff-footer.$format.tmpl", + { %{$vars}, + bonsai_url => Bugzilla->params->{'bonsai_url'}, + lxr_url => Bugzilla->params->{'lxr_url'}, + lxr_root => Bugzilla->params->{'lxr_root'}, + })); } 1; @@ -314,4 +363,6 @@ __END__ =item process_interdiff +=item setup_patch_readers + =back diff --git a/mozilla/webtools/bugzilla/Bugzilla/Auth.pm b/mozilla/webtools/bugzilla/Bugzilla/Auth.pm index c830f0506d7..42e4ee784f2 100644 --- a/mozilla/webtools/bugzilla/Bugzilla/Auth.pm +++ b/mozilla/webtools/bugzilla/Bugzilla/Auth.pm @@ -9,8 +9,6 @@ package Bugzilla::Auth; use 5.10.1; use strict; -use warnings; - use fields qw( _info_getter _verifier @@ -32,7 +30,7 @@ sub new { my $self = fields::new($class); $params ||= {}; - $params->{Login} ||= Bugzilla->params->{'user_info_class'} . ',Cookie,APIKey'; + $params->{Login} ||= Bugzilla->params->{'user_info_class'} . ',Cookie'; $params->{Verify} ||= Bugzilla->params->{'user_verify_class'}; $self->{_info_getter} = new Bugzilla::Auth::Login::Stack($params->{Login}); @@ -46,6 +44,7 @@ sub new { sub login { my ($self, $type) = @_; + my $dbh = Bugzilla->dbh; # Get login info from the cookie, form, environment variables, etc. my $login_info = $self->{_info_getter}->get_login_info(); diff --git a/mozilla/webtools/bugzilla/Bugzilla/Auth/Login.pm b/mozilla/webtools/bugzilla/Bugzilla/Auth/Login.pm index a5f08977719..33d63a425cd 100644 --- a/mozilla/webtools/bugzilla/Bugzilla/Auth/Login.pm +++ b/mozilla/webtools/bugzilla/Bugzilla/Auth/Login.pm @@ -9,8 +9,6 @@ package Bugzilla::Auth::Login; use 5.10.1; use strict; -use warnings; - use fields qw(); # Determines whether or not a user can logout. It's really a subroutine, diff --git a/mozilla/webtools/bugzilla/Bugzilla/Auth/Login/APIKey.pm b/mozilla/webtools/bugzilla/Bugzilla/Auth/Login/APIKey.pm deleted file mode 100644 index 63e35578af4..00000000000 --- a/mozilla/webtools/bugzilla/Bugzilla/Auth/Login/APIKey.pm +++ /dev/null @@ -1,53 +0,0 @@ -# This Source Code Form is subject to the terms of the Mozilla Public -# License, v. 2.0. If a copy of the MPL was not distributed with this -# file, You can obtain one at http://mozilla.org/MPL/2.0/. -# -# This Source Code Form is "Incompatible With Secondary Licenses", as -# defined by the Mozilla Public License, v. 2.0. - -package Bugzilla::Auth::Login::APIKey; - -use 5.10.1; -use strict; -use warnings; - -use base qw(Bugzilla::Auth::Login); - -use Bugzilla::Constants; -use Bugzilla::User::APIKey; -use Bugzilla::Util; -use Bugzilla::Error; - -use constant requires_persistence => 0; -use constant requires_verification => 0; -use constant can_login => 0; -use constant can_logout => 0; - -# This method is only available to web services. An API key can never -# be used to authenticate a Web request. -sub get_login_info { - my ($self) = @_; - my $params = Bugzilla->input_params; - my ($user_id, $login_cookie); - - my $api_key_text = trim(delete $params->{'Bugzilla_api_key'}); - if (!i_am_webservice() || !$api_key_text) { - return { failure => AUTH_NODATA }; - } - - my $api_key = Bugzilla::User::APIKey->new({ name => $api_key_text }); - - if (!$api_key or $api_key->api_key ne $api_key_text) { - # The second part checks the correct capitalisation. Silly MySQL - ThrowUserError("api_key_not_valid"); - } - elsif ($api_key->revoked) { - ThrowUserError('api_key_revoked'); - } - - $api_key->update_last_used(); - - return { user_id => $api_key->user_id }; -} - -1; diff --git a/mozilla/webtools/bugzilla/Bugzilla/Auth/Login/CGI.pm b/mozilla/webtools/bugzilla/Bugzilla/Auth/Login/CGI.pm index 6003d62a5bd..76b82804a69 100644 --- a/mozilla/webtools/bugzilla/Bugzilla/Auth/Login/CGI.pm +++ b/mozilla/webtools/bugzilla/Bugzilla/Auth/Login/CGI.pm @@ -9,7 +9,6 @@ package Bugzilla::Auth::Login::CGI; use 5.10.1; use strict; -use warnings; use parent qw(Bugzilla::Auth::Login); use constant user_can_create_account => 1; diff --git a/mozilla/webtools/bugzilla/Bugzilla/Auth/Login/Cookie.pm b/mozilla/webtools/bugzilla/Bugzilla/Auth/Login/Cookie.pm index c09f08d24d1..29e2310a0a0 100644 --- a/mozilla/webtools/bugzilla/Bugzilla/Auth/Login/Cookie.pm +++ b/mozilla/webtools/bugzilla/Bugzilla/Auth/Login/Cookie.pm @@ -9,15 +9,13 @@ package Bugzilla::Auth::Login::Cookie; use 5.10.1; use strict; -use warnings; use base qw(Bugzilla::Auth::Login); use fields qw(_login_token); use Bugzilla::Constants; -use Bugzilla::Error; -use Bugzilla::Token; use Bugzilla::Util; +use Bugzilla::Error; use List::Util qw(first); @@ -51,20 +49,6 @@ sub get_login_info { @{$cgi->{'Bugzilla_cookie_list'}}; $user_id = $cookie->value if $cookie; } - - # If the call is for a web service, and an api token is provided, check - # it is valid. - if (i_am_webservice() && Bugzilla->input_params->{Bugzilla_api_token}) { - my $api_token = Bugzilla->input_params->{Bugzilla_api_token}; - my ($token_user_id, undef, undef, $token_type) - = Bugzilla::Token::GetTokenData($api_token); - if (!defined $token_type - || $token_type ne 'api_token' - || $user_id != $token_user_id) - { - ThrowUserError('auth_invalid_token', { token => $api_token }); - } - } } # If no cookies were provided, we also look for a login token diff --git a/mozilla/webtools/bugzilla/Bugzilla/Auth/Login/Env.pm b/mozilla/webtools/bugzilla/Bugzilla/Auth/Login/Env.pm index 653df2bb390..51261e6b9b1 100644 --- a/mozilla/webtools/bugzilla/Bugzilla/Auth/Login/Env.pm +++ b/mozilla/webtools/bugzilla/Bugzilla/Auth/Login/Env.pm @@ -9,7 +9,6 @@ package Bugzilla::Auth::Login::Env; use 5.10.1; use strict; -use warnings; use parent qw(Bugzilla::Auth::Login); @@ -25,6 +24,7 @@ use constant extern_id_used => 1; sub get_login_info { my ($self) = @_; + my $dbh = Bugzilla->dbh; my $env_id = $ENV{Bugzilla->params->{"auth_env_id"}} || ''; my $env_email = $ENV{Bugzilla->params->{"auth_env_email"}} || ''; diff --git a/mozilla/webtools/bugzilla/Bugzilla/Auth/Login/Stack.pm b/mozilla/webtools/bugzilla/Bugzilla/Auth/Login/Stack.pm index dc35998e4f9..ad5598576a8 100644 --- a/mozilla/webtools/bugzilla/Bugzilla/Auth/Login/Stack.pm +++ b/mozilla/webtools/bugzilla/Bugzilla/Auth/Login/Stack.pm @@ -9,7 +9,6 @@ package Bugzilla::Auth::Login::Stack; use 5.10.1; use strict; -use warnings; use base qw(Bugzilla::Auth::Login); use fields qw( diff --git a/mozilla/webtools/bugzilla/Bugzilla/Auth/Persist/Cookie.pm b/mozilla/webtools/bugzilla/Bugzilla/Auth/Persist/Cookie.pm index 2d1291f3b90..6f4eac96d25 100644 --- a/mozilla/webtools/bugzilla/Bugzilla/Auth/Persist/Cookie.pm +++ b/mozilla/webtools/bugzilla/Bugzilla/Auth/Persist/Cookie.pm @@ -9,8 +9,6 @@ package Bugzilla::Auth::Persist::Cookie; use 5.10.1; use strict; -use warnings; - use fields qw(); use Bugzilla::Constants; diff --git a/mozilla/webtools/bugzilla/Bugzilla/Auth/Verify.pm b/mozilla/webtools/bugzilla/Bugzilla/Auth/Verify.pm index e44fb06aef9..ecb64e22a74 100644 --- a/mozilla/webtools/bugzilla/Bugzilla/Auth/Verify.pm +++ b/mozilla/webtools/bugzilla/Bugzilla/Auth/Verify.pm @@ -9,8 +9,6 @@ package Bugzilla::Auth::Verify; use 5.10.1; use strict; -use warnings; - use fields qw(); use Bugzilla::Constants; diff --git a/mozilla/webtools/bugzilla/Bugzilla/Auth/Verify/DB.pm b/mozilla/webtools/bugzilla/Bugzilla/Auth/Verify/DB.pm index 28a9310c97c..d4a4674d3c4 100644 --- a/mozilla/webtools/bugzilla/Bugzilla/Auth/Verify/DB.pm +++ b/mozilla/webtools/bugzilla/Bugzilla/Auth/Verify/DB.pm @@ -9,7 +9,6 @@ package Bugzilla::Auth::Verify::DB; use 5.10.1; use strict; -use warnings; use parent qw(Bugzilla::Auth::Verify); @@ -56,19 +55,10 @@ sub check_credentials { }; } - # Force the user to change their password if it does not meet the current - # criteria. This should usually only happen if the criteria has changed. - if (Bugzilla->usage_mode == USAGE_MODE_BROWSER && - Bugzilla->params->{password_check_on_login}) - { - my $check = validate_password_check($password); - if ($check) { - return { - failure => AUTH_ERROR, - user_error => $check, - details => { locked_user => $user } - } - } + # Force the user to type a longer password if it's too short. + if (length($password) < USER_PASSWORD_MIN_LENGTH) { + return { failure => AUTH_ERROR, user_error => 'password_current_too_short', + details => { locked_user => $user } }; } # The user's credentials are okay, so delete any outstanding diff --git a/mozilla/webtools/bugzilla/Bugzilla/Auth/Verify/LDAP.pm b/mozilla/webtools/bugzilla/Bugzilla/Auth/Verify/LDAP.pm index e37f557939b..c113124f1d4 100644 --- a/mozilla/webtools/bugzilla/Bugzilla/Auth/Verify/LDAP.pm +++ b/mozilla/webtools/bugzilla/Bugzilla/Auth/Verify/LDAP.pm @@ -9,7 +9,6 @@ package Bugzilla::Auth::Verify::LDAP; use 5.10.1; use strict; -use warnings; use base qw(Bugzilla::Auth::Verify); use fields qw( diff --git a/mozilla/webtools/bugzilla/Bugzilla/Auth/Verify/RADIUS.pm b/mozilla/webtools/bugzilla/Bugzilla/Auth/Verify/RADIUS.pm index 283d9b46614..e5157c68f4c 100644 --- a/mozilla/webtools/bugzilla/Bugzilla/Auth/Verify/RADIUS.pm +++ b/mozilla/webtools/bugzilla/Bugzilla/Auth/Verify/RADIUS.pm @@ -9,7 +9,6 @@ package Bugzilla::Auth::Verify::RADIUS; use 5.10.1; use strict; -use warnings; use parent qw(Bugzilla::Auth::Verify); diff --git a/mozilla/webtools/bugzilla/Bugzilla/Auth/Verify/Stack.pm b/mozilla/webtools/bugzilla/Bugzilla/Auth/Verify/Stack.pm index 3e5db3cecbb..52c449e22f9 100644 --- a/mozilla/webtools/bugzilla/Bugzilla/Auth/Verify/Stack.pm +++ b/mozilla/webtools/bugzilla/Bugzilla/Auth/Verify/Stack.pm @@ -9,7 +9,6 @@ package Bugzilla::Auth::Verify::Stack; use 5.10.1; use strict; -use warnings; use base qw(Bugzilla::Auth::Verify); use fields qw( diff --git a/mozilla/webtools/bugzilla/Bugzilla/Bug.pm b/mozilla/webtools/bugzilla/Bugzilla/Bug.pm index aec7c1e82d0..b762a65003f 100644 --- a/mozilla/webtools/bugzilla/Bugzilla/Bug.pm +++ b/mozilla/webtools/bugzilla/Bugzilla/Bug.pm @@ -9,7 +9,6 @@ package Bugzilla::Bug; use 5.10.1; use strict; -use warnings; use Bugzilla::Attachment; use Bugzilla::Constants; @@ -49,7 +48,7 @@ use parent qw(Bugzilla::Object Exporter); use constant DB_TABLE => 'bugs'; use constant ID_FIELD => 'bug_id'; -use constant NAME_FIELD => 'bug_id'; +use constant NAME_FIELD => 'alias'; use constant LIST_ORDER => ID_FIELD; # Bugs have their own auditing table, bugs_activity. use constant AUDIT_CREATES => 0; @@ -65,6 +64,7 @@ sub DB_COLUMNS { my @custom_names = map {$_->name} @custom; my @columns = (qw( + alias assigned_to bug_file_loc bug_id @@ -207,6 +207,7 @@ sub UPDATE_COLUMNS { Bugzilla->active_custom_fields; my @custom_names = map {$_->name} @custom; my @columns = qw( + alias assigned_to bug_file_loc bug_severity @@ -312,20 +313,11 @@ sub new { # If we get something that looks like a word (not a number), # make it the "name" param. if (!defined $param - || (!ref($param) && $param !~ /^\d+$/) - || (ref($param) && $param->{id} !~ /^\d+$/)) + || (!ref($param) && $param =~ /\D/) + || (ref($param) && $param->{id} =~ /\D/)) { if ($param) { - my $alias = ref($param) ? $param->{id} : $param; - my $bug_id = bug_alias_to_id($alias); - if (! $bug_id) { - my $error_self = {}; - bless $error_self, $class; - $error_self->{'bug_id'} = $alias; - $error_self->{'error'} = 'InvalidBugId'; - return $error_self; - } - $param = { id => $bug_id, + $param = { name => ref($param) ? $param->{id} : $param, cache => ref($param) ? $param->{cache} : 0 }; } else { @@ -555,9 +547,6 @@ sub _preload_referenced_bugs { foreach my $bug (@$referenced_bugs) { $bug->object_cache_set(); } - - # preload bug visibility - Bugzilla->user->visible_bugs(\@referenced_bug_ids); } sub possible_duplicates { @@ -694,22 +683,18 @@ sub create { unless defined $params->{rep_platform}; # Make sure a comment is always defined. $params->{comment} = '' unless defined $params->{comment}; - $params->{is_markdown} = 0 - unless defined $params->{is_markdown} && $params->{is_markdown} eq '1'; $class->check_required_create_fields($params); $params = $class->run_create_validators($params); # These are not a fields in the bugs table, so we don't pass them to # insert_create_data. - my $bug_aliases = delete $params->{alias}; my $cc_ids = delete $params->{cc}; my $groups = delete $params->{groups}; my $depends_on = delete $params->{dependson}; my $blocked = delete $params->{blocked}; my $keywords = delete $params->{keywords}; my $creation_comment = delete $params->{comment}; - my $is_markdown = delete $params->{is_markdown}; my $see_also = delete $params->{see_also}; # We don't want the bug to appear in the system until it's correctly @@ -797,19 +782,11 @@ sub create { # We now have a bug id so we can fill this out $creation_comment->{'bug_id'} = $bug->id; - $creation_comment->{'is_markdown'} = $is_markdown; # Insert the comment. We always insert a comment on bug creation, # but sometimes it's blank. Bugzilla::Comment->insert_create_data($creation_comment); - # Set up aliases - my $sth_aliases = $dbh->prepare('INSERT INTO bugs_aliases (alias, bug_id) VALUES (?, ?)'); - foreach my $alias (@$bug_aliases) { - trick_taint($alias); - $sth_aliases->execute($alias, $bug->bug_id); - } - Bugzilla::Hook::process('bug_end_of_create', { bug => $bug, timestamp => $timestamp, }); @@ -929,26 +906,7 @@ sub update { my $added_names = join(', ', (map {$_->login} @$added_users)); $changes->{cc} = [$removed_names, $added_names]; } - - # Aliases - my $old_aliases = $old_bug->alias; - my $new_aliases = $self->alias; - my ($removed_aliases, $added_aliases) = diff_arrays($old_aliases, $new_aliases); - - foreach my $alias (@$removed_aliases) { - $dbh->do('DELETE FROM bugs_aliases WHERE bug_id = ? AND alias = ?', - undef, $self->id, $alias); - } - foreach my $alias (@$added_aliases) { - trick_taint($alias); - $dbh->do('INSERT INTO bugs_aliases (bug_id, alias) VALUES (?,?)', - undef, $self->id, $alias); - } - # If any changes were found, record it in the activity log - if (scalar @$removed_aliases || scalar @$added_aliases) { - $changes->{alias} = [join(', ', @$removed_aliases), join(', ', @$added_aliases)]; - } - + # Keywords my @old_kw_ids = map { $_->id } @{$old_bug->keyword_objects}; my @new_kw_ids = map { $_->id } @{$self->keyword_objects}; @@ -1030,6 +988,12 @@ sub update { join(', ', @added_names)]; } + # Flags + my ($removed, $added) = Bugzilla::Flag->update_flags($self, $old_bug, $delta_ts); + if ($removed || $added) { + $changes->{'flagtypes.name'} = [$removed, $added]; + } + # Comments foreach my $comment (@{$self->{added_comments} || []}) { # Override the Comment's timestamp to be identical to the update @@ -1052,9 +1016,6 @@ sub update { $user->id, $delta_ts, $comment->id); } - # Clear the cache of comments - delete $self->{comments}; - # Insert the values into the multiselect value tables my @multi_selects = grep {$_->type == FIELD_TYPE_MULTI_SELECT} Bugzilla->active_custom_fields; @@ -1087,12 +1048,6 @@ sub update { join(', ', map { $_->name } @$added_see)]; } - # Flags - my ($removed, $added) = Bugzilla::Flag->update_flags($self, $old_bug, $delta_ts); - if ($removed || $added) { - $changes->{'flagtypes.name'} = [$removed, $added]; - } - $_->update foreach @{ $self->{_update_ref_bugs} || [] }; delete $self->{_update_ref_bugs}; @@ -1140,13 +1095,6 @@ sub update { $self->update_user_last_visit($user, $delta_ts); } - # If a user is no longer involved, remove their last visit entry - my $last_visits = - Bugzilla::BugUserLastVisit->match({ bug_id => $self->id }); - foreach my $lv (@$last_visits) { - $lv->remove_from_db() unless $lv->user->is_involved_in_bug($self); - } - # Update bug ignore data if user wants to ignore mail for this bug if (exists $self->{'bug_ignored'}) { my $bug_ignored_changed; @@ -1362,38 +1310,32 @@ sub _send_bugmail { ##################################################################### sub _check_alias { - my ($invocant, $aliases) = @_; - $aliases = ref $aliases ? $aliases : [split(/[\s,]+/, $aliases)]; + my ($invocant, $alias) = @_; + $alias = trim($alias); + return undef if (!$alias); - # Remove empty aliases - @$aliases = grep { $_ } @$aliases; - - foreach my $alias (@$aliases) { - $alias = trim($alias); - - # Make sure the alias isn't too long. - if (length($alias) > 40) { - ThrowUserError("alias_too_long"); - } - # Make sure the alias isn't just a number. - if ($alias =~ /^\d+$/) { - ThrowUserError("alias_is_numeric", { alias => $alias }); - } - # Make sure the alias has no commas or spaces. - if ($alias =~ /[, ]/) { - ThrowUserError("alias_has_comma_or_space", { alias => $alias }); - } - # Make sure the alias is unique, or that it's already our alias. - my $other_bug = new Bugzilla::Bug($alias); - if (!$other_bug->{error} - && (!ref $invocant || $other_bug->id != $invocant->id)) - { - ThrowUserError("alias_in_use", { alias => $alias, - bug_id => $other_bug->id }); - } + # Make sure the alias isn't too long. + if (length($alias) > 20) { + ThrowUserError("alias_too_long"); + } + # Make sure the alias isn't just a number. + if ($alias =~ /^\d+$/) { + ThrowUserError("alias_is_numeric", { alias => $alias }); + } + # Make sure the alias has no commas or spaces. + if ($alias =~ /[, ]/) { + ThrowUserError("alias_has_comma_or_space", { alias => $alias }); + } + # Make sure the alias is unique, or that it's already our alias. + my $other_bug = new Bugzilla::Bug($alias); + if (!$other_bug->{error} + && (!ref $invocant || $other_bug->id != $invocant->id)) + { + ThrowUserError("alias_in_use", { alias => $alias, + bug_id => $other_bug->id }); } - return $aliases; + return $alias; } sub _check_assigned_to { @@ -2430,15 +2372,7 @@ sub set_all { # there are lots of things that want to check if we added a comment. $self->add_comment($params->{'comment'}->{'body'}, { isprivate => $params->{'comment'}->{'is_private'}, - work_time => $params->{'work_time'}, - is_markdown => $params->{'comment'}->{'is_markdown'} }); - } - - if (exists $params->{alias} && $params->{alias}{set}) { - $params->{alias} = { - add => $params->{alias}{set}, - remove => $self->alias, - }; + work_time => $params->{'work_time'} }); } my %normal_set_all; @@ -2465,7 +2399,6 @@ sub set_all { } $self->_add_remove($params, 'cc'); - $self->_add_remove($params, 'alias'); # Theoretically you could move a product without ever specifying # a new assignee or qa_contact, or adding/removing any CCs. So, @@ -2482,13 +2415,14 @@ sub _add_remove { my ($self, $params, $name) = @_; my @add = @{ $params->{$name}->{add} || [] }; my @remove = @{ $params->{$name}->{remove} || [] }; - $name =~ s/s$// if $name ne 'alias'; + $name =~ s/s$//; my $add_method = "add_$name"; my $remove_method = "remove_$name"; $self->$add_method($_) foreach @add; $self->$remove_method($_) foreach @remove; } +sub set_alias { $_[0]->set('alias', $_[1]); } sub set_assigned_to { my ($self, $value) = @_; $self->set('assigned_to', $value); @@ -2905,21 +2839,6 @@ sub remove_cc { @$cc_users = grep { $_->id != $user->id } @$cc_users; } -sub add_alias { - my ($self, $alias) = @_; - return if !$alias; - my $aliases = $self->_check_alias($alias); - $alias = $aliases->[0]; - my $bug_aliases = $self->alias; - push(@$bug_aliases, $alias) if !grep($_ eq $alias, @$bug_aliases); -} - -sub remove_alias { - my ($self, $alias) = @_; - my $bug_aliases = $self->alias; - @$bug_aliases = grep { $_ ne $alias } @$bug_aliases; -} - # $bug->add_comment("comment", {isprivate => 1, work_time => 10.5, # type => CMT_NORMAL, extra_data => $data}); sub add_comment { @@ -3247,6 +3166,7 @@ sub tags { # These are accessors that don't need to access the database. # Keep them in alphabetical order. +sub alias { return $_[0]->{alias} } sub bug_file_loc { return $_[0]->{bug_file_loc} } sub bug_id { return $_[0]->{bug_id} } sub bug_severity { return $_[0]->{bug_severity} } @@ -3356,24 +3276,6 @@ sub actual_time { return $self->{'actual_time'}; } -sub alias { - my ($self) = @_; - return $self->{'alias'} if exists $self->{'alias'}; - return [] if $self->{'error'}; - - my $dbh = Bugzilla->dbh; - $self->{'alias'} = $dbh->selectcol_arrayref( - q{SELECT alias - FROM bugs_aliases - WHERE bug_id = ? - ORDER BY alias}, - undef, $self->bug_id); - - $self->{'alias'} = [] if !scalar(@{$self->{'alias'}}); - - return $self->{'alias'}; -} - sub any_flags_requesteeble { my ($self) = @_; return $self->{'any_flags_requesteeble'} @@ -3951,11 +3853,6 @@ sub choices { my @resolutions = grep($_->name, @{ $resolution_field->legal_values }); $choices{'resolution'} = \@resolutions; - foreach my $key (keys %choices) { - my $value = $self->$key; - $choices{$key} = [grep { $_->is_active || $_->name eq $value } @{ $choices{$key} }]; - } - $self->{'choices'} = \%choices; return $self->{'choices'}; } @@ -3970,7 +3867,7 @@ sub bug_alias_to_id { my $dbh = Bugzilla->dbh; trick_taint($alias); return $dbh->selectrow_array( - "SELECT bug_id FROM bugs_aliases WHERE alias = ?", undef, $alias); + "SELECT bug_id FROM bugs WHERE alias = ?", undef, $alias); } ##################################################################### @@ -4599,16 +4496,6 @@ __END__ Ensures the accessors for custom fields are always created. -=item C - -Adds an alias to the internal respresentation of the bug. You will need to -call L to make the changes permanent. - -=item C - -Removes an alias from the internal respresentation of the bug. You will need to -call L to make the changes permanent. - =item C Creates or updates a L for this bug and the supplied @@ -4776,6 +4663,8 @@ $user, the timestamp given as $last_visit. =item remove_group +=item set_alias + =item set_dup_id =item set_target_milestone diff --git a/mozilla/webtools/bugzilla/Bugzilla/BugMail.pm b/mozilla/webtools/bugzilla/Bugzilla/BugMail.pm index 8b4219787d5..d66df579dca 100644 --- a/mozilla/webtools/bugzilla/Bugzilla/BugMail.pm +++ b/mozilla/webtools/bugzilla/Bugzilla/BugMail.pm @@ -9,7 +9,6 @@ package Bugzilla::BugMail; use 5.10.1; use strict; -use warnings; use Bugzilla::Error; use Bugzilla::User; diff --git a/mozilla/webtools/bugzilla/Bugzilla/BugUrl.pm b/mozilla/webtools/bugzilla/Bugzilla/BugUrl.pm index 1e836ca1e8e..39b985d290d 100644 --- a/mozilla/webtools/bugzilla/Bugzilla/BugUrl.pm +++ b/mozilla/webtools/bugzilla/Bugzilla/BugUrl.pm @@ -9,7 +9,6 @@ package Bugzilla::BugUrl; use 5.10.1; use strict; -use warnings; use parent qw(Bugzilla::Object); diff --git a/mozilla/webtools/bugzilla/Bugzilla/BugUrl/Bugzilla.pm b/mozilla/webtools/bugzilla/Bugzilla/BugUrl/Bugzilla.pm index 402ff1509b4..db132eefff1 100644 --- a/mozilla/webtools/bugzilla/Bugzilla/BugUrl/Bugzilla.pm +++ b/mozilla/webtools/bugzilla/Bugzilla/BugUrl/Bugzilla.pm @@ -9,7 +9,6 @@ package Bugzilla::BugUrl::Bugzilla; use 5.10.1; use strict; -use warnings; use parent qw(Bugzilla::BugUrl); diff --git a/mozilla/webtools/bugzilla/Bugzilla/BugUrl/Bugzilla/Local.pm b/mozilla/webtools/bugzilla/Bugzilla/BugUrl/Bugzilla/Local.pm index 7b9cb6a4fa5..7381d561030 100644 --- a/mozilla/webtools/bugzilla/Bugzilla/BugUrl/Bugzilla/Local.pm +++ b/mozilla/webtools/bugzilla/Bugzilla/BugUrl/Bugzilla/Local.pm @@ -9,7 +9,6 @@ package Bugzilla::BugUrl::Bugzilla::Local; use 5.10.1; use strict; -use warnings; use parent qw(Bugzilla::BugUrl::Bugzilla); diff --git a/mozilla/webtools/bugzilla/Bugzilla/BugUrl/Debian.pm b/mozilla/webtools/bugzilla/Bugzilla/BugUrl/Debian.pm index 2b611aa57bd..97ad4b5456d 100644 --- a/mozilla/webtools/bugzilla/Bugzilla/BugUrl/Debian.pm +++ b/mozilla/webtools/bugzilla/Bugzilla/BugUrl/Debian.pm @@ -9,7 +9,6 @@ package Bugzilla::BugUrl::Debian; use 5.10.1; use strict; -use warnings; use parent qw(Bugzilla::BugUrl); diff --git a/mozilla/webtools/bugzilla/Bugzilla/BugUrl/GitHub.pm b/mozilla/webtools/bugzilla/Bugzilla/BugUrl/GitHub.pm index f14f1d6b05c..2c35bfb0827 100644 --- a/mozilla/webtools/bugzilla/Bugzilla/BugUrl/GitHub.pm +++ b/mozilla/webtools/bugzilla/Bugzilla/BugUrl/GitHub.pm @@ -9,7 +9,6 @@ package Bugzilla::BugUrl::GitHub; use 5.10.1; use strict; -use warnings; use parent qw(Bugzilla::BugUrl); @@ -22,10 +21,8 @@ sub should_handle { # GitHub issue URLs have only one form: # https://github.com/USER_OR_TEAM_OR_ORGANIZATION_NAME/REPOSITORY_NAME/issues/111 - # GitHub pull request URLs have only one form: - # https://github.com/USER_OR_TEAM_OR_ORGANIZATION_NAME/REPOSITORY_NAME/pull/111 return (lc($uri->authority) eq 'github.com' - and $uri->path =~ m!^/[^/]+/[^/]+/(?:issues|pull)/\d+$!) ? 1 : 0; + and $uri->path =~ m|^/[^/]+/[^/]+/issues/\d+$|) ? 1 : 0; } sub _check_value { diff --git a/mozilla/webtools/bugzilla/Bugzilla/BugUrl/Google.pm b/mozilla/webtools/bugzilla/Bugzilla/BugUrl/Google.pm index 71a9c46fb52..dd9ab7ff4b0 100644 --- a/mozilla/webtools/bugzilla/Bugzilla/BugUrl/Google.pm +++ b/mozilla/webtools/bugzilla/Bugzilla/BugUrl/Google.pm @@ -9,7 +9,6 @@ package Bugzilla::BugUrl::Google; use 5.10.1; use strict; -use warnings; use parent qw(Bugzilla::BugUrl); diff --git a/mozilla/webtools/bugzilla/Bugzilla/BugUrl/JIRA.pm b/mozilla/webtools/bugzilla/Bugzilla/BugUrl/JIRA.pm index e9d2a2d2a6c..e358ff43940 100644 --- a/mozilla/webtools/bugzilla/Bugzilla/BugUrl/JIRA.pm +++ b/mozilla/webtools/bugzilla/Bugzilla/BugUrl/JIRA.pm @@ -9,7 +9,6 @@ package Bugzilla::BugUrl::JIRA; use 5.10.1; use strict; -use warnings; use parent qw(Bugzilla::BugUrl); diff --git a/mozilla/webtools/bugzilla/Bugzilla/BugUrl/Launchpad.pm b/mozilla/webtools/bugzilla/Bugzilla/BugUrl/Launchpad.pm index 0362747a245..3409cbe19fb 100644 --- a/mozilla/webtools/bugzilla/Bugzilla/BugUrl/Launchpad.pm +++ b/mozilla/webtools/bugzilla/Bugzilla/BugUrl/Launchpad.pm @@ -9,7 +9,6 @@ package Bugzilla::BugUrl::Launchpad; use 5.10.1; use strict; -use warnings; use parent qw(Bugzilla::BugUrl); diff --git a/mozilla/webtools/bugzilla/Bugzilla/BugUrl/MantisBT.pm b/mozilla/webtools/bugzilla/Bugzilla/BugUrl/MantisBT.pm index 60d3b578ef8..8dffabcbebc 100644 --- a/mozilla/webtools/bugzilla/Bugzilla/BugUrl/MantisBT.pm +++ b/mozilla/webtools/bugzilla/Bugzilla/BugUrl/MantisBT.pm @@ -9,7 +9,6 @@ package Bugzilla::BugUrl::MantisBT; use 5.10.1; use strict; -use warnings; use parent qw(Bugzilla::BugUrl); diff --git a/mozilla/webtools/bugzilla/Bugzilla/BugUrl/SourceForge.pm b/mozilla/webtools/bugzilla/Bugzilla/BugUrl/SourceForge.pm index 4a330f34b35..630b97d7a7d 100644 --- a/mozilla/webtools/bugzilla/Bugzilla/BugUrl/SourceForge.pm +++ b/mozilla/webtools/bugzilla/Bugzilla/BugUrl/SourceForge.pm @@ -9,7 +9,6 @@ package Bugzilla::BugUrl::SourceForge; use 5.10.1; use strict; -use warnings; use parent qw(Bugzilla::BugUrl); @@ -22,18 +21,12 @@ sub should_handle { # SourceForge tracker URLs have only one form: # http://sourceforge.net/tracker/?func=detail&aid=111&group_id=111&atid=111 - # SourceForge Allura ticket URLs have several forms: - # http://sourceforge.net/p/project/bugs/12345/ - # http://sourceforge.net/p/project/feature-requests/12345/ - # http://sourceforge.net/p/project/patches/12345/ - # http://sourceforge.net/p/project/support-requests/12345/ return (lc($uri->authority) eq 'sourceforge.net' - and (($uri->path eq '/tracker/' - and $uri->query_param('func') eq 'detail' - and $uri->query_param('aid') - and $uri->query_param('group_id') - and $uri->query_param('atid')) - or $uri->path =~ m!^/p/[^/]+/(?:bugs|feature-requests|patches|support-requests)/\d+/?$!)) ? 1 : 0; + and $uri->path =~ m|/tracker/| + and $uri->query_param('func') eq 'detail' + and $uri->query_param('aid') + and $uri->query_param('group_id') + and $uri->query_param('atid')) ? 1 : 0; } sub _check_value { @@ -44,11 +37,6 @@ sub _check_value { # Remove any # part if there is one. $uri->fragment(undef); - # Make sure the trailing slash is present - my $path = $uri->path; - $path =~ s!/*$!/!; - $uri->path($path); - return $uri; } diff --git a/mozilla/webtools/bugzilla/Bugzilla/BugUrl/Trac.pm b/mozilla/webtools/bugzilla/Bugzilla/BugUrl/Trac.pm index fe74abf33d3..edb18e8fd2c 100644 --- a/mozilla/webtools/bugzilla/Bugzilla/BugUrl/Trac.pm +++ b/mozilla/webtools/bugzilla/Bugzilla/BugUrl/Trac.pm @@ -9,7 +9,6 @@ package Bugzilla::BugUrl::Trac; use 5.10.1; use strict; -use warnings; use parent qw(Bugzilla::BugUrl); diff --git a/mozilla/webtools/bugzilla/Bugzilla/BugUserLastVisit.pm b/mozilla/webtools/bugzilla/Bugzilla/BugUserLastVisit.pm index d043b121abd..c4acfa56b25 100644 --- a/mozilla/webtools/bugzilla/Bugzilla/BugUserLastVisit.pm +++ b/mozilla/webtools/bugzilla/Bugzilla/BugUserLastVisit.pm @@ -9,7 +9,6 @@ package Bugzilla::BugUserLastVisit; use 5.10.1; use strict; -use warnings; use parent qw(Bugzilla::Object); @@ -39,13 +38,6 @@ sub bug_id { return $_[0]->{bug_id} } sub user_id { return $_[0]->{user_id} } sub last_visit_ts { return $_[0]->{last_visit_ts} } -sub user { - my $self = shift; - - $self->{user} //= Bugzilla::User->new({ id => $self->user_id, cache => 1 }); - return $self->{user}; -} - 1; __END__ @@ -88,6 +80,4 @@ listed below. =item C -=item C - =back diff --git a/mozilla/webtools/bugzilla/Bugzilla/CGI.pm b/mozilla/webtools/bugzilla/Bugzilla/CGI.pm index 0b8a4869727..656c462b712 100644 --- a/mozilla/webtools/bugzilla/Bugzilla/CGI.pm +++ b/mozilla/webtools/bugzilla/Bugzilla/CGI.pm @@ -9,7 +9,6 @@ package Bugzilla::CGI; use 5.10.1; use strict; -use warnings; use parent qw(CGI); @@ -362,7 +361,6 @@ sub header { sub param { my $self = shift; - local $CGI::LIST_CONTEXT_WARN = 0; # When we are just requesting the value of a parameter... if (scalar(@_) == 1) { @@ -374,7 +372,10 @@ sub param { if (!scalar(@result) && $self->request_method && $self->request_method eq 'POST') { - @result = $self->url_param(@_); + # Some servers fail to set the QUERY_STRING parameter, which + # causes undef issues + $ENV{'QUERY_STRING'} = '' unless exists $ENV{'QUERY_STRING'}; + @result = $self->SUPER::url_param(@_); } # Fix UTF-8-ness of input parameters. @@ -399,14 +400,6 @@ sub param { return $self->SUPER::param(@_); } -sub url_param { - my $self = shift; - # Some servers fail to set the QUERY_STRING parameter, which - # causes undef issues - $ENV{'QUERY_STRING'} //= ''; - return $self->SUPER::url_param(@_); -} - sub _fix_utf8 { my $input = shift; # The is_utf8 is here in case CGI gets smart about utf8 someday. @@ -738,8 +731,6 @@ L, L =item param -=item url_param - =item header =back diff --git a/mozilla/webtools/bugzilla/Bugzilla/Chart.pm b/mozilla/webtools/bugzilla/Bugzilla/Chart.pm index 3c69006aac4..0329b9a0cf3 100644 --- a/mozilla/webtools/bugzilla/Bugzilla/Chart.pm +++ b/mozilla/webtools/bugzilla/Bugzilla/Chart.pm @@ -15,7 +15,6 @@ package Bugzilla::Chart; use 5.10.1; use strict; -use warnings; use Bugzilla::Error; use Bugzilla::Util; @@ -96,9 +95,10 @@ sub init { if ($self->{'datefrom'} && $self->{'dateto'} && $self->{'datefrom'} > $self->{'dateto'}) { - ThrowUserError('misarranged_dates', { 'datefrom' => scalar $cgi->param('datefrom'), - 'dateto' => scalar $cgi->param('dateto') }); - } + ThrowUserError("misarranged_dates", + {'datefrom' => $cgi->param('datefrom'), + 'dateto' => $cgi->param('dateto')}); + } } # Alter Chart so that the selected series are added to it. diff --git a/mozilla/webtools/bugzilla/Bugzilla/Classification.pm b/mozilla/webtools/bugzilla/Bugzilla/Classification.pm index 09f71baaf12..0ae548bb687 100644 --- a/mozilla/webtools/bugzilla/Bugzilla/Classification.pm +++ b/mozilla/webtools/bugzilla/Bugzilla/Classification.pm @@ -9,7 +9,6 @@ package Bugzilla::Classification; use 5.10.1; use strict; -use warnings; use Bugzilla::Constants; use Bugzilla::Field; diff --git a/mozilla/webtools/bugzilla/Bugzilla/Comment.pm b/mozilla/webtools/bugzilla/Bugzilla/Comment.pm index 3dabe67028d..238770d5720 100644 --- a/mozilla/webtools/bugzilla/Bugzilla/Comment.pm +++ b/mozilla/webtools/bugzilla/Bugzilla/Comment.pm @@ -9,7 +9,6 @@ package Bugzilla::Comment; use 5.10.1; use strict; -use warnings; use parent qw(Bugzilla::Object); @@ -43,7 +42,6 @@ use constant DB_COLUMNS => qw( already_wrapped type extra_data - is_markdown ); use constant UPDATE_COLUMNS => qw( @@ -66,7 +64,6 @@ use constant VALIDATORS => { work_time => \&_check_work_time, thetext => \&_check_thetext, isprivate => \&_check_isprivate, - is_markdown => \&Bugzilla::Object::check_boolean, extra_data => \&_check_extra_data, type => \&_check_type, }; @@ -179,7 +176,6 @@ sub body { return $_[0]->{'thetext'}; } sub bug_id { return $_[0]->{'bug_id'}; } sub creation_ts { return $_[0]->{'bug_when'}; } sub is_private { return $_[0]->{'isprivate'}; } -sub is_markdown { return $_[0]->{'is_markdown'}; } sub work_time { # Work time is returned as a string (see bug 607909) return 0 if $_[0]->{'work_time'} + 0 == 0; @@ -277,7 +273,6 @@ sub body_full { sub set_is_private { $_[0]->set('isprivate', $_[1]); } sub set_type { $_[0]->set('type', $_[1]); } sub set_extra_data { $_[0]->set('extra_data', $_[1]); } -sub set_is_markdown { $_[0]->set('is_markdown', $_[1]); } sub add_tag { my ($self, $tag) = @_; @@ -526,10 +521,6 @@ C Time spent as related to this comment. C Comment is marked as private. -=item C - -C Whether this comment needs L rendering to be applied. - =item C If this comment is stored in the database word-wrapped, this will be C<1>. @@ -625,16 +616,6 @@ A string, the full text of the comment as it would be displayed to an end-user. =cut -=head2 Modifiers - -=over - -=item C - -Sets whether this comment needs L rendering to be applied. - -=back - =head1 B =over diff --git a/mozilla/webtools/bugzilla/Bugzilla/Comment/TagWeights.pm b/mozilla/webtools/bugzilla/Bugzilla/Comment/TagWeights.pm index 7dba53e34c0..f1a220a47f8 100644 --- a/mozilla/webtools/bugzilla/Bugzilla/Comment/TagWeights.pm +++ b/mozilla/webtools/bugzilla/Bugzilla/Comment/TagWeights.pm @@ -9,7 +9,6 @@ package Bugzilla::Comment::TagWeights; use 5.10.1; use strict; -use warnings; use parent qw(Bugzilla::Object); diff --git a/mozilla/webtools/bugzilla/Bugzilla/Component.pm b/mozilla/webtools/bugzilla/Bugzilla/Component.pm index 9bc0a449314..3d56cc8c265 100644 --- a/mozilla/webtools/bugzilla/Bugzilla/Component.pm +++ b/mozilla/webtools/bugzilla/Bugzilla/Component.pm @@ -9,7 +9,6 @@ package Bugzilla::Component; use 5.10.1; use strict; -use warnings; use parent qw(Bugzilla::Field::ChoiceInterface Bugzilla::Object); diff --git a/mozilla/webtools/bugzilla/Bugzilla/Config.pm b/mozilla/webtools/bugzilla/Bugzilla/Config.pm index fdbedbdc044..5d9a8061c91 100644 --- a/mozilla/webtools/bugzilla/Bugzilla/Config.pm +++ b/mozilla/webtools/bugzilla/Bugzilla/Config.pm @@ -9,19 +9,12 @@ package Bugzilla::Config; use 5.10.1; use strict; -use warnings; use parent qw(Exporter); -use autodie qw(:default); - use Bugzilla::Constants; use Bugzilla::Hook; -use Bugzilla::Util qw(trick_taint); - -use JSON::XS; -use File::Slurp; +use Data::Dumper; use File::Temp; -use File::Basename; # Don't export localvars by default - people should have to explicitly # ask for it, as a (probably futile) attempt to stop code using it @@ -98,35 +91,8 @@ sub SetParam { sub update_params { my ($params) = @_; my $answer = Bugzilla->installation_answers; - my $datadir = bz_locations()->{'datadir'}; - my $param; - - # If the old data/params file using Data::Dumper output still exists, - # read it. It will be deleted once the parameters are stored in the new - # data/params.json file. - my $old_file = "$datadir/params"; - - if (-e $old_file) { - require Safe; - my $s = new Safe; - - $s->rdo($old_file); - die "Error reading $old_file: $!" if $!; - die "Error evaluating $old_file: $@" if $@; - - # Now read the param back out from the sandbox. - $param = \%{ $s->varglob('param') }; - } - else { - # Rename params.js to params.json if checksetup.pl - # was executed with an earlier version of this change - rename "$old_file.js", "$old_file.json" - if -e "$old_file.js" && !-e "$old_file.json"; - - # Read the new data/params.json file. - $param = read_param_file(); - } + my $param = read_param_file(); my %new_params; # If we didn't return any param values, then this is a new installation. @@ -185,19 +151,16 @@ sub update_params { } # Old mail_delivery_method choices contained no uppercase characters - my $mta = $param->{'mail_delivery_method'}; - if ($mta) { - if ($mta !~ /[A-Z]/) { - my %translation = ( - 'sendmail' => 'Sendmail', - 'smtp' => 'SMTP', - 'qmail' => 'Qmail', - 'testfile' => 'Test', - 'none' => 'None'); - $param->{'mail_delivery_method'} = $translation{$mta}; - } - # This will force the parameter to be reset to its default value. - delete $param->{'mail_delivery_method'} if $param->{'mail_delivery_method'} eq 'Qmail'; + if (exists $param->{'mail_delivery_method'} + && $param->{'mail_delivery_method'} !~ /[A-Z]/) { + my $method = $param->{'mail_delivery_method'}; + my %translation = ( + 'sendmail' => 'Sendmail', + 'smtp' => 'SMTP', + 'qmail' => 'Qmail', + 'testfile' => 'Test', + 'none' => 'None'); + $param->{'mail_delivery_method'} = $translation{$method}; } # Convert the old "ssl" parameter to the new "ssl_redirect" parameter. @@ -247,6 +210,7 @@ sub update_params { } # Write any old parameters to old-params.txt + my $datadir = bz_locations()->{'datadir'}; my $old_param_file = "$datadir/old-params.txt"; if (scalar(keys %oldparams)) { my $op_file = new IO::File($old_param_file, '>>', 0600) @@ -256,9 +220,12 @@ sub update_params { " and so have been\nmoved from your parameters file into", " $old_param_file:\n"; + local $Data::Dumper::Terse = 1; + local $Data::Dumper::Indent = 0; + my $comma = ""; foreach my $item (keys %oldparams) { - print $op_file "\n\n$item:\n" . $oldparams{$item} . "\n"; + print $op_file "\n\n$item:\n" . Data::Dumper->Dump([$oldparams{$item}]) . "\n"; print "${comma}$item"; $comma = ", "; } @@ -289,11 +256,6 @@ sub update_params { write_params($param); - if (-e $old_file) { - unlink $old_file; - say "$old_file has been converted into $old_file.json, using the JSON format."; - } - # Return deleted params and values so that checksetup.pl has a chance # to convert old params to new data. return %oldparams; @@ -302,10 +264,22 @@ sub update_params { sub write_params { my ($param_data) = @_; $param_data ||= Bugzilla->params; - my $param_file = bz_locations()->{'datadir'} . '/params.json'; - my $json_data = JSON::XS->new->canonical->pretty->encode($param_data); - write_file($param_file, { binmode => ':utf8', atomic => 1 }, \$json_data); + my $datadir = bz_locations()->{'datadir'}; + my $param_file = "$datadir/params"; + + local $Data::Dumper::Sortkeys = 1; + + my ($fh, $tmpname) = File::Temp::tempfile('params.XXXXX', + DIR => $datadir ); + + print $fh (Data::Dumper->Dump([$param_data], ['*param'])) + || die "Can't write param file: $!"; + + close $fh; + + rename $tmpname, $param_file + or die "Can't rename $tmpname to $param_file: $!"; # It's not common to edit parameters and loading # Bugzilla::Install::Filesystem is slow. @@ -319,23 +293,21 @@ sub write_params { sub read_param_file { my %params; - my $file = bz_locations()->{'datadir'} . '/params.json'; + my $datadir = bz_locations()->{'datadir'}; + if (-e "$datadir/params") { + # Note that checksetup.pl sets file permissions on '$datadir/params' - if (-e $file) { - my $data; - read_file($file, binmode => ':utf8', buf_ref => \$data); + # Using Safe mode is _not_ a guarantee of safety if someone does + # manage to write to the file. However, it won't hurt... + # See bug 165144 for not needing to eval this at all + my $s = new Safe; - # If params.json has been manually edited and e.g. some quotes are - # missing, we don't want JSON::XS to leak the content of the file - # to all users in its error message, so we have to eval'uate it. - %params = eval { %{JSON::XS->new->decode($data)} }; - if ($@) { - my $error_msg = (basename($0) eq 'checksetup.pl') ? - $@ : 'run checksetup.pl to see the details.'; - die "Error parsing $file: $error_msg"; - } - # JSON::XS doesn't detaint data for us. - trick_taint($params{$_}) foreach keys %params; + $s->rdo("$datadir/params"); + die "Error reading $datadir/params: $!" if $!; + die "Error evaluating $datadir/params: $@" if $@; + + # Now read the param back out from the sandbox + %params = %{$s->varglob('param')}; } elsif ($ENV{'SERVER_SOFTWARE'}) { # We're in a CGI, but the params file doesn't exist. We can't @@ -345,7 +317,7 @@ sub read_param_file { # so that the user sees the error. require CGI::Carp; CGI::Carp->import('fatalsToBrowser'); - die "The $file file does not exist." + die "The $datadir/params file does not exist." . ' You probably need to run checksetup.pl.', } return \%params; @@ -401,7 +373,7 @@ specified. Description: Writes the parameters to disk. Params: C<$params> (optional) - A hashref to write to the disk - instead of Cparams>. Used only by + instead of Cparams>. Used only by C. Returns: nothing @@ -409,12 +381,12 @@ Returns: nothing =item C Description: Most callers should never need this. This is used - by Cparams> to directly read C<$datadir/params.json> - and load it into memory. Use Cparams> instead. + by Cparams> to directly read C<$datadir/params> + and load it into memory. Use Cparams> instead. Params: none -Returns: A hashref containing the current params in C<$datadir/params.json>. +Returns: A hashref containing the current params in C<$datadir/params>. =item C diff --git a/mozilla/webtools/bugzilla/Bugzilla/Config/Admin.pm b/mozilla/webtools/bugzilla/Bugzilla/Config/Admin.pm index 41d92929852..97f8ea390de 100644 --- a/mozilla/webtools/bugzilla/Bugzilla/Config/Admin.pm +++ b/mozilla/webtools/bugzilla/Bugzilla/Config/Admin.pm @@ -9,7 +9,6 @@ package Bugzilla::Config::Admin; use 5.10.1; use strict; -use warnings; use Bugzilla::Config::Common; diff --git a/mozilla/webtools/bugzilla/Bugzilla/Config/Advanced.pm b/mozilla/webtools/bugzilla/Bugzilla/Config/Advanced.pm index 8356c33610e..eec2816d26d 100644 --- a/mozilla/webtools/bugzilla/Bugzilla/Config/Advanced.pm +++ b/mozilla/webtools/bugzilla/Bugzilla/Config/Advanced.pm @@ -9,7 +9,6 @@ package Bugzilla::Config::Advanced; use 5.10.1; use strict; -use warnings; use Bugzilla::Config::Common; diff --git a/mozilla/webtools/bugzilla/Bugzilla/Config/Attachment.pm b/mozilla/webtools/bugzilla/Bugzilla/Config/Attachment.pm index 5bf8542936c..f31e57254ab 100644 --- a/mozilla/webtools/bugzilla/Bugzilla/Config/Attachment.pm +++ b/mozilla/webtools/bugzilla/Bugzilla/Config/Attachment.pm @@ -9,7 +9,6 @@ package Bugzilla::Config::Attachment; use 5.10.1; use strict; -use warnings; use Bugzilla::Config::Common; @@ -37,14 +36,6 @@ sub get_param_list { default => 0 }, - { - name => 'xsendfile_header', - type => 's', - choices => ['off', 'X-Sendfile', 'X-Accel-Redirect', 'X-LIGHTTPD-send-file'], - default => 'off', - checker => \&check_multi - }, - { name => 'maxattachmentsize', type => 't', diff --git a/mozilla/webtools/bugzilla/Bugzilla/Config/Auth.pm b/mozilla/webtools/bugzilla/Bugzilla/Config/Auth.pm index 78d719b15d3..699881122eb 100644 --- a/mozilla/webtools/bugzilla/Bugzilla/Config/Auth.pm +++ b/mozilla/webtools/bugzilla/Bugzilla/Config/Auth.pm @@ -9,7 +9,6 @@ package Bugzilla::Config::Auth; use 5.10.1; use strict; -use warnings; use Bugzilla::Config::Common; @@ -114,14 +113,7 @@ sub get_param_list { 'letters_numbers_specialchars' ], default => 'no_constraints', checker => \&check_multi - }, - - { - name => 'password_check_on_login', - type => 'b', - default => '1' - }, - ); + } ); return @param_list; } diff --git a/mozilla/webtools/bugzilla/Bugzilla/Config/BugChange.pm b/mozilla/webtools/bugzilla/Bugzilla/Config/BugChange.pm index 0acdc0ce49c..53fc68d00c8 100644 --- a/mozilla/webtools/bugzilla/Bugzilla/Config/BugChange.pm +++ b/mozilla/webtools/bugzilla/Bugzilla/Config/BugChange.pm @@ -9,7 +9,6 @@ package Bugzilla::Config::BugChange; use 5.10.1; use strict; -use warnings; use Bugzilla::Config::Common; use Bugzilla::Status; diff --git a/mozilla/webtools/bugzilla/Bugzilla/Config/BugFields.pm b/mozilla/webtools/bugzilla/Bugzilla/Config/BugFields.pm index ef2faa64b64..39c43cb9235 100644 --- a/mozilla/webtools/bugzilla/Bugzilla/Config/BugFields.pm +++ b/mozilla/webtools/bugzilla/Bugzilla/Config/BugFields.pm @@ -9,7 +9,6 @@ package Bugzilla::Config::BugFields; use 5.10.1; use strict; -use warnings; use Bugzilla::Config::Common; use Bugzilla::Field; diff --git a/mozilla/webtools/bugzilla/Bugzilla/Config/Common.pm b/mozilla/webtools/bugzilla/Bugzilla/Config/Common.pm index fe6a2c2c0aa..e9e993396c9 100644 --- a/mozilla/webtools/bugzilla/Bugzilla/Config/Common.pm +++ b/mozilla/webtools/bugzilla/Bugzilla/Config/Common.pm @@ -9,7 +9,6 @@ package Bugzilla::Config::Common; use 5.10.1; use strict; -use warnings; use Email::Address; use Socket; @@ -29,7 +28,7 @@ use parent qw(Exporter); check_mail_delivery_method check_notification check_utf8 check_bug_status check_smtp_auth check_theschwartz_available check_maxattachmentsize check_email check_smtp_ssl - check_comment_taggers_group check_smtp_server + check_comment_taggers_group ); # Checking functions for the various values @@ -342,33 +341,6 @@ sub check_notification { return ""; } -sub check_smtp_server { - my $host = shift; - my $port; - - if ($host =~ /:/) { - ($host, $port) = split(/:/, $host, 2); - unless ($port && detaint_natural($port)) { - return "Invalid port. It must be an integer (typically 25, 465 or 587)"; - } - } - trick_taint($host); - # Let's first try to connect using SSL. If this fails, we fall back to - # an unencrypted connection. - foreach my $method (['Net::SMTP::SSL', 465], ['Net::SMTP', 25]) { - my ($class, $default_port) = @$method; - next if $class eq 'Net::SMTP::SSL' && !Bugzilla->feature('smtp_ssl'); - eval "require $class"; - my $smtp = $class->new($host, Port => $port || $default_port, Timeout => 5); - if ($smtp) { - # The connection works! - $smtp->quit; - return ''; - } - } - return "Cannot connect to $host" . ($port ? " using port $port" : ""); -} - sub check_smtp_auth { my $username = shift; if ($username and !Bugzilla->feature('smtp_auth')) { @@ -525,8 +497,6 @@ valid group is provided. =item check_shadowdb -=item check_smtp_server - =item check_smtp_auth =item check_url diff --git a/mozilla/webtools/bugzilla/Bugzilla/Config/Core.pm b/mozilla/webtools/bugzilla/Bugzilla/Config/Core.pm index 654e569ba1b..faf86c56736 100644 --- a/mozilla/webtools/bugzilla/Bugzilla/Config/Core.pm +++ b/mozilla/webtools/bugzilla/Bugzilla/Config/Core.pm @@ -9,7 +9,6 @@ package Bugzilla::Config::Core; use 5.10.1; use strict; -use warnings; use Bugzilla::Config::Common; diff --git a/mozilla/webtools/bugzilla/Bugzilla/Config/DependencyGraph.pm b/mozilla/webtools/bugzilla/Bugzilla/Config/DependencyGraph.pm index c815822f385..51836405cd3 100644 --- a/mozilla/webtools/bugzilla/Bugzilla/Config/DependencyGraph.pm +++ b/mozilla/webtools/bugzilla/Bugzilla/Config/DependencyGraph.pm @@ -9,7 +9,6 @@ package Bugzilla::Config::DependencyGraph; use 5.10.1; use strict; -use warnings; use Bugzilla::Config::Common; @@ -21,7 +20,7 @@ sub get_param_list { { name => 'webdotbase', type => 't', - default => '', + default => 'http://www.research.att.com/~north/cgi-bin/webdot.cgi/%urlbase%', checker => \&check_webdotbase }, diff --git a/mozilla/webtools/bugzilla/Bugzilla/Config/General.pm b/mozilla/webtools/bugzilla/Bugzilla/Config/General.pm index 5efaa6f6c2a..a401e98edd6 100644 --- a/mozilla/webtools/bugzilla/Bugzilla/Config/General.pm +++ b/mozilla/webtools/bugzilla/Bugzilla/Config/General.pm @@ -9,7 +9,6 @@ package Bugzilla::Config::General; use 5.10.1; use strict; -use warnings; use Bugzilla::Config::Common; diff --git a/mozilla/webtools/bugzilla/Bugzilla/Config/GroupSecurity.pm b/mozilla/webtools/bugzilla/Bugzilla/Config/GroupSecurity.pm index e827834a0b1..076f841fddb 100644 --- a/mozilla/webtools/bugzilla/Bugzilla/Config/GroupSecurity.pm +++ b/mozilla/webtools/bugzilla/Bugzilla/Config/GroupSecurity.pm @@ -9,7 +9,6 @@ package Bugzilla::Config::GroupSecurity; use 5.10.1; use strict; -use warnings; use Bugzilla::Config::Common; use Bugzilla::Group; diff --git a/mozilla/webtools/bugzilla/Bugzilla/Config/LDAP.pm b/mozilla/webtools/bugzilla/Bugzilla/Config/LDAP.pm index 0bc8240dfde..4a46f40d2cc 100644 --- a/mozilla/webtools/bugzilla/Bugzilla/Config/LDAP.pm +++ b/mozilla/webtools/bugzilla/Bugzilla/Config/LDAP.pm @@ -9,7 +9,6 @@ package Bugzilla::Config::LDAP; use 5.10.1; use strict; -use warnings; use Bugzilla::Config::Common; diff --git a/mozilla/webtools/bugzilla/Bugzilla/Config/MTA.pm b/mozilla/webtools/bugzilla/Bugzilla/Config/MTA.pm index 467bdab3f93..2f4af72f4e6 100644 --- a/mozilla/webtools/bugzilla/Bugzilla/Config/MTA.pm +++ b/mozilla/webtools/bugzilla/Bugzilla/Config/MTA.pm @@ -9,9 +9,15 @@ package Bugzilla::Config::MTA; use 5.10.1; use strict; -use warnings; use Bugzilla::Config::Common; +# Return::Value 1.666002 pollutes the error log with warnings about this +# deprecated module. We have to set NO_CLUCK = 1 before loading Email::Send +# to disable these warnings. +BEGIN { + $Return::Value::NO_CLUCK = 1; +} +use Email::Send; our $sortkey = 1200; @@ -21,7 +27,9 @@ sub get_param_list { { name => 'mail_delivery_method', type => 's', - choices => ['Sendmail', 'SMTP', 'Test', 'None'], + # Bugzilla is not ready yet to send mails to newsgroups, and 'IO' + # is of no use for now as we already have our own 'Test' mode. + choices => [grep {$_ ne 'NNTP' && $_ ne 'IO'} Email::Send->new()->all_mailers(), 'None'], default => 'Sendmail', checker => \&check_mail_delivery_method }, @@ -42,8 +50,7 @@ sub get_param_list { { name => 'smtpserver', type => 't', - default => 'localhost', - checker => \&check_smtp_server + default => 'localhost' }, { name => 'smtp_username', diff --git a/mozilla/webtools/bugzilla/Bugzilla/Config/Memcached.pm b/mozilla/webtools/bugzilla/Bugzilla/Config/Memcached.pm index 292803d8647..08d8ce0e7c4 100644 --- a/mozilla/webtools/bugzilla/Bugzilla/Config/Memcached.pm +++ b/mozilla/webtools/bugzilla/Bugzilla/Config/Memcached.pm @@ -9,7 +9,6 @@ package Bugzilla::Config::Memcached; use 5.10.1; use strict; -use warnings; use Bugzilla::Config::Common; diff --git a/mozilla/webtools/bugzilla/Bugzilla/Config/PatchViewer.pm b/mozilla/webtools/bugzilla/Bugzilla/Config/PatchViewer.pm new file mode 100644 index 00000000000..2005e4c4a1c --- /dev/null +++ b/mozilla/webtools/bugzilla/Bugzilla/Config/PatchViewer.pm @@ -0,0 +1,52 @@ +# This Source Code Form is subject to the terms of the Mozilla Public +# License, v. 2.0. If a copy of the MPL was not distributed with this +# file, You can obtain one at http://mozilla.org/MPL/2.0/. +# +# This Source Code Form is "Incompatible With Secondary Licenses", as +# defined by the Mozilla Public License, v. 2.0. + +package Bugzilla::Config::PatchViewer; + +use 5.10.1; +use strict; + +use Bugzilla::Config::Common; + +our $sortkey = 1300; + +sub get_param_list { + my $class = shift; + my @param_list = ( + { + name => 'cvsroot', + type => 't', + default => '', + }, + + { + name => 'cvsroot_get', + type => 't', + default => '', + }, + + { + name => 'bonsai_url', + type => 't', + default => '' + }, + + { + name => 'lxr_url', + type => 't', + default => '' + }, + + { + name => 'lxr_root', + type => 't', + default => '', + } ); + return @param_list; +} + +1; diff --git a/mozilla/webtools/bugzilla/Bugzilla/Config/Query.pm b/mozilla/webtools/bugzilla/Bugzilla/Config/Query.pm index f18bb90df19..c7b33f620b1 100644 --- a/mozilla/webtools/bugzilla/Bugzilla/Config/Query.pm +++ b/mozilla/webtools/bugzilla/Bugzilla/Config/Query.pm @@ -9,7 +9,6 @@ package Bugzilla::Config::Query; use 5.10.1; use strict; -use warnings; use Bugzilla::Config::Common; diff --git a/mozilla/webtools/bugzilla/Bugzilla/Config/RADIUS.pm b/mozilla/webtools/bugzilla/Bugzilla/Config/RADIUS.pm index 8e30b07a988..17fbdd7ddfd 100644 --- a/mozilla/webtools/bugzilla/Bugzilla/Config/RADIUS.pm +++ b/mozilla/webtools/bugzilla/Bugzilla/Config/RADIUS.pm @@ -9,7 +9,6 @@ package Bugzilla::Config::RADIUS; use 5.10.1; use strict; -use warnings; use Bugzilla::Config::Common; diff --git a/mozilla/webtools/bugzilla/Bugzilla/Config/ShadowDB.pm b/mozilla/webtools/bugzilla/Bugzilla/Config/ShadowDB.pm index 5dbbb5202a1..65c572980ff 100644 --- a/mozilla/webtools/bugzilla/Bugzilla/Config/ShadowDB.pm +++ b/mozilla/webtools/bugzilla/Bugzilla/Config/ShadowDB.pm @@ -9,7 +9,6 @@ package Bugzilla::Config::ShadowDB; use 5.10.1; use strict; -use warnings; use Bugzilla::Config::Common; diff --git a/mozilla/webtools/bugzilla/Bugzilla/Config/UserMatch.pm b/mozilla/webtools/bugzilla/Bugzilla/Config/UserMatch.pm index 3f74a7c44e6..53fb5136fbd 100644 --- a/mozilla/webtools/bugzilla/Bugzilla/Config/UserMatch.pm +++ b/mozilla/webtools/bugzilla/Bugzilla/Config/UserMatch.pm @@ -9,7 +9,6 @@ package Bugzilla::Config::UserMatch; use 5.10.1; use strict; -use warnings; use Bugzilla::Config::Common; diff --git a/mozilla/webtools/bugzilla/Bugzilla/Constants.pm b/mozilla/webtools/bugzilla/Bugzilla/Constants.pm index 414cd2fed22..d22eed063c9 100644 --- a/mozilla/webtools/bugzilla/Bugzilla/Constants.pm +++ b/mozilla/webtools/bugzilla/Bugzilla/Constants.pm @@ -9,7 +9,6 @@ package Bugzilla::Constants; use 5.10.1; use strict; -use warnings; use parent qw(Exporter); @@ -26,8 +25,6 @@ use Memoize; bz_locations - CONCATENATE_ASSETS - IS_NULL NOT_NULL @@ -193,14 +190,6 @@ use Memoize; AUDIT_REMOVE MOST_FREQUENT_THRESHOLD - - MARKDOWN_TAB_WIDTH - - EMAIL_LIMIT_PER_MINUTE - EMAIL_LIMIT_PER_HOUR - EMAIL_LIMIT_EXCEPTION - - JOB_QUEUE_VIEW_MAX_JOBS ); @Bugzilla::Constants::EXPORT_OK = qw(contenttypes); @@ -208,7 +197,7 @@ use Memoize; # CONSTANTS # # Bugzilla version -use constant BUGZILLA_VERSION => "5.1"; +use constant BUGZILLA_VERSION => "4.5.4+"; # A base link to the current REST Documentation. We place it here # as it will need to be updated to whatever the current release is. @@ -218,11 +207,6 @@ use constant REST_DOC => "http://www.bugzilla.org/docs/tip/en/html/api/"; use constant REMOTE_FILE => 'http://updates.bugzilla.org/bugzilla-update.xml'; use constant LOCAL_FILE => 'bugzilla-update.xml'; # Relative to datadir. -# When true CSS and JavaScript assets will be concatanted and minified at -# run-time, to reduce the number of requests required to render a page. -# Setting this to a false value can help debugging. -use constant CONCATENATE_ASSETS => 1; - # These are unique values that are unlikely to match a string or a number, # to be used in criteria for match() functions and other things. They start # and end with spaces because most Bugzilla stuff has trim() called on it, @@ -643,22 +627,6 @@ use constant AUDIT_REMOVE => '__remove__'; # on the "Most frequently reported bugs" page. use constant MOST_FREQUENT_THRESHOLD => 2; -# The number of spaces used to represent each tab character -# by Markdown engine -use constant MARKDOWN_TAB_WIDTH => 2; - -# The maximum number of emails per minute and hour a recipient can receive. -# Email will be queued/backlogged to avoid exceeeding these limits. -# Setting a limit to 0 will disable this feature. -use constant EMAIL_LIMIT_PER_MINUTE => 1000; -use constant EMAIL_LIMIT_PER_HOUR => 2500; -# Don't change this exception message. -use constant EMAIL_LIMIT_EXCEPTION => "email_limit_exceeded\n"; - -# The maximum number of jobs to show when viewing the job queue -# (view_job_queue.cgi). -use constant JOB_QUEUE_VIEW_MAX_JOBS => 500; - sub bz_locations { # Force memoize() to re-compute data per project, to avoid # sharing the same data across different installations. diff --git a/mozilla/webtools/bugzilla/Bugzilla/DB.pm b/mozilla/webtools/bugzilla/Bugzilla/DB.pm index 9f3ed0f494d..df84d9c79af 100644 --- a/mozilla/webtools/bugzilla/Bugzilla/DB.pm +++ b/mozilla/webtools/bugzilla/Bugzilla/DB.pm @@ -9,7 +9,6 @@ package Bugzilla::DB; use 5.10.1; use strict; -use warnings; use DBI; @@ -17,7 +16,6 @@ use DBI; use parent -norequire, qw(DBI::db); use Bugzilla::Constants; -use Bugzilla::Mailer; use Bugzilla::Install::Requirements; use Bugzilla::Install::Util qw(install_string); use Bugzilla::Install::Localconfig; @@ -115,6 +113,7 @@ sub connect_shadow { } sub connect_main { + my $lc = Bugzilla->localconfig; return _connect(Bugzilla->localconfig); } @@ -580,11 +579,8 @@ sub bz_add_column { my $current_def = $self->bz_column_info($table, $name); if (!$current_def) { - # REFERENCES need to happen later and not be created right away - my $trimmed_def = dclone($new_def); - delete $trimmed_def->{REFERENCES}; my @statements = $self->_bz_real_schema->get_add_column_ddl( - $table, $name, $trimmed_def, + $table, $name, $new_def, defined $init_value ? $self->quote($init_value) : undef); print get_text('install_column_add', { column => $name, table => $table }) . "\n" @@ -598,14 +594,14 @@ sub bz_add_column { # column exists there and has a REFERENCES item. # bz_setup_foreign_keys will then add this FK at the end of # Install::DB. - my $col_abstract = + my $col_abstract = $self->_bz_schema->get_column_abstract($table, $name); if (exists $col_abstract->{REFERENCES}) { my $new_fk = dclone($col_abstract->{REFERENCES}); $new_fk->{created} = 0; $new_def->{REFERENCES} = $new_fk; } - + $self->_bz_real_schema->set_column($table, $name, $new_def); $self->_bz_store_real_schema; } @@ -1213,13 +1209,12 @@ sub bz_start_transaction { sub bz_commit_transaction { my ($self) = @_; - + if ($self->{private_bz_transaction_count} > 1) { $self->{private_bz_transaction_count}--; } elsif ($self->bz_in_transaction) { $self->commit(); $self->{private_bz_transaction_count} = 0; - Bugzilla::Mailer->send_staged_mail(); } else { ThrowCodeError('not_in_transaction'); } @@ -2320,11 +2315,7 @@ values to. =item C<$name> - the name of the new column -=item C<$definition> - A hashref abstract column definition for the new column. -Note, if a C definition is included to create a foreign key -relationship, it will be created later instead of when the column is added. -Normally foreign keys are added by C at the end all at the same -time. +=item C<\%definition> - Abstract column definition for the new column =item C<$init_value> (optional) - An initial value to set the column to. Required if your column is NOT NULL and has no DEFAULT set. diff --git a/mozilla/webtools/bugzilla/Bugzilla/DB/Mysql.pm b/mozilla/webtools/bugzilla/Bugzilla/DB/Mysql.pm index ae158e0f681..28df1f0e85d 100644 --- a/mozilla/webtools/bugzilla/Bugzilla/DB/Mysql.pm +++ b/mozilla/webtools/bugzilla/Bugzilla/DB/Mysql.pm @@ -23,7 +23,6 @@ package Bugzilla::DB::Mysql; use 5.10.1; use strict; -use warnings; use parent qw(Bugzilla::DB); @@ -86,18 +85,17 @@ sub new { $self->{private_bz_dsn} = $dsn; bless ($self, $class); - - # Check for MySQL modes. + + # Bug 321645 - disable MySQL strict mode, if set my ($var, $sql_mode) = $self->selectrow_array( "SHOW VARIABLES LIKE 'sql\\_mode'"); - # Disable ANSI and strict modes, else Bugzilla will crash. if ($sql_mode) { # STRICT_TRANS_TABLE or STRICT_ALL_TABLES enable MySQL strict mode, # causing bug 321645. TRADITIONAL sets these modes (among others) as # well, so it has to be stipped as well my $new_sql_mode = - join(",", grep {$_ !~ /^(?:ANSI|STRICT_(?:TRANS|ALL)_TABLES|TRADITIONAL)$/} + join(",", grep {$_ !~ /^STRICT_(?:TRANS|ALL)_TABLES|TRADITIONAL$/} split(/,/, $sql_mode)); if ($sql_mode ne $new_sql_mode) { @@ -294,6 +292,7 @@ sub _bz_get_initial_schema { sub bz_check_server_version { my $self = shift; + my $lc = Bugzilla->localconfig; if (lc(Bugzilla->localconfig->{db_name}) eq 'mysql') { die "It is not safe to run Bugzilla inside a database named 'mysql'.\n" . " Please pick a different value for \$db_name in localconfig.\n"; diff --git a/mozilla/webtools/bugzilla/Bugzilla/DB/Oracle.pm b/mozilla/webtools/bugzilla/Bugzilla/DB/Oracle.pm index 7424019ac7f..23474fe15e5 100644 --- a/mozilla/webtools/bugzilla/Bugzilla/DB/Oracle.pm +++ b/mozilla/webtools/bugzilla/Bugzilla/DB/Oracle.pm @@ -23,7 +23,6 @@ package Bugzilla::DB::Oracle; use 5.10.1; use strict; -use warnings; use parent qw(Bugzilla::DB); @@ -722,7 +721,6 @@ package Bugzilla::DB::Oracle::st; use 5.10.1; use strict; -use warnings; use parent -norequire, qw(DBI::st); diff --git a/mozilla/webtools/bugzilla/Bugzilla/DB/Pg.pm b/mozilla/webtools/bugzilla/Bugzilla/DB/Pg.pm index 4ec95725de8..165eea559aa 100644 --- a/mozilla/webtools/bugzilla/Bugzilla/DB/Pg.pm +++ b/mozilla/webtools/bugzilla/Bugzilla/DB/Pg.pm @@ -23,7 +23,6 @@ package Bugzilla::DB::Pg; use 5.10.1; use strict; -use warnings; use Bugzilla::Error; use Bugzilla::Version; @@ -231,9 +230,6 @@ sub bz_setup_database { my $self = shift; $self->SUPER::bz_setup_database(@_); - my ($has_plpgsql) = $self->selectrow_array("SELECT COUNT(*) FROM pg_language WHERE lanname = 'plpgsql'"); - $self->do('CREATE LANGUAGE plpgsql') unless $has_plpgsql; - # Custom Functions # -Copyright © 2013 Joshua D. Burns (JDBurnZ) and Message In Action LLC diff --git a/mozilla/webtools/bugzilla/Bugzilla/DB/Schema.pm b/mozilla/webtools/bugzilla/Bugzilla/DB/Schema.pm index 0698585bb36..632ab639b83 100644 --- a/mozilla/webtools/bugzilla/Bugzilla/DB/Schema.pm +++ b/mozilla/webtools/bugzilla/Bugzilla/DB/Schema.pm @@ -17,7 +17,6 @@ package Bugzilla::DB::Schema; use 5.10.1; use strict; -use warnings; use Bugzilla::Error; use Bugzilla::Hook; @@ -278,8 +277,11 @@ use constant ABSTRACT_SCHEMA => { remaining_time => {TYPE => 'decimal(7,2)', NOTNULL => 1, DEFAULT => '0'}, deadline => {TYPE => 'DATETIME'}, + alias => {TYPE => 'varchar(20)'}, ], INDEXES => [ + bugs_alias_idx => {FIELDS => ['alias'], + TYPE => 'UNIQUE'}, bugs_assigned_to_idx => ['assigned_to'], bugs_creation_ts_idx => ['creation_ts'], bugs_delta_ts_idx => ['delta_ts'], @@ -356,21 +358,6 @@ use constant ABSTRACT_SCHEMA => { ], }, - bugs_aliases => { - FIELDS => [ - alias => {TYPE => 'varchar(40)', NOTNULL => 1}, - bug_id => {TYPE => 'INT3', - REFERENCES => {TABLE => 'bugs', - COLUMN => 'bug_id', - DELETE => 'CASCADE'}}, - ], - INDEXES => [ - bugs_aliases_bug_id_idx => ['bug_id'], - bugs_aliases_alias_idx => {FIELDS => ['alias'], - TYPE => 'UNIQUE'}, - ], - }, - cc => { FIELDS => [ bug_id => {TYPE => 'INT3', NOTNULL => 1, @@ -410,8 +397,7 @@ use constant ABSTRACT_SCHEMA => { DEFAULT => 'FALSE'}, type => {TYPE => 'INT2', NOTNULL => 1, DEFAULT => '0'}, - extra_data => {TYPE => 'varchar(255)'}, - is_markdown => {TYPE => 'BOOLEAN', NOTNULL => 1, DEFAULT => 'FALSE'} + extra_data => {TYPE => 'varchar(255)'} ], INDEXES => [ longdescs_bug_id_idx => [qw(bug_id work_time)], @@ -1191,7 +1177,7 @@ use constant ABSTRACT_SCHEMA => { issuedate => {TYPE => 'DATETIME', NOTNULL => 1} , token => {TYPE => 'varchar(16)', NOTNULL => 1, PRIMARYKEY => 1}, - tokentype => {TYPE => 'varchar(16)', NOTNULL => 1} , + tokentype => {TYPE => 'varchar(8)', NOTNULL => 1} , eventdata => {TYPE => 'TINYTEXT'}, ], INDEXES => [ @@ -1630,28 +1616,6 @@ use constant ABSTRACT_SCHEMA => { ], }, - # BUGMAIL - # ------- - - mail_staging => { - FIELDS => [ - id => {TYPE => 'INTSERIAL', PRIMARYKEY => 1, NOTNULL => 1}, - message => {TYPE => 'LONGBLOB', NOTNULL => 1}, - ], - }, - - email_rates => { - FIELDS => [ - id => {TYPE => 'INTSERIAL', NOTNULL => 1, - PRIMARYKEY => 1}, - recipient => {TYPE => 'varchar(255)', NOTNULL => 1}, - message_ts => {TYPE => 'DATETIME', NOTNULL => 1}, - ], - INDEXES => [ - email_rates_idx => [qw(recipient message_ts)], - ], - }, - # THESCHWARTZ TABLES # ------------------ # Note: In the standard TheSchwartz schema, most integers are unsigned, @@ -1769,26 +1733,6 @@ use constant ABSTRACT_SCHEMA => { bug_user_last_visit_last_visit_ts_idx => ['last_visit_ts'], ], }, - - user_api_keys => { - FIELDS => [ - id => {TYPE => 'INTSERIAL', NOTNULL => 1, - PRIMARYKEY => 1}, - user_id => {TYPE => 'INT3', NOTNULL => 1, - REFERENCES => {TABLE => 'profiles', - COLUMN => 'userid', - DELETE => 'CASCADE'}}, - api_key => {TYPE => 'VARCHAR(40)', NOTNULL => 1}, - description => {TYPE => 'VARCHAR(255)'}, - revoked => {TYPE => 'BOOLEAN', NOTNULL => 1, - DEFAULT => 'FALSE'}, - last_used => {TYPE => 'DATETIME'}, - ], - INDEXES => [ - user_api_keys_api_key_idx => {FIELDS => ['api_key'], TYPE => 'UNIQUE'}, - user_api_keys_user_id_idx => ['user_id'], - ], - }, }; # Foreign Keys are added in Bugzilla::DB::bz_add_field_tables diff --git a/mozilla/webtools/bugzilla/Bugzilla/DB/Schema/Mysql.pm b/mozilla/webtools/bugzilla/Bugzilla/DB/Schema/Mysql.pm index 0195fcb06c0..9d634243f83 100644 --- a/mozilla/webtools/bugzilla/Bugzilla/DB/Schema/Mysql.pm +++ b/mozilla/webtools/bugzilla/Bugzilla/DB/Schema/Mysql.pm @@ -15,7 +15,6 @@ package Bugzilla::DB::Schema::Mysql; use 5.10.1; use strict; -use warnings; use Bugzilla::Error; diff --git a/mozilla/webtools/bugzilla/Bugzilla/DB/Schema/Oracle.pm b/mozilla/webtools/bugzilla/Bugzilla/DB/Schema/Oracle.pm index 8fb5479b1d1..1554a0fe198 100644 --- a/mozilla/webtools/bugzilla/Bugzilla/DB/Schema/Oracle.pm +++ b/mozilla/webtools/bugzilla/Bugzilla/DB/Schema/Oracle.pm @@ -15,7 +15,6 @@ package Bugzilla::DB::Schema::Oracle; use 5.10.1; use strict; -use warnings; use parent qw(Bugzilla::DB::Schema); use Carp qw(confess); diff --git a/mozilla/webtools/bugzilla/Bugzilla/DB/Schema/Pg.pm b/mozilla/webtools/bugzilla/Bugzilla/DB/Schema/Pg.pm index 55a93227282..fa784ef7d4d 100644 --- a/mozilla/webtools/bugzilla/Bugzilla/DB/Schema/Pg.pm +++ b/mozilla/webtools/bugzilla/Bugzilla/DB/Schema/Pg.pm @@ -15,7 +15,6 @@ package Bugzilla::DB::Schema::Pg; use 5.10.1; use strict; -use warnings; use parent qw(Bugzilla::DB::Schema); use Storable qw(dclone); diff --git a/mozilla/webtools/bugzilla/Bugzilla/DB/Schema/Sqlite.pm b/mozilla/webtools/bugzilla/Bugzilla/DB/Schema/Sqlite.pm index ccdbfd8aaa0..b29d7da2258 100644 --- a/mozilla/webtools/bugzilla/Bugzilla/DB/Schema/Sqlite.pm +++ b/mozilla/webtools/bugzilla/Bugzilla/DB/Schema/Sqlite.pm @@ -9,7 +9,6 @@ package Bugzilla::DB::Schema::Sqlite; use 5.10.1; use strict; -use warnings; use parent qw(Bugzilla::DB::Schema); diff --git a/mozilla/webtools/bugzilla/Bugzilla/DB/Sqlite.pm b/mozilla/webtools/bugzilla/Bugzilla/DB/Sqlite.pm index ddafc169622..cffe3b65c7f 100644 --- a/mozilla/webtools/bugzilla/Bugzilla/DB/Sqlite.pm +++ b/mozilla/webtools/bugzilla/Bugzilla/DB/Sqlite.pm @@ -9,7 +9,6 @@ package Bugzilla::DB::Sqlite; use 5.10.1; use strict; -use warnings; use parent qw(Bugzilla::DB); diff --git a/mozilla/webtools/bugzilla/Bugzilla/Error.pm b/mozilla/webtools/bugzilla/Bugzilla/Error.pm index 05a7ce7b3a7..37b28095a40 100644 --- a/mozilla/webtools/bugzilla/Bugzilla/Error.pm +++ b/mozilla/webtools/bugzilla/Bugzilla/Error.pm @@ -9,7 +9,6 @@ package Bugzilla::Error; use 5.10.1; use strict; -use warnings; use parent qw(Exporter); diff --git a/mozilla/webtools/bugzilla/Bugzilla/Extension.pm b/mozilla/webtools/bugzilla/Bugzilla/Extension.pm index 17193f1b677..53bf6cd6633 100644 --- a/mozilla/webtools/bugzilla/Bugzilla/Extension.pm +++ b/mozilla/webtools/bugzilla/Bugzilla/Extension.pm @@ -9,7 +9,6 @@ package Bugzilla::Extension; use 5.10.1; use strict; -use warnings; use Bugzilla::Constants; use Bugzilla::Error; diff --git a/mozilla/webtools/bugzilla/Bugzilla/Field.pm b/mozilla/webtools/bugzilla/Bugzilla/Field.pm index 761f7b94e98..e72a9429343 100644 --- a/mozilla/webtools/bugzilla/Bugzilla/Field.pm +++ b/mozilla/webtools/bugzilla/Bugzilla/Field.pm @@ -59,7 +59,6 @@ package Bugzilla::Field; use 5.10.1; use strict; -use warnings; use parent qw(Exporter Bugzilla::Object); @Bugzilla::Field::EXPORT = qw(check_field get_field_id get_legal_field_values); diff --git a/mozilla/webtools/bugzilla/Bugzilla/Field/Choice.pm b/mozilla/webtools/bugzilla/Bugzilla/Field/Choice.pm index a66f69cee7a..6f730072fbf 100644 --- a/mozilla/webtools/bugzilla/Bugzilla/Field/Choice.pm +++ b/mozilla/webtools/bugzilla/Bugzilla/Field/Choice.pm @@ -9,7 +9,6 @@ package Bugzilla::Field::Choice; use 5.10.1; use strict; -use warnings; use parent qw(Bugzilla::Field::ChoiceInterface Bugzilla::Object); diff --git a/mozilla/webtools/bugzilla/Bugzilla/Field/ChoiceInterface.pm b/mozilla/webtools/bugzilla/Bugzilla/Field/ChoiceInterface.pm index 634d36ad127..f7f5e3b7330 100644 --- a/mozilla/webtools/bugzilla/Bugzilla/Field/ChoiceInterface.pm +++ b/mozilla/webtools/bugzilla/Bugzilla/Field/ChoiceInterface.pm @@ -9,7 +9,6 @@ package Bugzilla::Field::ChoiceInterface; use 5.10.1; use strict; -use warnings; use Bugzilla::Constants; use Bugzilla::Error; diff --git a/mozilla/webtools/bugzilla/Bugzilla/Flag.pm b/mozilla/webtools/bugzilla/Bugzilla/Flag.pm index 50474b8855f..ff9d236db6c 100644 --- a/mozilla/webtools/bugzilla/Bugzilla/Flag.pm +++ b/mozilla/webtools/bugzilla/Bugzilla/Flag.pm @@ -9,7 +9,6 @@ package Bugzilla::Flag; use 5.10.1; use strict; -use warnings; =head1 NAME @@ -454,15 +453,14 @@ sub create { sub update { my $self = shift; my $dbh = Bugzilla->dbh; - my $timestamp = shift || $dbh->selectrow_array('SELECT LOCALTIMESTAMP(0)'); + my $timestamp = shift || $dbh->selectrow_array('SELECT NOW()'); my $changes = $self->SUPER::update(@_); if (scalar(keys %$changes)) { $dbh->do('UPDATE flags SET modification_date = ? WHERE id = ?', undef, ($timestamp, $self->id)); - $self->{'modification_date'} = - format_time($timestamp, '%Y.%m.%d %T', Bugzilla->local_timezone); + $self->{'modification_date'} = format_time($timestamp, '%Y.%m.%d %T'); Bugzilla->memcached->clear({ table => 'flags', id => $self->id }); } return $changes; @@ -933,117 +931,6 @@ sub extract_flags_from_cgi { =over -=item C - -Checks whether or not there are new flags to create and returns an -array of hashes. This array is then passed to Flag::create(). This differs -from the previous sub-routine as it is called for changing multiple bugs - -=back - -=cut - -sub multi_extract_flags_from_cgi { - my ($class, $bug, $vars, $skip) = @_; - my $cgi = Bugzilla->cgi; - - my $match_status = Bugzilla::User::match_field({ - '^requestee(_type)?-(\d+)$' => { 'type' => 'multi' }, - }, undef, $skip); - - $vars->{'match_field'} = 'requestee'; - if ($match_status == USER_MATCH_FAILED) { - $vars->{'message'} = 'user_match_failed'; - } - elsif ($match_status == USER_MATCH_MULTIPLE) { - $vars->{'message'} = 'user_match_multiple'; - } - - # Extract a list of flag type IDs from field names. - my @flagtype_ids = map(/^flag_type-(\d+)$/ ? $1 : (), $cgi->param()); - - my (@new_flags, @flags); - - # Get a list of active flag types available for this product/component. - my $flag_types = Bugzilla::FlagType::match( - { 'product_id' => $bug->{'product_id'}, - 'component_id' => $bug->{'component_id'}, - 'is_active' => 1 }); - - foreach my $flagtype_id (@flagtype_ids) { - # Checks if there are unexpected flags for the product/component. - if (!scalar(grep { $_->id == $flagtype_id } @$flag_types)) { - $vars->{'message'} = 'unexpected_flag_types'; - last; - } - } - - foreach my $flag_type (@$flag_types) { - my $type_id = $flag_type->id; - - # Bug flags are only valid for bugs - next unless ($flag_type->target_type eq 'bug'); - - # We are only interested in flags the user tries to create. - next unless scalar(grep { $_ == $type_id } @flagtype_ids); - - # Get the flags of this type already set for this bug. - my $current_flags = $class->match( - { 'type_id' => $type_id, - 'target_type' => 'bug', - 'bug_id' => $bug->bug_id }); - - # We will update existing flags (instead of creating new ones) - # if the flag exists and the user has not chosen the 'always add' - # option - my $update = scalar(@$current_flags) && ! $cgi->param("flags_add-$type_id"); - - my $status = $cgi->param("flag_type-$type_id"); - trick_taint($status); - - my @logins = $cgi->param("requestee_type-$type_id"); - if ($status eq "?" && scalar(@logins)) { - foreach my $login (@logins) { - if ($update) { - foreach my $current_flag (@$current_flags) { - push (@flags, { id => $current_flag->id, - status => $status, - requestee => $login, - skip_roe => $skip }); - } - } - else { - push (@new_flags, { type_id => $type_id, - status => $status, - requestee => $login, - skip_roe => $skip }); - } - - last unless $flag_type->is_multiplicable; - } - } - else { - if ($update) { - foreach my $current_flag (@$current_flags) { - push (@flags, { id => $current_flag->id, - status => $status }); - } - } - else { - push (@new_flags, { type_id => $type_id, - status => $status }); - } - } - } - - # Return the list of flags to update and/or to create. - return (\@flags, \@new_flags); -} - -=pod - -=over - =item C Sends an email notification about a flag being created, fulfilled @@ -1124,32 +1011,18 @@ sub notify { $default_lang = Bugzilla::User->new()->setting('lang'); } - # Get comments on the bug - my $all_comments = $bug->comments({ after => $bug->lastdiffed }); - @$all_comments = grep { $_->type || $_->body =~ /\S/ } @$all_comments; - - # Get public only comments - my $public_comments = [ grep { !$_->is_private } @$all_comments ]; - foreach my $to (keys %recipients) { # Add threadingmarker to allow flag notification emails to be the # threaded similar to normal bug change emails. my $thread_user_id = $recipients{$to} ? $recipients{$to}->id : 0; - # We only want to show private comments to users in the is_insider group - my $comments = $recipients{$to} && $recipients{$to}->is_insider - ? $all_comments : $public_comments; - - my $vars = { - flag => $flag, - old_flag => $old_flag, - to => $to, - date => $timestamp, - bug => $bug, - attachment => $attachment, - threadingmarker => build_thread_marker($bug->id, $thread_user_id), - new_comments => $comments, - }; + my $vars = { 'flag' => $flag, + 'old_flag' => $old_flag, + 'to' => $to, + 'date' => $timestamp, + 'bug' => $bug, + 'attachment' => $attachment, + 'threadingmarker' => build_thread_marker($bug->id, $thread_user_id) }; my $lang = $recipients{$to} ? $recipients{$to}->setting('lang') : $default_lang; diff --git a/mozilla/webtools/bugzilla/Bugzilla/FlagType.pm b/mozilla/webtools/bugzilla/Bugzilla/FlagType.pm index 72b3f64c1fb..34973684af3 100644 --- a/mozilla/webtools/bugzilla/Bugzilla/FlagType.pm +++ b/mozilla/webtools/bugzilla/Bugzilla/FlagType.pm @@ -9,7 +9,6 @@ package Bugzilla::FlagType; use 5.10.1; use strict; -use warnings; =head1 NAME @@ -41,7 +40,6 @@ use Bugzilla::Util; use Bugzilla::Group; use Email::Address; -use List::MoreUtils qw(uniq); use parent qw(Bugzilla::Object); @@ -380,6 +378,8 @@ sub set_clusions { if (!$products{$prod_id}) { $params->{id} = $prod_id; $products{$prod_id} = Bugzilla::Product->check($params); + $user->in_group('editcomponents', $prod_id) + || ThrowUserError('product_access_denied', $params); } $prod_name = $products{$prod_id}->name; @@ -405,22 +405,6 @@ sub set_clusions { $clusions{"$prod_name:$comp_name"} = "$prod_id:$comp_id"; $clusions_as_hash{$prod_id}->{$comp_id} = 1; } - - # Check the user has the editcomponent permission on products that are changing - if (! $user->in_group('editcomponents')) { - my $current_clusions = $self->$category; - my ($removed, $added) - = diff_arrays([ values %$current_clusions ], [ values %clusions ]); - my @changed_product_ids - = uniq map { substr($_, 0, index($_, ':')) } @$removed, @$added; - foreach my $product_id (@changed_product_ids) { - $user->in_group('editcomponents', $product_id) - || ThrowUserError('product_access_denied', - { name => $products{$product_id}->name }); - } - } - - # Set the changes $self->{$category} = \%clusions; $self->{"${category}_as_hash"} = \%clusions_as_hash; $self->{"_update_$category"} = 1; diff --git a/mozilla/webtools/bugzilla/Bugzilla/Group.pm b/mozilla/webtools/bugzilla/Bugzilla/Group.pm index 07b78e3663b..965fa226f9d 100644 --- a/mozilla/webtools/bugzilla/Bugzilla/Group.pm +++ b/mozilla/webtools/bugzilla/Bugzilla/Group.pm @@ -9,7 +9,6 @@ package Bugzilla::Group; use 5.10.1; use strict; -use warnings; use parent qw(Bugzilla::Object); @@ -56,10 +55,8 @@ use constant UPDATE_COLUMNS => qw( ); # Parameters that are lists of groups. -use constant GROUP_PARAMS => qw( - chartgroup comment_taggers_group debug_group insidergroup - querysharegroup timetrackinggroup -); +use constant GROUP_PARAMS => qw(chartgroup insidergroup timetrackinggroup + querysharegroup); ############################### #### Accessors ###### diff --git a/mozilla/webtools/bugzilla/Bugzilla/Hook.pm b/mozilla/webtools/bugzilla/Bugzilla/Hook.pm index 430d5af49a6..5e4114398f4 100644 --- a/mozilla/webtools/bugzilla/Bugzilla/Hook.pm +++ b/mozilla/webtools/bugzilla/Bugzilla/Hook.pm @@ -9,7 +9,6 @@ package Bugzilla::Hook; use 5.10.1; use strict; -use warnings; sub process { my ($name, $args) = @_; @@ -1033,6 +1032,9 @@ Params: =item C - The C object that's about to be sent. +=item C - An arrayref that's passed as C to +L. + =back =head2 object_before_create @@ -1704,26 +1706,6 @@ The current JSONRPC, XMLRPC, or REST object. =back -=head2 webservice_status_code_map - -This hook allows an extension to change the status codes returned by -specific webservice errors. The valid internal error codes that Bugzilla -generates, and the status codes they map to by default, are defined in the -C constant in C. When -remapping an error, you may wish to use an existing status code constant. -Such constants are also in C and start -with C such as C. - -Params: - -=over - -=item C - -A hash reference containing the current status code mapping. - -=back - =head1 SEE ALSO L diff --git a/mozilla/webtools/bugzilla/Bugzilla/Install.pm b/mozilla/webtools/bugzilla/Bugzilla/Install.pm index d02c43d2fdb..41f88d70b32 100644 --- a/mozilla/webtools/bugzilla/Bugzilla/Install.pm +++ b/mozilla/webtools/bugzilla/Bugzilla/Install.pm @@ -17,7 +17,6 @@ package Bugzilla::Install; use 5.10.1; use strict; -use warnings; use Bugzilla::Component; use Bugzilla::Config qw(:admin); @@ -90,8 +89,6 @@ sub SETTINGS { bugmail_new_prefix => { options => ['on', 'off'], default => 'on' }, # 2013-07-26 joshi_sunil@in.com -- Bug 669535 possible_duplicates => { options => ['on', 'off'], default => 'on' }, - # 2014-05-24 koosha.khajeh@gmail.com -- Bug 1014164 - use_markdown => { options => ['on', 'off'], default => 'on' }, } }; @@ -135,13 +132,11 @@ use constant SYSTEM_GROUPS => ( }, { name => 'bz_canusewhineatothers', - description => 'Can configure queries and schedules for periodic' - . ' reports to be run and sent via email to other users and groups', + description => 'Can configure whine reports for other users', }, { name => 'bz_canusewhines', - description => 'Can configure queries and schedules for periodic' - . ' reports to be run and sent via email to themselves', + description => 'User can configure whine reports for self', # inherited_by means that users in the groups listed below are # automatically members of bz_canusewhines. inherited_by => ['editbugs', 'bz_canusewhineatothers'], @@ -219,8 +214,8 @@ sub update_system_groups { # Create most of the system groups foreach my $definition (SYSTEM_GROUPS) { - my $group = new Bugzilla::Group({ name => $definition->{name} }); - if (!$group) { + my $exists = new Bugzilla::Group({ name => $definition->{name} }); + if (!$exists) { $definition->{isbuggroup} = 0; $definition->{silently} = !$editbugs_exists; my $inherited_by = delete $definition->{inherited_by}; @@ -236,10 +231,6 @@ sub update_system_groups { } } } - elsif ($group->description ne $definition->{description}) { - $group->set_description($definition->{description}); - $group->update(); - } } $dbh->bz_commit_transaction(); diff --git a/mozilla/webtools/bugzilla/Bugzilla/Install/CPAN.pm b/mozilla/webtools/bugzilla/Bugzilla/Install/CPAN.pm index 19f14319083..ba301863d9b 100644 --- a/mozilla/webtools/bugzilla/Bugzilla/Install/CPAN.pm +++ b/mozilla/webtools/bugzilla/Bugzilla/Install/CPAN.pm @@ -9,7 +9,6 @@ package Bugzilla::Install::CPAN; use 5.10.1; use strict; -use warnings; use parent qw(Exporter); our @EXPORT = qw( diff --git a/mozilla/webtools/bugzilla/Bugzilla/Install/DB.pm b/mozilla/webtools/bugzilla/Bugzilla/Install/DB.pm index ab02fe41db3..9e197a90711 100644 --- a/mozilla/webtools/bugzilla/Bugzilla/Install/DB.pm +++ b/mozilla/webtools/bugzilla/Bugzilla/Install/DB.pm @@ -12,7 +12,6 @@ package Bugzilla::Install::DB; use 5.10.1; use strict; -use warnings; use Bugzilla::Constants; use Bugzilla::Hook; @@ -273,6 +272,10 @@ sub update_table_definitions { $dbh->bz_add_column('attachments', 'isprivate', {TYPE => 'BOOLEAN', NOTNULL => 1, DEFAULT => 'FALSE'}); + $dbh->bz_add_column("bugs", "alias", {TYPE => "varchar(20)"}); + $dbh->bz_add_index('bugs', 'bugs_alias_idx', + {TYPE => 'UNIQUE', FIELDS => [qw(alias)]}); + _move_quips_into_db(); $dbh->bz_drop_column("namedqueries", "watchfordiffs"); @@ -716,20 +719,6 @@ sub update_table_definitions { 'bug_user_last_visit_last_visit_ts_idx', ['last_visit_ts']); - # 2014-07-14 sgreen@redhat.com - Bug 726696 - $dbh->bz_alter_column('tokens', 'tokentype', - {TYPE => 'varchar(16)', NOTNULL => 1}); - - # 2014-07-27 LpSolit@gmail.com - Bug 1044561 - _fix_user_api_keys_indexes(); - - # 2014-08-11 sgreen@redhat.com - Bug 1012506 - _update_alias(); - - # 2014-08-14 koosha.khajeh@gmail.com - Bug 330707 - $dbh->bz_add_column('longdescs', 'is_markdown', - {TYPE => 'BOOLEAN', NOTNULL => 1, DEFAULT => 'FALSE'}); - ################################################################ # New --TABLE-- changes should go *** A B O V E *** this point # ################################################################ @@ -2561,7 +2550,7 @@ sub _fix_whine_queries_title_and_op_sys_value { undef, "Other", "other"); if (Bugzilla->params->{'defaultopsys'} eq 'other') { # We can't actually fix the param here, because WriteParams() will - # make $datadir/params.json unwriteable to the webservergroup. + # make $datadir/params unwriteable to the webservergroup. # It's too much of an ugly hack to copy the permission-fixing code # down to here. (It would create more potential future bugs than # it would solve problems.) @@ -3888,33 +3877,6 @@ sub _fix_components_primary_key { } } -sub _fix_user_api_keys_indexes { - my $dbh = Bugzilla->dbh; - - if ($dbh->bz_index_info('user_api_keys', 'user_api_keys_key')) { - $dbh->bz_drop_index('user_api_keys', 'user_api_keys_key'); - $dbh->bz_add_index('user_api_keys', 'user_api_keys_api_key_idx', - { FIELDS => ['api_key'], TYPE => 'UNIQUE' }); - } - if ($dbh->bz_index_info('user_api_keys', 'user_api_keys_user_id')) { - $dbh->bz_drop_index('user_api_keys', 'user_api_keys_user_id'); - $dbh->bz_add_index('user_api_keys', 'user_api_keys_user_id_idx', ['user_id']); - } -} - -sub _update_alias { - my $dbh = Bugzilla->dbh; - return unless $dbh->bz_column_info('bugs', 'alias'); - - # We need to move the aliases from the bugs table to the bugs_aliases table - $dbh->do(q{ - INSERT INTO bugs_aliases (bug_id, alias) - SELECT bug_id, alias FROM bugs WHERE alias IS NOT NULL - }); - - $dbh->bz_drop_column('bugs', 'alias'); -} - 1; __END__ diff --git a/mozilla/webtools/bugzilla/Bugzilla/Install/Filesystem.pm b/mozilla/webtools/bugzilla/Bugzilla/Install/Filesystem.pm index 523c09fecfc..d980a219947 100644 --- a/mozilla/webtools/bugzilla/Bugzilla/Install/Filesystem.pm +++ b/mozilla/webtools/bugzilla/Bugzilla/Install/Filesystem.pm @@ -17,7 +17,6 @@ package Bugzilla::Install::Filesystem; use 5.10.1; use strict; -use warnings; use Bugzilla::Constants; use Bugzilla::Error; @@ -31,7 +30,6 @@ use File::Path; use File::Basename; use File::Copy qw(move); use File::Spec; -use File::Slurp; use IO::File; use POSIX (); @@ -167,13 +165,12 @@ sub FILESYSTEM { 'contrib/README' => { perms => OWNER_WRITE }, 'contrib/*/README' => { perms => OWNER_WRITE }, 'contrib/Bugzilla.pm' => { perms => OWNER_WRITE }, - 'contrib/replyrc' => { perms => OWNER_WRITE }, 'docs/bugzilla.ent' => { perms => OWNER_WRITE }, 'docs/makedocs.pl' => { perms => OWNER_EXECUTE }, 'docs/style.css' => { perms => WS_SERVE }, 'docs/*/rel_notes.txt' => { perms => WS_SERVE }, 'docs/*/README.docs' => { perms => OWNER_WRITE }, - "$datadir/params.json" => { perms => CGI_WRITE }, + "$datadir/params" => { perms => CGI_WRITE }, "$datadir/old-params.txt" => { perms => OWNER_WRITE }, "$extensionsdir/create.pl" => { perms => OWNER_EXECUTE }, "$extensionsdir/*/*.pl" => { perms => WS_EXECUTE }, @@ -369,7 +366,7 @@ EOT "$assetsdir/.htaccess" => { perms => WS_SERVE, contents => < + Allow from all @@ -412,7 +409,6 @@ sub update_filesystem { my $datadir = bz_locations->{'datadir'}; my $graphsdir = bz_locations->{'graphsdir'}; - my $assetsdir = bz_locations->{'assetsdir'}; # If the graphs/ directory doesn't exist, we're upgrading from # a version old enough that we need to update the $datadir/mining # format. @@ -453,13 +449,6 @@ sub update_filesystem { _rename_file($oldparamsfile, "$datadir/$oldparamsfile"); } - # Remove old assets htaccess file to force recreation with correct values. - if (-e "$assetsdir/.htaccess") { - if (read_file("$assetsdir/.htaccess") =~ //) { - unlink("$assetsdir/.htaccess"); - } - } - _create_files(%files); if ($params->{index_html}) { _create_files(%{$fs->{index_html}}); @@ -503,7 +492,7 @@ EOT _remove_empty_css_files(); _convert_single_file_skins(); - _remove_dynamic_assets(); + _remove_dynamic_css_files(); } sub _remove_empty_css_files { @@ -548,14 +537,10 @@ sub _convert_single_file_skins { } } -# delete all automatically generated css/js files to force recreation at the -# next request. -sub _remove_dynamic_assets { - my @files = ( - glob(bz_locations()->{assetsdir} . '/*.css'), - glob(bz_locations()->{assetsdir} . '/*.js'), - ); - foreach my $file (@files) { +# delete all automatically generated css files to force recreation at the next +# request. +sub _remove_dynamic_css_files { + foreach my $file (glob(bz_locations()->{assetsdir} . '/*.css')) { unlink($file); } diff --git a/mozilla/webtools/bugzilla/Bugzilla/Install/Localconfig.pm b/mozilla/webtools/bugzilla/Bugzilla/Install/Localconfig.pm index 7f473cc77f2..71a9c6ae089 100644 --- a/mozilla/webtools/bugzilla/Bugzilla/Install/Localconfig.pm +++ b/mozilla/webtools/bugzilla/Bugzilla/Install/Localconfig.pm @@ -17,7 +17,6 @@ package Bugzilla::Install::Localconfig; use 5.10.1; use strict; -use warnings; use Bugzilla::Constants; use Bugzilla::Install::Util qw(bin_loc install_string); @@ -100,6 +99,10 @@ use constant LOCALCONFIG_VARS => ( name => 'index_html', default => 0, }, + { + name => 'cvsbin', + default => sub { bin_loc('cvs') }, + }, { name => 'interdiffbin', default => sub { bin_loc('interdiff') }, diff --git a/mozilla/webtools/bugzilla/Bugzilla/Install/Requirements.pm b/mozilla/webtools/bugzilla/Bugzilla/Install/Requirements.pm index 622d1db666e..d9e49017d1c 100644 --- a/mozilla/webtools/bugzilla/Bugzilla/Install/Requirements.pm +++ b/mozilla/webtools/bugzilla/Bugzilla/Install/Requirements.pm @@ -15,7 +15,6 @@ package Bugzilla::Install::Requirements; use 5.10.1; use strict; -use warnings; use Bugzilla::Constants; use Bugzilla::Install::Util qw(install_string bin_loc @@ -23,6 +22,13 @@ use Bugzilla::Install::Util qw(install_string bin_loc use List::Util qw(max); use Term::ANSIColor; +# Return::Value 1.666002 pollutes the error log with warnings about this +# deprecated module. We have to set NO_CLUCK = 1 before loading Email::Send +# in have_vers() to disable these warnings. +BEGIN { + $Return::Value::NO_CLUCK = 1; +} + use parent qw(Exporter); our @EXPORT = qw( REQUIRED_MODULES @@ -124,11 +130,12 @@ sub REQUIRED_MODULES { module => 'Template', version => '2.24' }, - # 1.300011 has a debug mode for SMTP and automatically pass -i to sendmail. + # 2.04 implement the "Test" method (to write to data/mailer.testfile). { - package => 'Email-Sender', - module => 'Email::Sender', - version => '1.300011', + package => 'Email-Send', + module => 'Email::Send', + version => ON_WINDOWS ? '2.16' : '2.04', + blacklist => ['^2\.196$'] }, { package => 'Email-MIME', @@ -158,12 +165,6 @@ sub REQUIRED_MODULES { module => 'File::Slurp', version => '9999.13', }, - { - package => 'JSON-XS', - module => 'JSON::XS', - # 2.0 is the first version that will work with JSON::RPC. - version => '2.01', - }, ); if (ON_WINDOWS) { @@ -296,6 +297,13 @@ sub OPTIONAL_MODULES { version => 0, feature => ['jsonrpc', 'rest'], }, + { + package => 'JSON-XS', + module => 'JSON::XS', + # 2.0 is the first version that will work with JSON::RPC. + version => '2.0', + feature => ['jsonrpc_faster'], + }, { package => 'Test-Taint', module => 'Test::Taint', @@ -349,8 +357,8 @@ sub OPTIONAL_MODULES { { package => 'TheSchwartz', module => 'TheSchwartz', - # 1.10 supports declining of jobs. - version => 1.10, + # 1.07 supports the prioritization of jobs. + version => 1.07, feature => ['jobqueue'], }, { @@ -396,22 +404,6 @@ sub OPTIONAL_MODULES { version => '0', feature => ['memcached'], }, - - # Markdown - { - package => 'Text-Markdown', - module => 'Text::Markdown', - version => '1.0.26', - feature => ['markdown'], - }, - - # Documentation - { - package => 'File-Copy-Recursive', - module => 'File::Copy::Recursive', - version => 0, - feature => ['documentation'], - } ); my $extra_modules = _get_extension_requirements('OPTIONAL_MODULES'); @@ -435,7 +427,6 @@ use constant FEATURE_FILES => ( 'Bugzilla/JobQueue/*', 'jobqueue.pl'], patch_viewer => ['Bugzilla/Attachment/PatchReader.pm'], updates => ['Bugzilla/Update.pm'], - markdown => ['Bugzilla/Markdown.pm'], memcached => ['Bugzilla/Memcache.pm'], ); diff --git a/mozilla/webtools/bugzilla/Bugzilla/Install/Util.pm b/mozilla/webtools/bugzilla/Bugzilla/Install/Util.pm index c05037061f9..66ea7169ea0 100644 --- a/mozilla/webtools/bugzilla/Bugzilla/Install/Util.pm +++ b/mozilla/webtools/bugzilla/Bugzilla/Install/Util.pm @@ -13,7 +13,6 @@ package Bugzilla::Install::Util; use 5.10.1; use strict; -use warnings; use Bugzilla::Constants; diff --git a/mozilla/webtools/bugzilla/Bugzilla/Job/BugMail.pm b/mozilla/webtools/bugzilla/Bugzilla/Job/BugMail.pm index b4887c47026..9c176b005f3 100644 --- a/mozilla/webtools/bugzilla/Bugzilla/Job/BugMail.pm +++ b/mozilla/webtools/bugzilla/Bugzilla/Job/BugMail.pm @@ -9,14 +9,23 @@ package Bugzilla::Job::BugMail; use 5.10.1; use strict; -use warnings; use Bugzilla::BugMail; BEGIN { eval "use parent qw(Bugzilla::Job::Mailer)"; } -sub process_job { - my ($class, $arg) = @_; - Bugzilla::BugMail::dequeue($arg->{vars}); +sub work { + my ($class, $job) = @_; + my $success = eval { + Bugzilla::BugMail::dequeue($job->arg->{vars}); + 1; + }; + if (!$success) { + $job->failed($@); + undef $@; + } + else { + $job->completed; + } } 1; diff --git a/mozilla/webtools/bugzilla/Bugzilla/Job/Mailer.pm b/mozilla/webtools/bugzilla/Bugzilla/Job/Mailer.pm index 0f0e9c71fab..8fce80dd01c 100644 --- a/mozilla/webtools/bugzilla/Bugzilla/Job/Mailer.pm +++ b/mozilla/webtools/bugzilla/Bugzilla/Job/Mailer.pm @@ -9,9 +9,7 @@ package Bugzilla::Job::Mailer; use 5.10.1; use strict; -use warnings; -use Bugzilla::Constants; use Bugzilla::Mailer; BEGIN { eval "use parent qw(TheSchwartz::Worker)"; } @@ -33,24 +31,15 @@ sub retry_delay { sub work { my ($class, $job) = @_; - eval { $class->process_job($job->arg) }; - if (my $error = $@) { - if ($error eq EMAIL_LIMIT_EXCEPTION) { - $job->declined(); - } - else { - $job->failed($error); - } + my $msg = $job->arg->{msg}; + my $success = eval { MessageToMTA($msg, 1); 1; }; + if (!$success) { + $job->failed($@); undef $@; - } + } else { $job->completed; } } -sub process_job { - my ($class, $arg) = @_; - MessageToMTA($arg->{msg}, 1); -} - 1; diff --git a/mozilla/webtools/bugzilla/Bugzilla/JobQueue.pm b/mozilla/webtools/bugzilla/Bugzilla/JobQueue.pm index d5ceda8e9fa..4ff5750da80 100644 --- a/mozilla/webtools/bugzilla/Bugzilla/JobQueue.pm +++ b/mozilla/webtools/bugzilla/Bugzilla/JobQueue.pm @@ -9,7 +9,6 @@ package Bugzilla::JobQueue; use 5.10.1; use strict; -use warnings; use Bugzilla::Constants; use Bugzilla::Error; diff --git a/mozilla/webtools/bugzilla/Bugzilla/JobQueue/Runner.pm b/mozilla/webtools/bugzilla/Bugzilla/JobQueue/Runner.pm index 2367f8d77e6..a0d6a77cb5d 100644 --- a/mozilla/webtools/bugzilla/Bugzilla/JobQueue/Runner.pm +++ b/mozilla/webtools/bugzilla/Bugzilla/JobQueue/Runner.pm @@ -13,7 +13,6 @@ package Bugzilla::JobQueue::Runner; use 5.10.1; use strict; -use warnings; use Cwd qw(abs_path); use File::Basename; @@ -80,7 +79,6 @@ sub gd_more_opt { return ( 'pidfile=s' => \$self->{gd_args}{pidfile}, 'n=s' => \$self->{gd_args}{progname}, - 'j=s@' => \$self->{gd_args}{job_name}, ); } @@ -211,12 +209,10 @@ sub gd_run { sub _do_work { my ($self, $fn) = @_; - my @job_name = @{ $self->{gd_args}{job_name} // [] }; my $jq = Bugzilla->job_queue(); $jq->set_verbose($self->{debug}); $jq->set_pidfile($self->{gd_pidfile}); - while (my ($key, $module) = each %{ Bugzilla::JobQueue->job_map() }) { - next if @job_name and ! grep { $_ eq $key } @job_name; + foreach my $module (values %{ Bugzilla::JobQueue->job_map() }) { eval "use $module"; $jq->can_do($module); } diff --git a/mozilla/webtools/bugzilla/Bugzilla/Keyword.pm b/mozilla/webtools/bugzilla/Bugzilla/Keyword.pm index afa93e1e9ad..a8c098854a3 100644 --- a/mozilla/webtools/bugzilla/Bugzilla/Keyword.pm +++ b/mozilla/webtools/bugzilla/Bugzilla/Keyword.pm @@ -9,7 +9,6 @@ package Bugzilla::Keyword; use 5.10.1; use strict; -use warnings; use parent qw(Bugzilla::Object); diff --git a/mozilla/webtools/bugzilla/Bugzilla/Mailer.pm b/mozilla/webtools/bugzilla/Bugzilla/Mailer.pm index bcf17458fe0..b60ddb72e5f 100644 --- a/mozilla/webtools/bugzilla/Bugzilla/Mailer.pm +++ b/mozilla/webtools/bugzilla/Bugzilla/Mailer.pm @@ -9,7 +9,6 @@ package Bugzilla::Mailer; use 5.10.1; use strict; -use warnings; use parent qw(Exporter); @Bugzilla::Mailer::EXPORT = qw(MessageToMTA build_thread_marker); @@ -23,26 +22,26 @@ use Date::Format qw(time2str); use Encode qw(encode); use Encode::MIME::Header; +use Email::Address; use Email::MIME; -use Email::Sender::Simple qw(sendmail); -use Email::Sender::Transport::SMTP::Persistent; -use Bugzilla::Sender::Transport::Sendmail; +# Return::Value 1.666002 pollutes the error log with warnings about this +# deprecated module. We have to set NO_CLUCK = 1 before loading Email::Send +# to disable these warnings. +BEGIN { + $Return::Value::NO_CLUCK = 1; +} +use Email::Send; sub MessageToMTA { my ($msg, $send_now) = (@_); my $method = Bugzilla->params->{'mail_delivery_method'}; return if $method eq 'None'; - if (Bugzilla->params->{'use_mailer_queue'} - && ! $send_now - && ! Bugzilla->dbh->bz_in_transaction() - ) { + if (Bugzilla->params->{'use_mailer_queue'} and !$send_now) { Bugzilla->job_queue->insert('send_mail', { msg => $msg }); return; } - my $dbh = Bugzilla->dbh; - my $email; if (ref $msg) { $email = $msg; @@ -52,58 +51,12 @@ sub MessageToMTA { # Email::MIME doesn't do this for us. We use \015 (CR) and \012 (LF) # directly because Perl translates "\n" depending on what platform # you're running on. See http://perldoc.perl.org/perlport.html#Newlines + # We check for multiple CRs because of this Template-Toolkit bug: + # https://rt.cpan.org/Ticket/Display.html?id=43345 $msg =~ s/(?:\015+)?\012/\015\012/msg; $email = new Email::MIME($msg); } - # If we're called from within a transaction, we don't want to send the - # email immediately, in case the transaction is rolled back. Instead we - # insert it into the mail_staging table, and bz_commit_transaction calls - # send_staged_mail() after the transaction is committed. - if (! $send_now && $dbh->bz_in_transaction()) { - # The e-mail string may contain tainted values. - my $string = $email->as_string; - trick_taint($string); - $dbh->do("INSERT INTO mail_staging (message) VALUES(?)", undef, $string); - return; - } - - # Ensure that we are not sending emails too quickly to recipients. - if (Bugzilla->params->{use_mailer_queue} - && (EMAIL_LIMIT_PER_MINUTE || EMAIL_LIMIT_PER_HOUR)) - { - $dbh->do( - "DELETE FROM email_rates WHERE message_ts < " - . $dbh->sql_date_math('LOCALTIMESTAMP(0)', '-', '1', 'HOUR')); - - my $recipient = $email->header('To'); - - if (EMAIL_LIMIT_PER_MINUTE) { - my $minute_rate = $dbh->selectrow_array( - "SELECT COUNT(*) - FROM email_rates - WHERE recipient = ? AND message_ts >= " - . $dbh->sql_date_math('LOCALTIMESTAMP(0)', '-', '1', 'MINUTE'), - undef, - $recipient); - if ($minute_rate >= EMAIL_LIMIT_PER_MINUTE) { - die EMAIL_LIMIT_EXCEPTION; - } - } - if (EMAIL_LIMIT_PER_HOUR) { - my $hour_rate = $dbh->selectrow_array( - "SELECT COUNT(*) - FROM email_rates - WHERE recipient = ? AND message_ts >= " - . $dbh->sql_date_math('LOCALTIMESTAMP(0)', '-', '1', 'HOUR'), - undef, - $recipient); - if ($hour_rate >= EMAIL_LIMIT_PER_HOUR) { - die EMAIL_LIMIT_EXCEPTION; - } - } - } - # We add this header to uniquely identify all email that we # send as coming from this Bugzilla installation. # @@ -111,7 +64,7 @@ sub MessageToMTA { # *always* be the same for this Bugzilla, in every email, # even if the admin changes the "ssl_redirect" parameter some day. $email->header_set('X-Bugzilla-URL', Bugzilla->params->{'urlbase'}); - + # We add this header to mark the mail as "auto-generated" and # thus to hopefully avoid auto replies. $email->header_set('Auto-Submitted', 'auto-generated'); @@ -139,14 +92,21 @@ sub MessageToMTA { my $from = $email->header('From'); - my $hostname; - my $transport; + my ($hostname, @args); + my $mailer_class = $method; if ($method eq "Sendmail") { + $mailer_class = 'Bugzilla::Send::Sendmail'; if (ON_WINDOWS) { - $transport = Bugzilla::Sender::Transport::Sendmail->new({ sendmail => SENDMAIL_EXE }); + $Email::Send::Sendmail::SENDMAIL = SENDMAIL_EXE; } - else { - $transport = Bugzilla::Sender::Transport::Sendmail->new(); + push @args, "-i"; + # We want to make sure that we pass *only* an email address. + if ($from) { + my ($email_obj) = Email::Address->parse($from); + if ($email_obj) { + my $from_email = $email_obj->address; + push(@args, "-f$from_email") if $from_email; + } } } else { @@ -154,7 +114,7 @@ sub MessageToMTA { # address, but other mailers won't. my $urlbase = Bugzilla->params->{'urlbase'}; $urlbase =~ m|//([^:/]+)[:/]?|; - $hostname = $1 || 'localhost'; + $hostname = $1; $from .= "\@$hostname" if $from !~ /@/; $email->header_set('From', $from); @@ -165,19 +125,16 @@ sub MessageToMTA { } if ($method eq "SMTP") { - my ($host, $port) = split(/:/, Bugzilla->params->{'smtpserver'}, 2); - $transport = Bugzilla->request_cache->{smtp} //= - Email::Sender::Transport::SMTP::Persistent->new({ - host => $host, - defined($port) ? (port => $port) : (), - sasl_username => Bugzilla->params->{'smtp_username'}, - sasl_password => Bugzilla->params->{'smtp_password'}, - helo => $hostname, - ssl => Bugzilla->params->{'smtp_ssl'}, - debug => Bugzilla->params->{'smtp_debug'} }); + push @args, Host => Bugzilla->params->{"smtpserver"}, + username => Bugzilla->params->{"smtp_username"}, + password => Bugzilla->params->{"smtp_password"}, + Hello => $hostname, + ssl => Bugzilla->params->{'smtp_ssl'}, + Debug => Bugzilla->params->{'smtp_debug'}; } - Bugzilla::Hook::process('mailer_before_send', { email => $email }); + Bugzilla::Hook::process('mailer_before_send', + { email => $email, mailer_args => \@args }); return if $email->header('to') eq ''; @@ -212,23 +169,13 @@ sub MessageToMTA { close TESTFILE; } else { - # This is useful for Sendmail, so we put it out here. + # This is useful for both Sendmail and Qmail, so we put it out here. local $ENV{PATH} = SENDMAIL_PATH; - eval { sendmail($email, { transport => $transport }) }; - if ($@) { - ThrowCodeError('mail_send_error', { msg => $@->message, mail => $email }); - } - } - - # insert into email_rates - if (Bugzilla->params->{use_mailer_queue} - && (EMAIL_LIMIT_PER_MINUTE || EMAIL_LIMIT_PER_HOUR)) - { - $dbh->do( - "INSERT INTO email_rates(recipient, message_ts) VALUES (?, LOCALTIMESTAMP(0))", - undef, - $email->header('To') - ); + my $mailer = Email::Send->new({ mailer => $mailer_class, + mailer_args => \@args }); + my $retval = $mailer->send($email); + ThrowCodeError('mail_send_error', { msg => $retval, mail => $email }) + if !$retval; } } @@ -261,50 +208,14 @@ sub build_thread_marker { return $threadingmarker; } -sub send_staged_mail { - my $dbh = Bugzilla->dbh; - my @ids; - my $emails - = $dbh->selectall_arrayref("SELECT id, message FROM mail_staging"); - - foreach my $row (@$emails) { - MessageToMTA($row->[1]); - push(@ids, $row->[0]); - } - - if (@ids) { - $dbh->do("DELETE FROM mail_staging WHERE " . $dbh->sql_in('id', \@ids)); - } -} - 1; -__END__ - -=head1 NAME - -Bugzilla::Mailer - Provides methods for sending email - -=head1 METHODS +=head1 B =over -=item C +=item build_thread_marker -Sends the passed message to the mail transfer agent. - -The actual behaviour depends on a number of factors: if called from within a -database transaction, the message will be staged and sent when the transaction -is committed. If email queueing is enabled, the message will be sent to -TheSchwartz job queue where it will be processed by the jobqueue daemon, else -the message is sent immediately. - -=item C - -Builds header suitable for use as a threading marker in email notifications. - -=item C - -Sends all staged messages -- called after a database transaction is committed. +=item MessageToMTA =back diff --git a/mozilla/webtools/bugzilla/Bugzilla/Markdown.pm b/mozilla/webtools/bugzilla/Bugzilla/Markdown.pm deleted file mode 100644 index 353c2ff6aef..00000000000 --- a/mozilla/webtools/bugzilla/Bugzilla/Markdown.pm +++ /dev/null @@ -1,520 +0,0 @@ -# This Source Code Form is subject to the terms of the Mozilla Public -# License, v. 2.0. If a copy of the MPL was not distributed with this -# file, You can obtain one at http://mozilla.org/MPL/2.0/. -# -# This Source Code Form is "Incompatible With Secondary Licenses", as -# defined by the Mozilla Public License, v. 2.0. - -package Bugzilla::Markdown; - -use 5.10.1; -use strict; -use warnings; - -use Bugzilla::Constants; -use Bugzilla::Template; - -use Digest::MD5 qw(md5_hex); - -use parent qw(Text::Markdown); - -@Bugzilla::Markdown::EXPORT = qw(new); - -# Regex to match balanced [brackets]. See Friedl's -# "Mastering Regular Expressions", 2nd Ed., pp. 328-331. -our ($g_nested_brackets, $g_nested_parens); -$g_nested_brackets = qr{ - (?> # Atomic matching - [^\[\]]+ # Anything other than brackets - | - \[ - (??{ $g_nested_brackets }) # Recursive set of nested brackets - \] - )* -}x; -# Doesn't allow for whitespace, because we're using it to match URLs: -$g_nested_parens = qr{ - (?> # Atomic matching - [^()\s]+ # Anything other than parens or whitespace - | - \( - (??{ $g_nested_parens }) # Recursive set of nested brackets - \) - )* -}x; - -our %g_escape_table; -foreach my $char (split //, '\\`*_{}[]()>#+-.!~') { - $g_escape_table{$char} = md5_hex($char); -} -$g_escape_table{'<'} = md5_hex('<'); - -sub new { - my $invocant = shift; - my $class = ref $invocant || $invocant; - return $class->SUPER::new(tab_width => MARKDOWN_TAB_WIDTH, - # Bugzilla uses HTML not XHTML - empty_element_suffix => '>'); -} - -sub markdown { - my $self = shift; - my $text = shift; - my $user = Bugzilla->user; - - if ($user->settings->{use_markdown}->{is_enabled} - && $user->setting('use_markdown') eq 'on') - { - return $self->SUPER::markdown($text, @_); - } - - return Bugzilla::Template::quoteUrls($text); -} - -sub _Markdown { - my $self = shift; - my $text = shift; - - $text = Bugzilla::Template::quoteUrls($text, undef, undef, undef, undef, 1); - - return $self->SUPER::_Markdown($text, @_); -} - -sub _RunSpanGamut { - # These are all the transformations that occur *within* block-level - # tags like paragraphs, headers, and list items. - - my ($self, $text) = @_; - - $text = $self->_DoCodeSpans($text); - $text = $self->_EscapeSpecialCharsWithinTagAttributes($text); - $text = $self->_EscapeSpecialChars($text); - - $text = $self->_DoAnchors($text); - - # Strikethroughs is Bugzilla's extension - $text = $self->_DoStrikethroughs($text); - - $text = $self->_DoAutoLinks($text); - $text = $self->_EncodeAmpsAndAngles($text); - $text = $self->_DoItalicsAndBold($text); - - $text =~ s/\n/{empty_element_suffix}\n/g; - - return $text; -} - -# Override to check for HTML-escaped <>" chars. -sub _StripLinkDefinitions { -# -# Strips link definitions from text, stores the URLs and titles in -# hash references. -# - my ($self, $text) = @_; - my $less_than_tab = $self->{tab_width} - 1; - - # Link defs are in the form: ^[id]: url "optional title" - while ($text =~ s{ - ^[ ]{0,$less_than_tab}\[(.+)\]: # id = \$1 - [ \t]* - \n? # maybe *one* newline - [ \t]* - (?:<)?\2(?:>)? # url = \$2 - [ \t]* - \n? # maybe one newline - [ \t]* - (?: - (?<=\s) # lookbehind for whitespace - (?:"|\() - (.+?) # title = \$3 - (?:"|\)) - [ \t]* - )? # title is optional - (?:\n+|\Z) - }{}omx) { - $self->{_urls}{lc $1} = $self->_EncodeAmpsAndAngles( $2 ); # Link IDs are case-insensitive - if ($3) { - $self->{_titles}{lc $1} = $3; - $self->{_titles}{lc $1} =~ s/"/"/g; - } - - } - - return $text; -} - -# We need to look for HTML-escaped '<' and '>' (i.e. < and >). -# We also remove Email linkification from the original implementation -# as it is already done in Bugzilla's quoteUrls(). -sub _DoAutoLinks { - my ($self, $text) = @_; - - $text =~ s{(?:<|<)((?:https?|ftp):[^'">\s]+?)(?:>|>)}{$1}gi; - return $text; -} - -# The main reasons for overriding this method are -# resolving URL conflicts with Bugzilla's quoteUrls() -# and also changing '"' to '"' in regular expressions wherever needed. -sub _DoAnchors { -# -# Turn Markdown link shortcuts into tags. -# - my ($self, $text) = @_; - - # We revert linkifications of non-email links and only - # those links whose URL and title are the same because - # this way we can be sure that link is generated by quoteUrls() - $text =~ s@\1@$1@xmg; - - # - # First, handle reference-style links: [link text] [id] - # - $text =~ s{ - ( # wrap whole match in $1 - \[ - ($g_nested_brackets) # link text = $2 - \] - - [ ]? # one optional space - (?:\n[ ]*)? # one optional newline followed by spaces - - \[ - (.*?) # id = $3 - \] - ) - }{ - my $whole_match = $1; - my $link_text = $2; - my $link_id = lc $3; - - if ($link_id eq "") { - $link_id = lc $link_text; # for shortcut links like [this][]. - } - - $link_id =~ s{[ ]*\n}{ }g; # turn embedded newlines into spaces - - $self->_GenerateAnchor($whole_match, $link_text, $link_id); - }xsge; - - # - # Next, inline-style links: [link text](url "optional title") - # - $text =~ s{ - ( # wrap whole match in $1 - \[ - ($g_nested_brackets) # link text = $2 - \] - \( # literal paren - [ \t]* - ($g_nested_parens) # href = $3 - [ \t]* - ( # $4 - ("|') # quote char = $5 - (.*?) # Title = $6 - \5 # matching quote - [ \t]* # ignore any spaces/tabs between closing quote and ) - )? # title is optional - \) - ) - }{ - my $result; - my $whole_match = $1; - my $link_text = $2; - my $url = $3; - my $title = $6; - - # Remove Bugzilla quoteUrls() linkification - if ($url =~ /^a href="/ && $url =~ m|]+>//; - $url =~ s@_GenerateAnchor($whole_match, $link_text, undef, $url, $title); - }xsge; - - # - # Last, handle reference-style shortcuts: [link text] - # These must come last in case you've also got [link test][1] - # or [link test](/foo) - # - $text =~ s{ - ( # wrap whole match in $1 - \[ - ([^\[\]]+) # link text = $2; can't contain '[' or ']' - \] - ) - }{ - my $result; - my $whole_match = $1; - my $link_text = $2; - (my $link_id = lc $2) =~ s{[ ]*\n}{ }g; # lower-case and turn embedded newlines into spaces - - $self->_GenerateAnchor($whole_match, $link_text, $link_id); - }xsge; - - return $text; -} - -# The purpose of overriding this function is to add support -# for a Github Flavored Markdown (GFM) feature called 'Multiple -# underscores in words'. The standard markdown specification -# specifies the underscore for making the text emphasized/bold. -# However, some variable names in programming languages contain underscores -# and we do not want a part of those variables to look emphasized/bold. -# Instead, we render them as the way they originally are. -sub _DoItalicsAndBold { - my ($self, $text) = @_; - - # Handle at beginning of lines: - $text =~ s{ (^__ (?=\S) (.+?[*_]*) (?<=\S) __ (?!\S)) } - { - my $result = _has_multiple_underscores($2) ? $1 : "$2"; - $result; - }gsxe; - - $text =~ s{ ^\*\* (?=\S) (.+?[*_]*) (?<=\S) \*\* }{$1}gsx; - - $text =~ s{ (^_ (?=\S) (.+?) (?<=\S) _ (?!\S)) } - { - my $result = _has_multiple_underscores($2) ? $1 : "$2"; - $result; - }gsxe; - - $text =~ s{ ^\* (?=\S) (.+?) (?<=\S) \* }{$1}gsx; - - # must go first: - $text =~ s{ ( (?<=\W) __ (?=\S) (.+?[*_]*) (?<=\S) __ (?!\S) ) } - { - my $result = _has_multiple_underscores($2) ? $1 : "$2"; - $result; - }gsxe; - - - $text =~ s{ (?<=\W) \*\* (?=\S) (.+?[*_]*) (?<=\S) \*\* }{$1}gsx; - - $text =~ s{ ( (?<=\W) _ (?=\S) (.+?) (?<=\S) _ (?!\S) ) } - { - my $result = _has_multiple_underscores($2) ? $1 : "$2"; - $result; - }gsxe; - - $text =~ s{ (?<=\W) \* (?=\S) (.+?) (?<=\S) \* }{$1}gsx; - - # And now, a second pass to catch nested strong and emphasis special cases - $text =~ s{ ( (?<=\W) __ (?=\S) (.+?[*_]*) (?<=\S) __ (\S*) ) } - { - my $result = _has_multiple_underscores($3) ? $1 : "$2$3"; - $result; - }gsxe; - - $text =~ s{ (?<=\W) \*\* (?=\S) (.+?[*_]*) (?<=\S) \*\* }{$1}gsx; - $text =~ s{ ( (?<=\W) _ (?=\S) (.+?) (?<=\S) _ (\S*) ) } - { - my $result = _has_multiple_underscores($3) ? $1 : "$2$3"; - $result; - }gsxe; - - $text =~ s{ (?<=\W) \* (?=\S) (.+?) (?<=\S) \* }{$1}gsx; - - return $text; -} - -sub _DoStrikethroughs { - my ($self, $text) = @_; - - $text =~ s{ ^ ~~ (?=\S) ([^~]+?) (?<=\S) ~~ (?!~) }{$1}gsx; - $text =~ s{ (?<=_|[^~\w]) ~~ (?=\S) ([^~]+?) (?<=\S) ~~ (?!~) }{$1}gsx; - - return $text; -} - -# The original _DoCodeSpans() uses the 's' modifier in its regex -# which prevents _DoCodeBlocks() to match GFM fenced code blocks. -# We copy the code from the original implementation and remove the -# 's' modifier from it. -sub _DoCodeSpans { - my ($self, $text) = @_; - - $text =~ s@ - (?_EncodeCode($c); - "$c"; - @egx; - - return $text; -} - -# Override to add GFM Fenced Code Blocks -sub _DoCodeBlocks { - my ($self, $text) = @_; - - $text =~ s{ - ^ `{3,} [\s\t]* \n - ( # $1 = the entire code block - (?: .* \n+)+? - ) - `{3,} [\s\t]* $ - }{ - my $codeblock = $1; - my $result; - - $codeblock = $self->_EncodeCode($codeblock); - $codeblock = $self->_Detab($codeblock); - $codeblock =~ s/\n\z//; # remove the trailing newline - - $result = "\n\n
" . $codeblock . "
\n\n"; - $result; - }egmx; - - # And now do the standard code blocks - $text = $self->SUPER::_DoCodeBlocks($text); - - return $text; -} - -sub _DoBlockQuotes { - my ($self, $text) = @_; - - $text =~ s{ - ( # Wrap whole match in $1 - (?: - ^[ \t]*>[ \t]? # '>' at the start of a line - .+\n # rest of the first line - (?:.+\n)* # subsequent consecutive lines - \n* # blanks - )+ - ) - }{ - my $bq = $1; - $bq =~ s/^[ \t]*>[ \t]?//gm; # trim one level of quoting - $bq =~ s/^[ \t]+$//mg; # trim whitespace-only lines - $bq = $self->_RunBlockGamut($bq, {wrap_in_p_tags => 1}); # recurse - $bq =~ s/^/ /mg; - # These leading spaces screw with
 content, so we need to fix that:
-            $bq =~ s{(\s*
.+?
)}{ - my $pre = $1; - $pre =~ s/^ //mg; - $pre; - }egs; - "
\n$bq\n
\n\n"; - }egmx; - - return $text; -} - -sub _EncodeCode { - my ($self, $text) = @_; - - # We need to unescape the escaped HTML characters in code blocks. - # These are the reverse of the escapings done in Bugzilla::Util::html_quote() - $text =~ s/<//g; - $text =~ s/"/"/g; - $text =~ s/@/@/g; - # '&' substitution must be the last one, otherwise a literal like '>' - # will turn to '>' because '&' is already changed to '&' in Bugzilla::Util::html_quote(). - # In other words, html_quote() will change '>' to '&gt;' and then we will - # change '&gt' -> '>' -> '>' if we write this substitution as the first one. - $text =~ s/&/&/g; - $text =~ s{ \1 }{$1}xmgi; - $text = $self->SUPER::_EncodeCode($text); - $text =~ s/~/$g_escape_table{'~'}/go; - # Encode '<' to prevent URLs from getting linkified in code spans - $text =~ s/</$g_escape_table{'<'}/go; - - return $text; -} - -sub _EncodeBackslashEscapes { - my ($self, $text) = @_; - - $text = $self->SUPER::_EncodeBackslashEscapes($text); - $text =~ s/\\~/$g_escape_table{'~'}/go; - - return $text; -} - -sub _UnescapeSpecialChars { - my ($self, $text) = @_; - - $text = $self->SUPER::_UnescapeSpecialChars($text); - $text =~ s/$g_escape_table{'~'}/~/go; - $text =~ s/$g_escape_table{'<'}/</go; - - return $text; -} - -# Check if the passed string is of the form multiple_underscores_in_a_word. -# To check that, we first need to make sure that the string does not contain -# any white-space. Then, if the string is composed of non-space chunks which -# are bound together with underscores, the string has the desired form. -sub _has_multiple_underscores { - my $string = shift; - return 0 unless defined($string) && length($string); - return 0 if $string =~ /[\t\s]+/; - return 1 if scalar (split /_/, $string) > 1; - return 0; -} - -1; - -__END__ - -=head1 NAME - -Bugzilla::Markdown - Generates HTML output from structured plain-text input. - -=head1 SYNOPSIS - - use Bugzilla::Markdown; - - my $markdown = Bugzilla::Markdown->new(); - print $markdown->markdown($text); - -=head1 DESCRIPTION - -Bugzilla::Markdown implements a Markdown engine that produces -an HTML-based output from a given plain-text input. - -The majority of the implementation is done by C -CPAN module. It also applies the linkifications done in L -to the input resulting in an output which is a combination of both Markdown -structures and those defined by Bugzilla itself. - -=head2 Accessors - -=over - -=item C - -C Produces an HTML-based output string based on the structures -and format defined in the given plain-text input. - -=over - -=item B - -=over - -=item C - -C A plain-text string which includes Markdown structures. - -=back - -=back - -=back diff --git a/mozilla/webtools/bugzilla/Bugzilla/Memcached.pm b/mozilla/webtools/bugzilla/Bugzilla/Memcached.pm index df90fef9342..1464b6c003e 100644 --- a/mozilla/webtools/bugzilla/Bugzilla/Memcached.pm +++ b/mozilla/webtools/bugzilla/Bugzilla/Memcached.pm @@ -254,13 +254,10 @@ sub _get { elsif (ref($value) eq 'ARRAY') { foreach my $value (@$value) { next unless defined $value; - # arrays of hashes and arrays are common + # arrays of hashes are common if (ref($value) eq 'HASH') { _detaint_hashref($value); } - elsif (ref($value) eq 'ARRAY') { - _detaint_arrayref($value); - } elsif (!ref($value)) { trick_taint($value); } @@ -281,15 +278,6 @@ sub _detaint_hashref { } } -sub _detaint_arrayref { - my ($arrayref) = @_; - foreach my $value (@$arrayref) { - if (defined($value) && !ref($value)) { - trick_taint($value); - } - } -} - sub _delete { my ($self, $key) = @_; $key = $self->_encode_key($key) diff --git a/mozilla/webtools/bugzilla/Bugzilla/Migrate.pm b/mozilla/webtools/bugzilla/Bugzilla/Migrate.pm index 0731d4fedf9..2763ecb2bd4 100644 --- a/mozilla/webtools/bugzilla/Bugzilla/Migrate.pm +++ b/mozilla/webtools/bugzilla/Bugzilla/Migrate.pm @@ -9,7 +9,6 @@ package Bugzilla::Migrate; use 5.10.1; use strict; -use warnings; use Bugzilla::Attachment; use Bugzilla::Bug qw(LogActivityEntry); diff --git a/mozilla/webtools/bugzilla/Bugzilla/Migrate/Gnats.pm b/mozilla/webtools/bugzilla/Bugzilla/Migrate/Gnats.pm index 5feda4b8db3..2778d28cc8a 100644 --- a/mozilla/webtools/bugzilla/Bugzilla/Migrate/Gnats.pm +++ b/mozilla/webtools/bugzilla/Bugzilla/Migrate/Gnats.pm @@ -9,7 +9,6 @@ package Bugzilla::Migrate::Gnats; use 5.10.1; use strict; -use warnings; use parent qw(Bugzilla::Migrate); diff --git a/mozilla/webtools/bugzilla/Bugzilla/Milestone.pm b/mozilla/webtools/bugzilla/Bugzilla/Milestone.pm index cf7e3e35f18..83438e7c683 100644 --- a/mozilla/webtools/bugzilla/Bugzilla/Milestone.pm +++ b/mozilla/webtools/bugzilla/Bugzilla/Milestone.pm @@ -9,7 +9,6 @@ package Bugzilla::Milestone; use 5.10.1; use strict; -use warnings; use parent qw(Bugzilla::Object); diff --git a/mozilla/webtools/bugzilla/Bugzilla/Object.pm b/mozilla/webtools/bugzilla/Bugzilla/Object.pm index 8f25e2b20c2..f2080363299 100644 --- a/mozilla/webtools/bugzilla/Bugzilla/Object.pm +++ b/mozilla/webtools/bugzilla/Bugzilla/Object.pm @@ -9,7 +9,6 @@ package Bugzilla::Object; use 5.10.1; use strict; -use warnings; use Bugzilla::Constants; use Bugzilla::Hook; diff --git a/mozilla/webtools/bugzilla/Bugzilla/Product.pm b/mozilla/webtools/bugzilla/Bugzilla/Product.pm index 30ebc7c6cd5..3d4de7430aa 100644 --- a/mozilla/webtools/bugzilla/Bugzilla/Product.pm +++ b/mozilla/webtools/bugzilla/Bugzilla/Product.pm @@ -9,7 +9,6 @@ package Bugzilla::Product; use 5.10.1; use strict; -use warnings; use parent qw(Bugzilla::Field::ChoiceInterface Bugzilla::Object); diff --git a/mozilla/webtools/bugzilla/Bugzilla/RNG.pm b/mozilla/webtools/bugzilla/Bugzilla/RNG.pm index 96e442fa032..14b83167222 100644 --- a/mozilla/webtools/bugzilla/Bugzilla/RNG.pm +++ b/mozilla/webtools/bugzilla/Bugzilla/RNG.pm @@ -9,7 +9,6 @@ package Bugzilla::RNG; use 5.10.1; use strict; -use warnings; use parent qw(Exporter); use Bugzilla::Constants qw(ON_WINDOWS); diff --git a/mozilla/webtools/bugzilla/Bugzilla/Report.pm b/mozilla/webtools/bugzilla/Bugzilla/Report.pm index 10af2ea9efc..fe2b826614f 100644 --- a/mozilla/webtools/bugzilla/Bugzilla/Report.pm +++ b/mozilla/webtools/bugzilla/Bugzilla/Report.pm @@ -9,7 +9,6 @@ package Bugzilla::Report; use 5.10.1; use strict; -use warnings; use parent qw(Bugzilla::Object); diff --git a/mozilla/webtools/bugzilla/Bugzilla/Search.pm b/mozilla/webtools/bugzilla/Bugzilla/Search.pm index 0395d08eefb..036e0a60581 100644 --- a/mozilla/webtools/bugzilla/Bugzilla/Search.pm +++ b/mozilla/webtools/bugzilla/Bugzilla/Search.pm @@ -9,7 +9,6 @@ package Bugzilla::Search; use 5.10.1; use strict; -use warnings; use parent qw(Exporter); @Bugzilla::Search::EXPORT = qw( @@ -265,7 +264,7 @@ use constant OPERATOR_FIELD_OVERRIDE => { }, # General Bug Fields - alias => { _non_changed => \&_alias_nonchanged }, + alias => { _non_changed => \&_nullable }, 'attach_data.thedata' => MULTI_SELECT_OVERRIDE, # We check all attachment fields against this. attachments => MULTI_SELECT_OVERRIDE, @@ -456,10 +455,6 @@ sub COLUMN_JOINS { . ' FROM longdescs GROUP BY bug_id)', join => 'INNER', }, - alias => { - table => 'bugs_aliases', - as => 'map_alias', - }, assigned_to => { from => 'assigned_to', to => 'userid', @@ -590,7 +585,6 @@ sub COLUMNS { # like "bugs.bug_id". my $total_time = "(map_actual_time.total + bugs.remaining_time)"; my %special_sql = ( - alias => $dbh->sql_group_concat('DISTINCT map_alias.alias'), deadline => $dbh->sql_date_format('bugs.deadline', '%Y-%m-%d'), actual_time => 'map_actual_time.total', @@ -761,7 +755,7 @@ sub data { my @orig_fields = $self->_input_columns; my $all_in_bugs_table = 1; foreach my $field (@orig_fields) { - next if ($self->COLUMNS->{$field}->{name} // $field) =~ /^bugs\.\w+$/; + next if $self->COLUMNS->{$field}->{name} =~ /^bugs\.\w+$/; $self->{fields} = ['bug_id']; $all_in_bugs_table = 0; last; @@ -1013,16 +1007,10 @@ sub _sql_select { my ($self) = @_; my @sql_fields; foreach my $column ($self->_display_columns) { - my $sql = $self->COLUMNS->{$column}->{name} // ''; - if ($sql) { - my $alias = $column; - # Aliases cannot contain dots in them. We convert them to underscores. - $alias =~ tr/./_/; - $sql .= " AS $alias"; - } - else { - $sql = $column; - } + my $alias = $column; + # Aliases cannot contain dots in them. We convert them to underscores. + $alias =~ s/\./_/g; + my $sql = $self->COLUMNS->{$column}->{name} . " AS $alias"; push(@sql_fields, $sql); } return @sql_fields; @@ -1399,7 +1387,7 @@ sub _sql_group_by { my @extra_group_by; foreach my $column ($self->_select_columns) { next if $self->_skip_group_by->{$column}; - my $sql = $self->COLUMNS->{$column}->{name} // $column; + my $sql = $self->COLUMNS->{$column}->{name}; push(@extra_group_by, $sql); } @@ -2738,15 +2726,6 @@ sub _product_nonchanged { "products.id", "products", $term); } -sub _alias_nonchanged { - my ($self, $args) = @_; - - $args->{full_field} = "bugs_aliases.alias"; - $self->_do_operator_function($args); - $args->{term} = build_subselect("bugs.bug_id", - "bugs_aliases.bug_id", "bugs_aliases", $args->{term}); -} - sub _classification_nonchanged { my ($self, $args) = @_; my $joins = $args->{joins}; diff --git a/mozilla/webtools/bugzilla/Bugzilla/Search/Clause.pm b/mozilla/webtools/bugzilla/Bugzilla/Search/Clause.pm index 1d7872c7857..9d3d690a393 100644 --- a/mozilla/webtools/bugzilla/Bugzilla/Search/Clause.pm +++ b/mozilla/webtools/bugzilla/Bugzilla/Search/Clause.pm @@ -9,7 +9,6 @@ package Bugzilla::Search::Clause; use 5.10.1; use strict; -use warnings; use Bugzilla::Error; use Bugzilla::Search::Condition qw(condition); diff --git a/mozilla/webtools/bugzilla/Bugzilla/Search/ClauseGroup.pm b/mozilla/webtools/bugzilla/Bugzilla/Search/ClauseGroup.pm index 590c737fad0..eb306525c2b 100644 --- a/mozilla/webtools/bugzilla/Bugzilla/Search/ClauseGroup.pm +++ b/mozilla/webtools/bugzilla/Bugzilla/Search/ClauseGroup.pm @@ -9,7 +9,6 @@ package Bugzilla::Search::ClauseGroup; use 5.10.1; use strict; -use warnings; use parent qw(Bugzilla::Search::Clause); diff --git a/mozilla/webtools/bugzilla/Bugzilla/Search/Condition.pm b/mozilla/webtools/bugzilla/Bugzilla/Search/Condition.pm index 306a63eed3c..eab4ab79d24 100644 --- a/mozilla/webtools/bugzilla/Bugzilla/Search/Condition.pm +++ b/mozilla/webtools/bugzilla/Bugzilla/Search/Condition.pm @@ -9,7 +9,6 @@ package Bugzilla::Search::Condition; use 5.10.1; use strict; -use warnings; use parent qw(Exporter); our @EXPORT_OK = qw(condition); diff --git a/mozilla/webtools/bugzilla/Bugzilla/Search/Quicksearch.pm b/mozilla/webtools/bugzilla/Bugzilla/Search/Quicksearch.pm index 830177f8b51..98e8a648274 100644 --- a/mozilla/webtools/bugzilla/Bugzilla/Search/Quicksearch.pm +++ b/mozilla/webtools/bugzilla/Bugzilla/Search/Quicksearch.pm @@ -9,7 +9,6 @@ package Bugzilla::Search::Quicksearch; use 5.10.1; use strict; -use warnings; use Bugzilla::Error; use Bugzilla::Constants; @@ -322,7 +321,7 @@ sub _handle_alias { my $alias = $1; # We use this direct SQL because we want quicksearch to be VERY fast. my $bug_id = Bugzilla->dbh->selectrow_array( - q{SELECT bug_id FROM bugs_aliases WHERE alias = ?}, undef, $alias); + q{SELECT bug_id FROM bugs WHERE alias = ?}, undef, $alias); # If the user cannot see the bug or if we are using a webservice, # do not resolve its alias. if ($bug_id && Bugzilla->user->can_see_bug($bug_id) && !i_am_webservice()) { diff --git a/mozilla/webtools/bugzilla/Bugzilla/Search/Recent.pm b/mozilla/webtools/bugzilla/Bugzilla/Search/Recent.pm index e774c7fe059..cc1c3c582e8 100644 --- a/mozilla/webtools/bugzilla/Bugzilla/Search/Recent.pm +++ b/mozilla/webtools/bugzilla/Bugzilla/Search/Recent.pm @@ -9,7 +9,6 @@ package Bugzilla::Search::Recent; use 5.10.1; use strict; -use warnings; use parent qw(Bugzilla::Object); diff --git a/mozilla/webtools/bugzilla/Bugzilla/Search/Saved.pm b/mozilla/webtools/bugzilla/Bugzilla/Search/Saved.pm index 50a9cdd6721..2e4c4a33617 100644 --- a/mozilla/webtools/bugzilla/Bugzilla/Search/Saved.pm +++ b/mozilla/webtools/bugzilla/Bugzilla/Search/Saved.pm @@ -9,7 +9,6 @@ package Bugzilla::Search::Saved; use 5.10.1; use strict; -use warnings; use parent qw(Bugzilla::Object); diff --git a/mozilla/webtools/bugzilla/Bugzilla/Sender/Transport/Sendmail.pm b/mozilla/webtools/bugzilla/Bugzilla/Send/Sendmail.pm similarity index 64% rename from mozilla/webtools/bugzilla/Bugzilla/Sender/Transport/Sendmail.pm rename to mozilla/webtools/bugzilla/Bugzilla/Send/Sendmail.pm index 49f00777fc1..9496ff97cf9 100644 --- a/mozilla/webtools/bugzilla/Bugzilla/Sender/Transport/Sendmail.pm +++ b/mozilla/webtools/bugzilla/Bugzilla/Send/Sendmail.pm @@ -5,49 +5,57 @@ # This Source Code Form is "Incompatible With Secondary Licenses", as # defined by the Mozilla Public License, v. 2.0. -package Bugzilla::Sender::Transport::Sendmail; +package Bugzilla::Send::Sendmail; use 5.10.1; use strict; -use warnings; -use parent qw(Email::Sender::Transport::Sendmail); +use parent qw(Email::Send::Sendmail); -use Email::Sender::Failure; +use Return::Value; +use Symbol qw(gensym); -sub send_email { - my ($self, $email, $envelope) = @_; +sub send { + my ($class, $message, @args) = @_; + my $mailer = $class->_find_sendmail; - my $pipe = $self->_sendmail_pipe($envelope); + return failure "Couldn't find 'sendmail' executable in your PATH" + ." and Email::Send::Sendmail::SENDMAIL is not set" + unless $mailer; - my $string = $email->as_string; - $string =~ s/\x0D\x0A/\x0A/g unless $^O eq 'MSWin32'; + return failure "Found $mailer but cannot execute it" + unless -x $mailer; + + local $SIG{'CHLD'} = 'DEFAULT'; - print $pipe $string - or Email::Sender::Failure->throw("couldn't send message to sendmail: $!"); + my $pipe = gensym; + open($pipe, "| $mailer -t -oi @args") + || return failure "Error executing $mailer: $!"; + print($pipe $message->as_string) + || return failure "Error printing via pipe to $mailer: $!"; unless (close $pipe) { - Email::Sender::Failure->throw("error when closing pipe to sendmail: $!") if $!; + return failure "error when closing pipe to $mailer: $!" if $!; my ($error_message, $is_transient) = _map_exitcode($? >> 8); if (Bugzilla->params->{'use_mailer_queue'}) { # Return success for errors which are fatal so Bugzilla knows to - # remove them from the queue. + # remove them from the queue if ($is_transient) { - Email::Sender::Failure->throw("error when closing pipe to sendmail: $error_message"); + return failure "error when closing pipe to $mailer: $error_message"; } else { - warn "error when closing pipe to sendmail: $error_message\n"; - return $self->success; + warn "error when closing pipe to $mailer: $error_message\n"; + return success; } } else { - Email::Sender::Failure->throw("error when closing pipe to sendmail: $error_message"); + return failure "error when closing pipe to $mailer: $error_message"; } } - return $self->success; + return success; } sub _map_exitcode { # Returns (error message, is_transient) - # from the sendmail source (sendmail/sysexits.h) + # from the sendmail source (sendmail/sysexit.h) my $code = shift; if ($code == 64) { return ("Command line usage error (EX_USAGE)", 1); @@ -90,6 +98,6 @@ sub _map_exitcode { =over -=item send_email +=item send =back diff --git a/mozilla/webtools/bugzilla/Bugzilla/Series.pm b/mozilla/webtools/bugzilla/Bugzilla/Series.pm index 22202c6f18d..6c11f5dbcfd 100644 --- a/mozilla/webtools/bugzilla/Bugzilla/Series.pm +++ b/mozilla/webtools/bugzilla/Bugzilla/Series.pm @@ -16,7 +16,6 @@ package Bugzilla::Series; use 5.10.1; use strict; -use warnings; use Bugzilla::Error; use Bugzilla::Util; diff --git a/mozilla/webtools/bugzilla/Bugzilla/Status.pm b/mozilla/webtools/bugzilla/Bugzilla/Status.pm index 27551021604..1f8862a36a0 100644 --- a/mozilla/webtools/bugzilla/Bugzilla/Status.pm +++ b/mozilla/webtools/bugzilla/Bugzilla/Status.pm @@ -9,7 +9,6 @@ package Bugzilla::Status; use 5.10.1; use strict; -use warnings; # This subclasses Bugzilla::Field::Choice instead of implementing # ChoiceInterface, because a bug status literally is a special type diff --git a/mozilla/webtools/bugzilla/Bugzilla/Template.pm b/mozilla/webtools/bugzilla/Bugzilla/Template.pm index 26ef3758596..8fe50fa4f8b 100644 --- a/mozilla/webtools/bugzilla/Bugzilla/Template.pm +++ b/mozilla/webtools/bugzilla/Bugzilla/Template.pm @@ -10,7 +10,6 @@ package Bugzilla::Template; use 5.10.1; use strict; -use warnings; use Bugzilla::Constants; use Bugzilla::WebService::Constants; @@ -148,11 +147,10 @@ sub get_format { # If you want to modify this routine, read the comments carefully sub quoteUrls { - my ($text, $bug, $comment, $user, $bug_link_func, $for_markdown) = @_; + my ($text, $bug, $comment, $user, $bug_link_func) = @_; return $text unless $text; $user ||= Bugzilla->user; $bug_link_func ||= \&get_bug_link; - $for_markdown ||= 0; # We use /g for speed, but uris can have other things inside them # (http://foo/bug#3 for example). Filtering that out filters valid @@ -223,11 +221,10 @@ sub quoteUrls { $text = html_quote($text); - unless ($for_markdown) { - # Color quoted text - $text =~ s~^(>.+)$~$1~mg; - $text =~ s~\n~\n~g; - } + # Color quoted text + $text =~ s~^(>.+)$~$1~mg; + $text =~ s~\n~\n~g; + # mailto: # Use | so that $1 is defined regardless # @ is the encoded '@' character. @@ -265,23 +262,28 @@ sub quoteUrls { my $bugs_re = qr/\Q$bugs_word\E$s*\#?$s* \d+(?:$s*,$s*\#?$s*\d+)+/ix; + while ($text =~ m/($bugs_re)/g) { + my $offset = $-[0]; + my $length = $+[0] - $-[0]; + my $match = $1; - $text =~ s{($bugs_re)}{ - my $match = $1; $match =~ s/((?:#$s*)?(\d+))/$bug_link_func->($2, $1);/eg; - $match; - }eg; + # Replace the old string with the linkified one. + substr($text, $offset, $length) = $match; + } my $comments_word = template_var('terms')->{comments}; my $comments_re = qr/(?:comments|\Q$comments_word\E)$s*\#?$s* \d+(?:$s*,$s*\#?$s*\d+)+/ix; + while ($text =~ m/($comments_re)/g) { + my $offset = $-[0]; + my $length = $+[0] - $-[0]; + my $match = $1; - $text =~ s{($comments_re)}{ - my $match = $1; $match =~ s|((?:#$s*)?(\d+))|$1|g; - $match; - }eg; + substr($text, $offset, $length) = $match; + } # Old duplicate markers. These don't use $bug_word because they are old # and were never customizable. @@ -532,7 +534,7 @@ sub _concatenate_css { write_file($file, $content); } - $file =~ s/^\Q$cgi_path\E\///o; + $file =~ s/^\Q$cgi_path\E\///; return mtime_filter($file); } @@ -541,61 +543,10 @@ sub _css_url_rewrite { # rewrite relative urls as the unified stylesheet lives in a different # directory from the source $url =~ s/(^['"]|['"]$)//g; - if (substr($url, 0, 1) eq '/' || substr($url, 0, 5) eq 'data:') { - return 'url(' . $url . ')'; - } + return $url if substr($url, 0, 1) eq '/'; return 'url(../../' . dirname($source) . '/' . $url . ')'; } -sub _concatenate_js { - return @_ unless CONCATENATE_ASSETS; - my ($sources) = @_; - return [] unless $sources; - $sources = ref($sources) ? $sources : [ $sources ]; - - my %files = - map { - (my $file = $_) =~ s/(^[^\?]+)\?.+/$1/; - $_ => $file; - } @$sources; - - my $cgi_path = bz_locations()->{cgi_path}; - my $skins_path = bz_locations()->{assetsdir}; - - # build minified files - my @minified; - foreach my $source (@$sources) { - next unless -e "$cgi_path/$files{$source}"; - my $file = $skins_path . '/' . md5_hex($source) . '.js'; - if (!-e $file) { - my $content = read_file("$cgi_path/$files{$source}"); - - # minimal minification - $content =~ s#/\*.*?\*/##sg; # block comments - $content =~ s#(^ +| +$)##gm; # leading/trailing spaces - $content =~ s#^//.+$##gm; # single line comments - $content =~ s#\n{2,}#\n#g; # blank lines - $content =~ s#(^\s+|\s+$)##g; # whitespace at the start/end of file - - write_file($file, ";/* $files{$source} */\n" . $content . "\n"); - } - push @minified, $file; - } - - # concat files - my $file = $skins_path . '/' . md5_hex(join(' ', @$sources)) . '.js'; - if (!-e $file) { - my $content = ''; - foreach my $source (@minified) { - $content .= read_file($source); - } - write_file($file, $content); - } - - $file =~ s/^\Q$cgi_path\E\///o; - return [ $file ]; -} - # YUI dependency resolution sub yui_resolve_deps { my ($yui, $yui_deps) = @_; @@ -660,21 +611,6 @@ $Template::Stash::LIST_OPS->{ clone } = return [@$list]; }; -# Allow us to sort the list of fields correctly -$Template::Stash::LIST_OPS->{ sort_by_field_name } = - sub { - sub field_name { - if ($_[0] eq 'noop') { - # Sort --- first - return ''; - } - # Otherwise sort by field_desc or description - return $_[1]{$_[0]} || $_[0]; - } - my ($list, $field_desc) = @_; - return [ sort { lc field_name($a, $field_desc) cmp lc field_name($b, $field_desc) } @$list ]; - }; - # Allow us to still get the scalar if we use the list operation ".0" on it, # as we often do for defaults in query.cgi and other places. $Template::Stash::SCALAR_OPS->{ 0 } = @@ -860,24 +796,6 @@ sub create { 1 ], - markdown => [ sub { - my ($context, $bug, $comment, $user) = @_; - return sub { - my $text = shift; - return unless $text; - - if (Bugzilla->feature('markdown') - && ((ref($comment) eq 'HASH' && $comment->{is_markdown}) - || (ref($comment) eq 'Bugzilla::Comment' && $comment->is_markdown))) - { - return Bugzilla->markdown->markdown($text); - } - return quoteUrls($text, $bug, $comment, $user); - }; - }, - 1 - ], - bug_link => [ sub { my ($context, $bug, $options) = @_; return sub { @@ -894,12 +812,10 @@ sub create { }, # In CSV, quotes are doubled, and any value containing a quote or a - # comma is enclosed in quotes. If a field starts with an equals - # sign, it is proceed by a space. + # comma is enclosed in quotes. csv => sub { my ($var) = @_; - $var = ' ' . $var if substr($var, 0, 1) eq '='; $var =~ s/\"/\"\"/g; if ($var !~ /^-?(\d+\.)?\d*$/) { $var = "\"$var\""; @@ -1085,12 +1001,6 @@ sub create { return $cookie ? issue_hash_token(['login_request', $cookie]) : ''; }, - 'get_api_token' => sub { - return '' unless Bugzilla->user->id; - my $cache = Bugzilla->request_cache; - return $cache->{api_token} //= issue_api_token(); - }, - # A way for all templates to get at Field data, cached. 'bug_fields' => sub { my $cache = Bugzilla->request_cache; @@ -1109,7 +1019,6 @@ sub create { 'css_files' => \&css_files, yui_resolve_deps => \&yui_resolve_deps, - concatenate_js => \&_concatenate_js, # All classifications (sorted by sortkey, name) 'all_classifications' => sub { diff --git a/mozilla/webtools/bugzilla/Bugzilla/Template/Context.pm b/mozilla/webtools/bugzilla/Bugzilla/Template/Context.pm index 470e6a9ee1f..1e75d1d6f1a 100644 --- a/mozilla/webtools/bugzilla/Bugzilla/Template/Context.pm +++ b/mozilla/webtools/bugzilla/Bugzilla/Template/Context.pm @@ -10,7 +10,6 @@ package Bugzilla::Template::Context; use 5.10.1; use strict; -use warnings; use parent qw(Template::Context); diff --git a/mozilla/webtools/bugzilla/Bugzilla/Template/Plugin/Bugzilla.pm b/mozilla/webtools/bugzilla/Bugzilla/Template/Plugin/Bugzilla.pm index 806dd903b68..f0de2ed4d18 100644 --- a/mozilla/webtools/bugzilla/Bugzilla/Template/Plugin/Bugzilla.pm +++ b/mozilla/webtools/bugzilla/Bugzilla/Template/Plugin/Bugzilla.pm @@ -9,7 +9,6 @@ package Bugzilla::Template::Plugin::Bugzilla; use 5.10.1; use strict; -use warnings; use parent qw(Template::Plugin); diff --git a/mozilla/webtools/bugzilla/Bugzilla/Template/Plugin/Hook.pm b/mozilla/webtools/bugzilla/Bugzilla/Template/Plugin/Hook.pm index 669c77614ce..19260f0057f 100644 --- a/mozilla/webtools/bugzilla/Bugzilla/Template/Plugin/Hook.pm +++ b/mozilla/webtools/bugzilla/Bugzilla/Template/Plugin/Hook.pm @@ -9,7 +9,6 @@ package Bugzilla::Template::Plugin::Hook; use 5.10.1; use strict; -use warnings; use parent qw(Template::Plugin); diff --git a/mozilla/webtools/bugzilla/Bugzilla/Token.pm b/mozilla/webtools/bugzilla/Bugzilla/Token.pm index 24ffad3c34a..5352638682b 100644 --- a/mozilla/webtools/bugzilla/Bugzilla/Token.pm +++ b/mozilla/webtools/bugzilla/Bugzilla/Token.pm @@ -9,7 +9,6 @@ package Bugzilla::Token; use 5.10.1; use strict; -use warnings; use Bugzilla::Constants; use Bugzilla::Error; @@ -24,28 +23,13 @@ use Digest::SHA qw(hmac_sha256_base64); use parent qw(Exporter); -@Bugzilla::Token::EXPORT = qw(issue_api_token issue_session_token - check_token_data delete_token +@Bugzilla::Token::EXPORT = qw(issue_session_token check_token_data delete_token issue_hash_token check_hash_token); ################################################################################ # Public Functions ################################################################################ -# Create a token used for internal API authentication -sub issue_api_token { - # Generates a random token, adds it to the tokens table if one does not - # already exist, and returns the token to the caller. - my $dbh = Bugzilla->dbh; - my $user = Bugzilla->user; - my ($token) = $dbh->selectrow_array(" - SELECT token FROM tokens - WHERE userid = ? AND tokentype = 'api_token' - AND (" . $dbh->sql_date_math('issuedate', '+', (MAX_TOKEN_AGE * 24 - 12), 'HOUR') . ") > NOW()", - undef, $user->id); - return $token // _create_token($user->id, 'api_token', ''); -} - # Creates and sends a token to create a new user account. # It assumes that the login has the correct format and is not already in use. sub issue_new_user_account_token { @@ -482,14 +466,6 @@ Bugzilla::Token - Provides different routines to manage tokens. =over -=item C - - Description: Creates a token that can be used for API calls on the web page. - - Params: None. - - Returns: The token. - =item C Description: Creates and sends a token per email to the email address diff --git a/mozilla/webtools/bugzilla/Bugzilla/Update.pm b/mozilla/webtools/bugzilla/Bugzilla/Update.pm index 72a7108a8e3..6a101219956 100644 --- a/mozilla/webtools/bugzilla/Bugzilla/Update.pm +++ b/mozilla/webtools/bugzilla/Bugzilla/Update.pm @@ -9,7 +9,6 @@ package Bugzilla::Update; use 5.10.1; use strict; -use warnings; use Bugzilla::Constants; diff --git a/mozilla/webtools/bugzilla/Bugzilla/User.pm b/mozilla/webtools/bugzilla/Bugzilla/User.pm index fa267436618..3efe02633f9 100644 --- a/mozilla/webtools/bugzilla/Bugzilla/User.pm +++ b/mozilla/webtools/bugzilla/Bugzilla/User.pm @@ -9,7 +9,6 @@ package Bugzilla::User; use 5.10.1; use strict; -use warnings; use Bugzilla::Error; use Bugzilla::Util; @@ -32,7 +31,7 @@ use URI::QueryParam; use parent qw(Bugzilla::Object Exporter); @Bugzilla::User::EXPORT = qw(is_available_username - login_to_id validate_password validate_password_check + login_to_id validate_password USER_MATCH_MULTIPLE USER_MATCH_FAILED USER_MATCH_SUCCESS MATCH_SKIP_CONFIRM ); @@ -632,14 +631,6 @@ sub is_bug_ignored { return (grep {$_->{'id'} == $bug_id} @{$self->bugs_ignored}) ? 1 : 0; } -sub use_markdown { - my ($self, $comment) = @_; - return Bugzilla->feature('markdown') - && $self->settings->{use_markdown}->{is_enabled} - && $self->settings->{use_markdown}->{value} eq 'on' - && (!defined $comment || $comment->is_markdown); -} - ########################## # Saved Recent Bug Lists # ########################## @@ -2457,35 +2448,29 @@ sub login_to_id { } sub validate_password { - my $check = validate_password_check(@_); - ThrowUserError($check) if $check; - return 1; -} - -sub validate_password_check { my ($password, $matchpassword) = @_; if (length($password) < USER_PASSWORD_MIN_LENGTH) { - return 'password_too_short'; + ThrowUserError('password_too_short'); } elsif ((defined $matchpassword) && ($password ne $matchpassword)) { - return 'passwords_dont_match'; + ThrowUserError('passwords_dont_match'); } - + my $complexity_level = Bugzilla->params->{password_complexity}; if ($complexity_level eq 'letters_numbers_specialchars') { - return 'password_not_complex' + ThrowUserError('password_not_complex') if ($password !~ /[[:alpha:]]/ || $password !~ /\d/ || $password !~ /[[:punct:]]/); } elsif ($complexity_level eq 'letters_numbers') { - return 'password_not_complex' + ThrowUserError('password_not_complex') if ($password !~ /[[:lower:]]/ || $password !~ /[[:upper:]]/ || $password !~ /\d/); } elsif ($complexity_level eq 'mixed_letters') { - return 'password_not_complex' + ThrowUserError('password_not_complex') if ($password !~ /[[:lower:]]/ || $password !~ /[[:upper:]]/); } # Having done these checks makes us consider the password untainted. trick_taint($_[0]); - return; + return 1; } @@ -2631,12 +2616,6 @@ C The current summary of the bug. Returns true if the user does not want email notifications for the specified bug ID, else returns false. -=item C - -Returns true if the user has set their preferences to use Markdown -for rendering comments. If an optional C object is passed -then it returns true if the comment has markdown enabled. - =back =head2 Saved Recent Bug Lists @@ -3162,23 +3141,12 @@ if you need more information about the user than just their ID. =item C Returns true if a password is valid (i.e. meets Bugzilla's -requirements for length and content), else throws an error. +requirements for length and content), else returns false. Untaints C<$passwd1> if successful. If a second password is passed in, this function also verifies that the two passwords match. -=item C - -This sub routine is similair to C, except that it allows -the calling code to handle its own errors. - -Returns undef and untaints C<$passwd1> if a password is valid (i.e. meets -Bugzilla's requirements for length and content), else returns the error. - -If a second password is passed in, this function also verifies that -the two passwords match. - =item C =over diff --git a/mozilla/webtools/bugzilla/Bugzilla/User/APIKey.pm b/mozilla/webtools/bugzilla/Bugzilla/User/APIKey.pm deleted file mode 100644 index d268a0a93c4..00000000000 --- a/mozilla/webtools/bugzilla/Bugzilla/User/APIKey.pm +++ /dev/null @@ -1,155 +0,0 @@ -# This Source Code Form is subject to the terms of the Mozilla Public -# License, v. 2.0. If a copy of the MPL was not distributed with this -# file, You can obtain one at http://mozilla.org/MPL/2.0/. -# -# This Source Code Form is "Incompatible With Secondary Licenses", as -# defined by the Mozilla Public License, v. 2.0. - -package Bugzilla::User::APIKey; - -use 5.10.1; -use strict; -use warnings; - -use parent qw(Bugzilla::Object); - -use Bugzilla::User; -use Bugzilla::Util qw(generate_random_password trim); - -##################################################################### -# Overriden Constants that are used as methods -##################################################################### - -use constant DB_TABLE => 'user_api_keys'; -use constant DB_COLUMNS => qw( - id - user_id - api_key - description - revoked - last_used -); - -use constant UPDATE_COLUMNS => qw(description revoked last_used); -use constant VALIDATORS => { - api_key => \&_check_api_key, - description => \&_check_description, - revoked => \&Bugzilla::Object::check_boolean, -}; -use constant LIST_ORDER => 'id'; -use constant NAME_FIELD => 'api_key'; - -# turn off auditing and exclude these objects from memcached -use constant { AUDIT_CREATES => 0, - AUDIT_UPDATES => 0, - AUDIT_REMOVES => 0, - USE_MEMCACHED => 0 }; - -# Accessors -sub id { return $_[0]->{id} } -sub user_id { return $_[0]->{user_id} } -sub api_key { return $_[0]->{api_key} } -sub description { return $_[0]->{description} } -sub revoked { return $_[0]->{revoked} } -sub last_used { return $_[0]->{last_used} } - -# Helpers -sub user { - my $self = shift; - $self->{user} //= Bugzilla::User->new({name => $self->user_id, cache => 1}); - return $self->{user}; -} - -sub update_last_used { - my $self = shift; - my $timestamp = shift - || Bugzilla->dbh->selectrow_array('SELECT LOCALTIMESTAMP(0)'); - $self->set('last_used', $timestamp); - $self->update; -} - -# Setters -sub set_description { $_[0]->set('description', $_[1]); } -sub set_revoked { $_[0]->set('revoked', $_[1]); } - -# Validators -sub _check_api_key { return generate_random_password(40); } -sub _check_description { return trim($_[1]) || ''; } -1; - -__END__ - -=head1 NAME - -Bugzilla::User::APIKey - Model for an api key belonging to a user. - -=head1 SYNOPSIS - - use Bugzilla::User::APIKey; - - my $api_key = Bugzilla::User::APIKey->new($id); - my $api_key = Bugzilla::User::APIKey->new({ name => $api_key }); - - # Class Functions - $user_api_key = Bugzilla::User::APIKey->create({ - description => $description, - }); - -=head1 DESCRIPTION - -This package handles Bugzilla User::APIKey. - -C is an implementation of L, and -thus provides all the methods of L in addition to the methods -listed below. - -=head1 METHODS - -=head2 Accessor Methods - -=over - -=item C - -The internal id of the api key. - -=item C - -The Bugzilla::User object that this api key belongs to. - -=item C - -The user id that this api key belongs to. - -=item C - -The API key, which is a random string. - -=item C - -An optional string that lets the user describe what a key is used for. -For example: "Dashboard key", "Application X key". - -=item C - -If true, this api key cannot be used. - -=item C - -The date that this key was last used. undef if never used. - -=item C - -Updates the last used value to the current timestamp. This is updated even -if the RPC call resulted in an error. It is not updated when the description -or the revoked flag is changed. - -=item C - -Sets the new description - -=item C - -Sets the revoked flag - -=back diff --git a/mozilla/webtools/bugzilla/Bugzilla/User/Setting.pm b/mozilla/webtools/bugzilla/Bugzilla/User/Setting.pm index ea3bbfb5423..451e946f774 100644 --- a/mozilla/webtools/bugzilla/Bugzilla/User/Setting.pm +++ b/mozilla/webtools/bugzilla/Bugzilla/User/Setting.pm @@ -10,18 +10,13 @@ package Bugzilla::User::Setting; use 5.10.1; use strict; -use warnings; use parent qw(Exporter); # Module stuff -@Bugzilla::User::Setting::EXPORT = qw( - get_all_settings - get_defaults - add_setting - clear_settings_cache -); +@Bugzilla::User::Setting::EXPORT = qw(get_all_settings get_defaults + add_setting); use Bugzilla::Error; use Bugzilla::Util qw(trick_taint get_text); @@ -164,20 +159,15 @@ sub get_all_settings { my $settings = {}; my $dbh = Bugzilla->dbh; - my $cache_key = "user_settings.$user_id"; - my $rows = Bugzilla->memcached->get_config({ key => $cache_key }); - if (!$rows) { - $rows = $dbh->selectall_arrayref( - q{SELECT name, default_value, is_enabled, setting_value, subclass - FROM setting - LEFT JOIN profile_setting - ON setting.name = profile_setting.setting_name - AND profile_setting.user_id = ?}, undef, ($user_id)); - Bugzilla->memcached->set_config({ key => $cache_key, data => $rows }); - } + my $rows = $dbh->selectall_arrayref( + q{SELECT name, default_value, is_enabled, setting_value, subclass + FROM setting + LEFT JOIN profile_setting + ON setting.name = profile_setting.setting_name + AND profile_setting.user_id = ?}, undef, ($user_id)); foreach my $row (@$rows) { - my ($name, $default_value, $is_enabled, $value, $subclass) = @$row; + my ($name, $default_value, $is_enabled, $value, $subclass) = @$row; my $is_default; @@ -189,18 +179,13 @@ sub get_all_settings { } $settings->{$name} = new Bugzilla::User::Setting( - $name, $user_id, $is_enabled, + $name, $user_id, $is_enabled, $default_value, $value, $is_default, $subclass); } return $settings; } -sub clear_settings_cache { - my ($user_id) = @_; - Bugzilla->memcached->clear_config({ key => "user_settings.$user_id" }); -} - sub get_defaults { my ($user_id) = @_; my $dbh = Bugzilla->dbh; @@ -383,13 +368,6 @@ Params: C<$setting_name> - string - the name of the setting C<$is_enabled> - boolean - if false, all users must use the global default Returns: nothing -=item C - -Description: Clears cached settings data for the specified user. Must be - called after updating any user's setting. -Params: C<$user_id> - integer - the user id. -Returns: nothing - =begin private =item C<_setting_exists> diff --git a/mozilla/webtools/bugzilla/Bugzilla/User/Setting/Lang.pm b/mozilla/webtools/bugzilla/Bugzilla/User/Setting/Lang.pm index d980b7a92e0..4465185e3ff 100644 --- a/mozilla/webtools/bugzilla/Bugzilla/User/Setting/Lang.pm +++ b/mozilla/webtools/bugzilla/Bugzilla/User/Setting/Lang.pm @@ -9,7 +9,6 @@ package Bugzilla::User::Setting::Lang; use 5.10.1; use strict; -use warnings; use parent qw(Bugzilla::User::Setting); diff --git a/mozilla/webtools/bugzilla/Bugzilla/User/Setting/Skin.pm b/mozilla/webtools/bugzilla/Bugzilla/User/Setting/Skin.pm index 7b0688c0c83..1e4e95a03e3 100644 --- a/mozilla/webtools/bugzilla/Bugzilla/User/Setting/Skin.pm +++ b/mozilla/webtools/bugzilla/Bugzilla/User/Setting/Skin.pm @@ -10,7 +10,6 @@ package Bugzilla::User::Setting::Skin; use 5.10.1; use strict; -use warnings; use parent qw(Bugzilla::User::Setting); diff --git a/mozilla/webtools/bugzilla/Bugzilla/User/Setting/Timezone.pm b/mozilla/webtools/bugzilla/Bugzilla/User/Setting/Timezone.pm index 8959d1ddace..848fa418f8b 100644 --- a/mozilla/webtools/bugzilla/Bugzilla/User/Setting/Timezone.pm +++ b/mozilla/webtools/bugzilla/Bugzilla/User/Setting/Timezone.pm @@ -9,7 +9,6 @@ package Bugzilla::User::Setting::Timezone; use 5.10.1; use strict; -use warnings; use DateTime::TimeZone; diff --git a/mozilla/webtools/bugzilla/Bugzilla/UserAgent.pm b/mozilla/webtools/bugzilla/Bugzilla/UserAgent.pm index 6ceb9d3c5ce..4e685cacc75 100644 --- a/mozilla/webtools/bugzilla/Bugzilla/UserAgent.pm +++ b/mozilla/webtools/bugzilla/Bugzilla/UserAgent.pm @@ -9,7 +9,6 @@ package Bugzilla::UserAgent; use 5.10.1; use strict; -use warnings; use parent qw(Exporter); our @EXPORT = qw(detect_platform detect_op_sys); @@ -106,7 +105,6 @@ use constant OS_MAP => ( qr/\(.*Android.*\)/ => ["Android"], # Windows qr/\(.*Windows XP.*\)/ => ["Windows XP"], - qr/\(.*Windows NT 6\.4.*\)/ => ["Windows 10"], qr/\(.*Windows NT 6\.3.*\)/ => ["Windows 8.1"], qr/\(.*Windows NT 6\.2.*\)/ => ["Windows 8"], qr/\(.*Windows NT 6\.1.*\)/ => ["Windows 7"], diff --git a/mozilla/webtools/bugzilla/Bugzilla/Util.pm b/mozilla/webtools/bugzilla/Bugzilla/Util.pm index 670f5f8f28b..4f0711b7e0c 100644 --- a/mozilla/webtools/bugzilla/Bugzilla/Util.pm +++ b/mozilla/webtools/bugzilla/Bugzilla/Util.pm @@ -9,7 +9,6 @@ package Bugzilla::Util; use 5.10.1; use strict; -use warnings; use parent qw(Exporter); @Bugzilla::Util::EXPORT = qw(trick_taint detaint_natural detaint_signed @@ -552,14 +551,9 @@ sub datetime_from { # In the database, this is the "0" date. return undef if $date =~ /^0000/; - my @time; - # Most dates will be in this format, avoid strptime's generic parser - if ($date =~ /^(\d{4})[\.-](\d{2})[\.-](\d{2})(?: (\d{2}):(\d{2}):(\d{2}))?$/) { - @time = ($6, $5, $4, $3, $2 - 1, $1 - 1900, undef); - } - else { - @time = strptime($date); - } + # strptime($date) returns an empty array if $date has an invalid + # date format. + my @time = strptime($date); unless (scalar @time) { # If an unknown timezone is passed (such as MSK, for Moskow), @@ -571,14 +565,10 @@ sub datetime_from { return undef if !@time; - # strptime() counts years from 1900, except if they are older than 1901 - # in which case it returns the full year (so 1890 -> 1890, but 1984 -> 84, - # and 3790 -> 1890). We make a guess and assume that 1100 <= year < 3000. - $time[5] += 1900 if $time[5] < 1100; - + # strptime() counts years from 1900, and months from 0 (January). + # We have to fix both values. my %args = ( - year => $time[5], - # Months start from 0 (January). + year => $time[5] + 1900, month => $time[4] + 1, day => $time[3], hour => $time[2], diff --git a/mozilla/webtools/bugzilla/Bugzilla/Version.pm b/mozilla/webtools/bugzilla/Bugzilla/Version.pm index 4b332ff2bc9..c6b178a8ab9 100644 --- a/mozilla/webtools/bugzilla/Bugzilla/Version.pm +++ b/mozilla/webtools/bugzilla/Bugzilla/Version.pm @@ -9,7 +9,6 @@ package Bugzilla::Version; use 5.10.1; use strict; -use warnings; use parent qw(Bugzilla::Object Exporter); diff --git a/mozilla/webtools/bugzilla/Bugzilla/WebService.pm b/mozilla/webtools/bugzilla/Bugzilla/WebService.pm index 1bdeb49d1f6..1dc04c1f6c9 100644 --- a/mozilla/webtools/bugzilla/Bugzilla/WebService.pm +++ b/mozilla/webtools/bugzilla/Bugzilla/WebService.pm @@ -11,7 +11,6 @@ package Bugzilla::WebService; use 5.10.1; use strict; -use warnings; use Bugzilla::WebService::Server; @@ -135,22 +134,14 @@ how this is implemented for those frontends. =head1 LOGGING IN -Some methods do not require you to log in. An example of this is Bug.get. -However, authenticating yourself allows you to see non public information. For -example, a bug that is not publicly visible. - -There are two ways to authenticate yourself: +There are various ways to log in: =over -=item C +=item C -B - -You can specify C as an argument to any WebService method, and -you will be logged in as that user if the key is correct, and has not been -revoked. You can set up an API key by using the 'API Key' tab in the -Preferences pages. +You can use L to log in as a Bugzilla +user. This issues a token that you must then use in future calls. =item C and C @@ -173,29 +164,15 @@ then your login will only be valid for your IP address. =back The C option is only used when you have also -specified C and C. This value will be -deprecated in the release after Bugzilla 5.0 and you will be required to -pass the Bugzilla_login and Bugzilla_password for every call. +specified C and C. For REST, you may also use the C and C variable names instead of C and C as a convenience. You may also use C instead of C. -=back - -There are also two deprecreated methods of authentications. This will be -removed in the version after Bugzilla 5.0. - -=over - -=item C - -You can use L to log in as a Bugzilla -user. This issues a token that you must then use in future calls. - =item C -B +B You can specify C as argument to any WebService method, and you will be logged in as that user if the token is correct. This is @@ -315,7 +292,7 @@ hashes. Some RPC calls support specifying sub fields. If an RPC call states that it support sub field restrictions, you can restrict what information is -returned within the first field. For example, if you call Product.get +returned within the first field. For example, if you call Products.get with an include_fields of components.name, then only the component name would be returned (and nothing else). You can include the main field, and exclude a sub field. @@ -390,8 +367,6 @@ objects. =item L -=item L - =item L =item L diff --git a/mozilla/webtools/bugzilla/Bugzilla/WebService/Bug.pm b/mozilla/webtools/bugzilla/Bugzilla/WebService/Bug.pm index de358b1e027..0346511a943 100644 --- a/mozilla/webtools/bugzilla/Bugzilla/WebService/Bug.pm +++ b/mozilla/webtools/bugzilla/Bugzilla/WebService/Bug.pm @@ -9,7 +9,6 @@ package Bugzilla::WebService::Bug; use 5.10.1; use strict; -use warnings; use parent qw(Bugzilla::WebService); @@ -331,9 +330,7 @@ sub render_comment { Bugzilla->switch_to_shadow_db(); my $bug = $params->{id} ? Bugzilla::Bug->check($params->{id}) : undef; - my $markdown = $params->{markdown} ? 1 : 0; - my $tmpl = $markdown ? '[% text FILTER markdown(bug, { is_markdown => 1 }) %]' : '[% text FILTER markdown(bug) %]'; - + my $tmpl = '[% text FILTER quoteUrls(bug) %]'; my $html; my $template = Bugzilla->template; $template->process( @@ -352,16 +349,15 @@ sub _translate_comment { : undef; my $comment_hash = { - id => $self->type('int', $comment->id), - bug_id => $self->type('int', $comment->bug_id), - creator => $self->type('email', $comment->author->login), - time => $self->type('dateTime', $comment->creation_ts), + id => $self->type('int', $comment->id), + bug_id => $self->type('int', $comment->bug_id), + creator => $self->type('email', $comment->author->login), + time => $self->type('dateTime', $comment->creation_ts), creation_time => $self->type('dateTime', $comment->creation_ts), - is_private => $self->type('boolean', $comment->is_private), - is_markdown => $self->type('boolean', $comment->is_markdown), - text => $self->type('string', $comment->body_full), + is_private => $self->type('boolean', $comment->is_private), + text => $self->type('string', $comment->body_full), attachment_id => $self->type('int', $attach_id), - count => $self->type('int', $comment->count), + count => $self->type('int', $comment->count), }; # Don't load comment tags unless enabled @@ -471,7 +467,7 @@ sub history { # alias is returned in case users passes a mixture of ids and aliases # then they get to know which bug activity relates to which value # they passed - $item{alias} = [ map { $self->type('string', $_) } @{ $bug->alias } ]; + $item{alias} = $self->type('string', $bug->alias); push(@return, \%item); } @@ -635,16 +631,6 @@ sub update { # called using those field names. delete $values{dependencies}; - # For backwards compatibility, treat alias string or array as a set action - if (exists $values{alias}) { - if (not ref $values{alias}) { - $values{alias} = { set => [ $values{alias} ] }; - } - elsif (ref $values{alias} eq 'ARRAY') { - $values{alias} = { set => $values{alias} }; - } - } - my $flags = delete $values{flags}; foreach my $bug (@bugs) { @@ -682,7 +668,7 @@ sub update { # alias is returned in case users pass a mixture of ids and aliases, # so that they can know which set of changes relates to which value # they passed. - $hash{alias} = [ map { $self->type('string', $_) } @{ $bug->alias } ]; + $hash{alias} = $self->type('string', $bug->alias); my %changes = %{ $all_changes{$bug->id} }; foreach my $field (keys %changes) { @@ -825,21 +811,10 @@ sub add_attachment { $attachment->update($timestamp); my $comment = $params->{comment} || ''; - - my $is_markdown = 0; - if (ref $params->{comment} eq 'HASH') { - $is_markdown = $params->{comment}->{is_markdown}; - $comment = $params->{comment}->{body}; - } - - ThrowUserError('markdown_disabled') - if $is_markdown && !Bugzilla->user->use_markdown(); - - $attachment->bug->add_comment($comment, - { is_markdown => $is_markdown, - isprivate => $attachment->isprivate, - type => CMT_ATTACHMENT_CREATED, - extra_data => $attachment->id }); + $attachment->bug->add_comment($comment, + { isprivate => $attachment->isprivate, + type => CMT_ATTACHMENT_CREATED, + extra_data => $attachment->id }); push(@created, $attachment); } $_->bug->update($timestamp) foreach @created; @@ -885,15 +860,6 @@ sub update_attachment { my $flags = delete $params->{flags}; my $comment = delete $params->{comment}; - my $is_markdown = 0; - - if (ref $comment eq 'HASH') { - $is_markdown = $comment->{is_markdown}; - $comment = $comment->{body}; - } - - ThrowUserError('markdown_disabled') - if $is_markdown && !$user->use_markdown(); # Update the values foreach my $attachment (@attachments) { @@ -913,10 +879,9 @@ sub update_attachment { if ($comment = trim($comment)) { $attachment->bug->add_comment($comment, - { is_markdown => $is_markdown, - isprivate => $attachment->isprivate, - type => CMT_ATTACHMENT_UPDATED, - extra_data => $attachment->id }); + { isprivate => $attachment->isprivate, + type => CMT_ATTACHMENT_UPDATED, + extra_data => $attachment->id }); } $changes = translate($changes, ATTACHMENT_MAPPED_RETURNS); @@ -973,14 +938,9 @@ sub add_comment { if (defined $params->{private}) { $params->{is_private} = delete $params->{private}; } - - ThrowUserError('markdown_disabled') - if $params->{is_markdown} && !$user->use_markdown(); - # Append comment - $bug->add_comment($comment, { isprivate => $params->{is_private}, - is_markdown => $params->{is_markdown}, - work_time => $params->{work_time} }); + $bug->add_comment($comment, { isprivate => $params->{is_private}, + work_time => $params->{work_time} }); # Capture the call to bug->update (which creates the new comment) in # a transaction so we're sure to get the correct comment_id. @@ -1175,11 +1135,7 @@ sub search_comment_tags { my $query = $params->{query}; $query // ThrowCodeError('param_required', { param => 'query' }); - my $limit = $params->{limit} || 7; - detaint_natural($limit) - || ThrowCodeError('param_must_be_numeric', { param => 'limit', - function => 'Bug.search_comment_tags' }); - + my $limit = detaint_natural($params->{limit}) || 7; my $tags = Bugzilla::Comment::TagWeights->match({ WHERE => { @@ -1206,11 +1162,14 @@ sub _bug_to_hash { # A bug attribute is "basic" if it doesn't require an additional # database call to get the info. my %item = %{ filter $params, { + alias => $self->type('string', $bug->alias), + creation_time => $self->type('dateTime', $bug->creation_ts), # No need to format $bug->deadline specially, because Bugzilla::Bug # already does it for us. deadline => $self->type('string', $bug->deadline), id => $self->type('int', $bug->bug_id), is_confirmed => $self->type('boolean', $bug->everconfirmed), + last_change_time => $self->type('dateTime', $bug->delta_ts), op_sys => $self->type('string', $bug->op_sys), platform => $self->type('string', $bug->rep_platform), priority => $self->type('string', $bug->priority), @@ -1224,11 +1183,9 @@ sub _bug_to_hash { whiteboard => $self->type('string', $bug->status_whiteboard), } }; - # First we handle any fields that require extra work (such as date parsing - # or SQL calls). - if (filter_wants $params, 'alias') { - $item{alias} = [ map { $self->type('string', $_) } @{ $bug->alias } ]; - } + # First we handle any fields that require extra SQL calls. + # We don't do the SQL calls at all if the filter would just + # eliminate them anyway. if (filter_wants $params, 'assigned_to') { $item{'assigned_to'} = $self->type('email', $bug->assigned_to->login); $item{'assigned_to_detail'} = $self->_user_to_hash($bug->assigned_to, $params, undef, 'assigned_to'); @@ -1248,9 +1205,6 @@ sub _bug_to_hash { $item{'cc'} = \@cc; $item{'cc_detail'} = [ map { $self->_user_to_hash($_, $params, undef, 'cc') } @{ $bug->cc_users } ]; } - if (filter_wants $params, 'creation_time') { - $item{'creation_time'} = $self->type('dateTime', $bug->creation_ts); - } if (filter_wants $params, 'creator') { $item{'creator'} = $self->type('email', $bug->reporter->login); $item{'creator_detail'} = $self->_user_to_hash($bug->reporter, $params, undef, 'creator'); @@ -1275,9 +1229,6 @@ sub _bug_to_hash { @{ $bug->keyword_objects }; $item{'keywords'} = \@keywords; } - if (filter_wants $params, 'last_change_time') { - $item{'last_change_time'} = $self->type('dateTime', $bug->delta_ts); - } if (filter_wants $params, 'product') { $item{product} = $self->type('string', $bug->product); } @@ -1531,12 +1482,6 @@ C The number of the fieldtype. The following values are defined: =item C<7> Bug URLs ("See Also") -=item C<8> Keywords - -=item C<9> Date - -=item C<10> Integer value - =back =item C @@ -2105,10 +2050,6 @@ may be deprecated and removed in a future release. C True if this comment is private (only visible to a certain group called the "insidergroup"), False otherwise. -=item is_markdown - -C True if this comment needs Markdown processing, false otherwise. - =back =item B @@ -2226,8 +2167,7 @@ in the return value. =item C -C of Cs The unique aliases of this bug. An empty array will be -returned if this bug has no aliases. +C The unique alias of this bug. =item C @@ -2672,8 +2612,7 @@ C The numeric id of the bug. =item alias -C of Cs The unique aliases of this bug. An empty array will be -returned if this bug has no aliases. +C The alias of this bug. If there is no alias, this will be undef. =item history @@ -2856,8 +2795,7 @@ just reuse the query parameter portion in the REST call itself. =item C -C of Cs The unique aliases of this bug. An empty array will be -returned if this bug has no aliases. +C The unique alias for this bug. =item C @@ -3114,7 +3052,7 @@ in by the developer, compared to the developer's other bugs. =item C (string) B - How severe the bug is. -=item C (array) - A brief alias for the bug that can be used +=item C (string) - A brief alias for the bug that can be used instead of a bug number when accessing this bug. Must be unique in all of this Bugzilla. @@ -3126,9 +3064,6 @@ don't want it to be assigned to the component owner. =item C (boolean) - If set to true, the description is private, otherwise it is assumed to be public. -=item C (boolean) - If set to true, the description -has Markdown structures, otherwise it is a normal text. - =item C (array) - An array of group names to put this bug into. You can see valid group names on the Permissions tab of the Preferences screen, or, if you are an administrator, @@ -3284,8 +3219,6 @@ Bugzilla B<4.4>. =item REST API call added in Bugzilla B<5.0>. -=item C option added in Bugzilla B<5.0>. - =back =back @@ -3345,21 +3278,7 @@ C or C. =item C -C or hash. A comment to add along with this attachment. If C -is a hash, it has the following keys: - -=over - -=item C - -C The body of the comment. - -=item C - -C If set to true, the comment has Markdown structures; otherwise, it -is an ordinary text. - -=back +C A comment to add along with this attachment. =item C @@ -3437,10 +3356,6 @@ the type id value to update or add a flag. The flag type is inactive and cannot be used to create new flags. -=item 140 (Markdown Disabled) - -You tried to set the C flag of the comment to true but the Markdown feature is not enabled. - =item 600 (Attachment Too Large) You tried to attach a file that was larger than Bugzilla will accept. @@ -3476,8 +3391,6 @@ You set the "data" field to an empty string. =item REST API call added in Bugzilla B<5.0>. -=item C added in Bugzilla B<5.0>. - =back =back @@ -3524,21 +3437,7 @@ attachment. =item C -C or hash: An optional comment to add to the attachment's bug. If C is -a hash, it has the following keys: - -=over - -=item C - -C The body of the comment to be added. - -=item C - -C If set to true, the comment has Markdown structures; otherwise it is a normal -text. - -=back +C An optional comment to add to the attachment's bug. =item C @@ -3687,11 +3586,6 @@ the type id value to update or add a flag. The flag type is inactive and cannot be used to create new flags. -=item 140 (Markdown Disabled) - -You tried to set the C flag of the C to true but Markdown feature is -not enabled. - =item 601 (Invalid MIME Type) You specified a C argument that was blank, not a valid @@ -3752,9 +3646,6 @@ you did not set the C parameter. =item C (boolean) - If set to true, the comment is private, otherwise it is assumed to be public. -=item C (boolean) - If set to true, the comment has Markdown -structures, otherwise it is a normal text. - =item C (double) - Adds this many hours to the "Hours Worked" on the bug. If you are not in the time tracking group, this value will be ignored. @@ -3796,11 +3687,6 @@ You tried to add a private comment, but don't have the necessary rights. You tried to add a comment longer than the maximum allowed length (65,535 characters). -=item 140 (Markdown Disabled) - -You tried to set the C flag to true but the Markdown feature -is not enabled. - =back =item B @@ -3823,8 +3709,6 @@ code of 32000. =item REST API call added in Bugzilla B<5.0>. -=item C option added in Bugzilla B<5.0>. - =back =back @@ -3869,29 +3753,9 @@ bugs you are updating. =item C -C These specify the aliases of a bug that can be used instead of a bug -number when acessing this bug. To set these, you should pass a hash as the -value. The hash may contain the following fields: - -=over - -=item C An array of Cs. Aliases to add to this field. - -=item C An array of Cs. Aliases to remove from this field. -If the aliases are not already in the field, they will be ignored. - -=item C An array of Cs. An exact set of aliases to set this -field to, overriding the current value. If you specify C, then C -and C will be ignored. - -=back - -You can only set this if you are modifying a single bug. If there is more -than one bug specified in C, passing in a value for C will cause -an error to be thrown. - -For backwards compatibility, you can also specify a single string. This will -be treated as if you specified the set key above. +(string) The alias of the bug. You can only set this if you are modifying +a single bug. If there is more than one bug specified in C, passing in +a value for C will cause an error to be thrown. =item C @@ -4210,8 +4074,7 @@ C The id of the bug that was updated. =item C -C of Cs The aliases of the bug that was updated, if this bug -has any alias. +C The alias of the bug that was updated, if this bug has an alias. =item C @@ -4245,7 +4108,7 @@ Here's an example of what a return value might look like: bugs => [ { id => 123, - alias => [ 'foo' ], + alias => 'foo', last_change_time => '2010-01-01T12:34:56', changes => { status => { diff --git a/mozilla/webtools/bugzilla/Bugzilla/WebService/BugUserLastVisit.pm b/mozilla/webtools/bugzilla/Bugzilla/WebService/BugUserLastVisit.pm index a29d2633b83..71b637fef65 100644 --- a/mozilla/webtools/bugzilla/Bugzilla/WebService/BugUserLastVisit.pm +++ b/mozilla/webtools/bugzilla/Bugzilla/WebService/BugUserLastVisit.pm @@ -9,7 +9,6 @@ package Bugzilla::WebService::BugUserLastVisit; use 5.10.1; use strict; -use warnings; use parent qw(Bugzilla::WebService); @@ -69,10 +68,10 @@ sub get { $user->visible_bugs([grep /^[0-9]$/, @$ids]); } - my @last_visits = @{ $user->last_visited }; + my @last_visits = @{ $user->last_visits }; if ($ids) { - # remove bugs that we are not interested in if ids is passed in. + # remove bugs that we arn't interested in if ids is passed in. my %id_set = map { ($_ => 1) } @$ids; @last_visits = grep { $id_set{ $_->bug_id } } @last_visits; } @@ -167,13 +166,20 @@ B =item B -Get the last visited timestamp for one or more specified bug ids. +Get the last visited timestamp for one or more specified bug ids or get a +list of the last 20 visited bugs and their timestamps. =item B To return the last visited timestamp for a single bug id: - GET /rest/bug_user_last_visit/ +GET /rest/bug_visit/ + +To return more than one bug timestamp or the last 20: + +GET /rest/bug_visit + +The returned data format is the same as below. =item B diff --git a/mozilla/webtools/bugzilla/Bugzilla/WebService/Bugzilla.pm b/mozilla/webtools/bugzilla/Bugzilla/WebService/Bugzilla.pm index 8333f99c480..6b5f9844ffc 100644 --- a/mozilla/webtools/bugzilla/Bugzilla/WebService/Bugzilla.pm +++ b/mozilla/webtools/bugzilla/Bugzilla/WebService/Bugzilla.pm @@ -9,7 +9,6 @@ package Bugzilla::WebService::Bugzilla; use 5.10.1; use strict; -use warnings; use parent qw(Bugzilla::WebService); use Bugzilla::Constants; diff --git a/mozilla/webtools/bugzilla/Bugzilla/WebService/Classification.pm b/mozilla/webtools/bugzilla/Bugzilla/WebService/Classification.pm index 8e1b3ae8a6e..bbc967ce7ac 100644 --- a/mozilla/webtools/bugzilla/Bugzilla/WebService/Classification.pm +++ b/mozilla/webtools/bugzilla/Bugzilla/WebService/Classification.pm @@ -9,7 +9,6 @@ package Bugzilla::WebService::Classification; use 5.10.1; use strict; -use warnings; use parent qw (Bugzilla::WebService); diff --git a/mozilla/webtools/bugzilla/Bugzilla/WebService/Component.pm b/mozilla/webtools/bugzilla/Bugzilla/WebService/Component.pm deleted file mode 100644 index 893e244b892..00000000000 --- a/mozilla/webtools/bugzilla/Bugzilla/WebService/Component.pm +++ /dev/null @@ -1,149 +0,0 @@ -# This Source Code Form is subject to the terms of the Mozilla Public -# License, v. 2.0. If a copy of the MPL was not distributed with this -# file, You can obtain one at http://mozilla.org/MPL/2.0/. -# -# This Source Code Form is "Incompatible With Secondary Licenses", as -# defined by the Mozilla Public License, v. 2.0. - -package Bugzilla::WebService::Component; - -use 5.10.1; -use strict; -use warnings; - -use base qw(Bugzilla::WebService); - -use Bugzilla::Component; -use Bugzilla::Constants; -use Bugzilla::Error; -use Bugzilla::WebService::Constants; -use Bugzilla::WebService::Util qw(translate params_to_objects validate); - -use constant MAPPED_FIELDS => { - default_assignee => 'initialowner', - default_qa_contact => 'initialqacontact', - default_cc => 'initial_cc', - is_open => 'isactive', -}; - -sub create { - my ($self, $params) = @_; - - my $user = Bugzilla->login(LOGIN_REQUIRED); - - $user->in_group('editcomponents') - || scalar @{ $user->get_products_by_permission('editcomponents') } - || ThrowUserError('auth_failure', { group => 'editcomponents', - action => 'edit', - object => 'components' }); - - my $product = $user->check_can_admin_product($params->{product}); - - # Translate the fields - my $values = translate($params, MAPPED_FIELDS); - $values->{product} = $product; - - # Create the component and return the newly created id. - my $component = Bugzilla::Component->create($values); - return { id => $self->type('int', $component->id) }; -} - -1; - -__END__ - -=head1 NAME - -Bugzilla::Webservice::Component - The Component API - -=head1 DESCRIPTION - -This part of the Bugzilla API allows you to deal with the available product components. -You will be able to get information about them as well as manipulate them. - -=head1 METHODS - -See L for a description of how parameters are passed, -and what B, B, and B mean. - -=head1 Component Creation and Modification - -=head2 create - -B - -=over - -=item B - -This allows you to create a new component in Bugzilla. - -=item B - -Some params must be set, or an error will be thrown. These params are -marked B. - -=over - -=item C - -B C The name of the new component. - -=item C - -B C The name of the product that the component must be -added to. This product must already exist, and the user have the necessary -permissions to edit components for it. - -=item C - -B C The description of the new component. - -=item C - -B C The login name of the default assignee of the component. - -=item C - -C An array of strings with each element representing one login name of the default CC list. - -=item C - -C The login name of the default QA contact for the component. - -=item C - -C 1 if you want to enable the component for bug creations. 0 otherwise. Default is 1. - -=back - -=item B - -A hash with one key: C. This will represent the ID of the newly-added -component. - -=item B - -=over - -=item 304 (Authorization Failure) - -You are not authorized to create a new component. - -=item 1200 (Component already exists) - -The name that you specified for the new component already exists in the -specified product. - -=back - -=item B - -=over - -=item Added in Bugzilla B<5.0>. - -=back - -=back - diff --git a/mozilla/webtools/bugzilla/Bugzilla/WebService/Constants.pm b/mozilla/webtools/bugzilla/Bugzilla/WebService/Constants.pm index cfd934c4ebd..2c21de15e8e 100644 --- a/mozilla/webtools/bugzilla/Bugzilla/WebService/Constants.pm +++ b/mozilla/webtools/bugzilla/Bugzilla/WebService/Constants.pm @@ -9,7 +9,6 @@ package Bugzilla::WebService::Constants; use 5.10.1; use strict; -use warnings; use parent qw(Exporter); @@ -101,7 +100,6 @@ use constant WS_ERROR_CODE => { comment_id_invalid => 111, comment_too_long => 114, comment_invalid_isprivate => 117, - markdown_disabled => 140, # Comment tagging comment_tag_disabled => 125, comment_tag_invalid => 126, @@ -143,11 +141,7 @@ use constant WS_ERROR_CODE => { auth_invalid_email => 302, extern_id_conflict => -303, auth_failure => 304, - password_too_short => 305, - password_not_complex => 305, - api_key_not_valid => 306, - api_key_revoked => 306, - auth_invalid_token => 307, + password_current_too_short => 305, # Except, historically, AUTH_NODATA, which is 410. login_required => 410, @@ -206,11 +200,6 @@ use constant WS_ERROR_CODE => { flag_type_sortkey_invalid => 1104, flag_type_not_editable => 1105, - # Component errors are 1200-1300 - component_already_exists => 1200, - component_is_last => 1201, - component_has_bugs => 1202, - # Errors thrown by the WebService itself. The ones that are negative # conform to http://xmlrpc-epi.sourceforge.net/specs/rfc.fault_codes.php xmlrpc_invalid_value => -32600, @@ -239,33 +228,26 @@ use constant STATUS_GONE => 410; # the related webvservice call. We choose the appropriate # http status code based on the error code or use the # default STATUS_BAD_REQUEST. -sub REST_STATUS_CODE_MAP { - my $status_code_map = { - 51 => STATUS_NOT_FOUND, - 101 => STATUS_NOT_FOUND, - 102 => STATUS_NOT_AUTHORIZED, - 106 => STATUS_NOT_AUTHORIZED, - 109 => STATUS_NOT_AUTHORIZED, - 110 => STATUS_NOT_AUTHORIZED, - 113 => STATUS_NOT_AUTHORIZED, - 115 => STATUS_NOT_AUTHORIZED, - 120 => STATUS_NOT_AUTHORIZED, - 300 => STATUS_NOT_AUTHORIZED, - 301 => STATUS_NOT_AUTHORIZED, - 302 => STATUS_NOT_AUTHORIZED, - 303 => STATUS_NOT_AUTHORIZED, - 304 => STATUS_NOT_AUTHORIZED, - 410 => STATUS_NOT_AUTHORIZED, - 504 => STATUS_NOT_AUTHORIZED, - 505 => STATUS_NOT_AUTHORIZED, - 32614 => STATUS_NOT_FOUND, - _default => STATUS_BAD_REQUEST - }; - - Bugzilla::Hook::process('webservice_status_code_map', - { status_code_map => $status_code_map }); - - return $status_code_map; +use constant REST_STATUS_CODE_MAP => { + 51 => STATUS_NOT_FOUND, + 101 => STATUS_NOT_FOUND, + 102 => STATUS_NOT_AUTHORIZED, + 106 => STATUS_NOT_AUTHORIZED, + 109 => STATUS_NOT_AUTHORIZED, + 110 => STATUS_NOT_AUTHORIZED, + 113 => STATUS_NOT_AUTHORIZED, + 115 => STATUS_NOT_AUTHORIZED, + 120 => STATUS_NOT_AUTHORIZED, + 300 => STATUS_NOT_AUTHORIZED, + 301 => STATUS_NOT_AUTHORIZED, + 302 => STATUS_NOT_AUTHORIZED, + 303 => STATUS_NOT_AUTHORIZED, + 304 => STATUS_NOT_AUTHORIZED, + 410 => STATUS_NOT_AUTHORIZED, + 504 => STATUS_NOT_AUTHORIZED, + 505 => STATUS_NOT_AUTHORIZED, + 32614 => STATUS_NOT_FOUND, + _default => STATUS_BAD_REQUEST }; # These are the fallback defaults for errors not in ERROR_CODE. @@ -297,7 +279,6 @@ sub WS_DISPATCH { 'Bugzilla' => 'Bugzilla::WebService::Bugzilla', 'Bug' => 'Bugzilla::WebService::Bug', 'Classification' => 'Bugzilla::WebService::Classification', - 'Component' => 'Bugzilla::WebService::Component', 'FlagType' => 'Bugzilla::WebService::FlagType', 'Group' => 'Bugzilla::WebService::Group', 'Product' => 'Bugzilla::WebService::Product', @@ -314,8 +295,6 @@ sub WS_DISPATCH { =over -=item REST_STATUS_CODE_MAP - =item WS_DISPATCH =back diff --git a/mozilla/webtools/bugzilla/Bugzilla/WebService/FlagType.pm b/mozilla/webtools/bugzilla/Bugzilla/WebService/FlagType.pm index cf654e6592d..b6b8aba8938 100644 --- a/mozilla/webtools/bugzilla/Bugzilla/WebService/FlagType.pm +++ b/mozilla/webtools/bugzilla/Bugzilla/WebService/FlagType.pm @@ -9,7 +9,6 @@ package Bugzilla::WebService::FlagType; use 5.10.1; use strict; -use warnings; use parent qw(Bugzilla::WebService); use Bugzilla::Component; diff --git a/mozilla/webtools/bugzilla/Bugzilla/WebService/Group.pm b/mozilla/webtools/bugzilla/Bugzilla/WebService/Group.pm index d0ee6fdbad9..d24d0539b0b 100644 --- a/mozilla/webtools/bugzilla/Bugzilla/WebService/Group.pm +++ b/mozilla/webtools/bugzilla/Bugzilla/WebService/Group.pm @@ -9,7 +9,6 @@ package Bugzilla::WebService::Group; use 5.10.1; use strict; -use warnings; use parent qw(Bugzilla::WebService); use Bugzilla::Constants; @@ -102,8 +101,8 @@ sub get { # Reject access if there is no sense in continuing. my $user = Bugzilla->user; - my $all_groups = $user->in_group('editusers') || $user->in_group('creategroups'); - if (!$all_groups && !$user->can_bless) { + my $all_groups = $user->in_group('edituser') || $user->in_group('creategroups'); + if (!$all_groups && ! scalar(@{$user->bless_groups})) { ThrowUserError('group_cannot_view'); } diff --git a/mozilla/webtools/bugzilla/Bugzilla/WebService/Product.pm b/mozilla/webtools/bugzilla/Bugzilla/WebService/Product.pm index 0e78836bf1a..2def7788633 100644 --- a/mozilla/webtools/bugzilla/Bugzilla/WebService/Product.pm +++ b/mozilla/webtools/bugzilla/Bugzilla/WebService/Product.pm @@ -9,7 +9,6 @@ package Bugzilla::WebService::Product; use 5.10.1; use strict; -use warnings; use parent qw(Bugzilla::WebService); use Bugzilla::Product; diff --git a/mozilla/webtools/bugzilla/Bugzilla/WebService/Server.pm b/mozilla/webtools/bugzilla/Bugzilla/WebService/Server.pm index 7950c7a3b92..89cb1a130ac 100644 --- a/mozilla/webtools/bugzilla/Bugzilla/WebService/Server.pm +++ b/mozilla/webtools/bugzilla/Bugzilla/WebService/Server.pm @@ -9,7 +9,6 @@ package Bugzilla::WebService::Server; use 5.10.1; use strict; -use warnings; use Bugzilla::Error; use Bugzilla::Util qw(datetime_from); diff --git a/mozilla/webtools/bugzilla/Bugzilla/WebService/Server/JSONRPC.pm b/mozilla/webtools/bugzilla/Bugzilla/WebService/Server/JSONRPC.pm index 6cda4748055..5290caa5d08 100644 --- a/mozilla/webtools/bugzilla/Bugzilla/WebService/Server/JSONRPC.pm +++ b/mozilla/webtools/bugzilla/Bugzilla/WebService/Server/JSONRPC.pm @@ -9,7 +9,6 @@ package Bugzilla::WebService::Server::JSONRPC; use 5.10.1; use strict; -use warnings; use Bugzilla::WebService::Server; BEGIN { @@ -81,9 +80,7 @@ sub response { # Implement JSONP. if (my $callback = $self->_bz_callback) { my $content = $response->content; - # Prepend the JSONP response with /**/ in order to protect - # against possible encoding attacks (e.g., affecting Flash). - $response->content("/**/$callback($content)"); + $response->content("$callback($content)"); } # Use $cgi->header properly instead of just printing text directly. diff --git a/mozilla/webtools/bugzilla/Bugzilla/WebService/Server/REST.pm b/mozilla/webtools/bugzilla/Bugzilla/WebService/Server/REST.pm index ab3062c0886..2f1b80c45d5 100644 --- a/mozilla/webtools/bugzilla/Bugzilla/WebService/Server/REST.pm +++ b/mozilla/webtools/bugzilla/Bugzilla/WebService/Server/REST.pm @@ -9,7 +9,6 @@ package Bugzilla::WebService::Server::REST; use 5.10.1; use strict; -use warnings; use parent qw(Bugzilla::WebService::Server::JSONRPC); @@ -24,14 +23,12 @@ use Bugzilla::WebService::Util qw(taint_data fix_credentials); use Bugzilla::WebService::Server::REST::Resources::Bug; use Bugzilla::WebService::Server::REST::Resources::Bugzilla; use Bugzilla::WebService::Server::REST::Resources::Classification; -use Bugzilla::WebService::Server::REST::Resources::Component; use Bugzilla::WebService::Server::REST::Resources::FlagType; use Bugzilla::WebService::Server::REST::Resources::Group; use Bugzilla::WebService::Server::REST::Resources::Product; use Bugzilla::WebService::Server::REST::Resources::User; use Bugzilla::WebService::Server::REST::Resources::BugUserLastVisit; -use List::MoreUtils qw(uniq); use Scalar::Util qw(blessed reftype); use MIME::Base64 qw(decode_base64); @@ -338,34 +335,14 @@ sub _retrieve_json_params { my $params = {}; %{$params} = %{ Bugzilla->input_params }; - # First add any parameters we were able to pull out of the path - # based on the resource regexp and combine with the normal URL - # parameters. - if (my $rest_params = $self->bz_rest_params) { - foreach my $param (keys %$rest_params) { - # If the param does not already exist or if the - # rest param is a single value, add it to the - # global params. - if (!exists $params->{$param} || !ref $rest_params->{$param}) { - $params->{$param} = $rest_params->{$param}; - } - # If rest_param is a list then add any extra values to the list - elsif (ref $rest_params->{$param}) { - my @extra_values = ref $params->{$param} - ? @{ $params->{$param} } - : ($params->{$param}); - $params->{$param} - = [ uniq (@{ $rest_params->{$param} }, @extra_values) ]; - } - } - } + # First add any params we were able to pull out of the path + # based on the resource regexp + %{$params} = (%{$params}, %{$self->bz_rest_params}) if $self->bz_rest_params; - # Any parameters passed in in the body of a non-GET request will override - # any parameters pull from the url path. Otherwise non-unique keys are - # combined. + # Merge any additional query key/values with $obj->{params} if not a GET request + # We do this manually cause CGI.pm doesn't understand JSON strings. if ($self->request->method ne 'GET') { my $extra_params = {}; - # We do this manually because CGI.pm doesn't understand JSON strings. my $json = delete $params->{'POSTDATA'} || delete $params->{'PUTDATA'}; if ($json) { eval { $extra_params = $self->json->decode($json); }; @@ -374,9 +351,9 @@ sub _retrieve_json_params { } } - # Allow parameters in the query string if request was non-GET. - # Note: parameters in query string body override any matching - # parameters in the request body. + # Allow parameters in the query string if request was not GET. + # Note: query string parameters will override any matching params + # also specified in the request body. foreach my $param ($self->cgi->url_param()) { $extra_params->{$param} = $self->cgi->url_param($param); } diff --git a/mozilla/webtools/bugzilla/Bugzilla/WebService/Server/REST/Resources/Bug.pm b/mozilla/webtools/bugzilla/Bugzilla/WebService/Server/REST/Resources/Bug.pm index 3fa8b65cf5d..7ab111d86ce 100644 --- a/mozilla/webtools/bugzilla/Bugzilla/WebService/Server/REST/Resources/Bug.pm +++ b/mozilla/webtools/bugzilla/Bugzilla/WebService/Server/REST/Resources/Bug.pm @@ -9,7 +9,6 @@ package Bugzilla::WebService::Server::REST::Resources::Bug; use 5.10.1; use strict; -use warnings; use Bugzilla::WebService::Constants; use Bugzilla::WebService::Bug; @@ -29,11 +28,6 @@ sub _rest_resources { status_code => STATUS_CREATED } }, - qr{^/bug/$}, { - GET => { - method => 'get' - } - }, qr{^/bug/([^/]+)$}, { GET => { method => 'get', diff --git a/mozilla/webtools/bugzilla/Bugzilla/WebService/Server/REST/Resources/Bugzilla.pm b/mozilla/webtools/bugzilla/Bugzilla/WebService/Server/REST/Resources/Bugzilla.pm index a8f3f9330ed..1c86f77bce3 100644 --- a/mozilla/webtools/bugzilla/Bugzilla/WebService/Server/REST/Resources/Bugzilla.pm +++ b/mozilla/webtools/bugzilla/Bugzilla/WebService/Server/REST/Resources/Bugzilla.pm @@ -9,7 +9,6 @@ package Bugzilla::WebService::Server::REST::Resources::Bugzilla; use 5.10.1; use strict; -use warnings; use Bugzilla::WebService::Constants; use Bugzilla::WebService::Bugzilla; diff --git a/mozilla/webtools/bugzilla/Bugzilla/WebService/Server/REST/Resources/Classification.pm b/mozilla/webtools/bugzilla/Bugzilla/WebService/Server/REST/Resources/Classification.pm index 3f8d32a0361..2bbc05c72c8 100644 --- a/mozilla/webtools/bugzilla/Bugzilla/WebService/Server/REST/Resources/Classification.pm +++ b/mozilla/webtools/bugzilla/Bugzilla/WebService/Server/REST/Resources/Classification.pm @@ -9,7 +9,6 @@ package Bugzilla::WebService::Server::REST::Resources::Classification; use 5.10.1; use strict; -use warnings; use Bugzilla::WebService::Constants; use Bugzilla::WebService::Classification; diff --git a/mozilla/webtools/bugzilla/Bugzilla/WebService/Server/REST/Resources/Component.pm b/mozilla/webtools/bugzilla/Bugzilla/WebService/Server/REST/Resources/Component.pm deleted file mode 100644 index 198c0933294..00000000000 --- a/mozilla/webtools/bugzilla/Bugzilla/WebService/Server/REST/Resources/Component.pm +++ /dev/null @@ -1,48 +0,0 @@ -# This Source Code Form is subject to the terms of the Mozilla Public -# License, v. 2.0. If a copy of the MPL was not distributed with this -# file, You can obtain one at http://mozilla.org/MPL/2.0/. -# -# This Source Code Form is "Incompatible With Secondary Licenses", as -# defined by the Mozilla Public License, v. 2.0. - -package Bugzilla::WebService::Server::REST::Resources::Component; - -use 5.10.1; -use strict; -use warnings; - -use Bugzilla::WebService::Constants; -use Bugzilla::WebService::Component; - -use Bugzilla::Error; - -BEGIN { - *Bugzilla::WebService::Component::rest_resources = \&_rest_resources; -}; - -sub _rest_resources { - my $rest_resources = [ - qr{^/component$}, { - POST => { - method => 'create', - success_code => STATUS_CREATED - } - }, - ]; - return $rest_resources; -} - -1; - -__END__ - -=head1 NAME - -Bugzilla::Webservice::Server::REST::Resources::Component - The Component REST API - -=head1 DESCRIPTION - -This part of the Bugzilla REST API allows you create Components. - -See L for more details on how to use this -part of the REST API. diff --git a/mozilla/webtools/bugzilla/Bugzilla/WebService/Server/REST/Resources/FlagType.pm b/mozilla/webtools/bugzilla/Bugzilla/WebService/Server/REST/Resources/FlagType.pm index 21dad0f73a8..1de5b126453 100644 --- a/mozilla/webtools/bugzilla/Bugzilla/WebService/Server/REST/Resources/FlagType.pm +++ b/mozilla/webtools/bugzilla/Bugzilla/WebService/Server/REST/Resources/FlagType.pm @@ -9,7 +9,6 @@ package Bugzilla::WebService::Server::REST::Resources::FlagType; use 5.10.1; use strict; -use warnings; use Bugzilla::WebService::Constants; use Bugzilla::WebService::FlagType; diff --git a/mozilla/webtools/bugzilla/Bugzilla/WebService/Server/REST/Resources/Group.pm b/mozilla/webtools/bugzilla/Bugzilla/WebService/Server/REST/Resources/Group.pm index b052e384b47..62f8af6dd62 100644 --- a/mozilla/webtools/bugzilla/Bugzilla/WebService/Server/REST/Resources/Group.pm +++ b/mozilla/webtools/bugzilla/Bugzilla/WebService/Server/REST/Resources/Group.pm @@ -9,7 +9,6 @@ package Bugzilla::WebService::Server::REST::Resources::Group; use 5.10.1; use strict; -use warnings; use Bugzilla::WebService::Constants; use Bugzilla::WebService::Group; diff --git a/mozilla/webtools/bugzilla/Bugzilla/WebService/Server/REST/Resources/Product.pm b/mozilla/webtools/bugzilla/Bugzilla/WebService/Server/REST/Resources/Product.pm index 607b94b538a..fef7c6174c9 100644 --- a/mozilla/webtools/bugzilla/Bugzilla/WebService/Server/REST/Resources/Product.pm +++ b/mozilla/webtools/bugzilla/Bugzilla/WebService/Server/REST/Resources/Product.pm @@ -9,7 +9,6 @@ package Bugzilla::WebService::Server::REST::Resources::Product; use 5.10.1; use strict; -use warnings; use Bugzilla::WebService::Constants; use Bugzilla::WebService::Product; diff --git a/mozilla/webtools/bugzilla/Bugzilla/WebService/Server/REST/Resources/User.pm b/mozilla/webtools/bugzilla/Bugzilla/WebService/Server/REST/Resources/User.pm index a83109e7370..539a9313a52 100644 --- a/mozilla/webtools/bugzilla/Bugzilla/WebService/Server/REST/Resources/User.pm +++ b/mozilla/webtools/bugzilla/Bugzilla/WebService/Server/REST/Resources/User.pm @@ -9,7 +9,6 @@ package Bugzilla::WebService::Server::REST::Resources::User; use 5.10.1; use strict; -use warnings; use Bugzilla::WebService::Constants; use Bugzilla::WebService::User; diff --git a/mozilla/webtools/bugzilla/Bugzilla/WebService/Server/XMLRPC.pm b/mozilla/webtools/bugzilla/Bugzilla/WebService/Server/XMLRPC.pm index 56b31ffefe6..40c66a8f95b 100644 --- a/mozilla/webtools/bugzilla/Bugzilla/WebService/Server/XMLRPC.pm +++ b/mozilla/webtools/bugzilla/Bugzilla/WebService/Server/XMLRPC.pm @@ -9,7 +9,6 @@ package Bugzilla::WebService::Server::XMLRPC; use 5.10.1; use strict; -use warnings; use XMLRPC::Transport::HTTP; use Bugzilla::WebService::Server; @@ -108,7 +107,6 @@ package Bugzilla::XMLRPC::Deserializer; use 5.10.1; use strict; -use warnings; # We can't use "use parent" because XMLRPC::Serializer doesn't return # a true value. @@ -117,7 +115,6 @@ our @ISA = qw(XMLRPC::Deserializer); use Bugzilla::Error; use Bugzilla::WebService::Constants qw(XMLRPC_CONTENT_TYPE_WHITELIST); -use Bugzilla::WebService::Util qw(fix_credentials); use Scalar::Util qw(tainted); sub deserialize { @@ -141,13 +138,7 @@ sub deserialize { my $params = $som->paramsin; # This allows positional parameters for Testopia. $params = {} if ref $params ne 'HASH'; - - # Update the params to allow for several convenience key/values - # use for authentication - fix_credentials($params); - Bugzilla->input_params($params); - return $som; } @@ -214,7 +205,6 @@ package Bugzilla::XMLRPC::SOM; use 5.10.1; use strict; -use warnings; use XMLRPC::Lite; our @ISA = qw(XMLRPC::SOM); @@ -241,7 +231,6 @@ package Bugzilla::XMLRPC::Serializer; use 5.10.1; use strict; -use warnings; use Scalar::Util qw(blessed reftype); # We can't use "use parent" because XMLRPC::Serializer doesn't return diff --git a/mozilla/webtools/bugzilla/Bugzilla/WebService/User.pm b/mozilla/webtools/bugzilla/Bugzilla/WebService/User.pm index f3b8bf703d7..f05b2b247f8 100644 --- a/mozilla/webtools/bugzilla/Bugzilla/WebService/User.pm +++ b/mozilla/webtools/bugzilla/Bugzilla/WebService/User.pm @@ -9,7 +9,6 @@ package Bugzilla::WebService::User; use 5.10.1; use strict; -use warnings; use parent qw(Bugzilla::WebService); @@ -53,20 +52,27 @@ use constant MAPPED_RETURNS => { sub login { my ($self, $params) = @_; - # Check to see if we are already logged in - my $user = Bugzilla->user; - if ($user->id) { - return $self->_login_to_hash($user); - } - # Username and password params are required foreach my $param ("login", "password") { - (defined $params->{$param} || defined $params->{'Bugzilla_' . $param}) + defined $params->{$param} || ThrowCodeError('param_required', { param => $param }); } - $user = Bugzilla->login(); - return $self->_login_to_hash($user); + # Make sure the CGI user info class works if necessary. + my $input_params = Bugzilla->input_params; + $input_params->{'Bugzilla_login'} = $params->{login}; + $input_params->{'Bugzilla_password'} = $params->{password}; + $input_params->{'Bugzilla_restrictlogin'} = $params->{restrict_login}; + + my $user = Bugzilla->login(); + + my $result = { id => $self->type('int', $user->id) }; + + if ($user->{_login_token}) { + $result->{'token'} = $user->id . "-" . $user->{_login_token}; + } + + return $result; } sub logout { @@ -402,15 +408,6 @@ sub _report_to_hash { return $item; } -sub _login_to_hash { - my ($self, $user) = @_; - my $item = { id => $self->type('int', $user->id) }; - if ($user->{_login_token}) { - $item->{'token'} = $user->id . "-" . $user->{_login_token}; - } - return $item; -} - 1; __END__ @@ -435,13 +432,9 @@ where applicable. =head1 Logging In and Out -These method are now deprecated, and will be removed in the release after -Bugzilla 5.0. The correct way of use these REST and RPC calls is noted in -L - =head2 login -B +B =over @@ -506,9 +499,7 @@ creates a login cookie. =item C was added in Bugzilla B<5.0>. -=item C was added in Bugzilla B<4.4.3>. - -=item This function will be removed in the release after Bugzilla 5.0, in favour of API keys. +=item C was added in Bugzilla B<5.0>. =back @@ -516,7 +507,7 @@ creates a login cookie. =head2 logout -B +B =over @@ -534,7 +525,7 @@ Log out the user. Does nothing if there is no user logged in. =head2 valid_login -B +B =over @@ -572,8 +563,6 @@ for the provided username. =item Added in Bugzilla B<5.0>. -=item This function will be removed in the release after Bugzilla 5.0, in favour of API keys. - =back =back diff --git a/mozilla/webtools/bugzilla/Bugzilla/WebService/Util.pm b/mozilla/webtools/bugzilla/Bugzilla/WebService/Util.pm index a0a51a8de23..26558fc6ac0 100644 --- a/mozilla/webtools/bugzilla/Bugzilla/WebService/Util.pm +++ b/mozilla/webtools/bugzilla/Bugzilla/WebService/Util.pm @@ -9,7 +9,6 @@ package Bugzilla::WebService::Util; use 5.10.1; use strict; -use warnings; use Bugzilla::Flag; use Bugzilla::FlagType; @@ -266,18 +265,13 @@ sub fix_credentials { # even if not calling GET /login. We also do not delete them as # GET /login requires "login" and "password". if (exists $params->{'login'} && exists $params->{'password'}) { - $params->{'Bugzilla_login'} = delete $params->{'login'}; - $params->{'Bugzilla_password'} = delete $params->{'password'}; - } - # Allow user to pass api_key=12345678 as a convenience which becomes - # "Bugzilla_api_key" which is what the auth code looks for. - if (exists $params->{api_key}) { - $params->{Bugzilla_api_key} = delete $params->{api_key}; + $params->{'Bugzilla_login'} = $params->{'login'}; + $params->{'Bugzilla_password'} = $params->{'password'}; } # Allow user to pass token=12345678 as a convenience which becomes # "Bugzilla_token" which is what the auth code looks for. if (exists $params->{'token'}) { - $params->{'Bugzilla_token'} = delete $params->{'token'}; + $params->{'Bugzilla_token'} = $params->{'token'}; } # Allow extensions to modify the credential data before login diff --git a/mozilla/webtools/bugzilla/Bugzilla/Whine.pm b/mozilla/webtools/bugzilla/Bugzilla/Whine.pm index eeaea6da4e0..488127dfa9d 100644 --- a/mozilla/webtools/bugzilla/Bugzilla/Whine.pm +++ b/mozilla/webtools/bugzilla/Bugzilla/Whine.pm @@ -9,7 +9,6 @@ package Bugzilla::Whine; use 5.10.1; use strict; -use warnings; use parent qw(Bugzilla::Object); diff --git a/mozilla/webtools/bugzilla/Bugzilla/Whine/Query.pm b/mozilla/webtools/bugzilla/Bugzilla/Whine/Query.pm index b2a2c9e0734..a4fd54539a5 100644 --- a/mozilla/webtools/bugzilla/Bugzilla/Whine/Query.pm +++ b/mozilla/webtools/bugzilla/Bugzilla/Whine/Query.pm @@ -9,7 +9,6 @@ package Bugzilla::Whine::Query; use 5.10.1; use strict; -use warnings; use parent qw(Bugzilla::Object); diff --git a/mozilla/webtools/bugzilla/Bugzilla/Whine/Schedule.pm b/mozilla/webtools/bugzilla/Bugzilla/Whine/Schedule.pm index 11f0bf16f1f..f16c629af48 100644 --- a/mozilla/webtools/bugzilla/Bugzilla/Whine/Schedule.pm +++ b/mozilla/webtools/bugzilla/Bugzilla/Whine/Schedule.pm @@ -9,7 +9,6 @@ package Bugzilla::Whine::Schedule; use 5.10.1; use strict; -use warnings; use parent qw(Bugzilla::Object); diff --git a/mozilla/webtools/bugzilla/admin.cgi b/mozilla/webtools/bugzilla/admin.cgi index 1dc9b2c1bd3..70a6aa20ec8 100755 --- a/mozilla/webtools/bugzilla/admin.cgi +++ b/mozilla/webtools/bugzilla/admin.cgi @@ -1,4 +1,4 @@ -#!/usr/bin/perl -T +#!/usr/bin/perl -wT # This Source Code Form is subject to the terms of the Mozilla Public # License, v. 2.0. If a copy of the MPL was not distributed with this # file, You can obtain one at http://mozilla.org/MPL/2.0/. @@ -8,8 +8,6 @@ use 5.10.1; use strict; -use warnings; - use lib qw(. lib); use Bugzilla; diff --git a/mozilla/webtools/bugzilla/attachment.cgi b/mozilla/webtools/bugzilla/attachment.cgi index 61e6f58d8df..94510fb190f 100755 --- a/mozilla/webtools/bugzilla/attachment.cgi +++ b/mozilla/webtools/bugzilla/attachment.cgi @@ -1,4 +1,4 @@ -#!/usr/bin/perl -T +#!/usr/bin/perl -wT # This Source Code Form is subject to the terms of the Mozilla Public # License, v. 2.0. If a copy of the MPL was not distributed with this # file, You can obtain one at http://mozilla.org/MPL/2.0/. @@ -8,8 +8,6 @@ use 5.10.1; use strict; -use warnings; - use lib qw(. lib); use Bugzilla; @@ -26,7 +24,6 @@ use Bugzilla::Attachment::PatchReader; use Bugzilla::Token; use Encode qw(encode find_encoding); -use Cwd qw(realpath); # For most scripts we don't make $cgi and $template global variables. But # when preparing Bugzilla for mod_perl, this script used these @@ -191,6 +188,19 @@ sub validateFormat { return $format; } +# Validates context of a diff/interdiff. Will throw an error if the context +# is not number, "file" or "patch". Returns the validated, detainted context. +sub validateContext +{ + my $context = $cgi->param('context') || "patch"; + if ($context ne "file" && $context ne "patch") { + detaint_natural($context) + || ThrowUserError("invalid_context", { context => $cgi->param('context') }); + } + + return $context; +} + # Gets the attachment object(s) generated by validateID, while ensuring # attachbase and token authentication is used when required. sub get_attachment { @@ -362,24 +372,9 @@ sub view { } } } - my $sendfile_header = {}; - my $sendfile_param = Bugzilla->params->{'xsendfile_header'}; - if ($attachment->is_on_filesystem && $sendfile_param ne 'off') { - # attachment is on filesystem and Admin turned on feature. - # This means we can let webserver handle the request and stream the file - # for us. This is called the X-Sendfile feature. see bug 1073264. - my $attachment_path = realpath($attachment->_get_local_filename()); - $sendfile_header->{$sendfile_param} = $attachment_path; - } print $cgi->header(-type=>"$contenttype; name=\"$filename\"", -content_disposition=> "$disposition; filename=\"$filename\"", - -content_length => $attachment->datasize, - %$sendfile_header); - if ($attachment->is_on_filesystem && $sendfile_param ne 'off') { - # in case of X-Sendfile, we do not print the data. - # that is handled directly by the webserver. - return; - } + -content_length => $attachment->datasize); disable_utf8(); print $attachment->data; } @@ -394,15 +389,17 @@ sub interdiff { $old_attachment = validateID('oldid'); $new_attachment = validateID('newid'); } + my $context = validateContext(); Bugzilla::Attachment::PatchReader::process_interdiff( - $old_attachment, $new_attachment, $format); + $old_attachment, $new_attachment, $format, $context); } sub diff { # Retrieve and validate parameters my $format = validateFormat('html', 'raw'); my $attachment = $format eq 'raw' ? get_attachment() : validateID(); + my $context = validateContext(); # If it is not a patch, view normally. if (!$attachment->ispatch) { @@ -410,7 +407,7 @@ sub diff { return; } - Bugzilla::Attachment::PatchReader::process_diff($attachment, $format); + Bugzilla::Attachment::PatchReader::process_diff($attachment, $format, $context); } # Display all attachments for a given bug in a series of IFRAMEs within one @@ -516,14 +513,13 @@ sub insert { # Get the filehandle of the attachment. my $data_fh = $cgi->upload('data'); - my $attach_text = $cgi->param('attach_text'); my $attachment = Bugzilla::Attachment->create( {bug => $bug, creation_ts => $timestamp, - data => $attach_text || $data_fh, + data => scalar $cgi->param('attach_text') || $data_fh, description => scalar $cgi->param('description'), - filename => $attach_text ? "file_$bugid.txt" : $data_fh, + filename => $cgi->param('attach_text') ? "file_$bugid.txt" : scalar $cgi->upload('data'), ispatch => scalar $cgi->param('ispatch'), isprivate => scalar $cgi->param('isprivate'), mimetype => $content_type, @@ -540,6 +536,7 @@ sub insert { my ($flags, $new_flags) = Bugzilla::Flag->extract_flags_from_cgi( $bug, $attachment, $vars, SKIP_REQUESTEE_ON_ERROR); $attachment->set_flags($flags, $new_flags); + $attachment->update($timestamp); # Insert a comment about the new attachment into the database. my $comment = $cgi->param('comment'); @@ -548,50 +545,45 @@ sub insert { type => CMT_ATTACHMENT_CREATED, extra_data => $attachment->id }); - # Assign the bug to the user, if they are allowed to take it - my $owner = ""; - if ($cgi->param('takebug') && $user->in_group('editbugs', $bug->product_id)) { - # When taking a bug, we have to follow the workflow. - my $bug_status = $cgi->param('bug_status') || ''; - ($bug_status) = grep { $_->name eq $bug_status } - @{ $bug->status->can_change_to }; + # Assign the bug to the user, if they are allowed to take it + my $owner = ""; + if ($cgi->param('takebug') && $user->in_group('editbugs', $bug->product_id)) { + # When taking a bug, we have to follow the workflow. + my $bug_status = $cgi->param('bug_status') || ''; + ($bug_status) = grep {$_->name eq $bug_status} @{$bug->status->can_change_to}; - if ($bug_status && $bug_status->is_open - && ($bug_status->name ne 'UNCONFIRMED' - || $bug->product_obj->allows_unconfirmed)) - { - $bug->set_bug_status($bug_status->name); - $bug->clear_resolution(); - } - # Make sure the person we are taking the bug from gets mail. - $owner = $bug->assigned_to->login; - $bug->set_assigned_to($user); - } + if ($bug_status && $bug_status->is_open + && ($bug_status->name ne 'UNCONFIRMED' + || $bug->product_obj->allows_unconfirmed)) + { + $bug->set_bug_status($bug_status->name); + $bug->clear_resolution(); + } + # Make sure the person we are taking the bug from gets mail. + $owner = $bug->assigned_to->login; + $bug->set_assigned_to($user); + } - $bug->add_cc($user) if $cgi->param('addselfcc'); - $bug->update($timestamp); + $bug->add_cc($user) if $cgi->param('addselfcc'); + $bug->update($timestamp); - # We have to update the attachment after updating the bug, to ensure new - # comments are available. - $attachment->update($timestamp); + $dbh->bz_commit_transaction; - $dbh->bz_commit_transaction; + # Define the variables and functions that will be passed to the UI template. + $vars->{'attachment'} = $attachment; + # We cannot reuse the $bug object as delta_ts has eventually been updated + # since the object was created. + $vars->{'bugs'} = [new Bugzilla::Bug($bugid)]; + $vars->{'header_done'} = 1; + $vars->{'contenttypemethod'} = $cgi->param('contenttypemethod'); - # Define the variables and functions that will be passed to the UI template. - $vars->{'attachment'} = $attachment; - # We cannot reuse the $bug object as delta_ts has eventually been updated - # since the object was created. - $vars->{'bugs'} = [new Bugzilla::Bug($bugid)]; - $vars->{'header_done'} = 1; - $vars->{'contenttypemethod'} = $cgi->param('contenttypemethod'); + my $recipients = { 'changer' => $user, 'owner' => $owner }; + $vars->{'sent_bugmail'} = Bugzilla::BugMail::Send($bugid, $recipients); - my $recipients = { 'changer' => $user, 'owner' => $owner }; - $vars->{'sent_bugmail'} = Bugzilla::BugMail::Send($bugid, $recipients); - - print $cgi->header(); - # Generate and return the UI (HTML page) from the appropriate template. - $template->process("attachment/created.html.tmpl", $vars) - || ThrowTemplateError($template->error()); + print $cgi->header(); + # Generate and return the UI (HTML page) from the appropriate template. + $template->process("attachment/created.html.tmpl", $vars) + || ThrowTemplateError($template->error()); } # Displays a form for editing attachment properties. @@ -599,25 +591,25 @@ sub insert { # is private and the user does not belong to the insider group. # Validations are done later when the user submits changes. sub edit { - my $attachment = validateID(); + my $attachment = validateID(); - my $bugattachments = - Bugzilla::Attachment->get_attachments_by_bug($attachment->bug); + my $bugattachments = + Bugzilla::Attachment->get_attachments_by_bug($attachment->bug); - my $any_flags_requesteeble = grep { $_->is_requestable && $_->is_requesteeble } - @{ $attachment->flag_types }; - # Useful in case a flagtype is no longer requestable but a requestee - # has been set before we turned off that bit. - $any_flags_requesteeble ||= grep { $_->requestee_id } @{ $attachment->flags }; - $vars->{'any_flags_requesteeble'} = $any_flags_requesteeble; - $vars->{'attachment'} = $attachment; - $vars->{'attachments'} = $bugattachments; + my $any_flags_requesteeble = + grep { $_->is_requestable && $_->is_requesteeble } @{$attachment->flag_types}; + # Useful in case a flagtype is no longer requestable but a requestee + # has been set before we turned off that bit. + $any_flags_requesteeble ||= grep { $_->requestee_id } @{$attachment->flags}; + $vars->{'any_flags_requesteeble'} = $any_flags_requesteeble; + $vars->{'attachment'} = $attachment; + $vars->{'attachments'} = $bugattachments; - print $cgi->header(); + print $cgi->header(); - # Generate and return the UI (HTML page) from the appropriate template. - $template->process("attachment/edit.html.tmpl", $vars) - || ThrowTemplateError($template->error()); + # Generate and return the UI (HTML page) from the appropriate template. + $template->process("attachment/edit.html.tmpl", $vars) + || ThrowTemplateError($template->error()); } # Updates an attachment record. Only users with "editbugs" privileges, @@ -719,11 +711,6 @@ sub update { # Figure out when the changes were made. my $timestamp = $dbh->selectrow_array('SELECT LOCALTIMESTAMP(0)'); - # Commit the comment, if any. - # This has to happen before updating the attachment, to ensure new comments - # are available to $attachment->update. - $bug->update($timestamp); - if ($can_edit) { my $changes = $attachment->update($timestamp); # If there are changes, we updated delta_ts in the DB. We have to @@ -731,6 +718,9 @@ sub update { $bug->{delta_ts} = $timestamp if scalar(keys %$changes); } + # Commit the comment, if any. + $bug->update($timestamp); + # Commit the transaction now that we are finished updating the database. $dbh->bz_commit_transaction(); diff --git a/mozilla/webtools/bugzilla/buglist.cgi b/mozilla/webtools/bugzilla/buglist.cgi index daee34c9bc6..d88939171fd 100755 --- a/mozilla/webtools/bugzilla/buglist.cgi +++ b/mozilla/webtools/bugzilla/buglist.cgi @@ -1,4 +1,4 @@ -#!/usr/bin/perl -T +#!/usr/bin/perl -wT # This Source Code Form is subject to the terms of the Mozilla Public # License, v. 2.0. If a copy of the MPL was not distributed with this # file, You can obtain one at http://mozilla.org/MPL/2.0/. @@ -8,8 +8,6 @@ use 5.10.1; use strict; -use warnings; - use lib qw(. lib); use Bugzilla; @@ -281,37 +279,6 @@ sub GetGroups { return [values %legal_groups]; } -sub _get_common_flag_types { - my $component_ids = shift; - my $user = Bugzilla->user; - - # Get all the different components in the bug list - my $components = Bugzilla::Component->new_from_list($component_ids); - my %flag_types; - my @flag_types_ids; - foreach my $component (@$components) { - foreach my $flag_type (@{$component->flag_types->{'bug'}}) { - push @flag_types_ids, $flag_type->id; - $flag_types{$flag_type->id} = $flag_type; - } - } - - # We only want flags that appear in all components - my %common_flag_types; - foreach my $id (keys %flag_types) { - my $flag_type_count = scalar grep { $_ == $id } @flag_types_ids; - $common_flag_types{$id} = $flag_types{$id} - if $flag_type_count == scalar @$components; - } - - # We only show flags that a user can request. - my @show_flag_types - = grep { $user->can_request_flag($_) } values %common_flag_types; - my $any_flags_requesteeble = grep { $_->is_requesteeble } @show_flag_types; - - return(\@show_flag_types, $any_flags_requesteeble); -} - ################################################################################ # Command Execution ################################################################################ @@ -541,6 +508,7 @@ if (grep('relevance', @displaycolumns) && !$fulltext) { @displaycolumns = grep($_ ne 'relevance', @displaycolumns); } + ################################################################################ # Select Column Determination ################################################################################ @@ -581,7 +549,6 @@ foreach my $col (@displaycolumns) { # has for modifying the bugs. if ($dotweak) { push(@selectcolumns, "bug_status") if !grep($_ eq 'bug_status', @selectcolumns); - push(@selectcolumns, "bugs.component_id"); } if ($format->{'extension'} eq 'ics') { @@ -784,10 +751,9 @@ my $time_info = { 'estimated_time' => 0, 'time_present' => ($estimated_time || $remaining_time || $actual_time || $percentage_complete), }; - + my $bugowners = {}; my $bugproducts = {}; -my $bugcomponentids = {}; my $bugcomponents = {}; my $bugstatuses = {}; my @bugidlist; @@ -821,7 +787,6 @@ foreach my $row (@$data) { # Record the assignee, product, and status in the big hashes of those things. $bugowners->{$bug->{'assigned_to'}} = 1 if $bug->{'assigned_to'}; $bugproducts->{$bug->{'product'}} = 1 if $bug->{'product'}; - $bugcomponentids->{$bug->{'bugs.component_id'}} = 1 if $bug->{'bugs.component_id'}; $bugcomponents->{$bug->{'component'}} = 1 if $bug->{'component'}; $bugstatuses->{$bug->{'bug_status'}} = 1 if $bug->{'bug_status'}; @@ -945,7 +910,7 @@ if (scalar(@products) == 1) { # This is used in the "Zarroo Boogs" case. elsif (my @product_input = $cgi->param('product')) { if (scalar(@product_input) == 1 and $product_input[0] ne '') { - $one_product = Bugzilla::Product->new({ name => $product_input[0], cache => 1 }); + $one_product = Bugzilla::Product->new({ name => $cgi->param('product'), cache => 1 }); } } # We only want the template to use it if the user can actually @@ -989,9 +954,6 @@ if ($dotweak && scalar @bugs) { $vars->{'severities'} = get_legal_field_values('bug_severity'); $vars->{'resolutions'} = get_legal_field_values('resolution'); - ($vars->{'flag_types'}, $vars->{any_flags_requesteeble}) - = _get_common_flag_types([keys %$bugcomponentids]); - # Convert bug statuses to their ID. my @bug_statuses = map {$dbh->quote($_)} keys %$bugstatuses; my $bug_status_ids = diff --git a/mozilla/webtools/bugzilla/chart.cgi b/mozilla/webtools/bugzilla/chart.cgi index 96ac9e1cf70..015077650f0 100755 --- a/mozilla/webtools/bugzilla/chart.cgi +++ b/mozilla/webtools/bugzilla/chart.cgi @@ -1,4 +1,4 @@ -#!/usr/bin/perl -T +#!/usr/bin/perl -wT # This Source Code Form is subject to the terms of the Mozilla Public # License, v. 2.0. If a copy of the MPL was not distributed with this # file, You can obtain one at http://mozilla.org/MPL/2.0/. @@ -29,8 +29,6 @@ use 5.10.1; use strict; -use warnings; - use lib qw(. lib); use Bugzilla; diff --git a/mozilla/webtools/bugzilla/checksetup.pl b/mozilla/webtools/bugzilla/checksetup.pl index 50ca8bda878..145faf04e30 100755 --- a/mozilla/webtools/bugzilla/checksetup.pl +++ b/mozilla/webtools/bugzilla/checksetup.pl @@ -1,4 +1,4 @@ -#!/usr/bin/perl +#!/usr/bin/perl -w # This Source Code Form is subject to the terms of the Mozilla Public # License, v. 2.0. If a copy of the MPL was not distributed with this # file, You can obtain one at http://mozilla.org/MPL/2.0/. @@ -12,10 +12,8 @@ # Initialization ###################################################################### -use 5.10.1; use strict; -use warnings; - +use 5.10.1; use File::Basename; use Getopt::Long qw(:config bundling); use Pod::Usage; @@ -109,7 +107,7 @@ my $lc_hash = Bugzilla->localconfig; # At this point, localconfig is defined and is readable. So we know # everything we need to create the DB. We have to create it early, -# because some data required to populate data/params.json is stored in the DB. +# because some data required to populate data/params is stored in the DB. Bugzilla::DB::bz_check_requirements(!$silent); Bugzilla::DB::bz_create_database() if $lc_hash->{'db_check'}; @@ -364,7 +362,7 @@ L. =item 9 -Updates the system parameters (stored in F), using +Updates the system parameters (stored in F), using L. =item 10 diff --git a/mozilla/webtools/bugzilla/clean-bug-user-last-visit.pl b/mozilla/webtools/bugzilla/clean-bug-user-last-visit.pl index 57486bfed8e..9884b7c48fb 100644 --- a/mozilla/webtools/bugzilla/clean-bug-user-last-visit.pl +++ b/mozilla/webtools/bugzilla/clean-bug-user-last-visit.pl @@ -1,4 +1,4 @@ -#!/usr/bin/perl +#!/usr/bin/perl -wT # This Source Code Form is subject to the terms of the Mozilla Public # License, v. 2.0. If a copy of the MPL was not distributed with this # file, You can obtain one at http://mozilla.org/MPL/2.0/. diff --git a/mozilla/webtools/bugzilla/colchange.cgi b/mozilla/webtools/bugzilla/colchange.cgi index 77d9f11eef1..66b661e5a91 100755 --- a/mozilla/webtools/bugzilla/colchange.cgi +++ b/mozilla/webtools/bugzilla/colchange.cgi @@ -1,4 +1,4 @@ -#!/usr/bin/perl -T +#!/usr/bin/perl -wT # This Source Code Form is subject to the terms of the Mozilla Public # License, v. 2.0. If a copy of the MPL was not distributed with this # file, You can obtain one at http://mozilla.org/MPL/2.0/. @@ -8,8 +8,6 @@ use 5.10.1; use strict; -use warnings; - use lib qw(. lib); use Bugzilla; diff --git a/mozilla/webtools/bugzilla/collectstats.pl b/mozilla/webtools/bugzilla/collectstats.pl index 3473c9e7189..330fae5b39f 100755 --- a/mozilla/webtools/bugzilla/collectstats.pl +++ b/mozilla/webtools/bugzilla/collectstats.pl @@ -1,4 +1,4 @@ -#!/usr/bin/perl +#!/usr/bin/perl -w # This Source Code Form is subject to the terms of the Mozilla Public # License, v. 2.0. If a copy of the MPL was not distributed with this # file, You can obtain one at http://mozilla.org/MPL/2.0/. @@ -8,8 +8,6 @@ use 5.10.1; use strict; -use warnings; - use lib qw(. lib); use Getopt::Long qw(:config bundling); diff --git a/mozilla/webtools/bugzilla/config.cgi b/mozilla/webtools/bugzilla/config.cgi index 56a9a3f8a18..02f95472625 100755 --- a/mozilla/webtools/bugzilla/config.cgi +++ b/mozilla/webtools/bugzilla/config.cgi @@ -1,4 +1,4 @@ -#!/usr/bin/perl -T +#!/usr/bin/perl -wT # This Source Code Form is subject to the terms of the Mozilla Public # License, v. 2.0. If a copy of the MPL was not distributed with this # file, You can obtain one at http://mozilla.org/MPL/2.0/. @@ -8,8 +8,6 @@ use 5.10.1; use strict; -use warnings; - use lib qw(. lib); use Bugzilla; diff --git a/mozilla/webtools/bugzilla/contrib/Bugzilla.pm b/mozilla/webtools/bugzilla/contrib/Bugzilla.pm index 31e0a0f6d0b..fbae60de4a3 100644 --- a/mozilla/webtools/bugzilla/contrib/Bugzilla.pm +++ b/mozilla/webtools/bugzilla/contrib/Bugzilla.pm @@ -6,7 +6,6 @@ package Bugzilla; use 5.10.1; use strict; -use warnings; ####################################################################### # The goal of this tiny module is to let Bugzilla packagers of # diff --git a/mozilla/webtools/bugzilla/contrib/README b/mozilla/webtools/bugzilla/contrib/README index f0d83086a24..f8206292523 100644 --- a/mozilla/webtools/bugzilla/contrib/README +++ b/mozilla/webtools/bugzilla/contrib/README @@ -33,10 +33,6 @@ bz_webservice_demo.pl -- An example script that demonstrates how to talk to recode.pl -- Script to convert a database from one encoding (or multiple encodings) to UTF-8. - replyrc -- A config file for Reply (a perl shell) that loads - Bugzilla, extensions and provides a few utility - functions for manipulating Bugzilla data. - sendbugmail.pl -- This script is a drop-in replacement for the 'processmail' script which used to be shipped with Bugzilla, but was replaced by the diff --git a/mozilla/webtools/bugzilla/contrib/bz_webservice_demo.pl b/mozilla/webtools/bugzilla/contrib/bz_webservice_demo.pl index af8c253084f..8850d642ad3 100755 --- a/mozilla/webtools/bugzilla/contrib/bz_webservice_demo.pl +++ b/mozilla/webtools/bugzilla/contrib/bz_webservice_demo.pl @@ -1,4 +1,4 @@ -#!/usr/bin/perl +#!/usr/bin/perl -w # This Source Code Form is subject to the terms of the Mozilla Public # License, v. 2.0. If a copy of the MPL was not distributed with this # file, You can obtain one at http://mozilla.org/MPL/2.0/. @@ -18,10 +18,7 @@ C for detailed help =cut -use 5.10.1; use strict; -use warnings; - use lib qw(lib); use Getopt::Long; use Pod::Usage; diff --git a/mozilla/webtools/bugzilla/contrib/bzdbcopy.pl b/mozilla/webtools/bugzilla/contrib/bzdbcopy.pl index fcdbefd56d3..f50002e85c2 100755 --- a/mozilla/webtools/bugzilla/contrib/bzdbcopy.pl +++ b/mozilla/webtools/bugzilla/contrib/bzdbcopy.pl @@ -1,4 +1,4 @@ -#!/usr/bin/perl +#!/usr/bin/perl -w # This Source Code Form is subject to the terms of the Mozilla Public # License, v. 2.0. If a copy of the MPL was not distributed with this # file, You can obtain one at http://mozilla.org/MPL/2.0/. @@ -6,10 +6,7 @@ # This Source Code Form is "Incompatible With Secondary Licenses", as # defined by the Mozilla Public License, v. 2.0. -use 5.10.1; use strict; -use warnings; - use lib qw(. lib); use Bugzilla; use Bugzilla::Constants; diff --git a/mozilla/webtools/bugzilla/contrib/console.pl b/mozilla/webtools/bugzilla/contrib/console.pl index fe2342cd9b0..dbd514ebdfb 100644 --- a/mozilla/webtools/bugzilla/contrib/console.pl +++ b/mozilla/webtools/bugzilla/contrib/console.pl @@ -1,4 +1,4 @@ -#!/usr/bin/perl +#!/usr/bin/perl -w # This Source Code Form is subject to the terms of the Mozilla Public # License, v. 2.0. If a copy of the MPL was not distributed with this # file, You can obtain one at http://mozilla.org/MPL/2.0/. @@ -6,8 +6,6 @@ # This Source Code Form is "Incompatible With Secondary Licenses", as # defined by the Mozilla Public License, v. 2.0. -use warnings; - use File::Basename; BEGIN { chdir dirname($0) . "/.."; } use lib qw(. lib); @@ -53,7 +51,7 @@ sub d { # p: print as a single string (normal behavior puts list items on separate lines) sub p { - no warnings; # suppress possible undefined var message + local $^W=0; # suppress possible undefined var message print(@_, "\n"); return (); } diff --git a/mozilla/webtools/bugzilla/contrib/convert-workflow.pl b/mozilla/webtools/bugzilla/contrib/convert-workflow.pl index d9bffb7bbed..8f76dac7f6d 100644 --- a/mozilla/webtools/bugzilla/contrib/convert-workflow.pl +++ b/mozilla/webtools/bugzilla/contrib/convert-workflow.pl @@ -1,4 +1,4 @@ -#!/usr/bin/perl +#!/usr/bin/perl -w # This Source Code Form is subject to the terms of the Mozilla Public # License, v. 2.0. If a copy of the MPL was not distributed with this # file, You can obtain one at http://mozilla.org/MPL/2.0/. @@ -6,10 +6,7 @@ # This Source Code Form is "Incompatible With Secondary Licenses", as # defined by the Mozilla Public License, v. 2.0. -use 5.10.1; use strict; -use warnings; - use lib qw(. lib); use Bugzilla; diff --git a/mozilla/webtools/bugzilla/contrib/extension-convert.pl b/mozilla/webtools/bugzilla/contrib/extension-convert.pl index 91a77b83943..4e24b614ac8 100644 --- a/mozilla/webtools/bugzilla/contrib/extension-convert.pl +++ b/mozilla/webtools/bugzilla/contrib/extension-convert.pl @@ -1,4 +1,4 @@ -#!/usr/bin/perl +#!/usr/bin/perl -w # This Source Code Form is subject to the terms of the Mozilla Public # License, v. 2.0. If a copy of the MPL was not distributed with this # file, You can obtain one at http://mozilla.org/MPL/2.0/. @@ -6,10 +6,8 @@ # This Source Code Form is "Incompatible With Secondary Licenses", as # defined by the Mozilla Public License, v. 2.0. -use 5.10.1; use strict; use warnings; - use lib qw(. lib); use Bugzilla; @@ -70,8 +68,6 @@ my ($modules, $subs) = code_files_to_subroutines($to_dir); my $config_pm = < '$extension_name'; $install_requirements __PACKAGE__->NAME; @@ -80,8 +76,6 @@ END my $extension_pm = <selectcol_arrayref(" SELECT earlier.id FROM bug_user_last_visit as earlier INNER JOIN bug_user_last_visit as later - ON (earlier.user_id != later.user_id - AND earlier.last_visit_ts < later.last_visit_ts + ON (earlier.user_id != later.user_id AND earlier.last_visit_ts < later.last_visit_ts AND earlier.bug_id = later.bug_id) WHERE (earlier.user_id = ? OR earlier.user_id = ?) AND (later.user_id = ? OR later.user_id = ?)", undef, $old_id, $new_id, $old_id, $new_id); - -if (@$dupe_ids) { - $dbh->do("DELETE FROM bug_user_last_visit WHERE " . - $dbh->sql_in('id', $dupe_ids)); -} +$dbh->do("DELETE FROM bug_user_last_visit WHERE " . $dbh->sql_in('id', $dupe_ids)); # Migrate records from old user to new user. foreach my $table (keys %changes) { diff --git a/mozilla/webtools/bugzilla/contrib/mysqld-watcher.pl b/mozilla/webtools/bugzilla/contrib/mysqld-watcher.pl index be93dcbb5df..08a87b5fe73 100755 --- a/mozilla/webtools/bugzilla/contrib/mysqld-watcher.pl +++ b/mozilla/webtools/bugzilla/contrib/mysqld-watcher.pl @@ -1,4 +1,4 @@ -#!/usr/bin/perl +#!/usr/bin/perl -w # This Source Code Form is subject to the terms of the Mozilla Public # License, v. 2.0. If a copy of the MPL was not distributed with this # file, You can obtain one at http://mozilla.org/MPL/2.0/. @@ -9,9 +9,7 @@ # mysqld-watcher.pl - a script that watches the running instance of # mysqld and kills off any long-running SELECTs against the shadow_db # -use 5.10.1; use strict; -use warnings; # some configurables: diff --git a/mozilla/webtools/bugzilla/contrib/recode.pl b/mozilla/webtools/bugzilla/contrib/recode.pl index e6da47b924a..de204f15568 100755 --- a/mozilla/webtools/bugzilla/contrib/recode.pl +++ b/mozilla/webtools/bugzilla/contrib/recode.pl @@ -1,4 +1,4 @@ -#!/usr/bin/perl +#!/usr/bin/perl -w # This Source Code Form is subject to the terms of the Mozilla Public # License, v. 2.0. If a copy of the MPL was not distributed with this # file, You can obtain one at http://mozilla.org/MPL/2.0/. @@ -6,10 +6,7 @@ # This Source Code Form is "Incompatible With Secondary Licenses", as # defined by the Mozilla Public License, v. 2.0. -use 5.10.1; use strict; -use warnings; - use lib qw(. lib); use Bugzilla; diff --git a/mozilla/webtools/bugzilla/contrib/replyrc b/mozilla/webtools/bugzilla/contrib/replyrc deleted file mode 100644 index 2c5541e4c8f..00000000000 --- a/mozilla/webtools/bugzilla/contrib/replyrc +++ /dev/null @@ -1,30 +0,0 @@ -# This is a config file for Reply, -# which is a cpan distribution. You can install it with "cpan Reply" or "cpanm Reply". -# To use this config file, either copy as ~/.replyrc or run the following command: -# reply --cfg `pwd`/contrib/replyrc - -script_line1 = use strict; -script_line2 = use warnings; -script_line3 = use v5.10; -script_line4 = use Bugzilla; -script_line5 = Bugzilla->extensions; 1; -script_line6 = sub filter { Bugzilla->template->{SERVICE}->{CONTEXT}->{CONFIG}->{FILTERS}->{$_[0]} } -script_line7 = sub b { Bugzilla::Bug->new(@_) } -script_line8 = sub u { Bugzilla::User->new(@_) } -script_line9 = sub f { Bugzilla::Field->new(@_) } - -[Interrupt] -[FancyPrompt] -[DataDumper] -[Colors] -[ReadLine] -[Hints] -[Packages] -[LexicalPersistence] -[ResultCache] -[Autocomplete::Packages] -[Autocomplete::Lexicals] -[Autocomplete::Functions] -[Autocomplete::Globals] -[Autocomplete::Methods] -[Autocomplete::Commands] diff --git a/mozilla/webtools/bugzilla/contrib/sendbugmail.pl b/mozilla/webtools/bugzilla/contrib/sendbugmail.pl index 223d91f6c6d..da0eafd30f0 100755 --- a/mozilla/webtools/bugzilla/contrib/sendbugmail.pl +++ b/mozilla/webtools/bugzilla/contrib/sendbugmail.pl @@ -1,4 +1,4 @@ -#!/usr/bin/perl -T +#!/usr/bin/perl -wT # This Source Code Form is subject to the terms of the Mozilla Public # License, v. 2.0. If a copy of the MPL was not distributed with this # file, You can obtain one at http://mozilla.org/MPL/2.0/. @@ -8,8 +8,6 @@ use 5.10.1; use strict; -use warnings; - use lib qw(. lib); use Bugzilla; diff --git a/mozilla/webtools/bugzilla/contrib/sendunsentbugmail.pl b/mozilla/webtools/bugzilla/contrib/sendunsentbugmail.pl index b9034aa8de2..47455413562 100755 --- a/mozilla/webtools/bugzilla/contrib/sendunsentbugmail.pl +++ b/mozilla/webtools/bugzilla/contrib/sendunsentbugmail.pl @@ -1,4 +1,4 @@ -#!/usr/bin/perl -T +#!/usr/bin/perl -wT # This Source Code Form is subject to the terms of the Mozilla Public # License, v. 2.0. If a copy of the MPL was not distributed with this # file, You can obtain one at http://mozilla.org/MPL/2.0/. @@ -8,8 +8,6 @@ use 5.10.1; use strict; -use warnings; - use lib qw(. lib); use Bugzilla; diff --git a/mozilla/webtools/bugzilla/contrib/syncLDAP.pl b/mozilla/webtools/bugzilla/contrib/syncLDAP.pl index f618624ec31..6ad96477bbe 100755 --- a/mozilla/webtools/bugzilla/contrib/syncLDAP.pl +++ b/mozilla/webtools/bugzilla/contrib/syncLDAP.pl @@ -1,4 +1,4 @@ -#!/usr/bin/perl -T +#!/usr/bin/perl -wT # This Source Code Form is subject to the terms of the Mozilla Public # License, v. 2.0. If a copy of the MPL was not distributed with this # file, You can obtain one at http://mozilla.org/MPL/2.0/. @@ -6,9 +6,7 @@ # This Source Code Form is "Incompatible With Secondary Licenses", as # defined by the Mozilla Public License, v. 2.0. -use 5.10.1; use strict; -use warnings; use lib qw(. lib); diff --git a/mozilla/webtools/bugzilla/createaccount.cgi b/mozilla/webtools/bugzilla/createaccount.cgi index 21d6cc8db34..c9516ab00fc 100755 --- a/mozilla/webtools/bugzilla/createaccount.cgi +++ b/mozilla/webtools/bugzilla/createaccount.cgi @@ -1,4 +1,4 @@ -#!/usr/bin/perl -T +#!/usr/bin/perl -wT # This Source Code Form is subject to the terms of the Mozilla Public # License, v. 2.0. If a copy of the MPL was not distributed with this # file, You can obtain one at http://mozilla.org/MPL/2.0/. @@ -8,8 +8,6 @@ use 5.10.1; use strict; -use warnings; - use lib qw(. lib); use Bugzilla; diff --git a/mozilla/webtools/bugzilla/describecomponents.cgi b/mozilla/webtools/bugzilla/describecomponents.cgi index f74dc75f43b..db8260b5d47 100755 --- a/mozilla/webtools/bugzilla/describecomponents.cgi +++ b/mozilla/webtools/bugzilla/describecomponents.cgi @@ -1,4 +1,4 @@ -#!/usr/bin/perl -T +#!/usr/bin/perl -wT # This Source Code Form is subject to the terms of the Mozilla Public # License, v. 2.0. If a copy of the MPL was not distributed with this # file, You can obtain one at http://mozilla.org/MPL/2.0/. @@ -8,8 +8,6 @@ use 5.10.1; use strict; -use warnings; - use lib qw(. lib); use Bugzilla; diff --git a/mozilla/webtools/bugzilla/describekeywords.cgi b/mozilla/webtools/bugzilla/describekeywords.cgi index 31bf0c13e11..2147ac47dc0 100755 --- a/mozilla/webtools/bugzilla/describekeywords.cgi +++ b/mozilla/webtools/bugzilla/describekeywords.cgi @@ -1,4 +1,4 @@ -#!/usr/bin/perl -T +#!/usr/bin/perl -wT # This Source Code Form is subject to the terms of the Mozilla Public # License, v. 2.0. If a copy of the MPL was not distributed with this # file, You can obtain one at http://mozilla.org/MPL/2.0/. @@ -8,8 +8,6 @@ use 5.10.1; use strict; -use warnings; - use lib qw(. lib); use Bugzilla; diff --git a/mozilla/webtools/bugzilla/docs/en/rst/administration.rst b/mozilla/webtools/bugzilla/docs/en/rst/administration.rst index df7631fdbda..81dc35107c5 100644 --- a/mozilla/webtools/bugzilla/docs/en/rst/administration.rst +++ b/mozilla/webtools/bugzilla/docs/en/rst/administration.rst @@ -346,7 +346,7 @@ user_verify_class well, you may otherwise not be able to log back in to Bugzilla once you log out. If this happens to you, you will need to manually edit - :file:`data/params.json` and set user_verify_class to + :file:`data/params` and set user_verify_class to ``DB``. LDAPserver @@ -414,7 +414,7 @@ user_verify_class well, you may otherwise not be able to log back in to Bugzilla once you log out. If this happens to you, you will need to manually edit - :file:`data/params.json` and set user_verify_class to + :file:`data/params` and set user_verify_class to ``DB``. RADIUS_server diff --git a/mozilla/webtools/bugzilla/docs/en/rst/api.rst b/mozilla/webtools/bugzilla/docs/en/rst/api.rst deleted file mode 100644 index 99cb94c6d04..00000000000 --- a/mozilla/webtools/bugzilla/docs/en/rst/api.rst +++ /dev/null @@ -1,11 +0,0 @@ -WebService API -============== - -This Bugzilla installation has the following WebService APIs available -(as of the last time you compiled the documentation): - -.. toctree:: - :glob: - - api/core/v*/index* - api/extensions/*/v*/index* diff --git a/mozilla/webtools/bugzilla/docs/en/rst/api/core/v1/attachment.rst b/mozilla/webtools/bugzilla/docs/en/rst/api/core/v1/attachment.rst deleted file mode 100644 index 22a57af6048..00000000000 --- a/mozilla/webtools/bugzilla/docs/en/rst/api/core/v1/attachment.rst +++ /dev/null @@ -1,357 +0,0 @@ -Attachments -=========== - -The Bugzilla API for creating, changing, and getting the details of attachments. - -.. _rest_attachments: - -Get Attachment --------------- - -This allows you to get data about attachments, given a list of bugs and/or -attachment IDs. Private attachments will only be returned if you are in the -appropriate group or if you are the submitter of the attachment. - -**Request** - -To get all current attachments for a bug: - -.. code-block:: text - - GET /rest/bug/(bug_id)/attachment - -To get a specific attachment based on attachment ID: - -.. code-block:: text - - GET /rest/bug/attachment/(attachment_id) - -One of the below must be specified. - -================= ==== ====================================================== -name type description -================= ==== ====================================================== -**bug_id** int Integer bug ID. -**attachment_id** int Integer attachment ID. -================= ==== ====================================================== - -**Response** - -.. code-block:: js - - { - "bugs" : { - "1345" : [ - { (attachment) }, - { (attachment) } - ], - "9874" : [ - { (attachment) }, - { (attachment) } - ], - }, - "attachments" : { - "234" : { (attachment) }, - "123" : { (attachment) }, - } - } - -An object containing two elements: ``bugs`` and ``attachments``. - -The attachments for the bug that you specified in the ``bug_id`` argument in -input are returned in ``bugs`` on output. ``bugs`` is a object that has integer -bug IDs for keys and the values are arrays of objects as attachments. -(Fields for attachments are described below.) - -For the attachment that you specified directly in ``attachment_id``, they -are returned in ``attachments`` on output. This is a object where the attachment -ids point directly to objects describing the individual attachment. - -The fields for each attachment (where it says ``(attachment)`` in the -sample response above) are: - -================ ======== ===================================================== -name type description -================ ======== ===================================================== -data base64 The raw data of the attachment, encoded as Base64. -size int The length (in bytes) of the attachment. -creation_time datetime The time the attachment was created. -last_change_time datetime The last time the attachment was modified. -id int The numeric ID of the attachment. -bug_id int The numeric ID of the bug that the attachment is - attached to. -file_name string The file name of the attachment. -summary string A short string describing the attachment. -content_type string The MIME type of the attachment. -is_private boolean ``true`` if the attachment is private (only visible - to a certain group called the "insidergroup", - ``false`` otherwise. -is_obsolete boolean ``true`` if the attachment is obsolete, ``false`` - otherwise. -is_patch boolean ``true`` if the attachment is a patch, ``false`` - otherwise. -creator string The login name of the user that created the - attachment. -flags array Array of objects, each containing the information - about the flag currently set for each attachment. - Each flag object contains items descibed in the - Flag object below. -================ ======== ===================================================== - -Flag object: - -================= ======== ==================================================== -name type description -================= ======== ==================================================== -id int The ID of the flag. -name string The name of the flag. -type_id int The type ID of the flag. -creation_date datetime The timestamp when this flag was originally created. -modification_date datetime The timestamp when the flag was last modified. -status string The current status of the flag such as ?, +, or -. -setter string The login name of the user who created or last - modified the flag. -requestee string The login name of the user this flag has been - requested to be granted or denied. Note, this field - is only returned if a requestee is set. -================= ======== ==================================================== - -.. _rest_add_attachment: - -Create Attachment ------------------ - -This allows you to add an attachment to a bug in Bugzilla. - -**Request** - -To create attachment on a current bug: - -.. code-block:: text - - POST /rest/bug/(bug_id)/attachment - -.. code-block:: js - - { - "ids" : [ 35 ], - "is_patch" : true, - "comment" : "This is a new attachment comment", - "is_markdown" : true, - "summary" : "Test Attachment", - "content_type" : "text/plain", - "data" : "(Some patch content)", - "file_name" : "test_attachment.patch", - "obsoletes" : [], - "is_private" : false, - "flags" : [ - { - "name" : "review", - "status" : "?", - "requestee" : "user@bugzilla.org", - "new" : true - } - ] - } - - -The params to include in the POST body, as well as the returned -data format, are the same as below. The ``bug_id`` param will be -overridden as it it pulled from the URL path. - -================ ======= ====================================================== -name type description -================ ======= ====================================================== -**ids** array The IDs or aliases of bugs that you want to add this - attachment to. The same attachment and comment will be - added to all these bugs. -**data** string The content of the attachment. If the content of the - attachment is not ASCII text such as - ``application/octet-stream`` you must encode it in - base64 using an appropriate client library such as - ``MIME::Base64`` for Perl. -**file_name** string The "file name" that will be displayed in the UI for - this attachment and also downloaded copies will be - given. -**summary** string A short string describing the attachment. -**content_type** string The MIME type of the attachment, like ``text/plain`` - or ``image/png``. -comment string A comment to add along with this attachment. -is_patch boolean ``true`` if Bugzilla should treat this attachment as a - patch. If you specify this, you do not need to specify - a ``content_type``. The ``content_type`` of the - attachment will be forced to ``text/plain``. Defaults - to ``false`` if not specified. -is_private boolean ``true`` if the attachment should be private - (restricted to the "insidergroup"), ``false`` if the - attachment should be public. Defaults to ``false`` if - not specified. -is_markdown boolean If set to ``true``, the comment has Markdown structures; - otherwise, it is normal text. -flags array Flags objects to add to the attachment. The object - format is described in the Flag object below. -================ ======= ====================================================== - -Flag object: - -To create a flag, at least the ``status`` and the ``type_id`` or ``name`` must -be provided. An optional requestee can be passed if the flag type is requestable -to a specific user. - -========= ====== ============================================================== -name type description -========= ====== ============================================================== -name string The name of the flag type. -type_id int The internal flag type ID. -status string The flags new status (i.e. "?", "+", "-" or "X" to clear a - flag). -requestee string The login of the requestee if the flag type is requestable to - a specific user. -========= ====== ============================================================== - -**Response** - -.. code-block:: js - - { - "ids" : [ - "2797" - ] - } - -==== ===== ========================= -name type description -==== ===== ========================= -ids array Attachment IDs created. -==== ===== ========================= - -.. _rest_update_attachment: - -Update Attachment ------------------ - -This allows you to update attachment metadata in Bugzilla. - -**Request** - -To update attachment metadata on a current attachment: - -.. code-block:: text - - PUT /rest/bug/attachment/(attachment_id) - -.. code-block:: js - - { - "ids" : [ 2796 ], - "summary" : "Test XML file", - "comment" : "Changed this from a patch to a XML file", - "is_markdown" : true, - "content_type" : "text/xml", - "is_patch" : 0 - } - -================= ===== ======================================================= -name type description -================= ===== ======================================================= -**attachment_id** int Integer attachment ID. -**ids** array The IDs of the attachments you want to update. -================= ===== ======================================================= - -============ ======= ========================================================== -name type description -============ ======= ========================================================== -file_name string The "file name" that will be displayed in the UI for this - attachment. -summary string A short string describing the attachment. -comment string An optional comment to add to the attachment's bug. -is_markdown boolean If set to ``true``, the comment has Markdown structures; - otherwise, it is normal text. -content_type string The MIME type of the attachment, like ``text/plain`` - or ``image/png``. -is_patch boolean ``true`` if Bugzilla should treat this attachment as a - patch. If you specify this, you do not need to specify a - ``content_type``. The ``content_type`` of the attachment - will be forced to ``text/plain``. -is_private boolean ``true`` if the attachment should be private (restricted - to the "insidergroup"), ``false`` if the attachment - should be public. -is_obsolete boolean ``true`` if the attachment is obsolete, ``false`` - otherwise. -flags array An array of Flag objects with changes to the flags. The - object format is described in the Flag object below. -============ ======= ========================================================== - -Flag object: - -The following values can be specified. At least the ``status`` and one of -``type_id``, ``id``, or ``name`` must be specified. If a type_id or name matches -a single currently set flag, the flag will be updated unless ``new`` is specified. - -========= ======= ============================================================= -name type description -========= ======= ============================================================= -name string The name of the flag that will be created or updated. -type_id int The internal flag type ID that will be created or updated. - You will need to specify the ``type_id`` if more than one - flag type of the same name exists. -status string The flags new status (i.e. "?", "+", "-" or "X" to clear a - flag). -requestee string The login of the requestee if the flag type is requestable - to a specific user. -id int Use ID to specify the flag to be updated. You will need to - specify the ``id`` if more than one flag is set of the same - name. -new boolean Set to true if you specifically want a new flag to be - created. -========= ======= ============================================================= - -**Response** - -.. code-block:: js - - { - "attachments" : [ - { - "changes" : { - "content_type" : { - "added" : "text/xml", - "removed" : "text/plain" - }, - "is_patch" : { - "added" : "0", - "removed" : "1" - }, - "summary" : { - "added" : "Test XML file", - "removed" : "test patch" - } - }, - "id" : 2796, - "last_change_time" : "2014-09-29T14:41:53Z" - } - ] - } - -``attachments`` (array) Change objects with the following items: - -================ ======== ===================================================== -name type description -================ ======== ===================================================== -id int The ID of the attachment that was updated. -last_change_time datetime The exact time that this update was done at, for this - attachment. If no update was done (that is, no fields - had their values changed and no comment was added) - then this will instead be the last time the - attachment was updated. -changes object The changes that were actually done on this - attachment. The keys are the names of the fields that - were changed, and the values are an object with two - items: - - * added: (string) The values that were added to this - field. Possibly a comma-and-space-separated list - if multiple values were added. - * removed: (string) The values that were removed from - this field. -================ ======== ===================================================== diff --git a/mozilla/webtools/bugzilla/docs/en/rst/api/core/v1/bug-user-last-visit.rst b/mozilla/webtools/bugzilla/docs/en/rst/api/core/v1/bug-user-last-visit.rst deleted file mode 100644 index 91974496807..00000000000 --- a/mozilla/webtools/bugzilla/docs/en/rst/api/core/v1/bug-user-last-visit.rst +++ /dev/null @@ -1,111 +0,0 @@ -Bug User Last Visited -===================== - -.. _rest-bug-user-last-visit-update: - -Update Last Visited -------------------- - -Update the last-visited time for the specified bug and current user. - -**Request** - -To update the time for a single bug id: - -.. code-block:: text - - POST /rest/bug_user_last_visit/(id) - -To update one or more bug ids at once: - -.. code-block:: text - - POST /rest/bug_user_last_visit - -.. code-block:: js - - { - "ids" : [35,36,37] - } - -======= ===== ============================== -name type description -======= ===== ============================== -**id** int An integer bug id. -**ids** array One or more bug ids to update. -======= ===== ============================== - -**Response** - -.. code-block:: js - - [ - { - "id" : 100, - "last_visit_ts" : "2014-10-16T17:38:24Z" - } - ] - -An array of objects containing the items: - -============= ======== ============================================ -name type description -============= ======== ============================================ -id int The bug id. -last_visit_ts datetime The timestamp the user last visited the bug. -============= ======== ============================================ - -.. _rest-bug-user-last-visit-get: - -Get Last Visited ----------------- - -**Request** - -Get the last-visited timestamp for one or more specified bug ids or get a -list of the last 20 visited bugs and their timestamps. - -To return the last-visited timestamp for a single bug id: - -.. code-block:: text - - GET /rest/bug_user_last_visit/(id) - -To return more than one specific bug timestamps: - -.. code-block:: text - - GET /rest/bug_user_last_visit/123?ids=234&ids=456 - -To return just the most recent 20 timestamps: - -.. code-block:: text - - GET /rest/bug_user_last_visit - -======= ===== ============================================ -name type description -======= ===== ============================================ -**id** int An integer bug id. -**ids** array One or more optional bug ids to get. -======= ===== ============================================ - -**Response** - -.. code-block:: js - - [ - { - "id" : 100, - "last_visit_ts" : "2014-10-16T17:38:24Z" - } - ] - -An array of objects containing the following items: - -============= ======== ============================================ -name type description -============= ======== ============================================ -id int The bug id. -last_visit_ts datetime The timestamp the user last visited the bug. -============= ======== ============================================ diff --git a/mozilla/webtools/bugzilla/docs/en/rst/api/core/v1/bug.rst b/mozilla/webtools/bugzilla/docs/en/rst/api/core/v1/bug.rst deleted file mode 100644 index 6b9be97cb10..00000000000 --- a/mozilla/webtools/bugzilla/docs/en/rst/api/core/v1/bug.rst +++ /dev/null @@ -1,991 +0,0 @@ -Bugs -==== - -The REST API for creating, changing, and getting the details of bugs. - -This part of the Bugzilla REST API allows you to file new bugs in Bugzilla and -to get information about existing bugs. - -.. _rest_single_bug: - -Get Bug -------- - -Gets information about particular bugs in the database. - -**Request** - -To get information about a particular bug using its ID or alias: - -.. code-block:: text - - GET /rest/bug/(id_or_alias) - -You can also use :ref:`rest_search_bugs` to return more than one bug at a time -by specifying bug IDs as the search terms. - -.. code-block:: text - - GET /rest/bug?id=12434,43421 - -================ ===== ====================================================== -name type description -================ ===== ====================================================== -**id_or_alias** mixed An integer bug ID or a bug alias string. -================ ===== ====================================================== - -**Response** - -.. code-block:: js - - { - "faults": [], - "bugs": [ - { - "assigned_to_detail": { - "id": 2, - "real_name": "Test User", - "name": "user@bugzilla.org", - "email": "user@bugzilla.org" - }, - "flags": [ - { - "type_id": 11, - "modification_date": "2014-09-28T21:03:47Z", - "name": "blocker", - "status": "?", - "id": 2906, - "setter": "user@bugzilla.org", - "creation_date": "2014-09-28T21:03:47Z" - } - ], - "resolution": "INVALID", - "id": 35, - "qa_contact": "", - "version": "1.0", - "status": "RESOLVED", - "creator": "user@bugzilla.org", - "cf_drop_down": "---", - "summary": "test bug", - "last_change_time": "2014-09-23T19:12:17Z", - "platform": "All", - "url": "", - "classification": "Unclassified", - "cc_detail": [ - { - "id": 786, - "real_name": "Foo Bar", - "name": "foo@bar.com", - "email": "foo@bar.com" - }, - ], - "priority": "P1", - "is_confirmed": true, - "creation_time": "2000-07-25T13:50:04Z", - "assigned_to": "user@bugzilla.org", - "flags": [], - "alias": [], - "cf_large_text": "", - "groups": [], - "op_sys": "All", - "cf_bug_id": null, - "depends_on": [], - "is_cc_accessible": true, - "is_open": false, - "cf_qa_list_4": "---", - "keywords": [], - "cc": [ - "foo@bar.com", - ], - "see_also": [], - "deadline": null, - "is_creator_accessible": true, - "whiteboard": "", - "dupe_of": null, - "target_milestone": "---", - "cf_mulitple_select": [], - "component": "SaltSprinkler", - "severity": "critical", - "cf_date": null, - "product": "FoodReplicator", - "creator_detail": { - "id": 28, - "real_name": "hello", - "name": "user@bugzilla.org", - "email": "namachi@netscape.com" - }, - "cf_free_text": "", - "blocks": [] - } - ] - } - -``bugs`` (array) Each bug object contains information about the bugs with valid -ids containing the following items: - -These fields are returned by default or by specifying ``_default`` in -``include_fields``. - -===================== ======== ================================================ -name type description -===================== ======== ================================================ -actual_time double The total number of hours that this bug has - taken so far. If you are not in the time-tracking - group, this field will not be included in the - return value. -alias array The unique aliases of this bug. An empty array - will be returned if this bug has no aliases. -assigned_to string The login name of the user to whom the bug is - assigned. -assigned_to_detail object An object containing detailed user information - for the assigned_to. To see the keys included - in the user detail object, see below. -blocks array The IDs of bugs that are "blocked" by this bug. -cc array The login names of users on the CC list of this - bug. -cc_detail array Array of objects containing detailed user - information for each of the cc list members. - To see the keys included in the user detail - object, see below. -classification string The name of the current classification the bug - is in. -component string The name of the current component of this bug. -creation_time datetime When the bug was created. -creator string The login name of the person who filed this bug - (the reporter). -creator_detail object An object containing detailed user information - for the creator. To see the keys included in the - user detail object, see below. -deadline string The day that this bug is due to be completed, in - the format ``YYYY-MM-DD``. -depends_on array The IDs of bugs that this bug "depends on". -dupe_of int The bug ID of the bug that this bug is a - duplicate of. If this bug isn't a duplicate of - any bug, this will be null. -estimated_time double The number of hours that it was estimated that - this bug would take. If you are not in the - time-tracking group, this field will not be - included in the return value. -flags array An array of objects containing the information - about flags currently set for the bug. Each flag - objects contains the following items -groups array The names of all the groups that this bug is in. -id int The unique numeric ID of this bug. -is_cc_accessible boolean If true, this bug can be accessed by members of - the CC list, even if they are not in the groups - the bug is restricted to. -is_confirmed boolean ``true`` if the bug has been confirmed. Usually - this means that the bug has at some point been - moved out of the ``UNCONFIRMED`` status and into - another open status. -is_open boolean ``true`` if this bug is open, ``false`` if it - is closed. -is_creator_accessible boolean If ``true``, this bug can be accessed by the - creator of the bug, even if they are not a - member of the groups the bug is restricted to. -keywords array Each keyword that is on this bug. -last_change_time datetime When the bug was last changed. -op_sys string The name of the operating system that the bug - was filed against. -platform string The name of the platform (hardware) that the bug - was filed against. -priority string The priority of the bug. -product string The name of the product this bug is in. -qa_contact string The login name of the current QA Contact on the - bug. -qa_contact_detail object An object containing detailed user information - for the qa_contact. To see the keys included in - the user detail object, see below. -remaining_time double The number of hours of work remaining until work - on this bug is complete. If you are not in the - time-tracking group, this field will not be - included in the return value. -resolution string The current resolution of the bug, or an empty - string if the bug is open. -see_also array The URLs in the See Also field on the bug. -severity string The current severity of the bug. -status string The current status of the bug. -summary string The summary of this bug. -target_milestone string The milestone that this bug is supposed to be - fixed by, or for closed bugs, the milestone that - it was fixed for. -update_token string The token that you would have to pass to the - ``process_bug.cgi`` page in order to update this - bug. This changes every time the bug is updated. - This field is not returned to logged-out users. -url string A URL that demonstrates the problem described in - the bug, or is somehow related to the bug report. -version string The version the bug was reported against. -whiteboard string The value of the "status whiteboard" field on - the bug. -===================== ======== ================================================ - -Custom fields: - -Every custom field in this installation will also be included in the -return value. Most fields are returned as strings. However, some field types have -different return values. - -Normally custom fields are returned by default similar to normal bug fields or -you can specify only custom fields by using ``_custom`` in ``include_fields``. - -Extra fields: - -These fields are returned only by specifying ``_extra`` or the field name in -``include_fields``. - -==== ===== ==================================================================== -name type description -==== ===== ==================================================================== -tags array Each array item is a tag name. Note that tags are - personal to the currently logged in user and are not the same as - comment tags. -==== ===== ==================================================================== - -User object: - -========= ====== ============================================================== -name type description -========= ====== ============================================================== -id int The user ID for this user. -real_name string The 'real' name for this user, if any. -name string The user's Bugzilla login. -email string The user's email address. Currently this is the same value as - the name. -========= ====== ============================================================== - -Flag object: - -================= ======== ==================================================== -name type description -================= ======== ==================================================== -id int The ID of the flag. -name string The name of the flag. -type_id int The type ID of the flag. -creation_date datetime The timestamp when this flag was originally created. -modification_date datetime The timestamp when the flag was last modified. -status string The current status of the flag. -setter string The login name of the user who created or last - modified the flag. -requestee string The login name of the user this flag has been - requested to be granted or denied. Note, this field - is only returned if a requestee is set. -================= ======== ==================================================== - -Custom field object: - -You can specify to only return custom fields by specifying ``_custom`` or the -field name in ``include_fields``. - -* Bug ID Fields: (int) -* Multiple-Selection Fields: (array of strings) -* Date/Time Fields: (datetime) - -.. _rest_history: - -Bug History ------------ - -Gets the history of changes for particular bugs in the database. - -**Request** - -To get the history for a specific bug ID: - -.. code-block:: text - - GET /rest/bug/(id)/history - -To get the history for a bug since a specific date: - -.. code-block:: text - - GET /rest/bug/(id)/history?new_since=YYYY-MM-DD - -========= ======== ============================================================ -name type description -========= ======== ============================================================ -**id** mixed An integer bug ID or alias. -new_since datetime A datetime timestamp to only show history since. -========= ======== ============================================================ - -**Response** - -.. code-block:: js - - { - "bugs": [ - { - "alias": [], - "history": [ - { - "when": "2014-09-23T19:12:17Z", - "who": "user@bugzilla.org", - "changes": [ - { - "added": "P1", - "field_name": "priority", - "removed": "P2" - }, - { - "removed": "blocker", - "field_name": "severity", - "added": "critical" - } - ] - }, - { - "when": "2014-09-28T21:03:47Z", - "who": "user@bugzilla.org", - "changes": [ - { - "added": "blocker?", - "removed": "", - "field_name": "flagtypes.name" - } - ] - } - ], - "id": 35 - } - ] - } - -``bugs`` (array) Bug objects each containing the following items: - -======= ===== ================================================================= -name type description -======= ===== ================================================================= -id int The numeric ID of the bug. -alias array The unique aliases of this bug. An empty array will be returned - if this bug has no aliases. -history array An array of History objects. -======= ===== ================================================================= - -History object: - -======= ======== ============================================================== -name type description -======= ======== ============================================================== -when datetime The date the bug activity/change happened. -who string The login name of the user who performed the bug change. -changes array An array of Change objects which contain all the changes that - happened to the bug at this time (as specified by ``when``). -======= ======== ============================================================== - -Change object: - -============= ====== ========================================================== -name type description -============= ====== ========================================================== -field_name string The name of the bug field that has changed. -removed string The previous value of the bug field which has been - deleted by the change. -added string The new value of the bug field which has been added - by the change. -attachment_id int The ID of the attachment that was changed. - This only appears if the change was to an attachment, - otherwise ``attachment_id`` will not be present in this - object. -============= ====== ========================================================== - -.. _rest_search_bugs: - -Search Bugs ------------ - -Allows you to search for bugs based on particular criteria. - -**Request** - -To search for bugs: - -.. code-block:: text - - GET /rest/bug - -Unless otherwise specified in the description of a parameter, bugs are -returned if they match *exactly* the criteria you specify in these -parameters. That is, we don't match against substrings--if a bug is in -the "Widgets" product and you ask for bugs in the "Widg" product, you -won't get anything. - -Criteria are joined in a logical AND. That is, you will be returned -bugs that match *all* of the criteria, not bugs that match *any* of -the criteria. - -Each parameter can be either the type it says, or a list of the types -it says. If you pass an array, it means "Give me bugs with *any* of -these values." For example, if you wanted bugs that were in either -the "Foo" or "Bar" products, you'd pass: - -.. code-block:: text - - GET /rest/bug?product=Foo&product=Bar - -Some Bugzillas may treat your arguments case-sensitively, depending -on what database system they are using. Most commonly, though, Bugzilla is -not case-sensitive with the arguments passed (because MySQL is the -most-common database to use with Bugzilla, and MySQL is not case sensitive). - -In addition to the fields listed below, you may also use criteria that -is similar to what is used in the Advanced Search screen of the Bugzilla -UI. This includes fields specified by ``Search by Change History`` and -``Custom Search``. The easiest way to determine what the field names are and what -format Bugzilla expects is to first construct your query using the -Advanced Search UI, execute it and use the query parameters in they URL -as your query for the REST call. - -================ ======== ===================================================== -name type description -================ ======== ===================================================== -alias array The unique aliases of this bug. An empty array will - be returned if this bug has no aliases. -assigned_to string The login name of a user that a bug is assigned to. -component string The name of the Component that the bug is in. Note - that if there are multiple Components with the same - name, and you search for that name, bugs in *all* - those Components will be returned. If you don't want - this, be sure to also specify the ``product`` argument. -creation_time datetime Searches for bugs that were created at this time or - later. May not be an array. -creator string The login name of the user who created the bug. You - can also pass this argument with the name - ``reporter``, for backwards compatibility with - older Bugzillas. -id int The numeric ID of the bug. -last_change_time datetime Searches for bugs that were modified at this time - or later. May not be an array. -limit int Limit the number of results returned. If the limit - is more than zero and higher than the maximum limit - set by the administrator, then the maximum limit will - be used instead. If you set the limit equal to zero, - then all matching results will be returned instead. -offset int Used in conjunction with the ``limit`` argument, - ``offset`` defines the starting position for the - search. For example, given a search that would - return 100 bugs, setting ``limit`` to 10 and - ``offset`` to 10 would return bugs 11 through 20 - from the set of 100. -op_sys string The "Operating System" field of a bug. -platform string The Platform (sometimes called "Hardware") field of - a bug. -priority string The Priority field on a bug. -product string The name of the Product that the bug is in. -resolution string The current resolution--only set if a bug is closed. - You can find open bugs by searching for bugs with an - empty resolution. -severity string The Severity field on a bug. -status string The current status of a bug (not including its - resolution, if it has one, which is a separate field - above). -summary string Searches for substrings in the single-line Summary - field on bugs. If you specify an array, then bugs - whose summaries match *any* of the passed substrings - will be returned. Note that unlike searching in the - Bugzilla UI, substrings are not split on spaces. So - searching for ``foo bar`` will match "This is a foo - bar" but not "This foo is a bar". ``['foo', 'bar']``, - would, however, match the second item. -tags string Searches for a bug with the specified tag. If you - specify an array, then any bugs that match *any* of - the tags will be returned. Note that tags are - personal to the currently logged in user. -target_milestone string The Target Milestone field of a bug. Note that even - if this Bugzilla does not have the Target Milestone - field enabled, you can still search for bugs by - Target Milestone. However, it is likely that in that - case, most bugs will not have a Target Milestone set - (it defaults to "---" when the field isn't enabled). -qa_contact string The login name of the bug's QA Contact. Note that - even if this Bugzilla does not have the QA Contact - field enabled, you can still search for bugs by QA - Contact (though it is likely that no bug will have a - QA Contact set, if the field is disabled). -url string The "URL" field of a bug. -version string The Version field of a bug. -whiteboard string Search the "Status Whiteboard" field on bugs for a - substring. Works the same as the ``summary`` field - described above, but searches the Status Whiteboard - field. -quicksearch string Search for bugs using quicksearch syntax. -================ ======== ===================================================== - -**Response** - -The same as :ref:`rest_single_bug`. - -.. _rest_create_bug: - -Create Bug ----------- - -This allows you to create a new bug in Bugzilla. If you specify any -invalid fields, an error will be thrown stating which field is invalid. -If you specify any fields you are not allowed to set, they will just be -set to their defaults or ignored. - -You cannot currently set all the items here that you can set on enter_bug.cgi. - -The WebService interface may allow you to set things other than those listed -here, but realize that anything undocumented here may likely change in the -future. - -**Request** - -To create a new bug in Bugzilla. - -.. code-block:: text - - POST /rest/bug - -.. code-block:: js - - { - "product" : "TestProduct", - "component" : "TestComponent", - "version" : "unspecified", - "summary" : "'This is a test bug - please disregard", - "alias" : "SomeAlias", - "op_sys" : "All", - "priority" : "P1", - "rep_platform" : "All" - } - -Some params must be set, or an error will be thrown. These params are -marked in **bold**. - -Some parameters can have defaults set in Bugzilla, by the administrator. -If these parameters have defaults set, you can omit them. These parameters -are marked (defaulted). - -Clients that want to be able to interact uniformly with multiple -Bugzillas should always set both the params marked required and those -marked (defaulted), because some Bugzillas may not have defaults set -for (defaulted) parameters, and then this method will throw an error -if you don't specify them. - -================== ======= ==================================================== -name type description -================== ======= ==================================================== -**product** string The name of the product the bug is being filed - against. -**component** string The name of a component in the product above. -**summary** string A brief description of the bug being filed. -**version** string A version of the product above; the version the - bug was found in. -description string (defaulted) The initial description for this bug. - Some Bugzilla installations require this to not be - blank. -op_sys string (defaulted) The operating system the bug was - discovered on. -platform string (defaulted) What type of hardware the bug was - experienced on. -priority string (defaulted) What order the bug will be fixed in by - the developer, compared to the developer's other - bugs. -severity string (defaulted) How severe the bug is. -alias array One or more brief aliases for the bug that can be - used instead of a bug number when accessing this bug. - Must be unique in all of this Bugzilla. -assigned_to string A user to assign this bug to, if you don't want it - to be assigned to the component owner. -cc array An array of usernames to CC on this bug. -comment_is_private boolean If set to ``true``, the description is private, - otherwise it is assumed to be public. -is_markdown boolean If set to ``true``, the description has Markdown - structures; otherwise it is normal text. -groups array An array of group names to put this bug into. You - can see valid group names on the Permissions tab of - the Preferences screen, or, if you are an - administrator, in the Groups control panel. If you - don't specify this argument, then the bug will be - added into all the groups that are set as being - "Default" for this product. (If you want to avoid - that, you should specify ``groups`` as an empty - array.) -qa_contact string If this installation has QA Contacts enabled, you - can set the QA Contact here if you don't want to - use the component's default QA Contact. -status string The status that this bug should start out as. Note - that only certain statuses can be set on bug - creation. -resolution string If you are filing a closed bug, then you will have - to specify a resolution. You cannot currently - specify a resolution of ``DUPLICATE`` for new - bugs, though. That must be done with - :ref:`rest_update_bug`. -target_milestone string A valid target milestone for this product. -flags array Flags objects to add to the bug. The object format - is described in the Flag object below. -================== ======= ==================================================== - -Flag object: - -To create a flag, at least the ``status`` and the ``type_id`` or ``name`` must -be provided. An optional requestee can be passed if the flag type is requestable -to a specific user. - -========= ====== ============================================================== -name type description -========= ====== ============================================================== -name string The name of the flag type. -type_id int The internal flag type ID. -status string The flags new status (i.e. "?", "+", "-" or "X" to clear flag). -requestee string The login of the requestee if the flag type is requestable - to a specific user. -========= ====== ============================================================== - -In addition to the above parameters, if your installation has any custom -fields, you can set them just by passing in the name of the field and -its value as a string. - -**Response** - -.. code-block:: js - - { - "id" : 12345 - } - -==== ==== ====================================== -name type description -==== ==== ====================================== -id int This is the ID of the newly-filed bug. -==== ==== ====================================== - -.. _rest_update_bug: - -Update Bug ----------- - -Allows you to update the fields of a bug. Automatically sends emails -out about the changes. - -**Request** - -To update the fields of a current bug. - -.. code-block:: text - - PUT /rest/bug/(id_or_alias) - -.. code-block:: js - - { - "ids" : [35], - "status" : "IN_PROGRESS", - "keywords" : { - "add" : ["funny", "stupid"] - } - } - -The params to include in the PUT body as well as the returned data format, -are the same as below. You can specify the ID or alias of the bug to update -either in the URL path and/or in the ``ids`` param. You can use both and they -will be combined so you can edit more than one bug at a time. - -=============== ===== ========================================================= -name type description -=============== ===== ========================================================= -**id_or_alias** mixed An integer bug ID or alias. -**ids** array The IDs or aliases of the bugs that you want to modify. -=============== ===== ========================================================= - -All following fields specify the values you want to set on the bugs you are -updating. - -===================== ======= ================================================= -name type description -===================== ======= ================================================= -alias object These specify the aliases of a bug that can be - used instead of a bug number when acessing this - bug. To set these, you should pass a hash as the - value. The object may contain the following - items: - - * ``add`` (array) Aliases to add to this field. - * ``remove`` (array) Aliases to remove from this - field. If the aliases are not already in the - field, they will be ignored. - * ``set`` (array) An exact set of aliases to set - this field to, overriding the current value. - If you specify ``set``, then ``add`` and - ``remove`` will be ignored. - - You can only set this if you are modifying a - single bug. If there is more than one bug - specified in ``ids``, passing in a value for - ``alias`` will cause an error to be thrown. - - For backwards compatibility, you can also - specify a single string. This will be treated as - if you specified the set key above. -assigned_to string The full login name of the user this bug is - assigned to. -blocks object (Same as ``depends_on`` below) -depends_on object These specify the bugs that this bug blocks or - depends on, respectively. To set these, you - should pass an object as the value. The object - may contain the following items: - - * ``add`` (array) Bug IDs to add to this field. - * ``remove`` (array) Bug IDs to remove from this - field. If the bug IDs are not already in the - field, they will be ignored. - * ``set`` (array of) An exact set of bug IDs to - set this field to, overriding the current - value. If you specify ``set``, then ``add`` - and ``remove`` will be ignored. -cc object The users on the cc list. To modify this field, - pass an object, which may have the following - items: - - * ``add`` (array) User names to add to the CC - list. They must be full user names, and an - error will be thrown if you pass in an invalid - user name. - * ``remove`` (array) User names to remove from - the CC list. They must be full user names, and - an error will be thrown if you pass in an - invalid user name. -is_cc_accessible boolean Whether or not users in the CC list are allowed - to access the bug, even if they aren't in a group - that can normally access the bug. -comment object A comment on the change. The object may contain - the following items: - - * ``body`` (string) The actual text of the - comment. For compatibility with the parameters - to :ref:`rest_add_comment`, you can also call - this field ``comment``, if you want. - * ``is_private`` (boolean) Whether the comment is - private or not. If you try to make a comment - private and you don't have the permission to, - an error will be thrown. - * ``is_markdown`` (boolean) If set to ``true``, - the comment has Markdown structures, otherwise - it is normal text. -comment_is_private object This is how you update the privacy of comments - that are already on a bug. This is a object, - where the keys are the ``int`` ID of comments - (not their count on a bug, like #1, #2, #3, but - their globally-unique ID, as returned by - :ref:`rest_comments` and the value is a - ``boolean`` which specifies whether that comment - should become private (``true``) or public - (``false``). - - The comment IDs must be valid for the bug being - updated. Thus, it is not practical to use this - while updating multiple bugs at once, as a single - comment ID will never be valid on multiple bugs. -component string The Component the bug is in. -deadline date The Deadline field is a date specifying when the - bug must be completed by, in the format - ``YYYY-MM-DD``. -dupe_of int The bug that this bug is a duplicate of. If you - want to mark a bug as a duplicate, the safest - thing to do is to set this value and *not* set - the ``status`` or ``resolutio`` fields. They will - automatically be set by Bugzilla to the - appropriate values for duplicate bugs. -estimated_time double The total estimate of time required to fix the - bug, in hours. This is the *total* estimate, not - the amount of time remaining to fix it. -flags array An array of Flag change objects. The items needed - are described below. -groups object The groups a bug is in. To modify this field, - pass an object, which may have the following - items: - - * ``add`` (array) The names of groups to add. - Passing in an invalid group name or a group - that you cannot add to this bug will cause an - error to be thrown. - * ``remove`` (array) The names of groups to - remove. Passing in an invalid group name or a - group that you cannot remove from this bug - will cause an error to be thrown. -keywords object Keywords on the bug. To modify this field, pass - an object, which may have the following items: - - * ``add`` (array) The names of keywords to add - to the field on the bug. Passing something that - isn't a valid keyword name will cause an error - to be thrown. - * ``remove`` (array) The names of keywords to - remove from the field on the bug. Passing - something that isn't a valid keyword name will - cause an error to be thrown. - * ``set`` (array) An exact set of keywords to set - the field to, on the bug. Passing something - that isn't a valid keyword name will cause an - error to be thrown. Specifying ``set`` - overrides ``add`` and ``remove``. -op_sys string The Operating System ("OS") field on the bug. -platform string The Platform or "Hardware" field on the bug. -priority string The Priority field on the bug. -product string The name of the product that the bug is in. If - you change this, you will probably also want to - change ``target_milestone``, ``version``, and - ``component``, since those have different legal - values in every product. - - If you cannot change the ``target_milestone`` - field, it will be reset to the default for the - product, when you move a bug to a new product. - - You may also wish to add or remove groups, as - which groups are - valid on a bug depends on the product. Groups - that are not valid in the new product will be - automatically removed, and groups which are - mandatory in the new product will be automaticaly - added, but no other automatic group changes will - be done. - - .. note:: - Users can only move a bug into a product if - they would normally have permission to file - new bugs in that product. -qa_contact string The full login name of the bug's QA Contact. -is_creator_accessible boolean Whether or not the bug's reporter is allowed - to access the bug, even if they aren't in a group - that can normally access the bug. -remaining_time double How much work time is remaining to fix the bug, - in hours. If you set ``work_time`` but don't - explicitly set ``remaining_time``, then the - ``work_time`` will be deducted from the bug's - ``remaining_time``. -reset_assigned_to boolean If true, the ``assigned_to`` field will be - reset to the default for the component that the - bug is in. (If you have set the component at the - same time as using this, then the component used - will be the new component, not the old one.) -reset_qa_contact boolean If true, the ``qa_contact`` field will be reset - to the default for the component that the bug is - in. (If you have set the component at the same - time as using this, then the component used will - be the new component, not the old one.) -resolution string The current resolution. May only be set if you - are closing a bug or if you are modifying an - already-closed bug. Attempting to set the - resolution to *any* value (even an empty or null - string) on an open bug will cause an error to be - thrown. - - .. note:: - If you change the ``status`` field to an open - status, the resolution field will automatically - be cleared, so you don't have to clear it - manually. -see_also object The See Also field on a bug, specifying URLs to - bugs in other bug trackers. To modify this field, - pass an object, which may have the following - items: - - * ``add`` (array) URLs to add to the field. Each - URL must be a valid URL to a bug-tracker, or - an error will be thrown. - * ``remove`` (array) URLs to remove from the - field. Invalid URLs will be ignored. -severity string The Severity field of a bug. -status string The status you want to change the bug to. Note - that if a bug is changing from open to closed, - you should also specify a ``resolution``. -summary string The Summary field of the bug. -target_milestone string The bug's Target Milestone. -url string The "URL" field of a bug. -version string The bug's Version field. -whiteboard string The Status Whiteboard field of a bug. -work_time double The number of hours worked on this bug as part - of this change. - If you set ``work_time`` but don't explicitly - set ``remaining_time``, then the ``work_time`` - will be deducted from the bug's ``remaining_time``. -===================== ======= ================================================= - -You can also set the value of any custom field by passing its name as -a parameter, and the value to set the field to. For multiple-selection -fields, the value should be an array of strings. - -Flag change object: - -The following values can be specified. At least the ``status`` and one of -``type_id``, ``id``, or ``name`` must be specified. If a ``type_id`` or -``name`` matches a single currently set flag, the flag will be updated unless -``new`` is specified. - -========== ======= ============================================================ -name type description -========== ======= ============================================================ -name string The name of the flag that will be created or updated. -type_id int The internal flag type ID that will be created or updated. - You will need to specify the ``type_id`` if more than one - flag type of the same name exists. -**status** string The flags new status (i.e. "?", "+", "-" or "X" to clear a - flag). -requestee string The login of the requestee if the flag type is requestable - to a specific user. -id int Use ID to specify the flag to be updated. You will need to - specify the ``id`` if more than one flag is set of the same - name. -new boolean Set to true if you specifically want a new flag to be - created. -========== ======= ============================================================ - -**Response** - -.. code-block:: js - - { - "bugs" : [ - { - "alias" : [], - "changes" : { - "keywords" : { - "added" : "funny, stupid", - "removed" : "" - }, - "status" : { - "added" : "IN_PROGRESS", - "removed" : "CONFIRMED" - } - }, - "id" : 35, - "last_change_time" : "2014-09-29T14:25:35Z" - } - ] - } - -``bugs`` (array) This points to an array of objects with the following items: - -================ ======== ===================================================== -name type description -================ ======== ===================================================== -id int The ID of the bug that was updated. -alias array The aliases of the bug that was updated, if this bug - has any alias. -last_change_time datetime The exact time that this update was done at, for - this bug. If no update was done (that is, no fields - had their values changed and no comment was added) - then this will instead be the last time the bug was - updated. -changes object The changes that were actually done on this bug. The - keys are the names of the fields that were changed, - and the values are an object with two keys: - - * ``added`` (string) The values that were added to - this field, possibly a comma-and-space-separated - list if multiple values were added. - * ``removed`` (string) The values that were removed - from this field, possibly a - comma-and-space-separated list if multiple values - were removed. -================ ======== ===================================================== - -Currently, some fields are not tracked in changes: ``comment``, -``comment_is_private``, and ``work_time``. This means that they will not -show up in the return value even if they were successfully updated. -This may change in a future version of Bugzilla. diff --git a/mozilla/webtools/bugzilla/docs/en/rst/api/core/v1/bugzilla.rst b/mozilla/webtools/bugzilla/docs/en/rst/api/core/v1/bugzilla.rst deleted file mode 100644 index 2dd40e0cbda..00000000000 --- a/mozilla/webtools/bugzilla/docs/en/rst/api/core/v1/bugzilla.rst +++ /dev/null @@ -1,302 +0,0 @@ -Bugzilla Information -==================== - -These methods are used to get general configuration information about this -Bugzilla instance. - -Version -------- - -Returns the current version of Bugzilla. Normally in the format of ``X.X`` or -``X.X.X``. For example, ``4.4`` for the initial release of a new branch. Or -``4.4.6`` for a minor release on the same branch. - -**Request** - -.. code-block:: text - - GET /rest/version - -**Response** - -.. code-block:: js - - { - "version": "4.5.5+" - } - -======= ====== ========================================= -name type description -======= ====== ========================================= -version string The current version of this Bugzilla -======= ====== ========================================= - -Extensions ----------- - -Gets information about the extensions that are currently installed and enabled -in this Bugzilla. - -**Request** - -.. code-block:: text - - GET /rest/extensions - -**Response** - -.. code-block:: js - - { - "extensions": { - "Voting": { - "version": "4.5.5+" - }, - "BmpConvert": { - "version": "1.0" - } - } - } - -========== ====== ==================================================== -name type description -========== ====== ==================================================== -extensions object An object containing the extensions enabled as keys. - Each extension object contains the following keys: - - * ``version`` (string) The version of the extension. -========== ====== ==================================================== - -Timezone --------- - -Returns the timezone in which Bugzilla expects to receive dates and times on the API. -Currently hard-coded to UTC ("+0000"). This is unlikely to change. - -**Request** - -.. code-block:: text - - GET /rest/timezone - -.. code-block:: js - - { - "timezone": "+0000" - } - -**Response** - -======== ====== =============================================================== -name type description -======== ====== =============================================================== -timezone string The timezone offset as a string in (+/-)XXXX (RFC 2822) format. -======== ====== =============================================================== - -Time ----- - -Gets information about what time the Bugzilla server thinks it is, and -what timezone it's running in. - -**Request** - -.. code-block:: text - - GET /rest/time - -**Response** - -.. code-block:: js - - { - "web_time_utc": "2014-09-26T18:01:30Z", - "db_time": "2014-09-26T18:01:30Z", - "web_time": "2014-09-26T18:01:30Z", - "tz_offset": "+0000", - "tz_short_name": "UTC", - "tz_name": "UTC" - } - -============= ====== ========================================================== -name type description -============= ====== ========================================================== -db_time string The current time in UTC, according to the Bugzilla - database server. - - Note that Bugzilla assumes that the database and the - webserver are running in the same time zone. However, - if the web server and the database server aren't - synchronized or some reason, *this* is the time that - you should rely on or doing searches and other input - to the WebService. -web_time string This is the current time in UTC, according to - Bugzilla's web server. - - This might be different by a second from ``db_time`` - since this comes from a different source. If it's any - more different than a second, then there is likely - some problem with this Bugzilla instance. In this - case you should rely on the ``db_time``, not the - ``web_time``. -web_time_utc string Identical to ``web_time``. (Exists only for - backwards-compatibility with versions of Bugzilla - before 3.6.) -tz_name string The literal string ``UTC``. (Exists only for - backwards-compatibility with versions of Bugzilla - before 3.6.) -tz_short_name string The literal string ``UTC``. (Exists only for - backwards-compatibility with versions of Bugzilla - before 3.6.) -tz_offset string The literal string ``+0000``. (Exists only for - backwards-compatibility with versions of Bugzilla - before 3.6.) -============= ====== ========================================================== - -Parameters ----------- - -Returns parameter values currently used in this Bugzilla. - -**Request** - -.. code-block:: text - - GET /rest/parameters - -**Response** - -Example response for anonymous user: - -.. code-block:: js - - { - "parameters" : { - "maintainer" : "admin@example.com", - "requirelogin" : "0" - } - } - -Example response for authenticated user: - -.. code-block:: js - - { - "parameters" : { - "allowemailchange" : "1", - "attachment_base" : "http://bugzilla.example.com/", - "commentonchange_resolution" : "0", - "commentonduplicate" : "0", - "cookiepath" : "/", - "createemailregexp" : ".*", - "defaultopsys" : "", - "defaultplatform" : "", - "defaultpriority" : "--", - "defaultseverity" : "normal", - "duplicate_or_move_bug_status" : "RESOLVED", - "emailregexp" : "^[\\w\\.\\+\\-=']+@[\\w\\.\\-]+\\.[\\w\\-]+$", - "emailsuffix" : "", - "letsubmitterchoosemilestone" : "1", - "letsubmitterchoosepriority" : "1", - "mailfrom" : "bugzilla-daemon@example.com", - "maintainer" : "admin@example.com", - "maxattachmentsize" : "1000", - "maxlocalattachment" : "0", - "musthavemilestoneonaccept" : "0", - "noresolveonopenblockers" : "0", - "password_complexity" : "no_constraints", - "rememberlogin" : "on", - "requirelogin" : "0", - "urlbase" : "http://bugzilla.example.com/", - "use_see_also" : "1", - "useclassification" : "1", - "usemenuforusers" : "0", - "useqacontact" : "1", - "usestatuswhiteboard" : "1", - "usetargetmilestone" : "1", - } - } - -A logged-out user can only access the ``maintainer`` and ``requirelogin`` -parameters. - -A logged-in user can access the following parameters (listed alphabetically): - -* allowemailchange -* attachment_base -* commentonchange_resolution -* commentonduplicate -* cookiepath -* defaultopsys -* defaultplatform -* defaultpriority -* defaultseverity -* duplicate_or_move_bug_status -* emailregexpdesc -* emailsuffix -* letsubmitterchoosemilestone -* letsubmitterchoosepriority -* mailfrom -* maintainer -* maxattachmentsize -* maxlocalattachment -* musthavemilestoneonaccept -* noresolveonopenblockers -* password_complexity -* rememberlogin -* requirelogin -* search_allow_no_criteria -* urlbase -* use_see_also -* useclassification -* usemenuforusers -* useqacontact -* usestatuswhiteboard -* usetargetmilestone - -A user in the tweakparams group can access all existing parameters. -New parameters can appear or obsolete parameters can disappear depending -on the version of Bugzilla and on extensions being installed. -The list of parameters returned by this method is not stable and will -never be stable. - -Last Audit Time ---------------- - -Gets the most recent timestamp among all of the events recorded in the audit_log -table. - -**Request** - -To get most recent audit timestamp for all classes: - -.. code-block:: text - - GET /rest/last_audit_time - -To get the the most recent audit timestamp for the ``Bugzilla::Product`` class: - -.. code-block:: text - - GET /rest/last_audit_time?class=Bugzilla::Product - -===== ===== =================================================================== -name type description -===== ===== =================================================================== -class array The class names are defined as ``Bugzilla::"`` such as - Bugzilla:Product`` for products. -===== ===== =================================================================== - -**Response** - -.. code-block:: js - - { - "last_audit_time": "2014-09-23T18:03:38Z" - } - -=============== ====== ==================================================== -name type description -=============== ====== ==================================================== -last_audit_time string The maximum of the at_time from the audit_log. -=============== ====== ==================================================== diff --git a/mozilla/webtools/bugzilla/docs/en/rst/api/core/v1/classification.rst b/mozilla/webtools/bugzilla/docs/en/rst/api/core/v1/classification.rst deleted file mode 100644 index 8b5003d390c..00000000000 --- a/mozilla/webtools/bugzilla/docs/en/rst/api/core/v1/classification.rst +++ /dev/null @@ -1,80 +0,0 @@ -Classifications -=============== - -This part of the Bugzilla API allows you to deal with the available -classifications. You will be able to get information about them as well as -manipulate them. - -.. _rest_get_classification: - -Get Classification ------------------- - -Returns an object containing information about a set of classifications. - -**Request** - -To return information on a single classification using the ID or name: - -.. code-block:: text - - GET /rest/classification/(id_or_name) - -============== ===== ===================================== -name type description -============== ===== ===================================== -**id_or_name** mixed An Integer classification ID or name. -============== ===== ===================================== - -**Response** - -.. code-block:: js - - { - "classifications": [ - { - "sort_key": 0, - "description": "Unassigned to any classifications", - "products": [ - { - "id": 2, - "name": "FoodReplicator", - "description": "Software that controls a piece of hardware that will create any food item through a voice interface." - }, - { - "description": "Spider secretions", - "name": "Ѕpїdєr Séçretíøns", - "id": 4 - } - ], - "id": 1, - "name": "Unclassified" - } - ] - } - -``classifications`` (array) Each object is a classification that the user is -authorized to see and has the following items: - -=========== ====== ============================================================ -name type description -=========== ====== ============================================================ -id int The ID of the classification. -name string The name of the classification. -description string The description of the classificaion. -sort_key int The value which determines the order the classification is - sorted. -products array Products the user is authorized to - access within the classification. Each hash has the - following keys: -=========== ====== ============================================================ - -Product object: - -=========== ====== ================================ -name type description -=========== ====== ================================ -name string The name of the product. -id int The ID of the product. -description string The description of the product. -=========== ====== ================================ diff --git a/mozilla/webtools/bugzilla/docs/en/rst/api/core/v1/comment.rst b/mozilla/webtools/bugzilla/docs/en/rst/api/core/v1/comment.rst deleted file mode 100644 index 54048122af5..00000000000 --- a/mozilla/webtools/bugzilla/docs/en/rst/api/core/v1/comment.rst +++ /dev/null @@ -1,248 +0,0 @@ -Comments -======== - -.. _rest_comments: - -Get Comments ------------- - -This allows you to get data about comments, given a bug ID or comment ID. - -**Request** - -To get all comments for a particular bug using the bug ID or alias: - -.. code-block:: text - - GET /rest/bug/(id_or_alias)/comment - -To get a specific comment based on the comment ID: - -.. code-block:: text - - GET /rest/bug/comment/(comment_id) - -=============== ======== ====================================================== -name type description -=============== ======== ====================================================== -**id_or_alias** mixed A single integer bug ID or alias. -**comment_id** int A single integer comment ID. -new_since datetime If specified, the method will only return comments - *newer* than this time. This only affects comments - returned from the ``ids`` argument. You will always be - returned all comments you request in the - ``comment_ids`` argument, even if they are older than - this date. -=============== ======== ====================================================== - -**Response** - -.. code-block:: js - - { - "bugs": { - "35": { - "comments": [ - { - "time": "2000-07-25T13:50:04Z", - "text": "test bug to fix problem in removing from cc list.", - "bug_id": 35, - "count": 0, - "attachment_id": null, - "is_private": false, - "is_markdown" : true, - "tags": [], - "creator": "user@bugzilla.org", - "creation_time": "2000-07-25T13:50:04Z", - "id": 75 - } - ] - } - }, - "comments": {} - } - -Two items are returned: - -``bugs`` This is used for bugs specified in ``ids``. This is an object, -where the keys are the numeric IDs of the bugs, and the value is -a object with a single key, ``comments``, which is an array of comments. -(The format of comments is described below.) - -Any individual bug will only be returned once, so if you specify an ID -multiple times in ``ids``, it will still only be returned once. - -``comments`` Each individual comment requested in ``comment_ids`` is -returned here, in a object where the numeric comment ID is the key, -and the value is the comment. (The format of comments is described below.) - -A "comment" as described above is a object that contains the following items: - -============= ======== ======================================================== -name type description -============= ======== ======================================================== -id int The globally unique ID for the comment. -bug_id int The ID of the bug that this comment is on. -attachment_id int If the comment was made on an attachment, this will be - the ID of that attachment. Otherwise it will be null. -count int The number of the comment local to the bug. The - Description is 0, comments start with 1. -text string The actual text of the comment. -creator string The login name of the comment's author. -time datetime The time (in Bugzilla's timezone) that the comment was - added. -creation_time datetime This is exactly same as the ``time`` key. Use this - field instead of ``time`` for consistency with other - methods including :ref:`rest_single_bug` and - :ref:`rest_attachments`. - - For compatibility, ``time`` is still usable. However, - please note that ``time`` may be deprecated and removed - in a future release. - -is_private boolean ``true`` if this comment is private (only visible to a - certain group called the "insidergroup"), ``false`` - otherwise. -is_markdown boolean ``true`` if this comment needs Markdown processing; - ``false`` otherwise. -============= ======== ======================================================== - -.. _rest_add_comment: - -Create Comments ---------------- - -This allows you to add a comment to a bug in Bugzilla. - -**Request** - -To create a comment on a current bug. - -.. code-block:: text - - POST /rest/bug/(id)/comment - -.. code-block:: js - - { - "ids" : [123,..], - "comment" : "This is an additional comment", - "is_private" : false, - "is_markdown" : true, - } - -``ids`` is optional in the data example above and can be used to specify adding -a comment to more than one bug at the same time. - -=========== ======= =========================================================== -name type description -=========== ======= =========================================================== -**id** int The ID or alias of the bug to append a comment to. -ids array List of integer bug IDs to add the comment to. -**comment** string The comment to append to the bug. If this is empty - or all whitespace, an error will be thrown saying that you - did not set the ``comment`` parameter. -is_private boolean If set to ``true``, the comment is private, otherwise it is - assumed to be public. -is_markdown boolean If set to ``true``, the comment has Markdown structures; - otherwise it is normal text. -work_time double Adds this many hours to the "Hours Worked" on the bug. - If you are not in the time tracking group, this value will - be ignored. -=========== ======= =========================================================== - -**Response** - -.. code-block:: js - - { - "id" : 789 - } - -==== ==== ================================= -name type description -==== ==== ================================= -id int ID of the newly-created comment. -==== ==== ================================= - -.. _rest_search_comment_tags: - -Search Comment Tags -------------------- - -Searches for tags which contain the provided substring. - -**Request** - -To search for comment tags: - -.. code-block:: text - - GET /rest/bug/comment/tags/(query) - -Example: - -.. code-block:: text - - GET /rest/bug/comment/tags/spa - -========= ====== ==================================================== -name type description -========= ====== ==================================================== -**query** string Only tags containg this substring will be returned. -limit int If provided will return no more than ``limit`` tags. - Defaults to ``10``. -========= ====== ==================================================== - -**Response** - -.. code-block:: js - - [ - "spam" - ] - -An array of matching tags. - -.. _rest_update_comment_tags: - -Update Comment Tags -------------------- - -Adds or removes tags from a comment. - -**Request** - -To update the tags comments attached to a comment: - -.. code-block:: text - - PUT /rest/bug/comment/(comment_id)/tags - -Example: - -.. code-block:: js - - { - "comment_id" : 75, - "add" : ["spam", "bad"] - } - -============== ===== ==================================== -name type description -============== ===== ==================================== -**comment_id** int The ID of the comment to update. -add array The tags to attach to the comment. -remove array The tags to detach from the comment. -============== ===== ==================================== - -**Response** - -.. code-block:: js - - [ - "bad", - "spam" - ] - -An array of strings containing the comment's updated tags. diff --git a/mozilla/webtools/bugzilla/docs/en/rst/api/core/v1/component.rst b/mozilla/webtools/bugzilla/docs/en/rst/api/core/v1/component.rst deleted file mode 100644 index aceada1a7cc..00000000000 --- a/mozilla/webtools/bugzilla/docs/en/rst/api/core/v1/component.rst +++ /dev/null @@ -1,65 +0,0 @@ -Components -========== - -This part of the Bugzilla API allows you to deal with the available product -components. You will be able to get information about them as well as manipulate -them. - -Create Component ----------------- - -This allows you to create a new component in Bugzilla. You must be authenticated -and be in the *editcomponents* group to perform this action. - -**Request** - -To create a new component: - -.. code-block:: text - - POST /rest/component - -.. code-block:: js - - { - "product" : "TestProduct", - "name" : "New Component", - "description" : "This is a new component", - "default_assignee" : "dkl@mozilla.com" - } - -Some params must be set, or an error will be thrown. These params are -shown in **bold**. - -==================== ======= ================================================== -name type description -==================== ======= ================================================== -**name** string The name of the new component. -**product** string The name of the product that the component must - be added to. This product must already exist, and - the user have the necessary permissions to edit - components for it. -**description** string The description of the new component. -**default_assignee** string The login name of the default assignee of the - component. -default_cc array Each string representing one login name of the - default CC list. -default_qa_contact string The login name of the default QA contact for the - component. -is_open boolean 1 if you want to enable the component for bug - creations. 0 otherwise. Default is 1. -==================== ======= ================================================== - -**Response** - -.. code-block:: js - - { - "id": 27 - } - -==== ==== ======================================== -name type description -==== ==== ======================================== -id int The ID of the newly-added component. -==== ==== ======================================== diff --git a/mozilla/webtools/bugzilla/docs/en/rst/api/core/v1/field.rst b/mozilla/webtools/bugzilla/docs/en/rst/api/core/v1/field.rst deleted file mode 100644 index d97aa305085..00000000000 --- a/mozilla/webtools/bugzilla/docs/en/rst/api/core/v1/field.rst +++ /dev/null @@ -1,240 +0,0 @@ -Bug Fields -========== - -The Bugzilla API for getting details about bug fields. - -.. _rest_fields: - -Fields ------- - -Get information about valid bug fields, including the lists of legal values -for each field. - -**Request** - -To get information about all fields: - -.. code-block:: text - - GET /rest/field/bug - -To get information related to a single field: - -.. code-block:: text - - GET /rest/field/bug/(id_or_name) - -========== ===== ========================================================== -name type description -========== ===== ========================================================== -id_or_name mixed An integer field ID or string representing the field name. -========== ===== ========================================================== - -**Response** - -.. code-block:: js - - { - "fields": [ - { - "display_name": "Priority", - "name": "priority", - "type": 2, - "is_mandatory": false, - "value_field": null, - "values": [ - { - "sortkey": 100, - "sort_key": 100, - "visibility_values": [], - "name": "P1" - }, - { - "sort_key": 200, - "name": "P2", - "visibility_values": [], - "sortkey": 200 - }, - { - "sort_key": 300, - "visibility_values": [], - "name": "P3", - "sortkey": 300 - }, - { - "sort_key": 400, - "name": "P4", - "visibility_values": [], - "sortkey": 400 - }, - { - "name": "P5", - "visibility_values": [], - "sort_key": 500, - "sortkey": 500 - } - ], - "visibility_values": [], - "visibility_field": null, - "is_on_bug_entry": false, - "is_custom": false, - "id": 13 - } - ] - } - -``field`` (array) Field objects each containing the following items: - -================= ======= ===================================================== -name type description -================= ======= ===================================================== -id int An integer ID uniquely identifying this field in this - installation only. -type int The number of the fieldtype. The following values are - defined: - - * ``0`` Field type unknown - * ``1`` Single-line string field - * ``2`` Single value field - * ``3`` Multiple value field - * ``4`` Multi-line text value - * ``5`` Date field with time - * ``6`` Bug ID field - * ``7`` See Also field - * ``8`` Keywords field - * ``9`` Date field - * ``10`` Integer field - -is_custom boolean ``true`` when this is a custom field, ``false`` - otherwise. -name string The internal name of this field. This is a unique - identifier for this field. If this is not a custom - field, then this name will be the same across all - Bugzilla installations. -display_name string The name of the field, as it is shown in the user - interface. -is_mandatory boolean ``true`` if the field must have a value when filing - new bugs. Also, mandatory fields cannot have their - value cleared when updating bugs. -is_on_bug_entry boolean For custom fields, this is ``true`` if the field is - shown when you enter a new bug. For standard fields, - this is currently always ``false``, even if the field - shows up when entering a bug. (To know whether or not - a standard field is valid on bug entry, see - :ref:`rest_create_bug`. -visibility_field string The name of a field that controls the visibility of - this field in the user interface. This field only - appears in the user interface when the named field is - equal to one of the values is ``visibility_values``. - Can be null. -visibility_values array This field is only shown when ``visibility_field`` - matches one of these string values. When - ``visibility_field`` is null, then this is an empty - array. -value_field string The name of the field that controls whether or not - particular values of the field are shown in the user - interface. Can be null. -values array Objects representing the legal values for - select-type (drop-down and multiple-selection) - fields. This is also populated for the - ``component``, ``version``, ``target_milestone``, - and ``keywords`` fields, but not for the ``product`` - field (you must use ``get_accessible_products`` for - that). For fields that aren't select-type fields, - this will simply be an empty array. Each object - contains the items described in the Value object - below. -================= ======= ===================================================== - -Value object: - -================= ======= ===================================================== -name type description -================= ======= ===================================================== -name string The actual value--this is what you would specify for - this field in ``create``, etc. -sort_key int Values, when displayed in a list, are sorted first by - this integer and then secondly by their name. -visibility_values array If ``value_field`` is defined for this field, then - this value is only shown if the ``value_field`` is - set to one of the values listed in this array. Note - that for per-product fields, ``value_field`` is set - to ``product`` and ``visibility_values`` will reflect - which product(s) this value appears in. -is_active boolean This value is defined only for certain - product-specific fields such as version, - target_milestone or component. When true, the value - is active; otherwise the value is not active. -description string The description of the value. This item is only - included for the ``keywords`` field. -is_open boolean For ``bug_status`` values, determines whether this - status specifies that the bug is "open" (``true``) - or "closed" (``false``). This item is only included - for the ``bug_status`` field. -can_change_to array For ``bug_status`` values, this is an array of - objects that determine which statuses you can - transition to from this status. (This item is only - included for the ``bug_status`` field.) - - Each object contains the following items: - - * name: (string) The name of the new status - * comment_required: (boolean) ``true`` if a comment - is required when you change a bug into this status - using this transition. -================= ======= ===================================================== - -.. _rest_legal_values: - -Legal Values ------------- - -**DEPRECATED** Use ''Fields'' instead. - -Tells you what values are allowed for a particular field. - -**Request** - -To get information on the values for a field based on field name: - -.. code-block:: text - - GET /rest/field/bug/(field)/values - -To get information based on field name and a specific product: - -.. code-block:: text - - GET /rest/field/bug/(field)/(product_id)/values - -========== ====== ============================================================= -name type description -========== ====== ============================================================= -field string The name of the field you want information about. - This should be the same as the name you would use in - :ref:`rest_create_bug`, below. -product_id int If you're picking a product-specific field, you have to - specify the ID of the product you want the values for. -========== ====== ============================================================= - -**Resppnse** - -.. code-block:: js - - { - "values": [ - "P1", - "P2", - "P3", - "P4", - "P5" - ] - } - -========== ====== ============================================================= -name type description -========== ====== ============================================================= -values array The legal values for this field. The values will be sorted - as they normally would be in Bugzilla. -========== ====== ============================================================= diff --git a/mozilla/webtools/bugzilla/docs/en/rst/api/core/v1/flagtype.rst b/mozilla/webtools/bugzilla/docs/en/rst/api/core/v1/flagtype.rst deleted file mode 100644 index 994ac27c84a..00000000000 --- a/mozilla/webtools/bugzilla/docs/en/rst/api/core/v1/flagtype.rst +++ /dev/null @@ -1,373 +0,0 @@ -Flag Types -========== - -This part of the Bugzilla API allows you to get and create bug and attachment -flags. - -.. _rest_flagtype_get: - -Get Flag Type -------------- - -Get information about valid flag types that can be set for bugs and attachments. - -**Request** - -To get information about all flag types for a product: - -.. code-block:: text - - GET /rest/flag_type/(product) - -To get information about flag_types for a product and component: - -.. code-block:: text - - GET /rest/flag_type/(product)/(component) - -.. code-block:: js - - { - "bug": [ - { - "is_multiplicable": false, - "is_requesteeble": false, - "values": [ - "X", - "?", - "+", - "-" - ], - "id": 11, - "type": "bug", - "is_active": true, - "description": "Blocks the next release", - "name": "blocker" - }, - { - "is_requesteeble": false, - "is_multiplicable": false, - "is_active": true, - "description": "Regression found?", - "name": "regression", - "id": 10, - "type": "bug", - "values": [ - "X", - "?", - "+", - "-" - ] - }, - ], - "attachment": [ - { - "is_requesteeble": true, - "is_multiplicable": true, - "name": "review", - "is_active": true, - "description": "Review the patch for correctness and applicability to the problem.", - "type": "attachment", - "id": 1, - "values": [ - "X", - "?", - "+", - "-" - ] - }, - { - "name": "approval", - "description": "Approve the patch for check-in to the tree.", - "is_active": true, - "values": [ - "X", - "?", - "+", - "-" - ], - "type": "attachment", - "id": 3, - "is_multiplicable": false, - "is_requesteeble": false - } - ] - } - -You must pass a product name and an optional component name. If the product or -component names contains a ``/`` character, up will need to url encode it. - -=========== ====== ============================================================ -name type description -=========== ====== ============================================================ -**product** string The name of a valid product. -component string An optional valid component name associated with the - product. -=========== ====== ============================================================ - -**Response** - -An object containing two items, ``bug`` and ``attachment``. Each value is an -array of objects, containing the following items: - -================ ======= ====================================================== -name type description -================ ======= ====================================================== -id int An integer ID uniquely identifying this flag type. -name string The name for the flag type. -type string The target of the flag type which is either ``bug`` - or ``attachment``. -description string The description of the flag type. -values array String values that the user can set on the flag type. -is_requesteeble boolean Users can ask specific other users to set flags of - this type. -is_multiplicable boolean Multiple flags of this type can be set for the same - bug or attachment. -================ ======= ====================================================== - -Create Flag Type ----------------- - -Create a new flag type. You must be authenticated and be in the *editcomponents* -group to perform this action. - -**Request** - -.. code-block:: text - - POST /rest/flag_type - -.. code-block:: js - - { - "name" : "feedback", - "description" : "This attachment needs feedback", - "inclusions" : [ "WorldControl "], - "target_type" : "attachment" - } - -Some params must be set, or an error will be thrown. The required params are -marked in **bold**. - -=========================== ======= =========================================== -name type description -=========================== ======= =========================================== -**name** string The name of the new flag type. -**description** string A description for the flag type. -target_type string The new flag is either for a ``bug`` or an - ``attachment``. -inclusions array An array of strings or an object containing - product names, and optionally component - names. If you provide a string, the flag - type will be shown on all bugs in that - product. If you provide an object, the key - represents the product name, and the value - is the components of the product to be - included. -exclusions array An array of strings or an object containing - product names. This uses the same format as - ``inclusions``. This will exclude the flag - from all products and components specified. -sortkey int A number between 1 and 32767 by which this - type will be sorted when displayed to users - in a list; ignore if you don't care what - order the types appear in or if you want - them to appear in alphabetical order. -is_active boolean Flag of this type appear in the UI and can - be set. Default is ``true``. -is_requestable boolean Users can ask for flags of this type to be - set. Default is ``true``. -cc_list array If the flag type is requestable, who should - receive e-mail notification of requests. - This is an array of e-mail addresses which\ - do not need to be Bugzilla logins. -is_specifically_requestable boolean Users can ask specific other users to - set flags of this type as opposed to just - asking the wind. Default is ``true``. -is_multiplicable boolean Multiple flags of this type can be set on - the same bug. Default is ``true``. -grant_group string The group allowed to grant/deny flags of - this type (to allow all users to grant/deny - these flags, select no group). Default is - no group. -request_group string If flags of this type are requestable, the - group allowed to request them (to allow all - users to request these flags, select no - group). Note that the request group alone - has no effect if the grant group is not - defined! Default is no group. -=========================== ======= =========================================== - -An example for ``inclusions`` and/or ``exclusions``: - -.. code-block:: js - - [ - "FooProduct" - ] - - { - "BarProduct" : [ "C1", "C3" ], - "BazProduct" : [ "C7" ] - } - -This flag will be added to **all** components of ``FooProduct``, components C1 -and C3 of ``BarProduct``, and C7 of ``BazProduct``. - -**Response** - -.. code-block:: js - - { - "id": 13 - } - -======= ==== ============================================== -name type description -======= ==== ============================================== -flag_id int ID of the new FlagType object is returned. -======= ==== ============================================== - -.. _rest_flagtype_update: - -Update Flag Type ----------------- - -This allows you to update a flag type in Bugzilla. You must be authenticated -and be in the *editcomponents* group to perform this action. - -**Request** - -.. code-block:: text - - PUT /rest/flag_type/(id_or_name) - -.. code-block:: js - - { - "ids" : [13], - "name" : "feedback-new", - "is_requestable" : false - } - -You can edit a single flag type by passing the ID or name of the flag type -in the URL. To edit more than one flag type, you can specify addition IDs or -flag type names using the ``ids`` or ``names`` parameters respectively. - -One of the below must be specified. - -============== ===== ========================================================== -name type description -============== ===== ========================================================== -**id_or_name** mixed Integer flag type ID or name. -**ids** array Numeric IDs of the flag types that you wish to update. -**names** array Names of the flag types that you wish to update. If many - flag types have the same name, this will change **all** - of them. -============== ===== ========================================================== - -The following parameters specify the new values you want to set for the flag -types you are updating. - -=========================== ======= =========================================== -name type description -=========================== ======= =========================================== -name string A short name identifying this type. -description string A comprehensive description of this type. -inclusions array An array of strings or an object containing - product names, and optionally component - names. If you provide a string, the flag - type will be shown on all bugs in that - product. If you provide an object, the key - represents the product name, and the value - is the components of the product to be - included. -exclusions array An array of strings or an object containing - product names. This uses the same format as - ``inclusions``. This will exclude the flag - from all products and components specified. -sortkey int A number between 1 and 32767 by which this - type will be sorted when displayed to users - in a list; ignore if you don't care what - order the types appear in or if you want - them to appear in alphabetical order. -is_active boolean Flag of this type appear in the UI and can - be set. -is_requestable boolean Users can ask for flags of this type to be - set. -cc_list array If the flag type is requestable, who should - receive e-mail notification of requests. - This is an array of e-mail addresses - which do not need to be Bugzilla logins. -is_specifically_requestable boolean Users can ask specific other users to set - flags of this type as opposed to just - asking the wind. -is_multiplicable boolean Multiple flags of this type can be set on - the same bug. -grant_group string The group allowed to grant/deny flags of - this type (to allow all users to grant/deny - these flags, select no group). -request_group string If flags of this type are requestable, the - group allowed to request them (to allow all - users to request these flags, select no - group). Note that the request group alone - has no effect if the grant group is not - defined! -=========================== ======= =========================================== - -An example for ``inclusions`` and/or ``exclusions``: - -.. code-block:: js - - [ - "FooProduct", - ] - - { - "BarProduct" : [ "C1", "C3" ], - "BazProduct" : [ "C7" ] - } - -This flag will be added to **all** components of ``FooProduct``, -components C1 and C3 of ``BarProduct``, and C7 of ``BazProduct``. - -**Response** - -.. code-block:: js - - { - "flagtypes": [ - { - "name": "feedback-new", - "changes": { - "is_requestable": { - "added": "0", - "removed": "1" - }, - "name": { - "removed": "feedback", - "added": "feedback-new" - } - }, - "id": 13 - } - ] - } - -``flagtypes`` (array) Flag change objects containing the following items: - -======= ====== ================================================================ -name type description -======= ====== ================================================================ -id int The ID of the flag type that was updated. -name string The name of the flag type that was updated. -changes object The changes that were actually done on this flag type. - The keys are the names of the fields that were changed, and the - values are an object with two items: - - * added: (string) The value that this field was changed to. - * removed: (string) The value that was previously set in this - field. -======= ====== ================================================================ - -Booleans changes will be represented with the strings '1' and '0'. diff --git a/mozilla/webtools/bugzilla/docs/en/rst/api/core/v1/general.rst b/mozilla/webtools/bugzilla/docs/en/rst/api/core/v1/general.rst deleted file mode 100644 index 06ef5b2fbc0..00000000000 --- a/mozilla/webtools/bugzilla/docs/en/rst/api/core/v1/general.rst +++ /dev/null @@ -1,255 +0,0 @@ -General -======= - -This is the standard REST API for external programs that want to interact -with Bugzilla. It provides a REST interface to various Bugzilla functions. - -Basic Information ------------------ - -**Browsing** - -If the ``Accept`` header of a request is set to ``text/html`` (as it is by an -ordinary web browser) then the API will return the JSON data as a HTML -page which the browser can display. In other words, you can play with the -API using just your browser to see results in a human-readable form. -This is a good way to try out the various GET calls, even if you can't use -it for POST or PUT. - -**Data Format** - -The REST API only supports JSON input, and either JSON or JSONP output. -So objects sent and received must be in JSON format. - -On every request, you must set both the ``Accept`` and ``Content-Type`` HTTP -headers to the MIME type of the data format you are using to communicate with -the API. ``Content-Type`` tells the API how to interpret your request, and -``Accept`` tells it how you want your data back. ``Content-Type`` must be -``application/json``. ``Accept`` can be either that, or -``application/javascript`` for JSONP. In the latter`case, add a ``callback`` -parameter to name your callback. - -Parameters may also be passed in as part of the query string for non-GET -requests and will override any matching parameters in the request body. - -Example request which returns the current version of Bugzilla: - -.. code-block:: http - - GET /rest/version HTTP/1.1 - Host: bugzilla.example.com - Accept: application/json - -Example response: - -.. code-block:: http - - HTTP/1.1 200 OK - Vary: Accept - Content-Type: application/json - - { - "version" : "4.2.9+" - } - -**Errors** - -When an error occurs over REST, an object is returned with the key ``error`` -set to ``true``. - -The error contents look similar to: - -.. code-block:: js - - { - "error": true, - "message": "Some message here", - "code": 123 - } - -Common Data Types ------------------ - -The Bugzilla API uses the following various types of parameters: - -======== ====================================================================== - type description -======== ====================================================================== -int Integer. -double A floating-point number. -string A string. -email A string representing an email address. This value, when returned, - may be filtered based on if the user is logged in or not. -date A specific date. Example format: ``YYYY-MM-DD``. -datetime A date/time. Timezone should be in UTC unless otherwise noted. - Example format: ``YYYY-MM-DDTHH24:MI:SSZ``. -boolean ``true`` or ``false``. -base64 A base64-encoded string. This is the only way to transfer - binary data via the API. -array An array. There may be mixed types in an array. ``[`` and ``]`` are - used to represent the beginning and end of arrays. -object A mapping of keys to values. Called a "hash", "dict", or "map" in - some other programming languages. The keys are strings, and the - values can be any type. ``{`` and ``}`` are used to represent the - beginning and end of objects. -======== ====================================================================== - -Parameters that are required will be displayed in **bold** in the parameters -table for each API method. - -Authentication --------------- - -Some methods do not require you to log in. An example of this is -:ref:`rest_single_bug`. However, authenticating yourself allows you to see -non-public information, for example, a bug that is not publicly visible. - -There are two ways to authenticate yourself: - -**API Keys** - -You can specify ``Bugzilla_api_key`` or simply ``api_key`` as an argument to -any call, and you will be logged in as that user if the key is correct and has -not been revoked. You can set up an API key by using the 'API Key' tab in the -Preferences pages. - -**Login and Password** - -You can specify ``Bugzilla_login`` and ``Bugzilla_password`` or simply -``login`` and ``password`` respectively, as arguments to any call, and you will -be logged in as that user if your credentials are correct. - -====================== ======= ============================================== -name type description -====================== ======= ============================================== -**Bugzilla_login** string A user's login name. -**Bugzilla_password** string That user's password. -Bugzilla_restrictlogin boolean If true, then your login will only be - valid for your IP address. -====================== ======= ============================================== - -The ``Bugzilla_restrictlogin`` option is only used when you have also -specified ``Bugzilla_login`` and ``Bugzilla_password``. - -There is also a deprecated method of authentication described below that will be -removed in the version after Bugzilla 5.0. - -**Bugzilla Tokens** - -You can use :ref:`rest_user_login` to log in as a Bugzilla user. This issues a -token that you must then use in future calls. Just use the value for ``token`` -and pass as either ``Bugzilla_token`` or simply ``token`` as arguments to an -API call. - -================== ====== =================================================== -name type description -================== ====== =================================================== -**Bugzilla_token** string You can specify this as argument to any call, - and you will be logged in as that user if the - token is correct. This is the token returned - when calling :ref:`rest_user_login` mentioned - above. -================== ====== =================================================== - -An error is thrown if you pass an invalid token; you will need to log in again -to get a new token. - -Also starting with Bugzilla 5.0, login cookies are no longer returned by -:ref:`rest_user_login` due to security concerns. - -Useful Parameters ------------------ - -Many calls take common arguments. These are documented below and linked from -the individual calls where these parameters are used. - -**Including Fields** - -Many calls return an array of objects with various fields in the objects. (For -example, :ref:`rest_single_bug` returns a list of ``bugs`` that have fields like -``id``, ``summary``, ``creation_time``, etc.) - -These parameters allow you to limit what fields are present in the objects, to -improve performance or save some bandwidth. - -``include_fields``: The (case-sensitive) names of fields in the response data. -Only the fields specified in the object will be returned, the rest will not be -included. Fields should be comma delimited. - -Invalid field names are ignored. - -Example request to :ref:`rest_user_get`: - -.. code-block:: text - - GET /rest/user/1?include_fields=id,name - -would return something like: - -.. code-block:: js - - { - "users" : [ - { - "id" : 1, - "name" : "user@domain.com" - } - ] - } - -**Excluding Fields** - -``exclude_fields``: The (case-sensitive) names of fields in the return value. The\ -fields specified will not be included in the returned hashes. Fields should -be comma delimited. - -Invalid field names are ignored. - -Specifying fields here overrides ``include_fields``, so if you specify a -field in both, it will be excluded, not included. - -Example request to :ref:`rest_user_get`: - -.. code-block:: js - - GET /rest/user/1?exclude_fields=name - -would return something like: - -.. code-block:: js - - { - "users" : [ - { - "id" : 1, - "real_name" : "John Smith" - } - ] - } - -Some calls support specifying "subfields". If a call states that it supports -"subfield" restrictions, you can restrict what information is returned within -the first field. For example, if you call :ref:`rest_product_get` with an -``include_fields`` of ``components.name``, then only the component name would be -returned (and nothing else). You can include the main field, and exclude a -subfield. - -There are several shortcut identifiers to ask for only certain groups of -fields to be returned or excluded: - -========= ===================================================================== -value description -========= ===================================================================== -_all All possible fields are returned if this is specified in - ``include_fields``. -_default Default fields are returned if ``include_fields`` is empty or - this is specified. This is useful if you want the default - fields in addition to a field that is not normally returned. -_extra Extra fields are not returned by default and need to be manually - specified in ``include_fields`` either by exact field name, or adding - ``_extra``. - _custom Custom fields are normally returned by default unless this is added - to ``exclude_fields``. Also you can use it in ``include_fields`` if - for example you want specific field names plus all custom fields. - Custom fields are normally only relevant to bug objects. -========= ===================================================================== diff --git a/mozilla/webtools/bugzilla/docs/en/rst/api/core/v1/group.rst b/mozilla/webtools/bugzilla/docs/en/rst/api/core/v1/group.rst deleted file mode 100644 index e2c5952404f..00000000000 --- a/mozilla/webtools/bugzilla/docs/en/rst/api/core/v1/group.rst +++ /dev/null @@ -1,278 +0,0 @@ -Groups -====== - -The API for creating, changing, and getting information about groups. - -.. _rest_group_create: - -Create Group ------------- - -This allows you to create a new group in Bugzilla. You must be authenticated and -be in the *creategroups* group to perform this action. - -**Request** - -.. code-block:: text - - POST /rest/group - -.. code-block:: js - - { - "name" : "secret-group", - "description" : "Too secret for you!", - "is_active" : true - } - -Some params must be set, or an error will be thrown. The required params are -marked in **bold**. - -=============== ======= ======================================================= -name type description -=============== ======= ======================================================= -**name** string A short name for this group. Must be unique. This - is not usually displayed in the user interface, except - in a few places. -**description** string A human-readable name for this group. Should be - relatively short. This is what will normally appear in - the UI as the name of the group. -user_regexp string A regular expression. Any user whose Bugzilla username - matches this regular expression will automatically be - granted membership in this group. -is_active boolean ``true`` if new group can be used for bugs, ``false`` - if this is a group that will only contain users and no - bugs will be restricted to it. -icon_url string A URL pointing to a small icon used to identify the - group. This icon will show up next to users' names in - various parts of Bugzilla if they are in this group. -=============== ======= ======================================================= - -**Response** - -.. code-block:: js - - { - "id": 22 - } - -==== ==== ============================== -name type description -==== ==== ============================== -id int ID of the newly-created group. -==== ==== ============================== - -.. _rest_group_update: - -Update Group ------------- - -This allows you to update a group in Bugzilla. You must be authenticated and be -in the *creategroups* group to perform this action. - -**Request** - -To update a group using the group ID or name: - -.. code-block:: text - - PUT /rest/group/(id_or_name) - -.. code-block:: js - - { - "name" : "secret-group", - "description" : "Too secret for you! (updated description)", - "is_active" : false - } - -You can edit a single group by passing the ID or name of the group -in the URL. To edit more than one group, you can specify addition IDs or -group names using the ``ids`` or ``names`` parameters respectively. - -One of the below must be specified. - -============== ===== ========================================================== -name type description -============== ===== ========================================================== -**id_or_name** mixed Integer group or name. -**ids** array IDs of groups to update. -**names** array Names of groups to update. -============== ===== ========================================================== - -The following parameters specify the new values you want to set for the group(s) -you are updating. - -=========== ======= =========================================================== -name type description -=========== ======= =========================================================== -name string A new name for the groups. If you try to set this while - updating more than one group, an error will occur, as - group names must be unique. -description string A new description for the groups. This is what will appear - in the UI as the name of the groups. -user_regexp string A new regular expression for email. Will automatically - grant membership to these groups to anyone with an email - address that matches this perl regular expression. -is_active boolean Set if groups are active and eligible to be used for bugs. - ``true`` if bugs can be restricted to this group, ``false`` - otherwise. -icon_url string A URL pointing to an icon that will appear next to the name - of users who are in this group. -=========== ======= =========================================================== - -**Response** - -.. code-block:: js - - { - "groups": [ - { - "changes": { - "description": { - "added": "Too secret for you! (updated description)", - "removed": "Too secret for you!" - }, - "is_active": { - "removed": "1", - "added": "0" - } - }, - "id": "22" - } - ] - } - -``groups`` (array) Group change objects, each containing the following items: - -======= ====== ================================================================ -name type description -======= ====== ================================================================ -id int The ID of the group that was updated. -changes object The changes that were actually done on this group. The - keys are the names of the fields that were changed, and the - values are an object with two items: - - * added: (string) The values that were added to this field, - possibly a comma-and-space-separated list if multiple values - were added. - * removed: (string) The values that were removed from this - field, possibly a comma-and-space-separated list if multiple - values were removed. -======= ====== ================================================================ - -.. _rest_group_get: - -Get Group ---------- - -Returns information about Bugzilla groups. - -**Request** - -To return information about a specific group ID or name: - -.. code-block:: text - - GET /rest/group/(id_or_name) - -You can also return information about more than one specific group by using the -following in your query string: - -.. code-block:: text - - GET /rest/group?ids=1&ids=2&ids=3 - GET /group?names=ProductOne&names=Product2 - -If neither IDs nor names are passed, and you are in the creategroups or -editusers group, then all groups will be retrieved. Otherwise, only groups -that you have bless privileges for will be returned. - -========== ======= ============================================================ -name type description -========== ======= ============================================================ -id_or_name mixed Integer group ID or name. -ids array Integer IDs of groups. -names array Names of groups. -membership boolean Set to 1 then a list of members of the passed groups names - and IDs will be returned. -========== ======= ============================================================ - -**Response** - -.. code-block:: js - - { - "groups": [ - { - "membership": [ - { - "real_name": "Bugzilla User", - "can_login": true, - "name": "user@bugzilla.org", - "login_denied_text": "", - "id": 85, - "email_enabled": false, - "email": "user@bugzilla.org" - }, - ], - "is_active": true, - "description": "Test Group", - "user_regexp": "", - "is_bug_group": true, - "name": "TestGroup", - "id": 9 - } - ] - } - -If the user is a member of the *creategroups* group they will receive -information about all groups or groups matching the criteria that they passed. -You have to be in the creategroups group unless you're requesting membership -information. - -If the user is not a member of the *creategroups* group, but they are in the -"editusers" group or have bless privileges to the groups they require -membership information for, the is_active, is_bug_group and user_regexp values -are not supplied. - -The return value will be an object containing group names as the keys; each -value will be an object that describes the group and has the following items: - -============ ====== =========================================================== -name type description -============ ====== =========================================================== -id int The unique integer ID that Bugzilla uses to identify this - group. Even if the name of the group changes, this ID will - stay the same. -name string The name of the group. -description string The description of the group. -is_bug_group int Whether this group is to be used for bug reports or is - only administrative specific. -user_regexp string A regular expression that allows users to be added to - this group if their login matches. -is_active int Whether this group is currently active or not. -users array User objects that are members of this group; only - returned if the user sets the ``membership`` parameter to - 1. Each user object has the items describe in the User - object below. -============ ====== =========================================================== - -User object: - -============= ======= ========================================================= -name type description -============= ======= ========================================================= -id int The ID of the user. -real_name string The actual name of the user. -email string The email address of the user. -name string The login name of the user. Note that in some situations - this is different than their email. -can_login boolean A boolean value to indicate if the user can login into - bugzilla. -email_enabled boolean A boolean value to indicate if bug-related mail will - be sent to the user or not. -disabled_text string A text field that holds the reason for disabling a user - from logging into Bugzilla. If empty, then the user - account is enabled; otherwise it is disabled/closed. -============= ======= ========================================================= diff --git a/mozilla/webtools/bugzilla/docs/en/rst/api/core/v1/index.rst b/mozilla/webtools/bugzilla/docs/en/rst/api/core/v1/index.rst deleted file mode 100644 index 933aeed968d..00000000000 --- a/mozilla/webtools/bugzilla/docs/en/rst/api/core/v1/index.rst +++ /dev/null @@ -1,18 +0,0 @@ -Core API v1 -=========== - -.. toctree:: - - general - attachment - bug - bug-user-last-visit - bugzilla - classification - comment - component - field - flagtype - group - product - user diff --git a/mozilla/webtools/bugzilla/docs/en/rst/api/core/v1/product.rst b/mozilla/webtools/bugzilla/docs/en/rst/api/core/v1/product.rst deleted file mode 100644 index 95726a3a8ac..00000000000 --- a/mozilla/webtools/bugzilla/docs/en/rst/api/core/v1/product.rst +++ /dev/null @@ -1,416 +0,0 @@ -Products -======== - -This part of the Bugzilla API allows you to list the available products and -get information about them. - -.. _rest_product_list: - -List Products -------------- - -Returns a list of the IDs of the products the user can search on. - -**Request** - -To get a list of product IDs a user can select such as for querying bugs: - -.. code-block:: text - - GET /rest/product_selectable - -To get a list of product IDs a user can enter a bug against: - -.. code-block:: text - - GET /rest/product_enterable - -To get a list of product IDs a user can search or enter bugs against. - -.. code-block:: text - - GET /rest/product_accessible - -**Response** - -.. code-block:: js - - { - "ids": [ - "2", - "3", - "19", - "1", - "4" - ] - } - -==== ===== ====================================== -name type description -==== ===== ====================================== -ids array List of integer product IDs. -==== ===== ====================================== - -.. _rest_product_get: - -Get Product ------------ - -Returns a list of information about the products passed to it. - -**Request** - -To return information about a specific type of products such as -``accessible``, ``selectable``, or ``enterable``: - -.. code-block:: text - - GET /rest/product?type=accessible - -To return information about a specific product by ``id`` or ``name``: - -.. code-block:: text - - GET /rest/product/(id_or_name) - -You can also return information about more than one product by using the -following parameters in your query string: - -.. code-block:: text - - GET /rest/product?ids=1&ids=2&ids=3 - GET /rest/product?names=ProductOne&names=Product2 - -========== ====== ============================================================= -name type description -========== ====== ============================================================= -id_or_name mixed Integer product ID or product name. -ids array Product IDs -names array Product names -type string The group of products to return. Valid values are - ``accessible`` (default), ``selectable``, and ``enterable``. - ``type`` can be a single value or an array of values if more - than one group is needed with duplicates removed. -========== ====== ============================================================= - -**Response** - -.. code-block:: js - - { - "products": [ - { - "id": 1, - "default_milestone": "---", - "components": [ - { - "is_active": true, - "default_assigned_to": "admin@bugzilla.org", - "id": 1, - "sort_key": 0, - "name": "TestComponent", - "flag_types": { - "bug": [ - { - "is_active": true, - "grant_group": null, - "cc_list": "", - "is_requestable": true, - "id": 3, - "is_multiplicable": true, - "name": "needinfo", - "request_group": null, - "is_requesteeble": true, - "sort_key": 0, - "description": "needinfo" - } - ], - "attachment": [ - { - "description": "Review", - "is_multiplicable": true, - "name": "review", - "is_requesteeble": true, - "request_group": null, - "sort_key": 0, - "cc_list": "", - "grant_group": null, - "is_requestable": true, - "id": 2, - "is_active": true - } - ] - }, - "default_qa_contact": "", - "description": "This is a test component." - } - ], - "is_active": true, - "classification": "Unclassified", - "versions": [ - { - "id": 1, - "name": "unspecified", - "is_active": true, - "sort_key": 0 - } - ], - "description": "This is a test product.", - "has_unconfirmed": true, - "milestones": [ - { - "name": "---", - "is_active": true, - "sort_key": 0, - "id": 1 - } - ], - "name": "TestProduct" - } - ] - } - -``products`` (array) Each product object has the following items: - -================= ======= ===================================================== -name type description -================= ======= ===================================================== -id int An integer ID uniquely identifying the product in - this installation only. -name string The name of the product. This is a unique identifier - for the product. -description string A description of the product, which may contain HTML. -is_active boolean A boolean indicating if the product is active. -default_milestone string The name of the default milestone for the product. -has_unconfirmed boolean Indicates whether the UNCONFIRMED bug status is - available for this product. -classification string The classification name for the product. -components array Each component object has the items described in the - Component object below. -versions array Each object describes a version, and has the - following items: ``name``, ``sort_key`` and - ``is_active``. -milestones array Each object describes a milestone, and has the - following items: ``name``, ``sort_key`` and - ``is_active``. -================= ======= ===================================================== - -If the user tries to access a product that is not in the list of accessible -products for the user, or a product that does not exist, that is silently -ignored, and no information about that product is returned. - -Component object: - -=================== ======= =================================================== -name type description -=================== ======= =================================================== -id int An integer ID uniquely identifying the component in - this installation only. -name string The name of the component. This is a unique - identifier for this component. -description string A description of the component, which may contain - HTML. -default_assigned_to string The login name of the user to whom new bugs - will be assigned by default. -default_qa_contact string The login name of the user who will be set as - the QA Contact for new bugs by default. Empty - string if the QA contact is not defined. -sort_key int Components, when displayed in a list, are sorted - first by this integer and then secondly by their - name. -is_active boolean A boolean indicating if the component is active. - Inactive components are not enabled for new bugs. -flag_types object An object containing two items ``bug`` and - ``attachment`` that each contains an array of - objects, where each describes a flagtype. The - flagtype items are described in the Flagtype - object below. -=================== ======= =================================================== - -Flagtype object: - -================ ======= ====================================================== -name type description -================ ======= ====================================================== -id int Returns the ID of the flagtype. -name string Returns the name of the flagtype. -description string Returns the description of the flagtype. -cc_list string Returns the concatenated CC list for the flagtype, as - a single string. -sort_key int Returns the sortkey of the flagtype. -is_active boolean Returns whether the flagtype is active or disabled. - Flags being in a disabled flagtype are not deleted. - It only prevents you from adding new flags to it. -is_requestable boolean Returns whether you can request for the given - flagtype (i.e. whether the '?' flag is available or - not). -is_requesteeble boolean Returns whether you can ask someone specifically - or not. -is_multiplicable boolean Returns whether you can have more than one - flag for the given flagtype in a given bug/attachment. -grant_group int the group ID that is allowed to grant/deny flags of - this type. If the item is not included all users are - allowed to grant/deny this flagtype. -request_group int The group ID that is allowed to request the flag if - the flag is of the type requestable. If the item is - not included all users are allowed request this - flagtype. -================ ======= ====================================================== - -.. _rest_product_create: - -Create Product --------------- - -This allows you to create a new product in Bugzilla. - -**Request** - -.. code-block:: text - - POST /rest/product - -.. code-block:: js - - { - "name" : "AnotherProduct", - "description" : "Another Product", - "classification" : "Unclassified", - "is_open" : false, - "has_unconfirmed" : false, - "version" : "unspecified" - } - -Some params must be set, or an error will be thrown. The required params are -marked in bold. - -================= ======= ===================================================== -name type description -================= ======= ===================================================== -**name** string The name of this product. Must be globally unique - within Bugzilla. -**description** string A description for this product. Allows some simple - HTML. -**version** string The default version for this product. -has_unconfirmed boolean Allow the UNCONFIRMED status to be set on bugs in - this product. Default: true. -classification string The name of the Classification which contains this - product. -default_milestone string The default milestone for this product. Default - '---'. -is_open boolean ``true`` if the product is currently allowing bugs - to be entered into it. Default: ``true``. -create_series boolean ``true`` if you want series for New Charts to be - created for this new product. Default: ``true``. -================= ======= ===================================================== - -**Response** - -.. code-block:: js - - { - "id": 20 - } - -Returns an object with the following items: - -==== ==== ===================================== -name type description -==== ==== ===================================== -id int ID of the newly-filed product. -==== ==== ===================================== - -.. _rest_product_update: - -Update Product --------------- - -This allows you to update a product in Bugzilla. - -**Request** - -.. code-block:: text - - PUT /rest/product/(id_or_name) - -You can edit a single product by passing the ID or name of the product -in the URL. To edit more than one product, you can specify addition IDs or -product names using the ``ids`` or ``names`` parameters respectively. - -.. code-block:: js - - { - "ids" : [123], - "name" : "BarName", - "has_unconfirmed" : false - } - -One of the below must be specified. - -============== ===== ========================================================== -name type description -============== ===== ========================================================== -**id_or_name** mixed Integer product ID or name. -**ids** array Numeric IDs of the products that you wish to update. -**names** array Names of the products that you wish to update. -============== ===== ========================================================== - -The following parameters specify the new values you want to set for the product(s) -you are updating. - -================= ======= ===================================================== -name type description -================= ======= ===================================================== -name string A new name for this product. If you try to set this - while updating more than one product, an error will - occur, as product names must be unique. -default_milestone string When a new bug is filed, what milestone does it - get by default if the user does not choose one? Must - represent a milestone that is valid for this product. -description string Update the long description for these products to - this value. -has_unconfirmed boolean Allow the UNCONFIRMED status to be set on bugs in - products. -is_open boolean ``true`` if the product is currently allowing bugs - to be entered into it, ``false`` otherwise. -================= ======= ===================================================== - -**Response** - -.. code-block:: js - - { - "products" : [ - { - "id" : 123, - "changes" : { - "name" : { - "removed" : "FooName", - "added" : "BarName" - }, - "has_unconfirmed" : { - "removed" : "1", - "added" : "0" - } - } - } - ] - } - -``products`` (array) Product change objects containing the following items: - -======= ====== ================================================================ -name type description -======= ====== ================================================================ -id int The ID of the product that was updated. -changes object The changes that were actually done on this product. The - keys are the names of the fields that were changed, and the - values are an object with two items: - - * added: (string) The value that this field was changed to. - * removed: (string) The value that was previously set in this - field. -======= ====== ================================================================ - -Booleans will be represented with the strings '1' and '0' for changed values -as they are stored as strings in the database currently. diff --git a/mozilla/webtools/bugzilla/docs/en/rst/api/core/v1/user.rst b/mozilla/webtools/bugzilla/docs/en/rst/api/core/v1/user.rst deleted file mode 100644 index e27211a7fa2..00000000000 --- a/mozilla/webtools/bugzilla/docs/en/rst/api/core/v1/user.rst +++ /dev/null @@ -1,380 +0,0 @@ -Users -===== - -This part of the Bugzilla API allows you to create user accounts, get information -about user accounts and to log in or out using an existing account. - -.. _rest_user_login: - -Login ------ - -Logging in with a username and password is required for many Bugzilla -installations, in order to search for private bugs, post new bugs, etc. This -method allows you to retrieve a token that can be used as authentication for -subsequent API calls. Otherwise yuou will need to pass your ``login`` and -``password`` with each call. - -This method will be going away in the future in favor of using *API keys*. - -**Request** - -.. code-block:: text - - GET /rest/login?login=foo@example.com&password=toosecrettoshow - -============== ======= ======================================================== -name type description -============== ======= ======================================================== -**login** string The user's login name. -**password** string The user's password. -restrict_login boolean If set to a true value, the token returned by this - method will only be valid from the IP address which - called this method. -============== ======= ======================================================== - -**Response** - -.. code-block:: js - - { - "token": "786-OLaWfBisMY", - "id": 786 - } - -======== ====== =============================================================== -name type description -======== ====== =============================================================== -id int Numeric ID of the user that was logged in. -token string Token which can be passed in the parameters as - authentication in other calls. The token can be sent along - with any future requests to the webservice, for the duration - of the session, i.e. til :ref:`rest_user_logout` is called. -======== ====== =============================================================== - -.. _rest_user_logout: - -Logout ------- - -Log out the user. Basically it invalidates the token provided so it cannot be -re-used. Does nothing if the token is not in use. Will also clear any existing -authentication cookies the client may still have stored. - -**Request** - -.. code-block:: text - - GET /rest/logout?token=1234-VWvO51X69r - -===== ====== =================================================== -name type description -===== ====== =================================================== -token string The user's token used for authentication. -===== ====== =================================================== - -.. _rest_user_valid_login: - -Valid Login ------------ - -This method will verify whether a client's cookies or current login token is -still valid or have expired. A valid username that matches must be provided as -well. - -**Request** - -.. code-block:: text - - GET /rest/valid_login?login=foo@example.com&token=1234-VWvO51X69r - -========= ======= ============================================================= -name type description -========= ======= ============================================================= -**login** string The login name that matches the provided cookies or token. -token string Persistent login token currently being used for - authentication. -========= ======= ============================================================= - -**Response** - -Returns true/false depending on if the current token is valid for the provided -username. - -.. _rest_user_create: - -Create User ------------ - -Creates a user account directly in Bugzilla, password and all. Instead of this, -you should use **Offer Account by Email** when possible because that makes sure -that the email address specified can actually receive an email. This function -does not check that. You must be authenticated and be in the *editusers* group -to perform this action. - -**Request** - -.. code-block:: text - - POST /rest/user - -.. code-block:: js - - { - "email" : "user@bugzilla.org", - "full_name" : "Test User", - "password" : "K16ldRr922I1" - } - -========== ====== ============================================================= -name type description -========== ====== ============================================================= -**email** string The email address for the new user. -full_name string The user's full name. Will be set to empty if not specified. -password string The password for the new user account, in plain text. It - will be stripped of leading and trailing whitespace. If - blank or not specified, the new created account will - exist in Bugzilla but will not be allowed to log in - using DB authentication until a password is set either - by the user (through resetting their password) or by the - administrator. -========== ====== ============================================================= - -**Response** - -.. code-block:: js - - { - "id": 58707 - } - -==== ==== ============================================ -name type desciption -==== ==== ============================================ -id int The numeric ID of the user that was created. -==== ==== ============================================ - -.. _rest_user_update: - -Update User ------------ - -Updates an existing user account in Bugzilla. You must be authenticated and be -in the *editusers* group to perform this action. - -**Request** - -.. code-block:: text - - PUT /rest/user/(id_or_name) - -You can edit a single user by passing the ID or login name of the user -in the URL. To edit more than one user, you can specify addition IDs or -login names using the ``ids`` or ``names`` parameters respectively. - -================= ======= ===================================================== - name type description -================= ======= ===================================================== -**id_or_name** mixed Either the ID or the login name of the user to - update. -**ids** array Additional IDs of users to update. -**names** array Additional login names of users to update. -full_name string The new name of the user. -email string The email of the user. Note that email used to - login to bugzilla. Also note that you can only - update one user at a time when changing the login - name / email. (An error will be thrown if you try to - update this field for multiple users at once.) -password string The password of the user. -email_enabled boolean A boolean value to enable/disable sending - bug-related mail to the user. -login_denied_text string A text field that holds the reason for disabling a - user from logging into Bugzilla. If empty, then the - user account is enabled; otherwise it is - disabled/closed. -groups object These specify the groups that this user is directly - a member of. To set these, you should pass an object - as the value. The object's items are described in - the Groups update objects below. -bless_groups object This is the same as groups but affects what groups - a user has direct membership to bless that group. - It takes the same inputs as groups. -================= ======= ===================================================== - -Groups and bless groups update object: - -====== ===== ================================================================== -name type description -====== ===== ================================================================== -add array The group IDs or group names that the user should be added to. -remove array The group IDs or group names that the user should be removed from. -set array Integers or strings which are an exact set of group IDs and group - names that the user should be a member of. This does not remove - groups from the user when the person making the change does not - have the bless privilege for the group. -====== ===== ================================================================== - -If you specify ``set``, then ``add`` and ``remove`` will be ignored. A group in -both the ``add`` and ``remove`` list will be added. Specifying a group that the -user making the change does not have bless rights will generate an error. - -**Response** - -* users: (array) List of user change objects with the following items: - -======= ====== ================================================================ -name type description -======= ====== ================================================================ -id int The ID of the user that was updated. -changes object The changes that were actually done on this user. The keys - are the names of the fields that were changed, and the values - are an object with two items: - - * added: (string) The values that were added to this field, - possibly a comma-and-space-separated list if multiple values - were added. - * removed: (string) The values that were removed from this - field, possibly a comma-and-space-separated list if multiple - values were removed. -======= ====== ================================================================ - -.. _rest_user_get: - -Get User --------- - -Gets information about user accounts in Bugzilla. - -**Request** - -To get information about a single user in Bugzilla: - -.. code-block:: text - - GET /rest/user/(id_or_name) - -To get multiple users by name or ID: - -.. code-block:: text - - GET /rest/user?names=foo@bar.com&name=test@bugzilla.org - GET /rest/user?ids=123&ids=321 - -To get user matching a search string: - -.. code-block:: text - - GET /rest/user?match=foo - -To get user by using an integer ID value or by using ``match``, you must be -authenticated. - -================ ======= ====================================================== -name type description -================ ======= ====================================================== -id_or_name mixed An integer user ID or login name of the user. -ids array Integer user IDs. Logged=out users cannot pass - this parameter to this function. If they try, - they will get an error. Logged=in users will get - an error if they specify the ID of a user they - cannot see. -names array Login names. -match array This works just like "user matching" in Bugzilla - itself. Users will be returned whose real name - or login name contains any one of the specified - strings. Users that you cannot see will not be - included in the returned list. - - Most installations have a limit on how many - matches are returned for each string; the default - is 1000 but can be changed by the Bugzilla - administrator. - - Logged-out users cannot use this argument, and - an error will be thrown if they try. (This is to - make it harder for spammers to harvest email - addresses from Bugzilla, and also to enforce the - user visibility restrictions that are - implemented on some Bugzillas.) -limit int Limit the number of users matched by the - ``match`` parameter. If the value is greater than the - system limit, the system limit will be used. - This parameter is only valid when using the ``match`` - parameter. -group_ids array Numeric IDs for groups that a user can be in. -groups array Names of groups that a user can be in. If - ``group_ids`` or ``groups`` are specified, they - limit the return value to users who are in *any* - of the groups specified. -include_disabled boolean By default, when using the ``match`` parameter, - disabled users are excluded from the returned - results unless their full username is identical - to the match string. Setting ``include_disabled`` to - ``true`` will include disabled users in the returned - results even if their username doesn't fully match - the input string. -================ ======= ====================================================== - -**Response** - -* users: (array) Each object describes a user and has the following items: - -================= ======= ===================================================== -name type description -================= ======= ===================================================== -id int The unique integer ID that Bugzilla uses to represent - this user. Even if the user's login name changes, - this will not change. -real_name string The actual name of the user. May be blank. -email string The email address of the user. -name string The login name of the user. Note that in some - situations this is different than their email. -can_login boolean A boolean value to indicate if the user can login - into bugzilla. -email_enabled boolean A boolean value to indicate if bug-related mail will - be sent to the user or not. -login_denied_text string A text field that holds the reason for disabling a - user from logging into Bugzilla. If empty then the - user account is enabled; otherwise it is - disabled/closed. -groups array Groups the user is a member of. If the currently - logged in user is querying their own account or is a - member of the 'editusers' group, the array will - contain all the groups that the user is a member of. - Otherwise, the array will only contain groups that - the logged in user can bless. Each object describes - the group and contains the items described in the - Group object below. -saved_searches array User's saved searches, each having the following - Search object items described below. -saved_reports array User's saved reports, each having the following - Search object items described below. -================= ======= ===================================================== - -Group object: - -=========== ====== ============================================================ -name type description -=========== ====== ============================================================ -id int The group ID -name string The name of the group -description string The description for the group -=========== ====== ============================================================ - -Search object: - -===== ====== ================================================================== -name type description -===== ====== ================================================================== -id int An integer ID uniquely identifying the saved report. -name string The name of the saved report. -query string The CGI parameters for the saved report. -===== ====== ================================================================== - -If you are not authenticated when you call this function, you will only be -returned the ``id``, ``name``, and ``real_name`` items. If you are authenticated -and not in 'editusers' group, you will only be returned the ``id``, ``name``, -``real_name``, ``email``, ``can_login``, and ``groups`` items. The groups -returned are filtered based on your permission to bless each group. The -``saved_searches`` and ``saved_reports`` items are only returned if you are -querying your own account, even if you are in the editusers group. diff --git a/mozilla/webtools/bugzilla/docs/en/rst/customization.rst b/mozilla/webtools/bugzilla/docs/en/rst/customization.rst index 01f7fce1d28..d82ded8d05e 100644 --- a/mozilla/webtools/bugzilla/docs/en/rst/customization.rst +++ b/mozilla/webtools/bugzilla/docs/en/rst/customization.rst @@ -254,11 +254,7 @@ this is another way to quickly get a distinctive look and feel for your Bugzilla installation. :command:`global/variables.none.tmpl`: -This defines a list of terms that may be changed in order to -``brand`` the Bugzilla instance In this way, terms -like ``bugs`` can be replaced with ``issues`` -across the whole Bugzilla installation. The name -``Bugzilla`` and other words can be customized as well. +XXX Need to describe the use of this file :command:`list/table.html.tmpl`: This template controls the appearance of the bug lists created diff --git a/mozilla/webtools/bugzilla/docs/en/rst/extensions.rst b/mozilla/webtools/bugzilla/docs/en/rst/extensions.rst index fa444a05244..91eaab9521c 100644 --- a/mozilla/webtools/bugzilla/docs/en/rst/extensions.rst +++ b/mozilla/webtools/bugzilla/docs/en/rst/extensions.rst @@ -5,6 +5,7 @@ Your Bugzilla installation has the following extensions available (as of the last time you compiled the documentation): .. toctree:: + :maxdepth: 1 :glob: - extensions/*/* + extensions/* diff --git a/mozilla/webtools/bugzilla/docs/en/rst/index.rst b/mozilla/webtools/bugzilla/docs/en/rst/index.rst index 2da16e2234a..f2bd14f18b0 100644 --- a/mozilla/webtools/bugzilla/docs/en/rst/index.rst +++ b/mozilla/webtools/bugzilla/docs/en/rst/index.rst @@ -16,7 +16,6 @@ Bugzilla Documentation security using extensions - api customization patches troubleshooting diff --git a/mozilla/webtools/bugzilla/docs/en/rst/installation.rst b/mozilla/webtools/bugzilla/docs/en/rst/installation.rst index 5c0aa2de503..ef7423d2de7 100644 --- a/mozilla/webtools/bugzilla/docs/en/rst/installation.rst +++ b/mozilla/webtools/bugzilla/docs/en/rst/installation.rst @@ -748,29 +748,6 @@ Without this directive, Apache will not follow symbolic links to places outside its own directory structure, and you will be unable to run Bugzilla. -Apache *httpd* log files with bugzilla -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - -For security reasons it is recommended to prevent Apache from logging -query strings. - -For example: -When external systems interact with Bugzilla via webservices (REST/XMLRPC/JSONRPC) -they include the user's credentials as part of the URL (query-string). For security -reasons we recommend configuring Apache to not include the query-string in its log -files to avoid storing passwords in clear text on the server. - -#. Load :file:`httpd.conf` or :file:`apache2.conf` in your editor. - In most of the Linux distributions this file is found in :folder:`/etc/httpd/conf/httpd.conf` - or in :folder:`/etc/apache2/apache2.conf`. - -#. Find the following line in the above mentioned file. - LogFormat "%v:%p %h %l %u %t \"%r\" %>s %O \"%{Referer}i\" \"%{User-Agent}i\"" vhost_combined. - -#. Replace \"%r\" with \"%m %U\". - -#. Now restart Apache. - .. _http-apache-mod_perl: Apache *httpd* with mod_perl diff --git a/mozilla/webtools/bugzilla/docs/en/rst/using.rst b/mozilla/webtools/bugzilla/docs/en/rst/using.rst index eb887093b2b..5be1a2582e7 100644 --- a/mozilla/webtools/bugzilla/docs/en/rst/using.rst +++ b/mozilla/webtools/bugzilla/docs/en/rst/using.rst @@ -404,7 +404,7 @@ You can use it to find a bug by its number or its alias, too. You'll find the Quicksearch box in Bugzilla's footer area. On Bugzilla's front page, there is an additional -`quicksearcgh help <../../../page.cgi?id=quicksearch.html>`_ +`Help <../../page.cgi?id=quicksearch.html>`_ link which details how to use it. .. _casesensitivity: @@ -623,10 +623,11 @@ file first. Patch Viewer ============ -Viewing and reviewing patches in Bugzilla is often difficult due to improper -format and the inherent readability issues that raw patches present. Patch -Viewer is an enhancement to Bugzilla designed to fix that by offering linking -to sections. +Viewing and reviewing patches in Bugzilla is often difficult due to +lack of context, improper format and the inherent readability issues that +raw patches present. Patch Viewer is an enhancement to Bugzilla designed +to fix that by offering increased context, linking to sections, and +integrating with Bonsai, LXR and CVS. Patch viewer allows you to: @@ -635,12 +636,17 @@ Patch viewer allows you to: + See the difference between two patches. ++ Get more context in a patch. + + Collapse and expand sections of a patch for easy reading. + Link to a particular section of a patch for discussion or review ++ Go to Bonsai or LXR to see more context, blame, and + cross-references for the part of the patch you are looking at + + Create a rawtext unified format diff out of any patch, no matter what format it came from @@ -665,6 +671,18 @@ dropdown at the top of the page ("Differences between \[dropdown] and this patch") and click the "Diff" button. This will show you what is new or changed in the newer patch. +.. _patchviewer_context: + +Getting More Context in a Patch +------------------------------- + +To get more context in a patch, you put a number in the textbox at +the top of Patch Viewer ("Patch / File / \[textbox]") and hit enter. +This will give you that many lines of context before and after each +change. Alternatively, you can click on the "File" link there and it +will show each change in the full context of the file. This feature only +works against files that were diffed using "cvs diff". + .. _patchviewer_collapse: Collapsing and Expanding Sections of a Patch @@ -687,6 +705,20 @@ able to give someone a URL to show them which part you are talking about) you simply click the "Link Here" link on the section header. The resulting URL can be copied and used in discussion. +.. _patchviewer_bonsai_lxr: + +Going to Bonsai and LXR +----------------------- + +To go to Bonsai to get blame for the lines you are interested in, +you can click the "Lines XX-YY" link on the section header you are +interested in. This works even if the patch is against an old +version of the file, since Bonsai stores all versions of the file. + +To go to LXR, you click on the filename on the file header +(unfortunately, since LXR only does the most recent version, line +numbers are likely to rot). + .. _patchviewer_unified_diff: Creating a Unified Diff @@ -717,12 +749,8 @@ Other strings which get linkified in the obvious manner are: + bug 12345 -+ bugs 123, 456, 789 - + comment 7 -+ comments 1, 2, 3, 4 - + bug 23456, comment 53 + attachment 4321 @@ -757,23 +785,6 @@ Don't use sigs in comments. Signing your name ("Bill") is acceptable, if you do it out of habit, but full mail/news-style four line ASCII art creations are not. -.. _markdown: - -Markdown --------- - -Markdown lets you write your comments in a structured plain-text format and -have your comments generated as HTML. For example, you may use Markdown for -making a part of your comment look italic or bold in the generated HTML. Bugzilla -supports most of the structures defined by `standard Markdown `_. -but does NOT support inline images and inline HTML. For a complete reference on -supported Markdown structures, please see the `syntax help <../../../page.cgi?id=markdown.html>`_ -link next to the markdown checkbox for new comments. - -To use the Markdown feature, make sure that ``Enable Markdown support for comments`` is set to ``on`` -in your :ref:`userpreferences` and that you also check the ``Use Markdown for this comment`` option below -the comment box when you want to submit a new comment. - .. _comment-wrapping: Server-Side Comment Wrapping @@ -852,6 +863,8 @@ This tab allows you to change several default settings of Bugzilla. changes to a bug are submitted. The options include to show the bug just modified, to show the next bug in your list, or to do nothing. +- Enable tags for bugs - turn bug tagging on or off. + - Zoom textareas large when in use (requires JavaScript) - enable or disable the automatic expanding of text areas when text is being entered into them. @@ -992,22 +1005,6 @@ If you attempt to change your email address, a confirmation email is sent to both the old and new addresses, with a link to use to confirm the change. This helps to prevent account hijacking. -.. _apikey: - -API Keys -======== - -API keys are used to authenticate WebService API calls. You can create more than -one API key if required. Each API key has an optional description which can help -you record what each key is used for. - -On this page, you can unrevoke, revoke and change the description of existing -API keys for your login. A revoked key means that it cannot be used. The -description for purely for your information, and is optional. - -You can also create a new API key by selecting the check box under the 'New -API key' section of the page. - .. _permissionsettings: Permissions diff --git a/mozilla/webtools/bugzilla/docs/makedocs.pl b/mozilla/webtools/bugzilla/docs/makedocs.pl index be557308087..4f0f52579da 100755 --- a/mozilla/webtools/bugzilla/docs/makedocs.pl +++ b/mozilla/webtools/bugzilla/docs/makedocs.pl @@ -26,8 +26,7 @@ use strict; use Cwd; use File::Find; -use File::Basename; -use File::Copy::Recursive qw(rcopy); +use File::Copy; # We need to be in this directory to use our libraries. BEGIN { @@ -49,8 +48,7 @@ if (eval { require Pod::Simple }) { $pod_simple = 1; }; -use Bugzilla; -use Bugzilla::Constants qw(BUGZILLA_VERSION bz_locations); +use Bugzilla::Constants qw(BUGZILLA_VERSION); use File::Path qw(rmtree); use File::Which qw(which); @@ -128,43 +126,23 @@ foreach my $lang (@langs) { next if grep { $_ eq '--pod-only' } @ARGV; - chdir $docparent; - - # Generate extension documentation, both normal and API - my $ext_dir = bz_locations()->{'extensionsdir'}; - my @ext_paths = grep { $_ !~ /\/create\.pl$/ && ! -e "$_/disabled" } - glob("$ext_dir/*"); - my %extensions; - foreach my $item (@ext_paths) { - my $basename = basename($item); - if (-d "$item/docs/$lang/rst") { - $extensions{$basename} = "$item/docs/$lang/rst"; - } - } - # Collect up local extension documentation into the extensions/ dir. + sub wanted { + if ($File::Find::dir =~ /\/doc\/?$/ && + $_ =~ /\.rst$/) + { + copy($File::Find::name, "rst/extensions"); + } + }; + # Clear out old extensions docs rmtree('rst/extensions', 0, 1); mkdir('rst/extensions'); - rmtree('rst/api/extensions', 0, 1); - mkdir('rst/api/extensions'); - - foreach my $ext_name (keys %extensions) { - foreach my $path (glob($extensions{$ext_name} . "/*")) { - my ($file, $dir) = fileparse($path); - if ($file eq 'api') { - my $dst = "$docparent/$lang/rst/api/extensions/$ext_name"; - mkdir($dst) unless -d $dst; - rcopy("$path/*", $dst); - next; - } - my $dst = "$docparent/$lang/rst/extensions/$ext_name"; - mkdir($dst) unless -d $dst; - rcopy($path, "$dst/$file"); - } - } - - chdir "$docparent/$lang"; + + find({ + 'wanted' => \&wanted, + 'no_chdir' => 1, + }, "$docparent/../extensions"); MakeDocs('HTML', 'make html'); MakeDocs('TXT', 'make text'); diff --git a/mozilla/webtools/bugzilla/duplicates.cgi b/mozilla/webtools/bugzilla/duplicates.cgi index c1bf036be32..beac9c37e35 100755 --- a/mozilla/webtools/bugzilla/duplicates.cgi +++ b/mozilla/webtools/bugzilla/duplicates.cgi @@ -1,4 +1,4 @@ -#!/usr/bin/perl -T +#!/usr/bin/perl -wT # This Source Code Form is subject to the terms of the Mozilla Public # License, v. 2.0. If a copy of the MPL was not distributed with this # file, You can obtain one at http://mozilla.org/MPL/2.0/. @@ -8,8 +8,6 @@ use 5.10.1; use strict; -use warnings; - use lib qw(. lib); use Bugzilla; diff --git a/mozilla/webtools/bugzilla/editclassifications.cgi b/mozilla/webtools/bugzilla/editclassifications.cgi index b06ce27ad9e..b743433b735 100755 --- a/mozilla/webtools/bugzilla/editclassifications.cgi +++ b/mozilla/webtools/bugzilla/editclassifications.cgi @@ -1,4 +1,4 @@ -#!/usr/bin/perl -T +#!/usr/bin/perl -wT # This Source Code Form is subject to the terms of the Mozilla Public # License, v. 2.0. If a copy of the MPL was not distributed with this # file, You can obtain one at http://mozilla.org/MPL/2.0/. @@ -9,8 +9,6 @@ use 5.10.1; use strict; -use warnings; - use lib qw(. lib); use Bugzilla; diff --git a/mozilla/webtools/bugzilla/editcomponents.cgi b/mozilla/webtools/bugzilla/editcomponents.cgi index 7442365f35a..4423931fe31 100755 --- a/mozilla/webtools/bugzilla/editcomponents.cgi +++ b/mozilla/webtools/bugzilla/editcomponents.cgi @@ -1,4 +1,4 @@ -#!/usr/bin/perl -T +#!/usr/bin/perl -wT # This Source Code Form is subject to the terms of the Mozilla Public # License, v. 2.0. If a copy of the MPL was not distributed with this # file, You can obtain one at http://mozilla.org/MPL/2.0/. @@ -8,8 +8,6 @@ use 5.10.1; use strict; -use warnings; - use lib qw(. lib); use Bugzilla; diff --git a/mozilla/webtools/bugzilla/editfields.cgi b/mozilla/webtools/bugzilla/editfields.cgi index e8351bdd697..5ac9dcccec3 100755 --- a/mozilla/webtools/bugzilla/editfields.cgi +++ b/mozilla/webtools/bugzilla/editfields.cgi @@ -1,4 +1,4 @@ -#!/usr/bin/perl -T +#!/usr/bin/perl -wT # This Source Code Form is subject to the terms of the Mozilla Public # License, v. 2.0. If a copy of the MPL was not distributed with this # file, You can obtain one at http://mozilla.org/MPL/2.0/. @@ -8,8 +8,6 @@ use 5.10.1; use strict; -use warnings; - use lib qw(. lib); use Bugzilla; diff --git a/mozilla/webtools/bugzilla/editflagtypes.cgi b/mozilla/webtools/bugzilla/editflagtypes.cgi index d848d250a54..73ef1e52802 100755 --- a/mozilla/webtools/bugzilla/editflagtypes.cgi +++ b/mozilla/webtools/bugzilla/editflagtypes.cgi @@ -1,4 +1,4 @@ -#!/usr/bin/perl -T +#!/usr/bin/perl -wT # This Source Code Form is subject to the terms of the Mozilla Public # License, v. 2.0. If a copy of the MPL was not distributed with this # file, You can obtain one at http://mozilla.org/MPL/2.0/. @@ -8,8 +8,6 @@ use 5.10.1; use strict; -use warnings; - use lib qw(. lib); use Bugzilla; @@ -41,24 +39,23 @@ my @products = @{$vars->{products}}; my $action = $cgi->param('action') || 'list'; my $token = $cgi->param('token'); -my $prod_name = $cgi->param('product'); -my $comp_name = $cgi->param('component'); +my $product = $cgi->param('product'); +my $component = $cgi->param('component'); my $flag_id = $cgi->param('id'); -my ($product, $component); - -if ($prod_name) { +if ($product) { # Make sure the user is allowed to view this product name. # Users with global editcomponents privs can see all product names. - ($product) = grep { lc($_->name) eq lc($prod_name) } @products; - $product || ThrowUserError('product_access_denied', { name => $prod_name }); + ($product) = grep { lc($_->name) eq lc($product) } @products; + $product || ThrowUserError('product_access_denied', { name => $cgi->param('product') }); } -if ($comp_name) { - $product || ThrowUserError('flag_type_component_without_product'); - ($component) = grep { lc($_->name) eq lc($comp_name) } @{$product->components}; +if ($component) { + ($product && $product->id) + || ThrowUserError('flag_type_component_without_product'); + ($component) = grep { lc($_->name) eq lc($component) } @{$product->components}; $component || ThrowUserError('product_unknown_component', { product => $product->name, - comp => $comp_name }); + comp => $cgi->param('component') }); } # If 'categoryAction' is set, it has priority over 'action'. diff --git a/mozilla/webtools/bugzilla/editgroups.cgi b/mozilla/webtools/bugzilla/editgroups.cgi index 287ac11142a..87c44f03c5f 100755 --- a/mozilla/webtools/bugzilla/editgroups.cgi +++ b/mozilla/webtools/bugzilla/editgroups.cgi @@ -1,4 +1,4 @@ -#!/usr/bin/perl -T +#!/usr/bin/perl -wT # This Source Code Form is subject to the terms of the Mozilla Public # License, v. 2.0. If a copy of the MPL was not distributed with this # file, You can obtain one at http://mozilla.org/MPL/2.0/. @@ -8,8 +8,6 @@ use 5.10.1; use strict; -use warnings; - use lib qw(. lib); use Bugzilla; @@ -22,6 +20,9 @@ use Bugzilla::Product; use Bugzilla::User; use Bugzilla::Token; +use constant SPECIAL_GROUPS => ('chartgroup', 'insidergroup', + 'timetrackinggroup', 'querysharegroup'); + my $cgi = Bugzilla->cgi; my $dbh = Bugzilla->dbh; my $template = Bugzilla->template; @@ -224,7 +225,7 @@ if ($action eq 'new') { if ($action eq 'del') { # Check that an existing group ID is given - my $group = Bugzilla::Group->check({ id => scalar $cgi->param('group') }); + my $group = Bugzilla::Group->check({ id => $cgi->param('group') }); $group->check_remove({ test_only => 1 }); $vars->{'shared_queries'} = $dbh->selectrow_array('SELECT COUNT(*) @@ -248,7 +249,7 @@ if ($action eq 'del') { if ($action eq 'delete') { check_token_data($token, 'delete_group'); # Check that an existing group ID is given - my $group = Bugzilla::Group->check({ id => scalar $cgi->param('group') }); + my $group = Bugzilla::Group->check({ id => $cgi->param('group') }); $vars->{'name'} = $group->name; $group->remove_from_db({ remove_from_users => scalar $cgi->param('removeusers'), diff --git a/mozilla/webtools/bugzilla/editkeywords.cgi b/mozilla/webtools/bugzilla/editkeywords.cgi index 41496f36229..5a7f6643b1a 100755 --- a/mozilla/webtools/bugzilla/editkeywords.cgi +++ b/mozilla/webtools/bugzilla/editkeywords.cgi @@ -1,4 +1,4 @@ -#!/usr/bin/perl -T +#!/usr/bin/perl -wT # This Source Code Form is subject to the terms of the Mozilla Public # License, v. 2.0. If a copy of the MPL was not distributed with this # file, You can obtain one at http://mozilla.org/MPL/2.0/. @@ -8,8 +8,6 @@ use 5.10.1; use strict; -use warnings; - use lib qw(. lib); use Bugzilla; diff --git a/mozilla/webtools/bugzilla/editmilestones.cgi b/mozilla/webtools/bugzilla/editmilestones.cgi index e20e623fb9d..927c1a9d1b6 100755 --- a/mozilla/webtools/bugzilla/editmilestones.cgi +++ b/mozilla/webtools/bugzilla/editmilestones.cgi @@ -1,4 +1,4 @@ -#!/usr/bin/perl -T +#!/usr/bin/perl -wT # This Source Code Form is subject to the terms of the Mozilla Public # License, v. 2.0. If a copy of the MPL was not distributed with this # file, You can obtain one at http://mozilla.org/MPL/2.0/. @@ -8,8 +8,6 @@ use 5.10.1; use strict; -use warnings; - use lib qw(. lib); use Bugzilla; diff --git a/mozilla/webtools/bugzilla/editparams.cgi b/mozilla/webtools/bugzilla/editparams.cgi index ae569c2eb4b..3486d70612f 100755 --- a/mozilla/webtools/bugzilla/editparams.cgi +++ b/mozilla/webtools/bugzilla/editparams.cgi @@ -1,4 +1,4 @@ -#!/usr/bin/perl -T +#!/usr/bin/perl -wT # This Source Code Form is subject to the terms of the Mozilla Public # License, v. 2.0. If a copy of the MPL was not distributed with this # file, You can obtain one at http://mozilla.org/MPL/2.0/. @@ -8,8 +8,6 @@ use 5.10.1; use strict; -use warnings; - use lib qw(. lib); use Bugzilla; diff --git a/mozilla/webtools/bugzilla/editproducts.cgi b/mozilla/webtools/bugzilla/editproducts.cgi index f2526575ebb..77d112f46a6 100755 --- a/mozilla/webtools/bugzilla/editproducts.cgi +++ b/mozilla/webtools/bugzilla/editproducts.cgi @@ -1,4 +1,4 @@ -#!/usr/bin/perl -T +#!/usr/bin/perl -wT # This Source Code Form is subject to the terms of the Mozilla Public # License, v. 2.0. If a copy of the MPL was not distributed with this # file, You can obtain one at http://mozilla.org/MPL/2.0/. @@ -8,8 +8,6 @@ use 5.10.1; use strict; -use warnings; - use lib qw(. lib); use Bugzilla; diff --git a/mozilla/webtools/bugzilla/editsettings.cgi b/mozilla/webtools/bugzilla/editsettings.cgi index b10a497ba5b..bf5e2025b2d 100755 --- a/mozilla/webtools/bugzilla/editsettings.cgi +++ b/mozilla/webtools/bugzilla/editsettings.cgi @@ -1,4 +1,4 @@ -#!/usr/bin/perl -T +#!/usr/bin/perl -wT # This Source Code Form is subject to the terms of the Mozilla Public # License, v. 2.0. If a copy of the MPL was not distributed with this # file, You can obtain one at http://mozilla.org/MPL/2.0/. @@ -8,8 +8,6 @@ use 5.10.1; use strict; -use warnings; - use lib qw(. lib); use Bugzilla; @@ -55,7 +53,6 @@ if ($action eq 'update') { } $vars->{'message'} = 'default_settings_updated'; $vars->{'changes_saved'} = $changed; - Bugzilla->memcached->clear_config(); delete_token($token); } diff --git a/mozilla/webtools/bugzilla/editusers.cgi b/mozilla/webtools/bugzilla/editusers.cgi index a38195a4b87..5eb49d1396c 100755 --- a/mozilla/webtools/bugzilla/editusers.cgi +++ b/mozilla/webtools/bugzilla/editusers.cgi @@ -1,4 +1,4 @@ -#!/usr/bin/perl -T +#!/usr/bin/perl -wT # This Source Code Form is subject to the terms of the Mozilla Public # License, v. 2.0. If a copy of the MPL was not distributed with this # file, You can obtain one at http://mozilla.org/MPL/2.0/. @@ -8,8 +8,6 @@ use 5.10.1; use strict; -use warnings; - use lib qw(. lib); use Bugzilla; @@ -649,9 +647,7 @@ sub check_user { sub mirrorListSelectionValues { my $cgi = Bugzilla->cgi; if (defined($cgi->param('matchtype'))) { - foreach ('matchvalue', 'matchstr', 'matchtype', - 'grouprestrict', 'groupid', 'is_enabled') - { + foreach ('matchvalue', 'matchstr', 'matchtype', 'grouprestrict', 'groupid') { $vars->{'listselectionvalues'}{$_} = $cgi->param($_); } } diff --git a/mozilla/webtools/bugzilla/editvalues.cgi b/mozilla/webtools/bugzilla/editvalues.cgi index 48775fc52a0..5bceed761ba 100755 --- a/mozilla/webtools/bugzilla/editvalues.cgi +++ b/mozilla/webtools/bugzilla/editvalues.cgi @@ -1,4 +1,4 @@ -#!/usr/bin/perl -T +#!/usr/bin/perl -wT # This Source Code Form is subject to the terms of the Mozilla Public # License, v. 2.0. If a copy of the MPL was not distributed with this # file, You can obtain one at http://mozilla.org/MPL/2.0/. @@ -6,10 +6,12 @@ # This Source Code Form is "Incompatible With Secondary Licenses", as # defined by the Mozilla Public License, v. 2.0. +# This is a script to edit the values of fields that have drop-down +# or select boxes. It is largely a copy of editmilestones.cgi, but +# with some cleanup. + use 5.10.1; use strict; -use warnings; - use lib qw(. lib); use Bugzilla; diff --git a/mozilla/webtools/bugzilla/editversions.cgi b/mozilla/webtools/bugzilla/editversions.cgi index 674a20b7e9c..2dce7bd0a2b 100755 --- a/mozilla/webtools/bugzilla/editversions.cgi +++ b/mozilla/webtools/bugzilla/editversions.cgi @@ -1,4 +1,4 @@ -#!/usr/bin/perl -T +#!/usr/bin/perl -wT # This Source Code Form is subject to the terms of the Mozilla Public # License, v. 2.0. If a copy of the MPL was not distributed with this # file, You can obtain one at http://mozilla.org/MPL/2.0/. @@ -8,8 +8,6 @@ use 5.10.1; use strict; -use warnings; - use lib qw(. lib); use Bugzilla; diff --git a/mozilla/webtools/bugzilla/editwhines.cgi b/mozilla/webtools/bugzilla/editwhines.cgi index b11c44949c1..84a97b87768 100755 --- a/mozilla/webtools/bugzilla/editwhines.cgi +++ b/mozilla/webtools/bugzilla/editwhines.cgi @@ -1,4 +1,4 @@ -#!/usr/bin/perl -T +#!/usr/bin/perl -wT # This Source Code Form is subject to the terms of the Mozilla Public # License, v. 2.0. If a copy of the MPL was not distributed with this # file, You can obtain one at http://mozilla.org/MPL/2.0/. @@ -12,8 +12,6 @@ use 5.10.1; use strict; -use warnings; - use lib qw(. lib); use Bugzilla; diff --git a/mozilla/webtools/bugzilla/editworkflow.cgi b/mozilla/webtools/bugzilla/editworkflow.cgi index 71b14af7786..68cd984586c 100755 --- a/mozilla/webtools/bugzilla/editworkflow.cgi +++ b/mozilla/webtools/bugzilla/editworkflow.cgi @@ -1,4 +1,4 @@ -#!/usr/bin/perl -T +#!/usr/bin/perl -wT # This Source Code Form is subject to the terms of the Mozilla Public # License, v. 2.0. If a copy of the MPL was not distributed with this # file, You can obtain one at http://mozilla.org/MPL/2.0/. @@ -8,8 +8,6 @@ use 5.10.1; use strict; -use warnings; - use lib qw(. lib); use Bugzilla; diff --git a/mozilla/webtools/bugzilla/email_in.pl b/mozilla/webtools/bugzilla/email_in.pl index ae4c42bde5f..03db450f7a4 100755 --- a/mozilla/webtools/bugzilla/email_in.pl +++ b/mozilla/webtools/bugzilla/email_in.pl @@ -1,4 +1,4 @@ -#!/usr/bin/perl -T +#!/usr/bin/perl -wT # This Source Code Form is subject to the terms of the Mozilla Public # License, v. 2.0. If a copy of the MPL was not distributed with this # file, You can obtain one at http://mozilla.org/MPL/2.0/. diff --git a/mozilla/webtools/bugzilla/enter_bug.cgi b/mozilla/webtools/bugzilla/enter_bug.cgi index 3f22fe4b840..baf5d78339d 100755 --- a/mozilla/webtools/bugzilla/enter_bug.cgi +++ b/mozilla/webtools/bugzilla/enter_bug.cgi @@ -1,4 +1,4 @@ -#!/usr/bin/perl -T +#!/usr/bin/perl -wT # This Source Code Form is subject to the terms of the Mozilla Public # License, v. 2.0. If a copy of the MPL was not distributed with this # file, You can obtain one at http://mozilla.org/MPL/2.0/. @@ -18,8 +18,6 @@ use 5.10.1; use strict; -use warnings; - use lib qw(. lib); use Bugzilla; diff --git a/mozilla/webtools/bugzilla/extensions/BmpConvert/Config.pm b/mozilla/webtools/bugzilla/extensions/BmpConvert/Config.pm index 4984f19a9d7..91808bc4b7a 100644 --- a/mozilla/webtools/bugzilla/extensions/BmpConvert/Config.pm +++ b/mozilla/webtools/bugzilla/extensions/BmpConvert/Config.pm @@ -9,8 +9,6 @@ package Bugzilla::Extension::BmpConvert; use 5.10.1; use strict; -use warnings; - use constant NAME => 'BmpConvert'; use constant REQUIRED_MODULES => [ { diff --git a/mozilla/webtools/bugzilla/extensions/BmpConvert/Extension.pm b/mozilla/webtools/bugzilla/extensions/BmpConvert/Extension.pm index b8201f106df..eb634f4a127 100644 --- a/mozilla/webtools/bugzilla/extensions/BmpConvert/Extension.pm +++ b/mozilla/webtools/bugzilla/extensions/BmpConvert/Extension.pm @@ -9,8 +9,6 @@ package Bugzilla::Extension::BmpConvert; use 5.10.1; use strict; -use warnings; - use parent qw(Bugzilla::Extension); use Image::Magick; diff --git a/mozilla/webtools/bugzilla/extensions/Example/Config.pm b/mozilla/webtools/bugzilla/extensions/Example/Config.pm index e7782ef6ced..13635dc7f5a 100644 --- a/mozilla/webtools/bugzilla/extensions/Example/Config.pm +++ b/mozilla/webtools/bugzilla/extensions/Example/Config.pm @@ -9,8 +9,6 @@ package Bugzilla::Extension::Example; use 5.10.1; use strict; -use warnings; - use constant NAME => 'Example'; use constant REQUIRED_MODULES => [ { diff --git a/mozilla/webtools/bugzilla/extensions/Example/Extension.pm b/mozilla/webtools/bugzilla/extensions/Example/Extension.pm index af36b107af6..c9449d8b0a0 100644 --- a/mozilla/webtools/bugzilla/extensions/Example/Extension.pm +++ b/mozilla/webtools/bugzilla/extensions/Example/Extension.pm @@ -9,8 +9,6 @@ package Bugzilla::Extension::Example; use 5.10.1; use strict; -use warnings; - use parent qw(Bugzilla::Extension); use Bugzilla::Constants; @@ -21,7 +19,6 @@ use Bugzilla::User::Setting; use Bugzilla::Util qw(diff_arrays html_quote); use Bugzilla::Status qw(is_open_state); use Bugzilla::Install::Filesystem; -use Bugzilla::WebService::Constants; # This is extensions/Example/lib/Util.pm. I can load this here in my # Extension.pm only because I have a Config.pm. @@ -959,20 +956,11 @@ sub webservice { sub webservice_error_codes { my ($self, $args) = @_; - + my $error_map = $args->{error_map}; $error_map->{'example_my_error'} = 10001; } -sub webservice_status_code_map { - my ($self, $args) = @_; - - my $status_code_map = $args->{status_code_map}; - # Uncomment this line to override the status code for the - # error 'object_does_not_exist' to STATUS_BAD_REQUEST - #$status_code_map->{51} = STATUS_BAD_REQUEST; -} - sub webservice_before_call { my ($self, $args) = @_; diff --git a/mozilla/webtools/bugzilla/extensions/Example/docs/en/rst/example.rst b/mozilla/webtools/bugzilla/extensions/Example/doc/example.rst similarity index 99% rename from mozilla/webtools/bugzilla/extensions/Example/docs/en/rst/example.rst rename to mozilla/webtools/bugzilla/extensions/Example/doc/example.rst index f2c055bae0a..07b355887f1 100644 --- a/mozilla/webtools/bugzilla/extensions/Example/docs/en/rst/example.rst +++ b/mozilla/webtools/bugzilla/extensions/Example/doc/example.rst @@ -19,3 +19,4 @@ documentation is copied into the same directory. So, for example, this file is called :file:`example.rst`, as it's part of the Example extension. If you need multiple documentation files, prefix the filename with the name of your extension, e.g. :file:`example-extra.rst`. + diff --git a/mozilla/webtools/bugzilla/extensions/Example/docs/en/rst/api/v1/index.rst b/mozilla/webtools/bugzilla/extensions/Example/docs/en/rst/api/v1/index.rst deleted file mode 100644 index 02186bb0b84..00000000000 --- a/mozilla/webtools/bugzilla/extensions/Example/docs/en/rst/api/v1/index.rst +++ /dev/null @@ -1,4 +0,0 @@ -Example API v1 -============== - -Here is where you place your API docs for the Example extension. diff --git a/mozilla/webtools/bugzilla/extensions/Example/lib/Auth/Login.pm b/mozilla/webtools/bugzilla/extensions/Example/lib/Auth/Login.pm index 15c58a881e4..c1cfe62cc95 100644 --- a/mozilla/webtools/bugzilla/extensions/Example/lib/Auth/Login.pm +++ b/mozilla/webtools/bugzilla/extensions/Example/lib/Auth/Login.pm @@ -9,8 +9,6 @@ package Bugzilla::Extension::Example::Auth::Login; use 5.10.1; use strict; -use warnings; - use parent qw(Bugzilla::Auth::Login); use constant user_can_create_account => 0; use Bugzilla::Constants; diff --git a/mozilla/webtools/bugzilla/extensions/Example/lib/Auth/Verify.pm b/mozilla/webtools/bugzilla/extensions/Example/lib/Auth/Verify.pm index 49fd9fbb783..df5059a05f4 100644 --- a/mozilla/webtools/bugzilla/extensions/Example/lib/Auth/Verify.pm +++ b/mozilla/webtools/bugzilla/extensions/Example/lib/Auth/Verify.pm @@ -9,8 +9,6 @@ package Bugzilla::Extension::Example::Auth::Verify; use 5.10.1; use strict; -use warnings; - use parent qw(Bugzilla::Auth::Verify); use Bugzilla::Constants; diff --git a/mozilla/webtools/bugzilla/extensions/Example/template/en/default/hook/search/tabs-search_tabs.html.tmpl b/mozilla/webtools/bugzilla/extensions/Example/template/en/default/hook/search/tabs-search_tabs.html.tmpl index bf522f7dd02..c40cb6e5e1f 100644 --- a/mozilla/webtools/bugzilla/extensions/Example/template/en/default/hook/search/tabs-search_tabs.html.tmpl +++ b/mozilla/webtools/bugzilla/extensions/Example/template/en/default/hook/search/tabs-search_tabs.html.tmpl @@ -6,8 +6,8 @@ # defined by the Mozilla Public License, v. 2.0. #%] -[% - tabs.push({ name => 'newsearch', label => "New Search", - link => "query.cgi?format=newsearch" }) +[% + tabs.push ({ name => 'newsearch', label => "New Search", + link => "query.cgi?format=newsearch" }) %] diff --git a/mozilla/webtools/bugzilla/extensions/MoreBugUrl/Config.pm b/mozilla/webtools/bugzilla/extensions/MoreBugUrl/Config.pm index e0eac5f8a82..1e62306c431 100644 --- a/mozilla/webtools/bugzilla/extensions/MoreBugUrl/Config.pm +++ b/mozilla/webtools/bugzilla/extensions/MoreBugUrl/Config.pm @@ -9,7 +9,6 @@ package Bugzilla::Extension::MoreBugUrl; use 5.10.1; use strict; -use warnings; use constant NAME => 'MoreBugUrl'; diff --git a/mozilla/webtools/bugzilla/extensions/MoreBugUrl/Extension.pm b/mozilla/webtools/bugzilla/extensions/MoreBugUrl/Extension.pm index 18507f8d1e5..ed0fe7b1f7c 100644 --- a/mozilla/webtools/bugzilla/extensions/MoreBugUrl/Extension.pm +++ b/mozilla/webtools/bugzilla/extensions/MoreBugUrl/Extension.pm @@ -9,8 +9,6 @@ package Bugzilla::Extension::MoreBugUrl; use 5.10.1; use strict; -use warnings; - use parent qw(Bugzilla::Extension); use constant MORE_SUB_CLASSES => qw( diff --git a/mozilla/webtools/bugzilla/extensions/MoreBugUrl/lib/BitBucket.pm b/mozilla/webtools/bugzilla/extensions/MoreBugUrl/lib/BitBucket.pm index dcc85992d69..fbb7be1a127 100644 --- a/mozilla/webtools/bugzilla/extensions/MoreBugUrl/lib/BitBucket.pm +++ b/mozilla/webtools/bugzilla/extensions/MoreBugUrl/lib/BitBucket.pm @@ -9,8 +9,6 @@ package Bugzilla::Extension::MoreBugUrl::BitBucket; use 5.10.1; use strict; -use warnings; - use parent qw(Bugzilla::BugUrl); ############################### diff --git a/mozilla/webtools/bugzilla/extensions/MoreBugUrl/lib/GetSatisfaction.pm b/mozilla/webtools/bugzilla/extensions/MoreBugUrl/lib/GetSatisfaction.pm index 74951735bf9..75d5ece3975 100644 --- a/mozilla/webtools/bugzilla/extensions/MoreBugUrl/lib/GetSatisfaction.pm +++ b/mozilla/webtools/bugzilla/extensions/MoreBugUrl/lib/GetSatisfaction.pm @@ -9,8 +9,6 @@ package Bugzilla::Extension::MoreBugUrl::GetSatisfaction; use 5.10.1; use strict; -use warnings; - use parent qw(Bugzilla::BugUrl); ############################### diff --git a/mozilla/webtools/bugzilla/extensions/MoreBugUrl/lib/PHP.pm b/mozilla/webtools/bugzilla/extensions/MoreBugUrl/lib/PHP.pm index 6f201d7b1f0..ea090e8652b 100644 --- a/mozilla/webtools/bugzilla/extensions/MoreBugUrl/lib/PHP.pm +++ b/mozilla/webtools/bugzilla/extensions/MoreBugUrl/lib/PHP.pm @@ -9,8 +9,6 @@ package Bugzilla::Extension::MoreBugUrl::PHP; use 5.10.1; use strict; -use warnings; - use parent qw(Bugzilla::BugUrl); ############################### diff --git a/mozilla/webtools/bugzilla/extensions/MoreBugUrl/lib/RT.pm b/mozilla/webtools/bugzilla/extensions/MoreBugUrl/lib/RT.pm index acb90cf396a..a1ca6fd8856 100644 --- a/mozilla/webtools/bugzilla/extensions/MoreBugUrl/lib/RT.pm +++ b/mozilla/webtools/bugzilla/extensions/MoreBugUrl/lib/RT.pm @@ -9,8 +9,6 @@ package Bugzilla::Extension::MoreBugUrl::RT; use 5.10.1; use strict; -use warnings; - use parent qw(Bugzilla::BugUrl); ############################### diff --git a/mozilla/webtools/bugzilla/extensions/MoreBugUrl/lib/Redmine.pm b/mozilla/webtools/bugzilla/extensions/MoreBugUrl/lib/Redmine.pm index 57a07123945..a1c1382ce30 100644 --- a/mozilla/webtools/bugzilla/extensions/MoreBugUrl/lib/Redmine.pm +++ b/mozilla/webtools/bugzilla/extensions/MoreBugUrl/lib/Redmine.pm @@ -9,8 +9,6 @@ package Bugzilla::Extension::MoreBugUrl::Redmine; use 5.10.1; use strict; -use warnings; - use parent qw(Bugzilla::BugUrl); ############################### diff --git a/mozilla/webtools/bugzilla/extensions/MoreBugUrl/lib/ReviewBoard.pm b/mozilla/webtools/bugzilla/extensions/MoreBugUrl/lib/ReviewBoard.pm index af5ff068418..08128353fcf 100644 --- a/mozilla/webtools/bugzilla/extensions/MoreBugUrl/lib/ReviewBoard.pm +++ b/mozilla/webtools/bugzilla/extensions/MoreBugUrl/lib/ReviewBoard.pm @@ -9,8 +9,6 @@ package Bugzilla::Extension::MoreBugUrl::ReviewBoard; use 5.10.1; use strict; -use warnings; - use parent qw(Bugzilla::BugUrl); ############################### diff --git a/mozilla/webtools/bugzilla/extensions/MoreBugUrl/lib/Rietveld.pm b/mozilla/webtools/bugzilla/extensions/MoreBugUrl/lib/Rietveld.pm index a4bf08492fe..a8bccba0884 100644 --- a/mozilla/webtools/bugzilla/extensions/MoreBugUrl/lib/Rietveld.pm +++ b/mozilla/webtools/bugzilla/extensions/MoreBugUrl/lib/Rietveld.pm @@ -9,8 +9,6 @@ package Bugzilla::Extension::MoreBugUrl::Rietveld; use 5.10.1; use strict; -use warnings; - use parent qw(Bugzilla::BugUrl); ############################### diff --git a/mozilla/webtools/bugzilla/extensions/MoreBugUrl/lib/Savane.pm b/mozilla/webtools/bugzilla/extensions/MoreBugUrl/lib/Savane.pm index efda1fa4f54..a8a439b415e 100644 --- a/mozilla/webtools/bugzilla/extensions/MoreBugUrl/lib/Savane.pm +++ b/mozilla/webtools/bugzilla/extensions/MoreBugUrl/lib/Savane.pm @@ -9,8 +9,6 @@ package Bugzilla::Extension::MoreBugUrl::Savane; use 5.10.1; use strict; -use warnings; - use parent qw(Bugzilla::BugUrl); ############################### diff --git a/mozilla/webtools/bugzilla/extensions/OldBugMove/Config.pm b/mozilla/webtools/bugzilla/extensions/OldBugMove/Config.pm index 681cbae2df5..a42567feeca 100644 --- a/mozilla/webtools/bugzilla/extensions/OldBugMove/Config.pm +++ b/mozilla/webtools/bugzilla/extensions/OldBugMove/Config.pm @@ -9,7 +9,5 @@ package Bugzilla::Extension::OldBugMove; use 5.10.1; use strict; -use warnings; - use constant NAME => 'OldBugMove'; __PACKAGE__->NAME; diff --git a/mozilla/webtools/bugzilla/extensions/OldBugMove/Extension.pm b/mozilla/webtools/bugzilla/extensions/OldBugMove/Extension.pm index 375707fd229..b58ffe883be 100644 --- a/mozilla/webtools/bugzilla/extensions/OldBugMove/Extension.pm +++ b/mozilla/webtools/bugzilla/extensions/OldBugMove/Extension.pm @@ -9,8 +9,6 @@ package Bugzilla::Extension::OldBugMove; use 5.10.1; use strict; -use warnings; - use parent qw(Bugzilla::Extension); use Bugzilla::Constants; use Bugzilla::Error; diff --git a/mozilla/webtools/bugzilla/extensions/OldBugMove/lib/Params.pm b/mozilla/webtools/bugzilla/extensions/OldBugMove/lib/Params.pm index 05e3ed2773b..c922e1faf82 100644 --- a/mozilla/webtools/bugzilla/extensions/OldBugMove/lib/Params.pm +++ b/mozilla/webtools/bugzilla/extensions/OldBugMove/lib/Params.pm @@ -9,7 +9,6 @@ package Bugzilla::Extension::OldBugMove::Params; use 5.10.1; use strict; -use warnings; use Bugzilla::Config::Common; diff --git a/mozilla/webtools/bugzilla/extensions/Voting/Config.pm b/mozilla/webtools/bugzilla/extensions/Voting/Config.pm index 97c44933e2a..812ede60f87 100644 --- a/mozilla/webtools/bugzilla/extensions/Voting/Config.pm +++ b/mozilla/webtools/bugzilla/extensions/Voting/Config.pm @@ -9,7 +9,6 @@ package Bugzilla::Extension::Voting; use 5.10.1; use strict; -use warnings; use constant NAME => 'Voting'; diff --git a/mozilla/webtools/bugzilla/extensions/Voting/Extension.pm b/mozilla/webtools/bugzilla/extensions/Voting/Extension.pm index 8009f16bbcc..e54a2aab0f8 100644 --- a/mozilla/webtools/bugzilla/extensions/Voting/Extension.pm +++ b/mozilla/webtools/bugzilla/extensions/Voting/Extension.pm @@ -9,8 +9,6 @@ package Bugzilla::Extension::Voting; use 5.10.1; use strict; -use warnings; - use parent qw(Bugzilla::Extension); use Bugzilla::Bug; diff --git a/mozilla/webtools/bugzilla/extensions/create.pl b/mozilla/webtools/bugzilla/extensions/create.pl index d4256694bca..e2d3321b195 100644 --- a/mozilla/webtools/bugzilla/extensions/create.pl +++ b/mozilla/webtools/bugzilla/extensions/create.pl @@ -1,4 +1,4 @@ -#!/usr/bin/perl +#!/usr/bin/perl -w # This Source Code Form is subject to the terms of the Mozilla Public # License, v. 2.0. If a copy of the MPL was not distributed with this # file, You can obtain one at http://mozilla.org/MPL/2.0/. @@ -8,8 +8,6 @@ use 5.10.1; use strict; -use warnings; - use lib qw(. lib); use Bugzilla; diff --git a/mozilla/webtools/bugzilla/importxml.pl b/mozilla/webtools/bugzilla/importxml.pl index 8750c63a110..05d86353023 100755 --- a/mozilla/webtools/bugzilla/importxml.pl +++ b/mozilla/webtools/bugzilla/importxml.pl @@ -1,4 +1,4 @@ -#!/usr/bin/perl -T +#!/usr/bin/perl -wT # This Source Code Form is subject to the terms of the Mozilla Public # License, v. 2.0. If a copy of the MPL was not distributed with this # file, You can obtain one at http://mozilla.org/MPL/2.0/. @@ -12,7 +12,6 @@ use 5.10.1; use strict; -use warnings; ##################################################################### # diff --git a/mozilla/webtools/bugzilla/index.cgi b/mozilla/webtools/bugzilla/index.cgi index 15d34451d51..032c6c371ab 100755 --- a/mozilla/webtools/bugzilla/index.cgi +++ b/mozilla/webtools/bugzilla/index.cgi @@ -1,4 +1,4 @@ -#!/usr/bin/perl -T +#!/usr/bin/perl -wT # This Source Code Form is subject to the terms of the Mozilla Public # License, v. 2.0. If a copy of the MPL was not distributed with this # file, You can obtain one at http://mozilla.org/MPL/2.0/. @@ -8,8 +8,6 @@ use 5.10.1; use strict; -use warnings; - use lib qw(. lib); use Bugzilla; diff --git a/mozilla/webtools/bugzilla/install-module.pl b/mozilla/webtools/bugzilla/install-module.pl index 365f10bbfa9..a7359917de6 100755 --- a/mozilla/webtools/bugzilla/install-module.pl +++ b/mozilla/webtools/bugzilla/install-module.pl @@ -1,4 +1,4 @@ -#!/usr/bin/perl +#!/usr/bin/perl -w # This Source Code Form is subject to the terms of the Mozilla Public # License, v. 2.0. If a copy of the MPL was not distributed with this # file, You can obtain one at http://mozilla.org/MPL/2.0/. diff --git a/mozilla/webtools/bugzilla/jobqueue.pl b/mozilla/webtools/bugzilla/jobqueue.pl index 85818033475..d538e478469 100755 --- a/mozilla/webtools/bugzilla/jobqueue.pl +++ b/mozilla/webtools/bugzilla/jobqueue.pl @@ -1,4 +1,4 @@ -#!/usr/bin/perl +#!/usr/bin/perl -w # This Source Code Form is subject to the terms of the Mozilla Public # License, v. 2.0. If a copy of the MPL was not distributed with this # file, You can obtain one at http://mozilla.org/MPL/2.0/. @@ -8,7 +8,6 @@ use 5.10.1; use strict; -use warnings; use Cwd qw(abs_path); use File::Basename; @@ -33,14 +32,13 @@ jobqueue.pl - Runs jobs in the background for Bugzilla. ./jobqueue.pl [OPTIONS] COMMAND OPTIONS: - -f Run in the foreground (don't detach) - -d Output a lot of debugging information - -p file Specify the file where jobqueue.pl should store its current - process id. Defaults to F. - -n name What should this process call itself in the system log? - Defaults to the full path you used to invoke the script. - -j job-name The name of jobs to process. Can be specified multiple times. - If not specified, all job types will be processed. + -f Run in the foreground (don't detach) + -d Output a lot of debugging information + -p file Specify the file where jobqueue.pl should store its current + process id. Defaults to F. + -n name What should this process call itself in the system log? + Defaults to the full path you used to invoke the script. + COMMANDS: start Starts a new jobqueue daemon if there isn't one running already stop Stops a running jobqueue daemon diff --git a/mozilla/webtools/bugzilla/js/bug.js b/mozilla/webtools/bugzilla/js/bug.js index f0bf68a3028..abefbb22d58 100644 --- a/mozilla/webtools/bugzilla/js/bug.js +++ b/mozilla/webtools/bugzilla/js/bug.js @@ -22,7 +22,6 @@ YAHOO.bugzilla.dupTable = { method : "Bug.possible_duplicates", id : YAHOO.bugzilla.dupTable.counter, params : { - Bugzilla_api_token: BUGZILLA.api_token, product : product_name, summary : summary_field.value, limit : 7, @@ -200,10 +199,7 @@ function set_assign_to(use_qa_contact) { var args = JSON.stringify({ version: "1.1", method: 'BugUserLastVisit.update', - params: { - Bugzilla_api_token: BUGZILLA.api_token, - ids: bug_id - }, + params: { ids: bug_id }, }); var callbacks = { failure: function(res) { @@ -222,9 +218,7 @@ function set_assign_to(use_qa_contact) { var args = JSON.stringify({ version: "1.1", method: 'BugUserLastVisit.get', - params: { - Bugzilla_api_token: BUGZILLA.api_token - }, + params: { }, }); var callbacks = { success: function(res) { done(JSON.parse(res.responseText)) }, diff --git a/mozilla/webtools/bugzilla/js/comment-tagging.js b/mozilla/webtools/bugzilla/js/comment-tagging.js index b6f02f00efd..035d05b0b73 100644 --- a/mozilla/webtools/bugzilla/js/comment-tagging.js +++ b/mozilla/webtools/bugzilla/js/comment-tagging.js @@ -20,10 +20,6 @@ YAHOO.bugzilla.commentTagging = { can_edit : false, pending : {}, - label : '', - min_len_error: '', - max_len_error: '', - init : function(can_edit) { this.can_edit = can_edit; this.ctag_div = Dom.get('bz_ctag_div'); @@ -52,14 +48,9 @@ YAHOO.bugzilla.commentTagging = { YAHOO.bugzilla.commentTagging.counter = YAHOO.bugzilla.commentTagging.counter + 1; YAHOO.util.Connect.setDefaultPostHeader('application/json', true); return YAHOO.lang.JSON.stringify({ - version: "1.1", method : "Bug.search_comment_tags", id : YAHOO.bugzilla.commentTagging.counter, - params : { - Bugzilla_api_token: BUGZILLA.api_token, - query : query, - limit : 10 - } + params : [ { query : query, limit : 10 } ] }); }; ac.minQueryLength = this.min_len; @@ -190,7 +181,7 @@ YAHOO.bugzilla.commentTagging = { tags.sort(); if (tags.length) { var div = document.createElement('div'); - div.appendChild(document.createTextNode(this.label)); + div.appendChild(document.createTextNode('Comment Tags:')); var ul = document.createElement('ul'); ul.id = 'comment_tags_collapse_expand'; div.appendChild(ul); @@ -265,9 +256,9 @@ YAHOO.bugzilla.commentTagging = { if (tag == '') continue; if (tag.length < YAHOO.bugzilla.commentTagging.min_len) - throw new Error(this.min_len_error) + throw new Error("Comment tags must be at least " + this.min_len + " characters."); if (tag.length > YAHOO.bugzilla.commentTagging.max_len) - throw new Error(this.max_len_error) + throw new Error("Comment tags cannot be longer than " + this.min_len + " characters."); // append new tag if (bz_isValueInArrayIgnoreCase(tags, tag)) continue; @@ -336,7 +327,6 @@ YAHOO.bugzilla.commentTagging = { version: "1.1", method: 'Bug.comments', params: { - Bugzilla_api_token: BUGZILLA.api_token, comment_ids: [ comment_id ], include_fields: [ 'tags' ] } @@ -369,7 +359,6 @@ YAHOO.bugzilla.commentTagging = { version: "1.1", method: 'Bug.update_comment_tags', params: { - Bugzilla_api_token: BUGZILLA.api_token, comment_id: comment_id, add: add, remove: remove diff --git a/mozilla/webtools/bugzilla/js/field.js b/mozilla/webtools/bugzilla/js/field.js index c24603988f0..892c8669f6c 100644 --- a/mozilla/webtools/bugzilla/js/field.js +++ b/mozilla/webtools/bugzilla/js/field.js @@ -46,14 +46,10 @@ function validateEnterBug(theform) { _errorFor(attach_desc, 'attach_desc'); focus_me = attach_desc; } - // bug_status can be undefined if the bug_status field is not editable by - // the currently logged in user. - if (bug_status) { - var check_description = status_comment_required[bug_status.value]; - if (check_description && YAHOO.lang.trim(description.value) == '') { - _errorFor(description, 'description'); - focus_me = description; - } + var check_description = status_comment_required[bug_status.value]; + if (check_description && YAHOO.lang.trim(description.value) == '') { + _errorFor(description, 'description'); + focus_me = description; } if (YAHOO.lang.trim(short_desc.value) == '') { _errorFor(short_desc); @@ -299,7 +295,7 @@ function checkForChangedFieldValues(e, ContainerInputArray ) { if ( el ) { if ( !ContainerInputArray[4] && (el.value != ContainerInputArray[3] - || (el.value == "" && el.id != "qa_contact")) ) + || (el.value == "" && el.id != "alias" && el.id != "qa_contact")) ) { unhide = true; } @@ -320,6 +316,17 @@ function checkForChangedFieldValues(e, ContainerInputArray ) { } +function hideAliasAndSummary(short_desc_value, alias_value) { + // check the short desc field + hideEditableField( 'summary_alias_container','summary_alias_input', + 'editme_action','short_desc', short_desc_value); + // check that the alias hasn't changed + var bz_alias_check_array = new Array('summary_alias_container', + 'summary_alias_input', 'alias', alias_value); + YAHOO.util.Event.addListener( window, 'load', checkForChangedFieldValues, + bz_alias_check_array); +} + function showPeopleOnChange( field_id_list ) { for(var i = 0; i < field_id_list.length; i++) { YAHOO.util.Event.addListener( field_id_list[i],'change', showEditableField, @@ -818,7 +825,6 @@ YAHOO.bugzilla.userAutocomplete = { method : "User.get", id : YAHOO.bugzilla.userAutocomplete.counter, params : [ { - Bugzilla_api_token: BUGZILLA.api_token, match : [ decodeURIComponent(enteredText) ], include_fields : [ "name", "real_name" ] } ] @@ -983,33 +989,17 @@ function initDirtyFieldTracking() { */ var last_comment_text = ''; -var last_markdown_cb_value = null; -var comment_textarea_width = null; -var comment_textarea_height = null; -function refresh_markdown_preview (bug_id) { - if (!YAHOO.util.Dom.hasClass('comment_preview_tab', 'active_comment_tab')) - return; - show_comment_preview(bug_id, 1); -} - -function show_comment_preview(bug_id, refresh) { +function show_comment_preview(bug_id) { var Dom = YAHOO.util.Dom; var comment = document.getElementById('comment'); var preview = document.getElementById('comment_preview'); - var markdown_cb = document.getElementById('use_markdown'); if (!comment || !preview) return; - if (Dom.hasClass('comment_preview_tab', 'active_comment_tab') && !refresh) - return; + if (Dom.hasClass('comment_preview_tab', 'active_comment_tab')) return; - if (!comment_textarea_width) { - comment_textarea_width = (comment.clientWidth - 4) + 'px'; - comment_textarea_height = comment.offsetHeight + 'px'; - } - - preview.style.width = comment_textarea_width; - preview.style.height = comment_textarea_height; + preview.style.width = (comment.clientWidth - 4) + 'px'; + preview.style.height = comment.offsetHeight + 'px'; var comment_tab = document.getElementById('comment_tab'); Dom.addClass(comment, 'bz_default_hidden'); @@ -1023,7 +1013,7 @@ function show_comment_preview(bug_id, refresh) { Dom.addClass('comment_preview_error', 'bz_default_hidden'); - if (last_comment_text == comment.value && last_markdown_cb_value == markdown_cb.checked) + if (last_comment_text == comment.value) return; Dom.addClass('comment_preview_text', 'bz_default_hidden'); @@ -1043,14 +1033,7 @@ function show_comment_preview(bug_id, refresh) { document.getElementById('comment_preview_text').innerHTML = data.result.html; Dom.addClass('comment_preview_loading', 'bz_default_hidden'); Dom.removeClass('comment_preview_text', 'bz_default_hidden'); - if (markdown_cb.checked) { - Dom.removeClass('comment_preview_text', 'comment_preview_pre'); - } - else { - Dom.addClass('comment_preview_text', 'comment_preview_pre'); - } last_comment_text = comment.value; - last_markdown_cb_value = markdown_cb.checked; } }, failure: function(res) { @@ -1064,10 +1047,8 @@ function show_comment_preview(bug_id, refresh) { version: "1.1", method: 'Bug.render_comment', params: { - Bugzilla_api_token: BUGZILLA.api_token, id: bug_id, - text: comment.value, - markdown: (markdown_cb != null) && markdown_cb.checked ? 1 : 0 + text: comment.value } }) ); diff --git a/mozilla/webtools/bugzilla/js/global.js b/mozilla/webtools/bugzilla/js/global.js index b4905e202b7..ea1a11dd3b8 100644 --- a/mozilla/webtools/bugzilla/js/global.js +++ b/mozilla/webtools/bugzilla/js/global.js @@ -7,35 +7,54 @@ */ function show_mini_login_form( suffix ) { - $('#login_link' + suffix).addClass('bz_default_hidden'); - $('#mini_login' + suffix).removeClass('bz_default_hidden'); - $('#new_account_container' + suffix).addClass('bz_default_hidden'); + var login_link = document.getElementById('login_link' + suffix); + var login_form = document.getElementById('mini_login' + suffix); + var account_container = document.getElementById('new_account_container' + + suffix); + + YAHOO.util.Dom.addClass(login_link, 'bz_default_hidden'); + YAHOO.util.Dom.removeClass(login_form, 'bz_default_hidden'); + YAHOO.util.Dom.addClass(account_container, 'bz_default_hidden'); return false; } function hide_mini_login_form( suffix ) { - $('#login_link' + suffix).removeClass('bz_default_hidden'); - $('#mini_login' + suffix).addClass('bz_default_hidden'); - $('#new_account_container' + suffix).removeClass('bz_default_hidden'); + var login_link = document.getElementById('login_link' + suffix); + var login_form = document.getElementById('mini_login' + suffix); + var account_container = document.getElementById('new_account_container' + + suffix); + + YAHOO.util.Dom.removeClass(login_link, 'bz_default_hidden'); + YAHOO.util.Dom.addClass(login_form, 'bz_default_hidden'); + YAHOO.util.Dom.removeClass(account_container, 'bz_default_hidden'); return false; } function show_forgot_form( suffix ) { - $('#forgot_link' + suffix).addClass('bz_default_hidden'); - $('#forgot_form' + suffix).removeClass('bz_default_hidden'); - $('#login_container' + suffix).addClass('bz_default_hidden'); + var forgot_link = document.getElementById('forgot_link' + suffix); + var forgot_form = document.getElementById('forgot_form' + suffix); + var login_container = document.getElementById('mini_login_container' + + suffix); + YAHOO.util.Dom.addClass(forgot_link, 'bz_default_hidden'); + YAHOO.util.Dom.removeClass(forgot_form, 'bz_default_hidden'); + YAHOO.util.Dom.addClass(login_container, 'bz_default_hidden'); return false; } function hide_forgot_form( suffix ) { - $('#forgot_link' + suffix).removeClass('bz_default_hidden'); - $('#forgot_form' + suffix).addClass('bz_default_hidden'); - $('#login_container' + suffix).removeClass('bz_default_hidden'); + var forgot_link = document.getElementById('forgot_link' + suffix); + var forgot_form = document.getElementById('forgot_form' + suffix); + var login_container = document.getElementById('mini_login_container' + + suffix); + YAHOO.util.Dom.removeClass(forgot_link, 'bz_default_hidden'); + YAHOO.util.Dom.addClass(forgot_form, 'bz_default_hidden'); + YAHOO.util.Dom.removeClass(login_container, 'bz_default_hidden'); return false; } function set_language( value ) { - $.cookie('LANG', value, { + YAHOO.util.Cookie.set('LANG', value, + { expires: new Date('January 1, 2038'), path: BUGZILLA.param.cookie_path }); diff --git a/mozilla/webtools/bugzilla/js/jquery/jquery-min.js b/mozilla/webtools/bugzilla/js/jquery/jquery-min.js deleted file mode 100644 index ab28a24729b..00000000000 --- a/mozilla/webtools/bugzilla/js/jquery/jquery-min.js +++ /dev/null @@ -1,4 +0,0 @@ -/*! jQuery v1.11.1 | (c) 2005, 2014 jQuery Foundation, Inc. | jquery.org/license */ -!function(a,b){"object"==typeof module&&"object"==typeof module.exports?module.exports=a.document?b(a,!0):function(a){if(!a.document)throw new Error("jQuery requires a window with a document");return b(a)}:b(a)}("undefined"!=typeof window?window:this,function(a,b){var c=[],d=c.slice,e=c.concat,f=c.push,g=c.indexOf,h={},i=h.toString,j=h.hasOwnProperty,k={},l="1.11.1",m=function(a,b){return new m.fn.init(a,b)},n=/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g,o=/^-ms-/,p=/-([\da-z])/gi,q=function(a,b){return b.toUpperCase()};m.fn=m.prototype={jquery:l,constructor:m,selector:"",length:0,toArray:function(){return d.call(this)},get:function(a){return null!=a?0>a?this[a+this.length]:this[a]:d.call(this)},pushStack:function(a){var b=m.merge(this.constructor(),a);return b.prevObject=this,b.context=this.context,b},each:function(a,b){return m.each(this,a,b)},map:function(a){return this.pushStack(m.map(this,function(b,c){return a.call(b,c,b)}))},slice:function(){return this.pushStack(d.apply(this,arguments))},first:function(){return this.eq(0)},last:function(){return this.eq(-1)},eq:function(a){var b=this.length,c=+a+(0>a?b:0);return this.pushStack(c>=0&&b>c?[this[c]]:[])},end:function(){return this.prevObject||this.constructor(null)},push:f,sort:c.sort,splice:c.splice},m.extend=m.fn.extend=function(){var a,b,c,d,e,f,g=arguments[0]||{},h=1,i=arguments.length,j=!1;for("boolean"==typeof g&&(j=g,g=arguments[h]||{},h++),"object"==typeof g||m.isFunction(g)||(g={}),h===i&&(g=this,h--);i>h;h++)if(null!=(e=arguments[h]))for(d in e)a=g[d],c=e[d],g!==c&&(j&&c&&(m.isPlainObject(c)||(b=m.isArray(c)))?(b?(b=!1,f=a&&m.isArray(a)?a:[]):f=a&&m.isPlainObject(a)?a:{},g[d]=m.extend(j,f,c)):void 0!==c&&(g[d]=c));return g},m.extend({expando:"jQuery"+(l+Math.random()).replace(/\D/g,""),isReady:!0,error:function(a){throw new Error(a)},noop:function(){},isFunction:function(a){return"function"===m.type(a)},isArray:Array.isArray||function(a){return"array"===m.type(a)},isWindow:function(a){return null!=a&&a==a.window},isNumeric:function(a){return!m.isArray(a)&&a-parseFloat(a)>=0},isEmptyObject:function(a){var b;for(b in a)return!1;return!0},isPlainObject:function(a){var b;if(!a||"object"!==m.type(a)||a.nodeType||m.isWindow(a))return!1;try{if(a.constructor&&!j.call(a,"constructor")&&!j.call(a.constructor.prototype,"isPrototypeOf"))return!1}catch(c){return!1}if(k.ownLast)for(b in a)return j.call(a,b);for(b in a);return void 0===b||j.call(a,b)},type:function(a){return null==a?a+"":"object"==typeof a||"function"==typeof a?h[i.call(a)]||"object":typeof a},globalEval:function(b){b&&m.trim(b)&&(a.execScript||function(b){a.eval.call(a,b)})(b)},camelCase:function(a){return a.replace(o,"ms-").replace(p,q)},nodeName:function(a,b){return a.nodeName&&a.nodeName.toLowerCase()===b.toLowerCase()},each:function(a,b,c){var d,e=0,f=a.length,g=r(a);if(c){if(g){for(;f>e;e++)if(d=b.apply(a[e],c),d===!1)break}else for(e in a)if(d=b.apply(a[e],c),d===!1)break}else if(g){for(;f>e;e++)if(d=b.call(a[e],e,a[e]),d===!1)break}else for(e in a)if(d=b.call(a[e],e,a[e]),d===!1)break;return a},trim:function(a){return null==a?"":(a+"").replace(n,"")},makeArray:function(a,b){var c=b||[];return null!=a&&(r(Object(a))?m.merge(c,"string"==typeof a?[a]:a):f.call(c,a)),c},inArray:function(a,b,c){var d;if(b){if(g)return g.call(b,a,c);for(d=b.length,c=c?0>c?Math.max(0,d+c):c:0;d>c;c++)if(c in b&&b[c]===a)return c}return-1},merge:function(a,b){var c=+b.length,d=0,e=a.length;while(c>d)a[e++]=b[d++];if(c!==c)while(void 0!==b[d])a[e++]=b[d++];return a.length=e,a},grep:function(a,b,c){for(var d,e=[],f=0,g=a.length,h=!c;g>f;f++)d=!b(a[f],f),d!==h&&e.push(a[f]);return e},map:function(a,b,c){var d,f=0,g=a.length,h=r(a),i=[];if(h)for(;g>f;f++)d=b(a[f],f,c),null!=d&&i.push(d);else for(f in a)d=b(a[f],f,c),null!=d&&i.push(d);return e.apply([],i)},guid:1,proxy:function(a,b){var c,e,f;return"string"==typeof b&&(f=a[b],b=a,a=f),m.isFunction(a)?(c=d.call(arguments,2),e=function(){return a.apply(b||this,c.concat(d.call(arguments)))},e.guid=a.guid=a.guid||m.guid++,e):void 0},now:function(){return+new Date},support:k}),m.each("Boolean Number String Function Array Date RegExp Object Error".split(" "),function(a,b){h["[object "+b+"]"]=b.toLowerCase()});function r(a){var b=a.length,c=m.type(a);return"function"===c||m.isWindow(a)?!1:1===a.nodeType&&b?!0:"array"===c||0===b||"number"==typeof b&&b>0&&b-1 in a}var s=function(a){var b,c,d,e,f,g,h,i,j,k,l,m,n,o,p,q,r,s,t,u="sizzle"+-new Date,v=a.document,w=0,x=0,y=gb(),z=gb(),A=gb(),B=function(a,b){return a===b&&(l=!0),0},C="undefined",D=1<<31,E={}.hasOwnProperty,F=[],G=F.pop,H=F.push,I=F.push,J=F.slice,K=F.indexOf||function(a){for(var b=0,c=this.length;c>b;b++)if(this[b]===a)return b;return-1},L="checked|selected|async|autofocus|autoplay|controls|defer|disabled|hidden|ismap|loop|multiple|open|readonly|required|scoped",M="[\\x20\\t\\r\\n\\f]",N="(?:\\\\.|[\\w-]|[^\\x00-\\xa0])+",O=N.replace("w","w#"),P="\\["+M+"*("+N+")(?:"+M+"*([*^$|!~]?=)"+M+"*(?:'((?:\\\\.|[^\\\\'])*)'|\"((?:\\\\.|[^\\\\\"])*)\"|("+O+"))|)"+M+"*\\]",Q=":("+N+")(?:\\((('((?:\\\\.|[^\\\\'])*)'|\"((?:\\\\.|[^\\\\\"])*)\")|((?:\\\\.|[^\\\\()[\\]]|"+P+")*)|.*)\\)|)",R=new RegExp("^"+M+"+|((?:^|[^\\\\])(?:\\\\.)*)"+M+"+$","g"),S=new RegExp("^"+M+"*,"+M+"*"),T=new RegExp("^"+M+"*([>+~]|"+M+")"+M+"*"),U=new RegExp("="+M+"*([^\\]'\"]*?)"+M+"*\\]","g"),V=new RegExp(Q),W=new RegExp("^"+O+"$"),X={ID:new RegExp("^#("+N+")"),CLASS:new RegExp("^\\.("+N+")"),TAG:new RegExp("^("+N.replace("w","w*")+")"),ATTR:new RegExp("^"+P),PSEUDO:new RegExp("^"+Q),CHILD:new RegExp("^:(only|first|last|nth|nth-last)-(child|of-type)(?:\\("+M+"*(even|odd|(([+-]|)(\\d*)n|)"+M+"*(?:([+-]|)"+M+"*(\\d+)|))"+M+"*\\)|)","i"),bool:new RegExp("^(?:"+L+")$","i"),needsContext:new RegExp("^"+M+"*[>+~]|:(even|odd|eq|gt|lt|nth|first|last)(?:\\("+M+"*((?:-\\d)?\\d*)"+M+"*\\)|)(?=[^-]|$)","i")},Y=/^(?:input|select|textarea|button)$/i,Z=/^h\d$/i,$=/^[^{]+\{\s*\[native \w/,_=/^(?:#([\w-]+)|(\w+)|\.([\w-]+))$/,ab=/[+~]/,bb=/'|\\/g,cb=new RegExp("\\\\([\\da-f]{1,6}"+M+"?|("+M+")|.)","ig"),db=function(a,b,c){var d="0x"+b-65536;return d!==d||c?b:0>d?String.fromCharCode(d+65536):String.fromCharCode(d>>10|55296,1023&d|56320)};try{I.apply(F=J.call(v.childNodes),v.childNodes),F[v.childNodes.length].nodeType}catch(eb){I={apply:F.length?function(a,b){H.apply(a,J.call(b))}:function(a,b){var c=a.length,d=0;while(a[c++]=b[d++]);a.length=c-1}}}function fb(a,b,d,e){var f,h,j,k,l,o,r,s,w,x;if((b?b.ownerDocument||b:v)!==n&&m(b),b=b||n,d=d||[],!a||"string"!=typeof a)return d;if(1!==(k=b.nodeType)&&9!==k)return[];if(p&&!e){if(f=_.exec(a))if(j=f[1]){if(9===k){if(h=b.getElementById(j),!h||!h.parentNode)return d;if(h.id===j)return d.push(h),d}else if(b.ownerDocument&&(h=b.ownerDocument.getElementById(j))&&t(b,h)&&h.id===j)return d.push(h),d}else{if(f[2])return I.apply(d,b.getElementsByTagName(a)),d;if((j=f[3])&&c.getElementsByClassName&&b.getElementsByClassName)return I.apply(d,b.getElementsByClassName(j)),d}if(c.qsa&&(!q||!q.test(a))){if(s=r=u,w=b,x=9===k&&a,1===k&&"object"!==b.nodeName.toLowerCase()){o=g(a),(r=b.getAttribute("id"))?s=r.replace(bb,"\\$&"):b.setAttribute("id",s),s="[id='"+s+"'] ",l=o.length;while(l--)o[l]=s+qb(o[l]);w=ab.test(a)&&ob(b.parentNode)||b,x=o.join(",")}if(x)try{return I.apply(d,w.querySelectorAll(x)),d}catch(y){}finally{r||b.removeAttribute("id")}}}return i(a.replace(R,"$1"),b,d,e)}function gb(){var a=[];function b(c,e){return a.push(c+" ")>d.cacheLength&&delete b[a.shift()],b[c+" "]=e}return b}function hb(a){return a[u]=!0,a}function ib(a){var b=n.createElement("div");try{return!!a(b)}catch(c){return!1}finally{b.parentNode&&b.parentNode.removeChild(b),b=null}}function jb(a,b){var c=a.split("|"),e=a.length;while(e--)d.attrHandle[c[e]]=b}function kb(a,b){var c=b&&a,d=c&&1===a.nodeType&&1===b.nodeType&&(~b.sourceIndex||D)-(~a.sourceIndex||D);if(d)return d;if(c)while(c=c.nextSibling)if(c===b)return-1;return a?1:-1}function lb(a){return function(b){var c=b.nodeName.toLowerCase();return"input"===c&&b.type===a}}function mb(a){return function(b){var c=b.nodeName.toLowerCase();return("input"===c||"button"===c)&&b.type===a}}function nb(a){return hb(function(b){return b=+b,hb(function(c,d){var e,f=a([],c.length,b),g=f.length;while(g--)c[e=f[g]]&&(c[e]=!(d[e]=c[e]))})})}function ob(a){return a&&typeof a.getElementsByTagName!==C&&a}c=fb.support={},f=fb.isXML=function(a){var b=a&&(a.ownerDocument||a).documentElement;return b?"HTML"!==b.nodeName:!1},m=fb.setDocument=function(a){var b,e=a?a.ownerDocument||a:v,g=e.defaultView;return e!==n&&9===e.nodeType&&e.documentElement?(n=e,o=e.documentElement,p=!f(e),g&&g!==g.top&&(g.addEventListener?g.addEventListener("unload",function(){m()},!1):g.attachEvent&&g.attachEvent("onunload",function(){m()})),c.attributes=ib(function(a){return a.className="i",!a.getAttribute("className")}),c.getElementsByTagName=ib(function(a){return a.appendChild(e.createComment("")),!a.getElementsByTagName("*").length}),c.getElementsByClassName=$.test(e.getElementsByClassName)&&ib(function(a){return a.innerHTML="
",a.firstChild.className="i",2===a.getElementsByClassName("i").length}),c.getById=ib(function(a){return o.appendChild(a).id=u,!e.getElementsByName||!e.getElementsByName(u).length}),c.getById?(d.find.ID=function(a,b){if(typeof b.getElementById!==C&&p){var c=b.getElementById(a);return c&&c.parentNode?[c]:[]}},d.filter.ID=function(a){var b=a.replace(cb,db);return function(a){return a.getAttribute("id")===b}}):(delete d.find.ID,d.filter.ID=function(a){var b=a.replace(cb,db);return function(a){var c=typeof a.getAttributeNode!==C&&a.getAttributeNode("id");return c&&c.value===b}}),d.find.TAG=c.getElementsByTagName?function(a,b){return typeof b.getElementsByTagName!==C?b.getElementsByTagName(a):void 0}:function(a,b){var c,d=[],e=0,f=b.getElementsByTagName(a);if("*"===a){while(c=f[e++])1===c.nodeType&&d.push(c);return d}return f},d.find.CLASS=c.getElementsByClassName&&function(a,b){return typeof b.getElementsByClassName!==C&&p?b.getElementsByClassName(a):void 0},r=[],q=[],(c.qsa=$.test(e.querySelectorAll))&&(ib(function(a){a.innerHTML="",a.querySelectorAll("[msallowclip^='']").length&&q.push("[*^$]="+M+"*(?:''|\"\")"),a.querySelectorAll("[selected]").length||q.push("\\["+M+"*(?:value|"+L+")"),a.querySelectorAll(":checked").length||q.push(":checked")}),ib(function(a){var b=e.createElement("input");b.setAttribute("type","hidden"),a.appendChild(b).setAttribute("name","D"),a.querySelectorAll("[name=d]").length&&q.push("name"+M+"*[*^$|!~]?="),a.querySelectorAll(":enabled").length||q.push(":enabled",":disabled"),a.querySelectorAll("*,:x"),q.push(",.*:")})),(c.matchesSelector=$.test(s=o.matches||o.webkitMatchesSelector||o.mozMatchesSelector||o.oMatchesSelector||o.msMatchesSelector))&&ib(function(a){c.disconnectedMatch=s.call(a,"div"),s.call(a,"[s!='']:x"),r.push("!=",Q)}),q=q.length&&new RegExp(q.join("|")),r=r.length&&new RegExp(r.join("|")),b=$.test(o.compareDocumentPosition),t=b||$.test(o.contains)?function(a,b){var c=9===a.nodeType?a.documentElement:a,d=b&&b.parentNode;return a===d||!(!d||1!==d.nodeType||!(c.contains?c.contains(d):a.compareDocumentPosition&&16&a.compareDocumentPosition(d)))}:function(a,b){if(b)while(b=b.parentNode)if(b===a)return!0;return!1},B=b?function(a,b){if(a===b)return l=!0,0;var d=!a.compareDocumentPosition-!b.compareDocumentPosition;return d?d:(d=(a.ownerDocument||a)===(b.ownerDocument||b)?a.compareDocumentPosition(b):1,1&d||!c.sortDetached&&b.compareDocumentPosition(a)===d?a===e||a.ownerDocument===v&&t(v,a)?-1:b===e||b.ownerDocument===v&&t(v,b)?1:k?K.call(k,a)-K.call(k,b):0:4&d?-1:1)}:function(a,b){if(a===b)return l=!0,0;var c,d=0,f=a.parentNode,g=b.parentNode,h=[a],i=[b];if(!f||!g)return a===e?-1:b===e?1:f?-1:g?1:k?K.call(k,a)-K.call(k,b):0;if(f===g)return kb(a,b);c=a;while(c=c.parentNode)h.unshift(c);c=b;while(c=c.parentNode)i.unshift(c);while(h[d]===i[d])d++;return d?kb(h[d],i[d]):h[d]===v?-1:i[d]===v?1:0},e):n},fb.matches=function(a,b){return fb(a,null,null,b)},fb.matchesSelector=function(a,b){if((a.ownerDocument||a)!==n&&m(a),b=b.replace(U,"='$1']"),!(!c.matchesSelector||!p||r&&r.test(b)||q&&q.test(b)))try{var d=s.call(a,b);if(d||c.disconnectedMatch||a.document&&11!==a.document.nodeType)return d}catch(e){}return fb(b,n,null,[a]).length>0},fb.contains=function(a,b){return(a.ownerDocument||a)!==n&&m(a),t(a,b)},fb.attr=function(a,b){(a.ownerDocument||a)!==n&&m(a);var e=d.attrHandle[b.toLowerCase()],f=e&&E.call(d.attrHandle,b.toLowerCase())?e(a,b,!p):void 0;return void 0!==f?f:c.attributes||!p?a.getAttribute(b):(f=a.getAttributeNode(b))&&f.specified?f.value:null},fb.error=function(a){throw new Error("Syntax error, unrecognized expression: "+a)},fb.uniqueSort=function(a){var b,d=[],e=0,f=0;if(l=!c.detectDuplicates,k=!c.sortStable&&a.slice(0),a.sort(B),l){while(b=a[f++])b===a[f]&&(e=d.push(f));while(e--)a.splice(d[e],1)}return k=null,a},e=fb.getText=function(a){var b,c="",d=0,f=a.nodeType;if(f){if(1===f||9===f||11===f){if("string"==typeof a.textContent)return a.textContent;for(a=a.firstChild;a;a=a.nextSibling)c+=e(a)}else if(3===f||4===f)return a.nodeValue}else while(b=a[d++])c+=e(b);return c},d=fb.selectors={cacheLength:50,createPseudo:hb,match:X,attrHandle:{},find:{},relative:{">":{dir:"parentNode",first:!0}," ":{dir:"parentNode"},"+":{dir:"previousSibling",first:!0},"~":{dir:"previousSibling"}},preFilter:{ATTR:function(a){return a[1]=a[1].replace(cb,db),a[3]=(a[3]||a[4]||a[5]||"").replace(cb,db),"~="===a[2]&&(a[3]=" "+a[3]+" "),a.slice(0,4)},CHILD:function(a){return a[1]=a[1].toLowerCase(),"nth"===a[1].slice(0,3)?(a[3]||fb.error(a[0]),a[4]=+(a[4]?a[5]+(a[6]||1):2*("even"===a[3]||"odd"===a[3])),a[5]=+(a[7]+a[8]||"odd"===a[3])):a[3]&&fb.error(a[0]),a},PSEUDO:function(a){var b,c=!a[6]&&a[2];return X.CHILD.test(a[0])?null:(a[3]?a[2]=a[4]||a[5]||"":c&&V.test(c)&&(b=g(c,!0))&&(b=c.indexOf(")",c.length-b)-c.length)&&(a[0]=a[0].slice(0,b),a[2]=c.slice(0,b)),a.slice(0,3))}},filter:{TAG:function(a){var b=a.replace(cb,db).toLowerCase();return"*"===a?function(){return!0}:function(a){return a.nodeName&&a.nodeName.toLowerCase()===b}},CLASS:function(a){var b=y[a+" "];return b||(b=new RegExp("(^|"+M+")"+a+"("+M+"|$)"))&&y(a,function(a){return b.test("string"==typeof a.className&&a.className||typeof a.getAttribute!==C&&a.getAttribute("class")||"")})},ATTR:function(a,b,c){return function(d){var e=fb.attr(d,a);return null==e?"!="===b:b?(e+="","="===b?e===c:"!="===b?e!==c:"^="===b?c&&0===e.indexOf(c):"*="===b?c&&e.indexOf(c)>-1:"$="===b?c&&e.slice(-c.length)===c:"~="===b?(" "+e+" ").indexOf(c)>-1:"|="===b?e===c||e.slice(0,c.length+1)===c+"-":!1):!0}},CHILD:function(a,b,c,d,e){var f="nth"!==a.slice(0,3),g="last"!==a.slice(-4),h="of-type"===b;return 1===d&&0===e?function(a){return!!a.parentNode}:function(b,c,i){var j,k,l,m,n,o,p=f!==g?"nextSibling":"previousSibling",q=b.parentNode,r=h&&b.nodeName.toLowerCase(),s=!i&&!h;if(q){if(f){while(p){l=b;while(l=l[p])if(h?l.nodeName.toLowerCase()===r:1===l.nodeType)return!1;o=p="only"===a&&!o&&"nextSibling"}return!0}if(o=[g?q.firstChild:q.lastChild],g&&s){k=q[u]||(q[u]={}),j=k[a]||[],n=j[0]===w&&j[1],m=j[0]===w&&j[2],l=n&&q.childNodes[n];while(l=++n&&l&&l[p]||(m=n=0)||o.pop())if(1===l.nodeType&&++m&&l===b){k[a]=[w,n,m];break}}else if(s&&(j=(b[u]||(b[u]={}))[a])&&j[0]===w)m=j[1];else while(l=++n&&l&&l[p]||(m=n=0)||o.pop())if((h?l.nodeName.toLowerCase()===r:1===l.nodeType)&&++m&&(s&&((l[u]||(l[u]={}))[a]=[w,m]),l===b))break;return m-=e,m===d||m%d===0&&m/d>=0}}},PSEUDO:function(a,b){var c,e=d.pseudos[a]||d.setFilters[a.toLowerCase()]||fb.error("unsupported pseudo: "+a);return e[u]?e(b):e.length>1?(c=[a,a,"",b],d.setFilters.hasOwnProperty(a.toLowerCase())?hb(function(a,c){var d,f=e(a,b),g=f.length;while(g--)d=K.call(a,f[g]),a[d]=!(c[d]=f[g])}):function(a){return e(a,0,c)}):e}},pseudos:{not:hb(function(a){var b=[],c=[],d=h(a.replace(R,"$1"));return d[u]?hb(function(a,b,c,e){var f,g=d(a,null,e,[]),h=a.length;while(h--)(f=g[h])&&(a[h]=!(b[h]=f))}):function(a,e,f){return b[0]=a,d(b,null,f,c),!c.pop()}}),has:hb(function(a){return function(b){return fb(a,b).length>0}}),contains:hb(function(a){return function(b){return(b.textContent||b.innerText||e(b)).indexOf(a)>-1}}),lang:hb(function(a){return W.test(a||"")||fb.error("unsupported lang: "+a),a=a.replace(cb,db).toLowerCase(),function(b){var c;do if(c=p?b.lang:b.getAttribute("xml:lang")||b.getAttribute("lang"))return c=c.toLowerCase(),c===a||0===c.indexOf(a+"-");while((b=b.parentNode)&&1===b.nodeType);return!1}}),target:function(b){var c=a.location&&a.location.hash;return c&&c.slice(1)===b.id},root:function(a){return a===o},focus:function(a){return a===n.activeElement&&(!n.hasFocus||n.hasFocus())&&!!(a.type||a.href||~a.tabIndex)},enabled:function(a){return a.disabled===!1},disabled:function(a){return a.disabled===!0},checked:function(a){var b=a.nodeName.toLowerCase();return"input"===b&&!!a.checked||"option"===b&&!!a.selected},selected:function(a){return a.parentNode&&a.parentNode.selectedIndex,a.selected===!0},empty:function(a){for(a=a.firstChild;a;a=a.nextSibling)if(a.nodeType<6)return!1;return!0},parent:function(a){return!d.pseudos.empty(a)},header:function(a){return Z.test(a.nodeName)},input:function(a){return Y.test(a.nodeName)},button:function(a){var b=a.nodeName.toLowerCase();return"input"===b&&"button"===a.type||"button"===b},text:function(a){var b;return"input"===a.nodeName.toLowerCase()&&"text"===a.type&&(null==(b=a.getAttribute("type"))||"text"===b.toLowerCase())},first:nb(function(){return[0]}),last:nb(function(a,b){return[b-1]}),eq:nb(function(a,b,c){return[0>c?c+b:c]}),even:nb(function(a,b){for(var c=0;b>c;c+=2)a.push(c);return a}),odd:nb(function(a,b){for(var c=1;b>c;c+=2)a.push(c);return a}),lt:nb(function(a,b,c){for(var d=0>c?c+b:c;--d>=0;)a.push(d);return a}),gt:nb(function(a,b,c){for(var d=0>c?c+b:c;++db;b++)d+=a[b].value;return d}function rb(a,b,c){var d=b.dir,e=c&&"parentNode"===d,f=x++;return b.first?function(b,c,f){while(b=b[d])if(1===b.nodeType||e)return a(b,c,f)}:function(b,c,g){var h,i,j=[w,f];if(g){while(b=b[d])if((1===b.nodeType||e)&&a(b,c,g))return!0}else while(b=b[d])if(1===b.nodeType||e){if(i=b[u]||(b[u]={}),(h=i[d])&&h[0]===w&&h[1]===f)return j[2]=h[2];if(i[d]=j,j[2]=a(b,c,g))return!0}}}function sb(a){return a.length>1?function(b,c,d){var e=a.length;while(e--)if(!a[e](b,c,d))return!1;return!0}:a[0]}function tb(a,b,c){for(var d=0,e=b.length;e>d;d++)fb(a,b[d],c);return c}function ub(a,b,c,d,e){for(var f,g=[],h=0,i=a.length,j=null!=b;i>h;h++)(f=a[h])&&(!c||c(f,d,e))&&(g.push(f),j&&b.push(h));return g}function vb(a,b,c,d,e,f){return d&&!d[u]&&(d=vb(d)),e&&!e[u]&&(e=vb(e,f)),hb(function(f,g,h,i){var j,k,l,m=[],n=[],o=g.length,p=f||tb(b||"*",h.nodeType?[h]:h,[]),q=!a||!f&&b?p:ub(p,m,a,h,i),r=c?e||(f?a:o||d)?[]:g:q;if(c&&c(q,r,h,i),d){j=ub(r,n),d(j,[],h,i),k=j.length;while(k--)(l=j[k])&&(r[n[k]]=!(q[n[k]]=l))}if(f){if(e||a){if(e){j=[],k=r.length;while(k--)(l=r[k])&&j.push(q[k]=l);e(null,r=[],j,i)}k=r.length;while(k--)(l=r[k])&&(j=e?K.call(f,l):m[k])>-1&&(f[j]=!(g[j]=l))}}else r=ub(r===g?r.splice(o,r.length):r),e?e(null,g,r,i):I.apply(g,r)})}function wb(a){for(var b,c,e,f=a.length,g=d.relative[a[0].type],h=g||d.relative[" "],i=g?1:0,k=rb(function(a){return a===b},h,!0),l=rb(function(a){return K.call(b,a)>-1},h,!0),m=[function(a,c,d){return!g&&(d||c!==j)||((b=c).nodeType?k(a,c,d):l(a,c,d))}];f>i;i++)if(c=d.relative[a[i].type])m=[rb(sb(m),c)];else{if(c=d.filter[a[i].type].apply(null,a[i].matches),c[u]){for(e=++i;f>e;e++)if(d.relative[a[e].type])break;return vb(i>1&&sb(m),i>1&&qb(a.slice(0,i-1).concat({value:" "===a[i-2].type?"*":""})).replace(R,"$1"),c,e>i&&wb(a.slice(i,e)),f>e&&wb(a=a.slice(e)),f>e&&qb(a))}m.push(c)}return sb(m)}function xb(a,b){var c=b.length>0,e=a.length>0,f=function(f,g,h,i,k){var l,m,o,p=0,q="0",r=f&&[],s=[],t=j,u=f||e&&d.find.TAG("*",k),v=w+=null==t?1:Math.random()||.1,x=u.length;for(k&&(j=g!==n&&g);q!==x&&null!=(l=u[q]);q++){if(e&&l){m=0;while(o=a[m++])if(o(l,g,h)){i.push(l);break}k&&(w=v)}c&&((l=!o&&l)&&p--,f&&r.push(l))}if(p+=q,c&&q!==p){m=0;while(o=b[m++])o(r,s,g,h);if(f){if(p>0)while(q--)r[q]||s[q]||(s[q]=G.call(i));s=ub(s)}I.apply(i,s),k&&!f&&s.length>0&&p+b.length>1&&fb.uniqueSort(i)}return k&&(w=v,j=t),r};return c?hb(f):f}return h=fb.compile=function(a,b){var c,d=[],e=[],f=A[a+" "];if(!f){b||(b=g(a)),c=b.length;while(c--)f=wb(b[c]),f[u]?d.push(f):e.push(f);f=A(a,xb(e,d)),f.selector=a}return f},i=fb.select=function(a,b,e,f){var i,j,k,l,m,n="function"==typeof a&&a,o=!f&&g(a=n.selector||a);if(e=e||[],1===o.length){if(j=o[0]=o[0].slice(0),j.length>2&&"ID"===(k=j[0]).type&&c.getById&&9===b.nodeType&&p&&d.relative[j[1].type]){if(b=(d.find.ID(k.matches[0].replace(cb,db),b)||[])[0],!b)return e;n&&(b=b.parentNode),a=a.slice(j.shift().value.length)}i=X.needsContext.test(a)?0:j.length;while(i--){if(k=j[i],d.relative[l=k.type])break;if((m=d.find[l])&&(f=m(k.matches[0].replace(cb,db),ab.test(j[0].type)&&ob(b.parentNode)||b))){if(j.splice(i,1),a=f.length&&qb(j),!a)return I.apply(e,f),e;break}}}return(n||h(a,o))(f,b,!p,e,ab.test(a)&&ob(b.parentNode)||b),e},c.sortStable=u.split("").sort(B).join("")===u,c.detectDuplicates=!!l,m(),c.sortDetached=ib(function(a){return 1&a.compareDocumentPosition(n.createElement("div"))}),ib(function(a){return a.innerHTML="","#"===a.firstChild.getAttribute("href")})||jb("type|href|height|width",function(a,b,c){return c?void 0:a.getAttribute(b,"type"===b.toLowerCase()?1:2)}),c.attributes&&ib(function(a){return a.innerHTML="",a.firstChild.setAttribute("value",""),""===a.firstChild.getAttribute("value")})||jb("value",function(a,b,c){return c||"input"!==a.nodeName.toLowerCase()?void 0:a.defaultValue}),ib(function(a){return null==a.getAttribute("disabled")})||jb(L,function(a,b,c){var d;return c?void 0:a[b]===!0?b.toLowerCase():(d=a.getAttributeNode(b))&&d.specified?d.value:null}),fb}(a);m.find=s,m.expr=s.selectors,m.expr[":"]=m.expr.pseudos,m.unique=s.uniqueSort,m.text=s.getText,m.isXMLDoc=s.isXML,m.contains=s.contains;var t=m.expr.match.needsContext,u=/^<(\w+)\s*\/?>(?:<\/\1>|)$/,v=/^.[^:#\[\.,]*$/;function w(a,b,c){if(m.isFunction(b))return m.grep(a,function(a,d){return!!b.call(a,d,a)!==c});if(b.nodeType)return m.grep(a,function(a){return a===b!==c});if("string"==typeof b){if(v.test(b))return m.filter(b,a,c);b=m.filter(b,a)}return m.grep(a,function(a){return m.inArray(a,b)>=0!==c})}m.filter=function(a,b,c){var d=b[0];return c&&(a=":not("+a+")"),1===b.length&&1===d.nodeType?m.find.matchesSelector(d,a)?[d]:[]:m.find.matches(a,m.grep(b,function(a){return 1===a.nodeType}))},m.fn.extend({find:function(a){var b,c=[],d=this,e=d.length;if("string"!=typeof a)return this.pushStack(m(a).filter(function(){for(b=0;e>b;b++)if(m.contains(d[b],this))return!0}));for(b=0;e>b;b++)m.find(a,d[b],c);return c=this.pushStack(e>1?m.unique(c):c),c.selector=this.selector?this.selector+" "+a:a,c},filter:function(a){return this.pushStack(w(this,a||[],!1))},not:function(a){return this.pushStack(w(this,a||[],!0))},is:function(a){return!!w(this,"string"==typeof a&&t.test(a)?m(a):a||[],!1).length}});var x,y=a.document,z=/^(?:\s*(<[\w\W]+>)[^>]*|#([\w-]*))$/,A=m.fn.init=function(a,b){var c,d;if(!a)return this;if("string"==typeof a){if(c="<"===a.charAt(0)&&">"===a.charAt(a.length-1)&&a.length>=3?[null,a,null]:z.exec(a),!c||!c[1]&&b)return!b||b.jquery?(b||x).find(a):this.constructor(b).find(a);if(c[1]){if(b=b instanceof m?b[0]:b,m.merge(this,m.parseHTML(c[1],b&&b.nodeType?b.ownerDocument||b:y,!0)),u.test(c[1])&&m.isPlainObject(b))for(c in b)m.isFunction(this[c])?this[c](b[c]):this.attr(c,b[c]);return this}if(d=y.getElementById(c[2]),d&&d.parentNode){if(d.id!==c[2])return x.find(a);this.length=1,this[0]=d}return this.context=y,this.selector=a,this}return a.nodeType?(this.context=this[0]=a,this.length=1,this):m.isFunction(a)?"undefined"!=typeof x.ready?x.ready(a):a(m):(void 0!==a.selector&&(this.selector=a.selector,this.context=a.context),m.makeArray(a,this))};A.prototype=m.fn,x=m(y);var B=/^(?:parents|prev(?:Until|All))/,C={children:!0,contents:!0,next:!0,prev:!0};m.extend({dir:function(a,b,c){var d=[],e=a[b];while(e&&9!==e.nodeType&&(void 0===c||1!==e.nodeType||!m(e).is(c)))1===e.nodeType&&d.push(e),e=e[b];return d},sibling:function(a,b){for(var c=[];a;a=a.nextSibling)1===a.nodeType&&a!==b&&c.push(a);return c}}),m.fn.extend({has:function(a){var b,c=m(a,this),d=c.length;return this.filter(function(){for(b=0;d>b;b++)if(m.contains(this,c[b]))return!0})},closest:function(a,b){for(var c,d=0,e=this.length,f=[],g=t.test(a)||"string"!=typeof a?m(a,b||this.context):0;e>d;d++)for(c=this[d];c&&c!==b;c=c.parentNode)if(c.nodeType<11&&(g?g.index(c)>-1:1===c.nodeType&&m.find.matchesSelector(c,a))){f.push(c);break}return this.pushStack(f.length>1?m.unique(f):f)},index:function(a){return a?"string"==typeof a?m.inArray(this[0],m(a)):m.inArray(a.jquery?a[0]:a,this):this[0]&&this[0].parentNode?this.first().prevAll().length:-1},add:function(a,b){return this.pushStack(m.unique(m.merge(this.get(),m(a,b))))},addBack:function(a){return this.add(null==a?this.prevObject:this.prevObject.filter(a))}});function D(a,b){do a=a[b];while(a&&1!==a.nodeType);return a}m.each({parent:function(a){var b=a.parentNode;return b&&11!==b.nodeType?b:null},parents:function(a){return m.dir(a,"parentNode")},parentsUntil:function(a,b,c){return m.dir(a,"parentNode",c)},next:function(a){return D(a,"nextSibling")},prev:function(a){return D(a,"previousSibling")},nextAll:function(a){return m.dir(a,"nextSibling")},prevAll:function(a){return m.dir(a,"previousSibling")},nextUntil:function(a,b,c){return m.dir(a,"nextSibling",c)},prevUntil:function(a,b,c){return m.dir(a,"previousSibling",c)},siblings:function(a){return m.sibling((a.parentNode||{}).firstChild,a)},children:function(a){return m.sibling(a.firstChild)},contents:function(a){return m.nodeName(a,"iframe")?a.contentDocument||a.contentWindow.document:m.merge([],a.childNodes)}},function(a,b){m.fn[a]=function(c,d){var e=m.map(this,b,c);return"Until"!==a.slice(-5)&&(d=c),d&&"string"==typeof d&&(e=m.filter(d,e)),this.length>1&&(C[a]||(e=m.unique(e)),B.test(a)&&(e=e.reverse())),this.pushStack(e)}});var E=/\S+/g,F={};function G(a){var b=F[a]={};return m.each(a.match(E)||[],function(a,c){b[c]=!0}),b}m.Callbacks=function(a){a="string"==typeof a?F[a]||G(a):m.extend({},a);var b,c,d,e,f,g,h=[],i=!a.once&&[],j=function(l){for(c=a.memory&&l,d=!0,f=g||0,g=0,e=h.length,b=!0;h&&e>f;f++)if(h[f].apply(l[0],l[1])===!1&&a.stopOnFalse){c=!1;break}b=!1,h&&(i?i.length&&j(i.shift()):c?h=[]:k.disable())},k={add:function(){if(h){var d=h.length;!function f(b){m.each(b,function(b,c){var d=m.type(c);"function"===d?a.unique&&k.has(c)||h.push(c):c&&c.length&&"string"!==d&&f(c)})}(arguments),b?e=h.length:c&&(g=d,j(c))}return this},remove:function(){return h&&m.each(arguments,function(a,c){var d;while((d=m.inArray(c,h,d))>-1)h.splice(d,1),b&&(e>=d&&e--,f>=d&&f--)}),this},has:function(a){return a?m.inArray(a,h)>-1:!(!h||!h.length)},empty:function(){return h=[],e=0,this},disable:function(){return h=i=c=void 0,this},disabled:function(){return!h},lock:function(){return i=void 0,c||k.disable(),this},locked:function(){return!i},fireWith:function(a,c){return!h||d&&!i||(c=c||[],c=[a,c.slice?c.slice():c],b?i.push(c):j(c)),this},fire:function(){return k.fireWith(this,arguments),this},fired:function(){return!!d}};return k},m.extend({Deferred:function(a){var b=[["resolve","done",m.Callbacks("once memory"),"resolved"],["reject","fail",m.Callbacks("once memory"),"rejected"],["notify","progress",m.Callbacks("memory")]],c="pending",d={state:function(){return c},always:function(){return e.done(arguments).fail(arguments),this},then:function(){var a=arguments;return m.Deferred(function(c){m.each(b,function(b,f){var g=m.isFunction(a[b])&&a[b];e[f[1]](function(){var a=g&&g.apply(this,arguments);a&&m.isFunction(a.promise)?a.promise().done(c.resolve).fail(c.reject).progress(c.notify):c[f[0]+"With"](this===d?c.promise():this,g?[a]:arguments)})}),a=null}).promise()},promise:function(a){return null!=a?m.extend(a,d):d}},e={};return d.pipe=d.then,m.each(b,function(a,f){var g=f[2],h=f[3];d[f[1]]=g.add,h&&g.add(function(){c=h},b[1^a][2].disable,b[2][2].lock),e[f[0]]=function(){return e[f[0]+"With"](this===e?d:this,arguments),this},e[f[0]+"With"]=g.fireWith}),d.promise(e),a&&a.call(e,e),e},when:function(a){var b=0,c=d.call(arguments),e=c.length,f=1!==e||a&&m.isFunction(a.promise)?e:0,g=1===f?a:m.Deferred(),h=function(a,b,c){return function(e){b[a]=this,c[a]=arguments.length>1?d.call(arguments):e,c===i?g.notifyWith(b,c):--f||g.resolveWith(b,c)}},i,j,k;if(e>1)for(i=new Array(e),j=new Array(e),k=new Array(e);e>b;b++)c[b]&&m.isFunction(c[b].promise)?c[b].promise().done(h(b,k,c)).fail(g.reject).progress(h(b,j,i)):--f;return f||g.resolveWith(k,c),g.promise()}});var H;m.fn.ready=function(a){return m.ready.promise().done(a),this},m.extend({isReady:!1,readyWait:1,holdReady:function(a){a?m.readyWait++:m.ready(!0)},ready:function(a){if(a===!0?!--m.readyWait:!m.isReady){if(!y.body)return setTimeout(m.ready);m.isReady=!0,a!==!0&&--m.readyWait>0||(H.resolveWith(y,[m]),m.fn.triggerHandler&&(m(y).triggerHandler("ready"),m(y).off("ready")))}}});function I(){y.addEventListener?(y.removeEventListener("DOMContentLoaded",J,!1),a.removeEventListener("load",J,!1)):(y.detachEvent("onreadystatechange",J),a.detachEvent("onload",J))}function J(){(y.addEventListener||"load"===event.type||"complete"===y.readyState)&&(I(),m.ready())}m.ready.promise=function(b){if(!H)if(H=m.Deferred(),"complete"===y.readyState)setTimeout(m.ready);else if(y.addEventListener)y.addEventListener("DOMContentLoaded",J,!1),a.addEventListener("load",J,!1);else{y.attachEvent("onreadystatechange",J),a.attachEvent("onload",J);var c=!1;try{c=null==a.frameElement&&y.documentElement}catch(d){}c&&c.doScroll&&!function e(){if(!m.isReady){try{c.doScroll("left")}catch(a){return setTimeout(e,50)}I(),m.ready()}}()}return H.promise(b)};var K="undefined",L;for(L in m(k))break;k.ownLast="0"!==L,k.inlineBlockNeedsLayout=!1,m(function(){var a,b,c,d;c=y.getElementsByTagName("body")[0],c&&c.style&&(b=y.createElement("div"),d=y.createElement("div"),d.style.cssText="position:absolute;border:0;width:0;height:0;top:0;left:-9999px",c.appendChild(d).appendChild(b),typeof b.style.zoom!==K&&(b.style.cssText="display:inline;margin:0;border:0;padding:1px;width:1px;zoom:1",k.inlineBlockNeedsLayout=a=3===b.offsetWidth,a&&(c.style.zoom=1)),c.removeChild(d))}),function(){var a=y.createElement("div");if(null==k.deleteExpando){k.deleteExpando=!0;try{delete a.test}catch(b){k.deleteExpando=!1}}a=null}(),m.acceptData=function(a){var b=m.noData[(a.nodeName+" ").toLowerCase()],c=+a.nodeType||1;return 1!==c&&9!==c?!1:!b||b!==!0&&a.getAttribute("classid")===b};var M=/^(?:\{[\w\W]*\}|\[[\w\W]*\])$/,N=/([A-Z])/g;function O(a,b,c){if(void 0===c&&1===a.nodeType){var d="data-"+b.replace(N,"-$1").toLowerCase();if(c=a.getAttribute(d),"string"==typeof c){try{c="true"===c?!0:"false"===c?!1:"null"===c?null:+c+""===c?+c:M.test(c)?m.parseJSON(c):c}catch(e){}m.data(a,b,c)}else c=void 0}return c}function P(a){var b;for(b in a)if(("data"!==b||!m.isEmptyObject(a[b]))&&"toJSON"!==b)return!1;return!0}function Q(a,b,d,e){if(m.acceptData(a)){var f,g,h=m.expando,i=a.nodeType,j=i?m.cache:a,k=i?a[h]:a[h]&&h; -if(k&&j[k]&&(e||j[k].data)||void 0!==d||"string"!=typeof b)return k||(k=i?a[h]=c.pop()||m.guid++:h),j[k]||(j[k]=i?{}:{toJSON:m.noop}),("object"==typeof b||"function"==typeof b)&&(e?j[k]=m.extend(j[k],b):j[k].data=m.extend(j[k].data,b)),g=j[k],e||(g.data||(g.data={}),g=g.data),void 0!==d&&(g[m.camelCase(b)]=d),"string"==typeof b?(f=g[b],null==f&&(f=g[m.camelCase(b)])):f=g,f}}function R(a,b,c){if(m.acceptData(a)){var d,e,f=a.nodeType,g=f?m.cache:a,h=f?a[m.expando]:m.expando;if(g[h]){if(b&&(d=c?g[h]:g[h].data)){m.isArray(b)?b=b.concat(m.map(b,m.camelCase)):b in d?b=[b]:(b=m.camelCase(b),b=b in d?[b]:b.split(" ")),e=b.length;while(e--)delete d[b[e]];if(c?!P(d):!m.isEmptyObject(d))return}(c||(delete g[h].data,P(g[h])))&&(f?m.cleanData([a],!0):k.deleteExpando||g!=g.window?delete g[h]:g[h]=null)}}}m.extend({cache:{},noData:{"applet ":!0,"embed ":!0,"object ":"clsid:D27CDB6E-AE6D-11cf-96B8-444553540000"},hasData:function(a){return a=a.nodeType?m.cache[a[m.expando]]:a[m.expando],!!a&&!P(a)},data:function(a,b,c){return Q(a,b,c)},removeData:function(a,b){return R(a,b)},_data:function(a,b,c){return Q(a,b,c,!0)},_removeData:function(a,b){return R(a,b,!0)}}),m.fn.extend({data:function(a,b){var c,d,e,f=this[0],g=f&&f.attributes;if(void 0===a){if(this.length&&(e=m.data(f),1===f.nodeType&&!m._data(f,"parsedAttrs"))){c=g.length;while(c--)g[c]&&(d=g[c].name,0===d.indexOf("data-")&&(d=m.camelCase(d.slice(5)),O(f,d,e[d])));m._data(f,"parsedAttrs",!0)}return e}return"object"==typeof a?this.each(function(){m.data(this,a)}):arguments.length>1?this.each(function(){m.data(this,a,b)}):f?O(f,a,m.data(f,a)):void 0},removeData:function(a){return this.each(function(){m.removeData(this,a)})}}),m.extend({queue:function(a,b,c){var d;return a?(b=(b||"fx")+"queue",d=m._data(a,b),c&&(!d||m.isArray(c)?d=m._data(a,b,m.makeArray(c)):d.push(c)),d||[]):void 0},dequeue:function(a,b){b=b||"fx";var c=m.queue(a,b),d=c.length,e=c.shift(),f=m._queueHooks(a,b),g=function(){m.dequeue(a,b)};"inprogress"===e&&(e=c.shift(),d--),e&&("fx"===b&&c.unshift("inprogress"),delete f.stop,e.call(a,g,f)),!d&&f&&f.empty.fire()},_queueHooks:function(a,b){var c=b+"queueHooks";return m._data(a,c)||m._data(a,c,{empty:m.Callbacks("once memory").add(function(){m._removeData(a,b+"queue"),m._removeData(a,c)})})}}),m.fn.extend({queue:function(a,b){var c=2;return"string"!=typeof a&&(b=a,a="fx",c--),arguments.lengthh;h++)b(a[h],c,g?d:d.call(a[h],h,b(a[h],c)));return e?a:j?b.call(a):i?b(a[0],c):f},W=/^(?:checkbox|radio)$/i;!function(){var a=y.createElement("input"),b=y.createElement("div"),c=y.createDocumentFragment();if(b.innerHTML="
a",k.leadingWhitespace=3===b.firstChild.nodeType,k.tbody=!b.getElementsByTagName("tbody").length,k.htmlSerialize=!!b.getElementsByTagName("link").length,k.html5Clone="<:nav>"!==y.createElement("nav").cloneNode(!0).outerHTML,a.type="checkbox",a.checked=!0,c.appendChild(a),k.appendChecked=a.checked,b.innerHTML="",k.noCloneChecked=!!b.cloneNode(!0).lastChild.defaultValue,c.appendChild(b),b.innerHTML="",k.checkClone=b.cloneNode(!0).cloneNode(!0).lastChild.checked,k.noCloneEvent=!0,b.attachEvent&&(b.attachEvent("onclick",function(){k.noCloneEvent=!1}),b.cloneNode(!0).click()),null==k.deleteExpando){k.deleteExpando=!0;try{delete b.test}catch(d){k.deleteExpando=!1}}}(),function(){var b,c,d=y.createElement("div");for(b in{submit:!0,change:!0,focusin:!0})c="on"+b,(k[b+"Bubbles"]=c in a)||(d.setAttribute(c,"t"),k[b+"Bubbles"]=d.attributes[c].expando===!1);d=null}();var X=/^(?:input|select|textarea)$/i,Y=/^key/,Z=/^(?:mouse|pointer|contextmenu)|click/,$=/^(?:focusinfocus|focusoutblur)$/,_=/^([^.]*)(?:\.(.+)|)$/;function ab(){return!0}function bb(){return!1}function cb(){try{return y.activeElement}catch(a){}}m.event={global:{},add:function(a,b,c,d,e){var f,g,h,i,j,k,l,n,o,p,q,r=m._data(a);if(r){c.handler&&(i=c,c=i.handler,e=i.selector),c.guid||(c.guid=m.guid++),(g=r.events)||(g=r.events={}),(k=r.handle)||(k=r.handle=function(a){return typeof m===K||a&&m.event.triggered===a.type?void 0:m.event.dispatch.apply(k.elem,arguments)},k.elem=a),b=(b||"").match(E)||[""],h=b.length;while(h--)f=_.exec(b[h])||[],o=q=f[1],p=(f[2]||"").split(".").sort(),o&&(j=m.event.special[o]||{},o=(e?j.delegateType:j.bindType)||o,j=m.event.special[o]||{},l=m.extend({type:o,origType:q,data:d,handler:c,guid:c.guid,selector:e,needsContext:e&&m.expr.match.needsContext.test(e),namespace:p.join(".")},i),(n=g[o])||(n=g[o]=[],n.delegateCount=0,j.setup&&j.setup.call(a,d,p,k)!==!1||(a.addEventListener?a.addEventListener(o,k,!1):a.attachEvent&&a.attachEvent("on"+o,k))),j.add&&(j.add.call(a,l),l.handler.guid||(l.handler.guid=c.guid)),e?n.splice(n.delegateCount++,0,l):n.push(l),m.event.global[o]=!0);a=null}},remove:function(a,b,c,d,e){var f,g,h,i,j,k,l,n,o,p,q,r=m.hasData(a)&&m._data(a);if(r&&(k=r.events)){b=(b||"").match(E)||[""],j=b.length;while(j--)if(h=_.exec(b[j])||[],o=q=h[1],p=(h[2]||"").split(".").sort(),o){l=m.event.special[o]||{},o=(d?l.delegateType:l.bindType)||o,n=k[o]||[],h=h[2]&&new RegExp("(^|\\.)"+p.join("\\.(?:.*\\.|)")+"(\\.|$)"),i=f=n.length;while(f--)g=n[f],!e&&q!==g.origType||c&&c.guid!==g.guid||h&&!h.test(g.namespace)||d&&d!==g.selector&&("**"!==d||!g.selector)||(n.splice(f,1),g.selector&&n.delegateCount--,l.remove&&l.remove.call(a,g));i&&!n.length&&(l.teardown&&l.teardown.call(a,p,r.handle)!==!1||m.removeEvent(a,o,r.handle),delete k[o])}else for(o in k)m.event.remove(a,o+b[j],c,d,!0);m.isEmptyObject(k)&&(delete r.handle,m._removeData(a,"events"))}},trigger:function(b,c,d,e){var f,g,h,i,k,l,n,o=[d||y],p=j.call(b,"type")?b.type:b,q=j.call(b,"namespace")?b.namespace.split("."):[];if(h=l=d=d||y,3!==d.nodeType&&8!==d.nodeType&&!$.test(p+m.event.triggered)&&(p.indexOf(".")>=0&&(q=p.split("."),p=q.shift(),q.sort()),g=p.indexOf(":")<0&&"on"+p,b=b[m.expando]?b:new m.Event(p,"object"==typeof b&&b),b.isTrigger=e?2:3,b.namespace=q.join("."),b.namespace_re=b.namespace?new RegExp("(^|\\.)"+q.join("\\.(?:.*\\.|)")+"(\\.|$)"):null,b.result=void 0,b.target||(b.target=d),c=null==c?[b]:m.makeArray(c,[b]),k=m.event.special[p]||{},e||!k.trigger||k.trigger.apply(d,c)!==!1)){if(!e&&!k.noBubble&&!m.isWindow(d)){for(i=k.delegateType||p,$.test(i+p)||(h=h.parentNode);h;h=h.parentNode)o.push(h),l=h;l===(d.ownerDocument||y)&&o.push(l.defaultView||l.parentWindow||a)}n=0;while((h=o[n++])&&!b.isPropagationStopped())b.type=n>1?i:k.bindType||p,f=(m._data(h,"events")||{})[b.type]&&m._data(h,"handle"),f&&f.apply(h,c),f=g&&h[g],f&&f.apply&&m.acceptData(h)&&(b.result=f.apply(h,c),b.result===!1&&b.preventDefault());if(b.type=p,!e&&!b.isDefaultPrevented()&&(!k._default||k._default.apply(o.pop(),c)===!1)&&m.acceptData(d)&&g&&d[p]&&!m.isWindow(d)){l=d[g],l&&(d[g]=null),m.event.triggered=p;try{d[p]()}catch(r){}m.event.triggered=void 0,l&&(d[g]=l)}return b.result}},dispatch:function(a){a=m.event.fix(a);var b,c,e,f,g,h=[],i=d.call(arguments),j=(m._data(this,"events")||{})[a.type]||[],k=m.event.special[a.type]||{};if(i[0]=a,a.delegateTarget=this,!k.preDispatch||k.preDispatch.call(this,a)!==!1){h=m.event.handlers.call(this,a,j),b=0;while((f=h[b++])&&!a.isPropagationStopped()){a.currentTarget=f.elem,g=0;while((e=f.handlers[g++])&&!a.isImmediatePropagationStopped())(!a.namespace_re||a.namespace_re.test(e.namespace))&&(a.handleObj=e,a.data=e.data,c=((m.event.special[e.origType]||{}).handle||e.handler).apply(f.elem,i),void 0!==c&&(a.result=c)===!1&&(a.preventDefault(),a.stopPropagation()))}return k.postDispatch&&k.postDispatch.call(this,a),a.result}},handlers:function(a,b){var c,d,e,f,g=[],h=b.delegateCount,i=a.target;if(h&&i.nodeType&&(!a.button||"click"!==a.type))for(;i!=this;i=i.parentNode||this)if(1===i.nodeType&&(i.disabled!==!0||"click"!==a.type)){for(e=[],f=0;h>f;f++)d=b[f],c=d.selector+" ",void 0===e[c]&&(e[c]=d.needsContext?m(c,this).index(i)>=0:m.find(c,this,null,[i]).length),e[c]&&e.push(d);e.length&&g.push({elem:i,handlers:e})}return h]","i"),hb=/^\s+/,ib=/<(?!area|br|col|embed|hr|img|input|link|meta|param)(([\w:]+)[^>]*)\/>/gi,jb=/<([\w:]+)/,kb=/\s*$/g,rb={option:[1,""],legend:[1,"
","
"],area:[1,"",""],param:[1,"",""],thead:[1,"","
"],tr:[2,"","
"],col:[2,"","
"],td:[3,"","
"],_default:k.htmlSerialize?[0,"",""]:[1,"X
","
"]},sb=db(y),tb=sb.appendChild(y.createElement("div"));rb.optgroup=rb.option,rb.tbody=rb.tfoot=rb.colgroup=rb.caption=rb.thead,rb.th=rb.td;function ub(a,b){var c,d,e=0,f=typeof a.getElementsByTagName!==K?a.getElementsByTagName(b||"*"):typeof a.querySelectorAll!==K?a.querySelectorAll(b||"*"):void 0;if(!f)for(f=[],c=a.childNodes||a;null!=(d=c[e]);e++)!b||m.nodeName(d,b)?f.push(d):m.merge(f,ub(d,b));return void 0===b||b&&m.nodeName(a,b)?m.merge([a],f):f}function vb(a){W.test(a.type)&&(a.defaultChecked=a.checked)}function wb(a,b){return m.nodeName(a,"table")&&m.nodeName(11!==b.nodeType?b:b.firstChild,"tr")?a.getElementsByTagName("tbody")[0]||a.appendChild(a.ownerDocument.createElement("tbody")):a}function xb(a){return a.type=(null!==m.find.attr(a,"type"))+"/"+a.type,a}function yb(a){var b=pb.exec(a.type);return b?a.type=b[1]:a.removeAttribute("type"),a}function zb(a,b){for(var c,d=0;null!=(c=a[d]);d++)m._data(c,"globalEval",!b||m._data(b[d],"globalEval"))}function Ab(a,b){if(1===b.nodeType&&m.hasData(a)){var c,d,e,f=m._data(a),g=m._data(b,f),h=f.events;if(h){delete g.handle,g.events={};for(c in h)for(d=0,e=h[c].length;e>d;d++)m.event.add(b,c,h[c][d])}g.data&&(g.data=m.extend({},g.data))}}function Bb(a,b){var c,d,e;if(1===b.nodeType){if(c=b.nodeName.toLowerCase(),!k.noCloneEvent&&b[m.expando]){e=m._data(b);for(d in e.events)m.removeEvent(b,d,e.handle);b.removeAttribute(m.expando)}"script"===c&&b.text!==a.text?(xb(b).text=a.text,yb(b)):"object"===c?(b.parentNode&&(b.outerHTML=a.outerHTML),k.html5Clone&&a.innerHTML&&!m.trim(b.innerHTML)&&(b.innerHTML=a.innerHTML)):"input"===c&&W.test(a.type)?(b.defaultChecked=b.checked=a.checked,b.value!==a.value&&(b.value=a.value)):"option"===c?b.defaultSelected=b.selected=a.defaultSelected:("input"===c||"textarea"===c)&&(b.defaultValue=a.defaultValue)}}m.extend({clone:function(a,b,c){var d,e,f,g,h,i=m.contains(a.ownerDocument,a);if(k.html5Clone||m.isXMLDoc(a)||!gb.test("<"+a.nodeName+">")?f=a.cloneNode(!0):(tb.innerHTML=a.outerHTML,tb.removeChild(f=tb.firstChild)),!(k.noCloneEvent&&k.noCloneChecked||1!==a.nodeType&&11!==a.nodeType||m.isXMLDoc(a)))for(d=ub(f),h=ub(a),g=0;null!=(e=h[g]);++g)d[g]&&Bb(e,d[g]);if(b)if(c)for(h=h||ub(a),d=d||ub(f),g=0;null!=(e=h[g]);g++)Ab(e,d[g]);else Ab(a,f);return d=ub(f,"script"),d.length>0&&zb(d,!i&&ub(a,"script")),d=h=e=null,f},buildFragment:function(a,b,c,d){for(var e,f,g,h,i,j,l,n=a.length,o=db(b),p=[],q=0;n>q;q++)if(f=a[q],f||0===f)if("object"===m.type(f))m.merge(p,f.nodeType?[f]:f);else if(lb.test(f)){h=h||o.appendChild(b.createElement("div")),i=(jb.exec(f)||["",""])[1].toLowerCase(),l=rb[i]||rb._default,h.innerHTML=l[1]+f.replace(ib,"<$1>")+l[2],e=l[0];while(e--)h=h.lastChild;if(!k.leadingWhitespace&&hb.test(f)&&p.push(b.createTextNode(hb.exec(f)[0])),!k.tbody){f="table"!==i||kb.test(f)?""!==l[1]||kb.test(f)?0:h:h.firstChild,e=f&&f.childNodes.length;while(e--)m.nodeName(j=f.childNodes[e],"tbody")&&!j.childNodes.length&&f.removeChild(j)}m.merge(p,h.childNodes),h.textContent="";while(h.firstChild)h.removeChild(h.firstChild);h=o.lastChild}else p.push(b.createTextNode(f));h&&o.removeChild(h),k.appendChecked||m.grep(ub(p,"input"),vb),q=0;while(f=p[q++])if((!d||-1===m.inArray(f,d))&&(g=m.contains(f.ownerDocument,f),h=ub(o.appendChild(f),"script"),g&&zb(h),c)){e=0;while(f=h[e++])ob.test(f.type||"")&&c.push(f)}return h=null,o},cleanData:function(a,b){for(var d,e,f,g,h=0,i=m.expando,j=m.cache,l=k.deleteExpando,n=m.event.special;null!=(d=a[h]);h++)if((b||m.acceptData(d))&&(f=d[i],g=f&&j[f])){if(g.events)for(e in g.events)n[e]?m.event.remove(d,e):m.removeEvent(d,e,g.handle);j[f]&&(delete j[f],l?delete d[i]:typeof d.removeAttribute!==K?d.removeAttribute(i):d[i]=null,c.push(f))}}}),m.fn.extend({text:function(a){return V(this,function(a){return void 0===a?m.text(this):this.empty().append((this[0]&&this[0].ownerDocument||y).createTextNode(a))},null,a,arguments.length)},append:function(){return this.domManip(arguments,function(a){if(1===this.nodeType||11===this.nodeType||9===this.nodeType){var b=wb(this,a);b.appendChild(a)}})},prepend:function(){return this.domManip(arguments,function(a){if(1===this.nodeType||11===this.nodeType||9===this.nodeType){var b=wb(this,a);b.insertBefore(a,b.firstChild)}})},before:function(){return this.domManip(arguments,function(a){this.parentNode&&this.parentNode.insertBefore(a,this)})},after:function(){return this.domManip(arguments,function(a){this.parentNode&&this.parentNode.insertBefore(a,this.nextSibling)})},remove:function(a,b){for(var c,d=a?m.filter(a,this):this,e=0;null!=(c=d[e]);e++)b||1!==c.nodeType||m.cleanData(ub(c)),c.parentNode&&(b&&m.contains(c.ownerDocument,c)&&zb(ub(c,"script")),c.parentNode.removeChild(c));return this},empty:function(){for(var a,b=0;null!=(a=this[b]);b++){1===a.nodeType&&m.cleanData(ub(a,!1));while(a.firstChild)a.removeChild(a.firstChild);a.options&&m.nodeName(a,"select")&&(a.options.length=0)}return this},clone:function(a,b){return a=null==a?!1:a,b=null==b?a:b,this.map(function(){return m.clone(this,a,b)})},html:function(a){return V(this,function(a){var b=this[0]||{},c=0,d=this.length;if(void 0===a)return 1===b.nodeType?b.innerHTML.replace(fb,""):void 0;if(!("string"!=typeof a||mb.test(a)||!k.htmlSerialize&&gb.test(a)||!k.leadingWhitespace&&hb.test(a)||rb[(jb.exec(a)||["",""])[1].toLowerCase()])){a=a.replace(ib,"<$1>");try{for(;d>c;c++)b=this[c]||{},1===b.nodeType&&(m.cleanData(ub(b,!1)),b.innerHTML=a);b=0}catch(e){}}b&&this.empty().append(a)},null,a,arguments.length)},replaceWith:function(){var a=arguments[0];return this.domManip(arguments,function(b){a=this.parentNode,m.cleanData(ub(this)),a&&a.replaceChild(b,this)}),a&&(a.length||a.nodeType)?this:this.remove()},detach:function(a){return this.remove(a,!0)},domManip:function(a,b){a=e.apply([],a);var c,d,f,g,h,i,j=0,l=this.length,n=this,o=l-1,p=a[0],q=m.isFunction(p);if(q||l>1&&"string"==typeof p&&!k.checkClone&&nb.test(p))return this.each(function(c){var d=n.eq(c);q&&(a[0]=p.call(this,c,d.html())),d.domManip(a,b)});if(l&&(i=m.buildFragment(a,this[0].ownerDocument,!1,this),c=i.firstChild,1===i.childNodes.length&&(i=c),c)){for(g=m.map(ub(i,"script"),xb),f=g.length;l>j;j++)d=i,j!==o&&(d=m.clone(d,!0,!0),f&&m.merge(g,ub(d,"script"))),b.call(this[j],d,j);if(f)for(h=g[g.length-1].ownerDocument,m.map(g,yb),j=0;f>j;j++)d=g[j],ob.test(d.type||"")&&!m._data(d,"globalEval")&&m.contains(h,d)&&(d.src?m._evalUrl&&m._evalUrl(d.src):m.globalEval((d.text||d.textContent||d.innerHTML||"").replace(qb,"")));i=c=null}return this}}),m.each({appendTo:"append",prependTo:"prepend",insertBefore:"before",insertAfter:"after",replaceAll:"replaceWith"},function(a,b){m.fn[a]=function(a){for(var c,d=0,e=[],g=m(a),h=g.length-1;h>=d;d++)c=d===h?this:this.clone(!0),m(g[d])[b](c),f.apply(e,c.get());return this.pushStack(e)}});var Cb,Db={};function Eb(b,c){var d,e=m(c.createElement(b)).appendTo(c.body),f=a.getDefaultComputedStyle&&(d=a.getDefaultComputedStyle(e[0]))?d.display:m.css(e[0],"display");return e.detach(),f}function Fb(a){var b=y,c=Db[a];return c||(c=Eb(a,b),"none"!==c&&c||(Cb=(Cb||m("