summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorByron Jones <glob@mozilla.com>2015-03-10 06:13:49 +0100
committerByron Jones <glob@mozilla.com>2015-03-10 06:13:49 +0100
commit887524670413292b71448bd0c67ab2b786c78b49 (patch)
tree794e276bdc45f081b681357069d61e8aa05be464
parentef96ae157223b3309f7703798b32b0b386b2edff (diff)
downloadbugzilla-887524670413292b71448bd0c67ab2b786c78b49.tar.gz
bugzilla-887524670413292b71448bd0c67ab2b786c78b49.tar.xz
Bug 1139749: backport bug 1128853 to bmo (Bugzilla shouldn't try to write API tokens into the shadow DB)
-rw-r--r--Bugzilla/Template.pm2
-rw-r--r--Bugzilla/Token.pm5
-rw-r--r--extensions/BMO/template/en/default/bug/create/create-automative.html.tmpl1
-rw-r--r--extensions/BMO/template/en/default/bug/create/create-costume.html.tmpl1
-rw-r--r--extensions/BMO/template/en/default/bug/create/create-creative.html.tmpl1
-rw-r--r--extensions/BMO/template/en/default/bug/create/create-data-compliance.html.tmpl1
-rw-r--r--extensions/BMO/template/en/default/bug/create/create-dev-engagement-event.html.tmpl1
-rw-r--r--extensions/BMO/template/en/default/bug/create/create-doc.html.tmpl1
-rw-r--r--extensions/BMO/template/en/default/bug/create/create-finance.html.tmpl1
-rw-r--r--extensions/BMO/template/en/default/bug/create/create-fxos-betaprogram.html.tmpl1
-rw-r--r--extensions/BMO/template/en/default/bug/create/create-fxos-mcts-waiver.html.tmpl1
-rw-r--r--extensions/BMO/template/en/default/bug/create/create-fxos-partner.html.tmpl1
-rw-r--r--extensions/BMO/template/en/default/bug/create/create-fxos-preload-app.html.tmpl1
-rw-r--r--extensions/BMO/template/en/default/bug/create/create-ipp.html.tmpl1
-rw-r--r--extensions/BMO/template/en/default/bug/create/create-itrequest.html.tmpl1
-rw-r--r--extensions/BMO/template/en/default/bug/create/create-legal.html.tmpl1
-rw-r--r--extensions/BMO/template/en/default/bug/create/create-mozlist.html.tmpl1
-rw-r--r--extensions/BMO/template/en/default/bug/create/create-mozpr.html.tmpl1
-rw-r--r--extensions/BMO/template/en/default/bug/create/create-recruiting.html.tmpl13
-rw-r--r--extensions/BMO/template/en/default/bug/create/create-swag.html.tmpl1
-rw-r--r--extensions/BMO/template/en/default/bug/create/create-user-engagement.html.tmpl1
-rw-r--r--extensions/BMO/template/en/default/bug/create/create-web-bounty.html.tmpl1
-rw-r--r--extensions/BMO/template/en/default/bug/create/create-webops-request.html.tmpl1
-rw-r--r--extensions/BMO/template/en/default/bug/create/create-winqual.html.tmpl1
-rw-r--r--extensions/BMO/template/en/default/pages/attachment_bounty_form.html.tmpl1
-rw-r--r--extensions/BMO/template/en/default/pages/group_membership.html.tmpl1
-rw-r--r--extensions/BMO/template/en/default/pages/triage_reports.html.tmpl1
-rw-r--r--extensions/BMO/template/en/default/pages/user_activity.html.tmpl1
-rw-r--r--extensions/GuidedBugEntry/template/en/default/guided/guided.html.tmpl1
-rw-r--r--extensions/MozProjectReview/template/en/default/bug/create/create-moz-project-review.html.tmpl1
-rw-r--r--extensions/MyDashboard/template/en/default/pages/mydashboard.html.tmpl1
-rw-r--r--extensions/ProductDashboard/template/en/default/pages/productdashboard.html.tmpl1
-rw-r--r--extensions/REMO/template/en/default/bug/create/create-mozreps.html.tmpl11
-rw-r--r--extensions/REMO/template/en/default/bug/create/create-remo-budget.html.tmpl1
-rw-r--r--extensions/REMO/template/en/default/bug/create/create-remo-swag.html.tmpl1
-rw-r--r--extensions/REMO/template/en/default/pages/remo-form-payment.html.tmpl1
-rw-r--r--extensions/Review/template/en/default/pages/review_history.html.tmpl1
-rw-r--r--extensions/Splinter/template/en/default/pages/splinter.html.tmpl1
-rw-r--r--extensions/UserProfile/template/en/default/pages/user_profile.html.tmpl1
-rw-r--r--template/en/default/account/prefs/prefs.html.tmpl1
-rw-r--r--template/en/default/admin/components/create.html.tmpl1
-rw-r--r--template/en/default/admin/components/edit.html.tmpl1
-rw-r--r--template/en/default/admin/products/create.html.tmpl1
-rw-r--r--template/en/default/admin/sudo.html.tmpl1
-rw-r--r--template/en/default/attachment/create.html.tmpl1
-rw-r--r--template/en/default/attachment/edit.html.tmpl1
-rw-r--r--template/en/default/bug/create/create.html.tmpl1
-rw-r--r--template/en/default/bug/show-header.html.tmpl1
-rw-r--r--template/en/default/bug/summarize-time.html.tmpl1
-rw-r--r--template/en/default/global/header.html.tmpl4
-rw-r--r--template/en/default/list/list.html.tmpl1
-rw-r--r--template/en/default/request/queue.html.tmpl1
-rw-r--r--template/en/default/search/search-advanced.html.tmpl1
-rw-r--r--template/en/default/search/search-create-series.html.tmpl1
-rw-r--r--template/en/default/search/search-report-graph.html.tmpl1
-rw-r--r--template/en/default/search/search-report-table.html.tmpl1
56 files changed, 72 insertions, 14 deletions
diff --git a/Bugzilla/Template.pm b/Bugzilla/Template.pm
index 94dcdb85d..efc2b5931 100644
--- a/Bugzilla/Template.pm
+++ b/Bugzilla/Template.pm
@@ -1042,8 +1042,6 @@ sub create {
'get_api_token' => sub {
return '' unless Bugzilla->user->id;
- # BMO - hack so we don't create tokens when pointing to the shadow_db
- return '' if Bugzilla->is_shadow_db;
my $cache = Bugzilla->request_cache;
return $cache->{api_token} //= issue_api_token();
},
diff --git a/Bugzilla/Token.pm b/Bugzilla/Token.pm
index 769cb8800..750c36435 100644
--- a/Bugzilla/Token.pm
+++ b/Bugzilla/Token.pm
@@ -450,6 +450,9 @@ sub _create_token {
trick_taint($tokentype);
trick_taint($eventdata);
+ my $is_shadow = Bugzilla->is_shadow_db;
+ $dbh = Bugzilla->switch_to_main_db() if $is_shadow;
+
$dbh->bz_start_transaction();
my $token = GenerateUniqueToken();
@@ -462,8 +465,10 @@ sub _create_token {
if (wantarray) {
my (undef, $token_ts, undef) = GetTokenData($token);
$token_ts = str2time($token_ts);
+ Bugzilla->switch_to_shadow_db() if $is_shadow;
return ($token, $token_ts);
} else {
+ Bugzilla->switch_to_shadow_db() if $is_shadow;
return $token;
}
}
diff --git a/extensions/BMO/template/en/default/bug/create/create-automative.html.tmpl b/extensions/BMO/template/en/default/bug/create/create-automative.html.tmpl
index cbe2da910..62d37e227 100644
--- a/extensions/BMO/template/en/default/bug/create/create-automative.html.tmpl
+++ b/extensions/BMO/template/en/default/bug/create/create-automative.html.tmpl
@@ -82,6 +82,7 @@ function validateAndSubmit() {
[% PROCESS global/header.html.tmpl
title = "Automation Request Form"
+ generate_api_token = 1
style = inline_style
javascript = inline_javascript
javascript_urls = [ 'extensions/BMO/web/js/form_validate.js',
diff --git a/extensions/BMO/template/en/default/bug/create/create-costume.html.tmpl b/extensions/BMO/template/en/default/bug/create/create-costume.html.tmpl
index 5db30bbef..0d8347177 100644
--- a/extensions/BMO/template/en/default/bug/create/create-costume.html.tmpl
+++ b/extensions/BMO/template/en/default/bug/create/create-costume.html.tmpl
@@ -126,6 +126,7 @@ YAHOO.util.Event.onDOMReady(function() {
[% PROCESS global/header.html.tmpl
title = "Firefox Costume Request Form"
+ generate_api_token = 1
style = inline_style
javascript = inline_javascript
javascript_urls = [ 'extensions/BMO/web/js/form_validate.js',
diff --git a/extensions/BMO/template/en/default/bug/create/create-creative.html.tmpl b/extensions/BMO/template/en/default/bug/create/create-creative.html.tmpl
index 56614f926..1e18b71de 100644
--- a/extensions/BMO/template/en/default/bug/create/create-creative.html.tmpl
+++ b/extensions/BMO/template/en/default/bug/create/create-creative.html.tmpl
@@ -111,6 +111,7 @@ function toggleTypeOther(element) {
[% PROCESS global/header.html.tmpl
title = "Creative Initiation Form"
+ generate_api_token = 1
style = inline_style
javascript = inline_javascript
javascript_urls = [ 'extensions/BMO/web/js/form_validate.js',
diff --git a/extensions/BMO/template/en/default/bug/create/create-data-compliance.html.tmpl b/extensions/BMO/template/en/default/bug/create/create-data-compliance.html.tmpl
index 4306ef0e1..f24fd340d 100644
--- a/extensions/BMO/template/en/default/bug/create/create-data-compliance.html.tmpl
+++ b/extensions/BMO/template/en/default/bug/create/create-data-compliance.html.tmpl
@@ -62,6 +62,7 @@
[% PROCESS global/header.html.tmpl
title = "Data Compliance Form"
+ generate_api_token = 1
style = inline_css
style_urls = [ 'skins/standard/enter_bug.css' ]
javascript = inline_javascript
diff --git a/extensions/BMO/template/en/default/bug/create/create-dev-engagement-event.html.tmpl b/extensions/BMO/template/en/default/bug/create/create-dev-engagement-event.html.tmpl
index c2f609727..ee1a29bba 100644
--- a/extensions/BMO/template/en/default/bug/create/create-dev-engagement-event.html.tmpl
+++ b/extensions/BMO/template/en/default/bug/create/create-dev-engagement-event.html.tmpl
@@ -39,6 +39,7 @@
[% PROCESS global/header.html.tmpl
title = "Developer Events Request Form"
+ generate_api_token = 1
style = inline_css
style_urls = [ 'skins/standard/enter_bug.css' ]
javascript_urls = [ 'js/field.js',
diff --git a/extensions/BMO/template/en/default/bug/create/create-doc.html.tmpl b/extensions/BMO/template/en/default/bug/create/create-doc.html.tmpl
index 5b75976d9..00ea21c0f 100644
--- a/extensions/BMO/template/en/default/bug/create/create-doc.html.tmpl
+++ b/extensions/BMO/template/en/default/bug/create/create-doc.html.tmpl
@@ -35,6 +35,7 @@ function validateAndSubmit() {
[% PROCESS global/header.html.tmpl
title = "Developer Documentation Request"
+ generate_api_token = 1
style = inline_style
javascript = inline_javascript
javascript_urls = [ 'extensions/BMO/web/js/form_validate.js',
diff --git a/extensions/BMO/template/en/default/bug/create/create-finance.html.tmpl b/extensions/BMO/template/en/default/bug/create/create-finance.html.tmpl
index fa8dc5f5b..d7734f042 100644
--- a/extensions/BMO/template/en/default/bug/create/create-finance.html.tmpl
+++ b/extensions/BMO/template/en/default/bug/create/create-finance.html.tmpl
@@ -62,6 +62,7 @@
[% PROCESS global/header.html.tmpl
title = "Finance"
+ generate_api_token = 1
style = inline_style
style_urls = [ 'skins/standard/enter_bug.css' ]
javascript = inline_js
diff --git a/extensions/BMO/template/en/default/bug/create/create-fxos-betaprogram.html.tmpl b/extensions/BMO/template/en/default/bug/create/create-fxos-betaprogram.html.tmpl
index 3f8bbdd71..3b8a3fe67 100644
--- a/extensions/BMO/template/en/default/bug/create/create-fxos-betaprogram.html.tmpl
+++ b/extensions/BMO/template/en/default/bug/create/create-fxos-betaprogram.html.tmpl
@@ -57,6 +57,7 @@
[% PROCESS global/header.html.tmpl
title = "Firefox OS Beta Program $terms.Bug Submission"
+ generate_api_token = 1
style = inline_css
style_urls = [ 'skins/standard/enter_bug.css' ]
javascript = inline_js
diff --git a/extensions/BMO/template/en/default/bug/create/create-fxos-mcts-waiver.html.tmpl b/extensions/BMO/template/en/default/bug/create/create-fxos-mcts-waiver.html.tmpl
index bfd624a8a..da75f7eb2 100644
--- a/extensions/BMO/template/en/default/bug/create/create-fxos-mcts-waiver.html.tmpl
+++ b/extensions/BMO/template/en/default/bug/create/create-fxos-mcts-waiver.html.tmpl
@@ -84,6 +84,7 @@ function validateAndSubmit() {
[% PROCESS global/header.html.tmpl
title = "Firefox OS MCTS Waiver Form"
+ generate_api_token = 1
style = inline_style
javascript = inline_javascript
javascript_urls = [ 'extensions/BMO/web/js/form_validate.js',
diff --git a/extensions/BMO/template/en/default/bug/create/create-fxos-partner.html.tmpl b/extensions/BMO/template/en/default/bug/create/create-fxos-partner.html.tmpl
index 3e910990d..69030bd3f 100644
--- a/extensions/BMO/template/en/default/bug/create/create-fxos-partner.html.tmpl
+++ b/extensions/BMO/template/en/default/bug/create/create-fxos-partner.html.tmpl
@@ -66,6 +66,7 @@
[% PROCESS global/header.html.tmpl
title = "Firefox OS Partner $terms.Bug Submission"
+ generate_api_token = 1
style_urls = [ 'skins/standard/enter_bug.css' ]
javascript = inline_js
javascript_urls = [ 'extensions/BMO/web/js/form_validate.js',
diff --git a/extensions/BMO/template/en/default/bug/create/create-fxos-preload-app.html.tmpl b/extensions/BMO/template/en/default/bug/create/create-fxos-preload-app.html.tmpl
index 7d7a16d06..105dc13ac 100644
--- a/extensions/BMO/template/en/default/bug/create/create-fxos-preload-app.html.tmpl
+++ b/extensions/BMO/template/en/default/bug/create/create-fxos-preload-app.html.tmpl
@@ -82,6 +82,7 @@ function validateAndSubmit() {
[% PROCESS global/header.html.tmpl
title = "Firefox OS Pre-load App"
+ generate_api_token = 1
style = inline_style
javascript = inline_javascript
javascript_urls = [ 'extensions/BMO/web/js/form_validate.js',
diff --git a/extensions/BMO/template/en/default/bug/create/create-ipp.html.tmpl b/extensions/BMO/template/en/default/bug/create/create-ipp.html.tmpl
index fb59cfeb3..5e5e3b6c2 100644
--- a/extensions/BMO/template/en/default/bug/create/create-ipp.html.tmpl
+++ b/extensions/BMO/template/en/default/bug/create/create-ipp.html.tmpl
@@ -56,6 +56,7 @@ function validateAndSubmit() {
[% PROCESS global/header.html.tmpl
title = "Internet Public Policy Issue"
+ generate_api_token = 1
style = inline_style
javascript = inline_javascript
javascript_urls = [ 'extensions/BMO/web/js/form_validate.js',
diff --git a/extensions/BMO/template/en/default/bug/create/create-itrequest.html.tmpl b/extensions/BMO/template/en/default/bug/create/create-itrequest.html.tmpl
index e3ff09284..ead28cd03 100644
--- a/extensions/BMO/template/en/default/bug/create/create-itrequest.html.tmpl
+++ b/extensions/BMO/template/en/default/bug/create/create-itrequest.html.tmpl
@@ -81,6 +81,7 @@
[% PROCESS global/header.html.tmpl
title = "Mozilla Corporation/Foundation IT Requests"
+ generate_api_token = 1
javascript = inline_javascript
javascript_urls = [ 'js/field.js' ]
yui = [ 'autocomplete' ]
diff --git a/extensions/BMO/template/en/default/bug/create/create-legal.html.tmpl b/extensions/BMO/template/en/default/bug/create/create-legal.html.tmpl
index 5abe79597..1b950475c 100644
--- a/extensions/BMO/template/en/default/bug/create/create-legal.html.tmpl
+++ b/extensions/BMO/template/en/default/bug/create/create-legal.html.tmpl
@@ -23,6 +23,7 @@
[% PROCESS global/header.html.tmpl
title = "Mozilla Corporation Legal Requests"
+ generate_api_token = 1
style_urls = [ 'skins/standard/attachment.css' ]
javascript_urls = [ 'js/attachment.js', 'js/field.js' ]
yui = [ 'autocomplete' ]
diff --git a/extensions/BMO/template/en/default/bug/create/create-mozlist.html.tmpl b/extensions/BMO/template/en/default/bug/create/create-mozlist.html.tmpl
index 38c08c72f..078c82272 100644
--- a/extensions/BMO/template/en/default/bug/create/create-mozlist.html.tmpl
+++ b/extensions/BMO/template/en/default/bug/create/create-mozlist.html.tmpl
@@ -10,6 +10,7 @@
[% PROCESS global/header.html.tmpl
title = "Mozilla Discussion Forum"
+ generate_api_token = 1
javascript_urls = [ 'extensions/BMO/web/js/form_validate.js',
'js/field.js' ]
yui = [ 'autocomplete' ]
diff --git a/extensions/BMO/template/en/default/bug/create/create-mozpr.html.tmpl b/extensions/BMO/template/en/default/bug/create/create-mozpr.html.tmpl
index 2f0d8c2dd..91921b43e 100644
--- a/extensions/BMO/template/en/default/bug/create/create-mozpr.html.tmpl
+++ b/extensions/BMO/template/en/default/bug/create/create-mozpr.html.tmpl
@@ -269,6 +269,7 @@ function validate_form() {
[% PROCESS global/header.html.tmpl
title = "PR Project Form"
+ generate_api_token = 1
style = inline_style
javascript = inline_javascript
javascript_urls = [ 'extensions/BMO/web/js/form_validate.js',
diff --git a/extensions/BMO/template/en/default/bug/create/create-recruiting.html.tmpl b/extensions/BMO/template/en/default/bug/create/create-recruiting.html.tmpl
index 62ca60e61..b6033275b 100644
--- a/extensions/BMO/template/en/default/bug/create/create-recruiting.html.tmpl
+++ b/extensions/BMO/template/en/default/bug/create/create-recruiting.html.tmpl
@@ -58,12 +58,13 @@ function jobDescToggle(what) {
[% END %]
[% PROCESS global/header.html.tmpl
- title = "Mozilla Corporation HR and Recruiting Requests"
- style_urls = [ 'skins/standard/attachment.css' ]
- javascript_urls = [ 'js/attachment.js', 'js/field.js' ]
- style = inline_style
- javascript = inline_javascript
- yui = [ 'autocomplete' ]
+ title = "Mozilla Corporation HR and Recruiting Requests"
+ generate_api_token = 1
+ style_urls = [ 'skins/standard/attachment.css' ]
+ javascript_urls = [ 'js/attachment.js', 'js/field.js' ]
+ style = inline_style
+ javascript = inline_javascript
+ yui = [ 'autocomplete' ]
%]
[% IF user.in_group("mozilla-employee-confidential")
diff --git a/extensions/BMO/template/en/default/bug/create/create-swag.html.tmpl b/extensions/BMO/template/en/default/bug/create/create-swag.html.tmpl
index b766e324b..8d2b14881 100644
--- a/extensions/BMO/template/en/default/bug/create/create-swag.html.tmpl
+++ b/extensions/BMO/template/en/default/bug/create/create-swag.html.tmpl
@@ -582,6 +582,7 @@ function showGear() {
[% PROCESS global/header.html.tmpl
title = "Mozilla Gear"
+ generate_api_token = 1
style = inline_style
javascript = inline_javascript
javascript_urls = [ 'extensions/BMO/web/js/form_validate.js',
diff --git a/extensions/BMO/template/en/default/bug/create/create-user-engagement.html.tmpl b/extensions/BMO/template/en/default/bug/create/create-user-engagement.html.tmpl
index f523b205b..a6d5b8e1f 100644
--- a/extensions/BMO/template/en/default/bug/create/create-user-engagement.html.tmpl
+++ b/extensions/BMO/template/en/default/bug/create/create-user-engagement.html.tmpl
@@ -76,6 +76,7 @@ function toggleGoalOther() {
[% PROCESS global/header.html.tmpl
title = "User Engagement Form"
+ generate_api_token = 1
style = inline_style
javascript = inline_javascript
javascript_urls = [ 'extensions/BMO/web/js/form_validate.js',
diff --git a/extensions/BMO/template/en/default/bug/create/create-web-bounty.html.tmpl b/extensions/BMO/template/en/default/bug/create/create-web-bounty.html.tmpl
index a15543375..0be58f813 100644
--- a/extensions/BMO/template/en/default/bug/create/create-web-bounty.html.tmpl
+++ b/extensions/BMO/template/en/default/bug/create/create-web-bounty.html.tmpl
@@ -59,6 +59,7 @@ function validateAndSubmit() {
[% PROCESS global/header.html.tmpl
title = "Web Bounty Form"
+ generate_api_token = 1
style = inline_style
javascript = inline_javascript
javascript_urls = [ 'extensions/BMO/web/js/form_validate.js',
diff --git a/extensions/BMO/template/en/default/bug/create/create-webops-request.html.tmpl b/extensions/BMO/template/en/default/bug/create/create-webops-request.html.tmpl
index 83197a755..54a09c2de 100644
--- a/extensions/BMO/template/en/default/bug/create/create-webops-request.html.tmpl
+++ b/extensions/BMO/template/en/default/bug/create/create-webops-request.html.tmpl
@@ -66,6 +66,7 @@ function validateAndSubmit() {
[% PROCESS global/header.html.tmpl
title = "WebOps Request Form"
+ generate_api_token = 1
style = inline_style
javascript = inline_javascript
javascript_urls = [ 'extensions/BMO/web/js/form_validate.js',
diff --git a/extensions/BMO/template/en/default/bug/create/create-winqual.html.tmpl b/extensions/BMO/template/en/default/bug/create/create-winqual.html.tmpl
index fd21ed4ed..524ec6781 100644
--- a/extensions/BMO/template/en/default/bug/create/create-winqual.html.tmpl
+++ b/extensions/BMO/template/en/default/bug/create/create-winqual.html.tmpl
@@ -30,6 +30,7 @@
[% PROCESS global/header.html.tmpl
title = title
+ generate_api_token = 1
yui = [ 'autocomplete', 'calendar', 'datatable', 'button' ]
style_urls = [ 'skins/standard/attachment.css',
'skins/standard/enter_bug.css',
diff --git a/extensions/BMO/template/en/default/pages/attachment_bounty_form.html.tmpl b/extensions/BMO/template/en/default/pages/attachment_bounty_form.html.tmpl
index 230fab3d9..e458d0111 100644
--- a/extensions/BMO/template/en/default/pages/attachment_bounty_form.html.tmpl
+++ b/extensions/BMO/template/en/default/pages/attachment_bounty_form.html.tmpl
@@ -119,6 +119,7 @@ function validateAndSubmit() {
[% PROCESS global/header.html.tmpl
title = "Bounty Attachment Form"
+ generate_api_token = 1
style = inline_style
javascript = inline_javascript
javascript_urls = [ 'extensions/BMO/web/js/form_validate.js',
diff --git a/extensions/BMO/template/en/default/pages/group_membership.html.tmpl b/extensions/BMO/template/en/default/pages/group_membership.html.tmpl
index 32484b13f..9218d44ed 100644
--- a/extensions/BMO/template/en/default/pages/group_membership.html.tmpl
+++ b/extensions/BMO/template/en/default/pages/group_membership.html.tmpl
@@ -8,6 +8,7 @@
[% PROCESS global/header.html.tmpl
title = "Group Membership Report"
+ generate_api_token = 1
yui = [ 'autocomplete' ]
style_urls = [ "extensions/BMO/web/styles/reports.css" ]
javascript_urls = [ "js/field.js" ]
diff --git a/extensions/BMO/template/en/default/pages/triage_reports.html.tmpl b/extensions/BMO/template/en/default/pages/triage_reports.html.tmpl
index a7f26e86d..a8cc85509 100644
--- a/extensions/BMO/template/en/default/pages/triage_reports.html.tmpl
+++ b/extensions/BMO/template/en/default/pages/triage_reports.html.tmpl
@@ -40,6 +40,7 @@ var selected_components = [
[% INCLUDE global/header.html.tmpl
title = "Triage Reports"
+ generate_api_token = 1
yui = [ 'autocomplete', 'calendar' ]
javascript = js_data
javascript_urls = [ "js/util.js", "js/field.js", "js/productform.js",
diff --git a/extensions/BMO/template/en/default/pages/user_activity.html.tmpl b/extensions/BMO/template/en/default/pages/user_activity.html.tmpl
index c9b46b2eb..2ba463247 100644
--- a/extensions/BMO/template/en/default/pages/user_activity.html.tmpl
+++ b/extensions/BMO/template/en/default/pages/user_activity.html.tmpl
@@ -14,6 +14,7 @@
[% INCLUDE global/header.html.tmpl
title = "User Activity Report" _ who_title
+ generate_api_token = 1
yui = [ 'autocomplete', 'calendar' ]
javascript_urls = [ "js/util.js", "js/field.js" ]
style_urls = [ "extensions/BMO/web/styles/reports.css" ]
diff --git a/extensions/GuidedBugEntry/template/en/default/guided/guided.html.tmpl b/extensions/GuidedBugEntry/template/en/default/guided/guided.html.tmpl
index 943370719..c3119810b 100644
--- a/extensions/GuidedBugEntry/template/en/default/guided/guided.html.tmpl
+++ b/extensions/GuidedBugEntry/template/en/default/guided/guided.html.tmpl
@@ -16,6 +16,7 @@
[% PROCESS global/header.html.tmpl
title = "Enter A Bug"
+ generate_api_token = 1
javascript_urls = js_urls
style_urls = [ 'extensions/GuidedBugEntry/web/style/guided.css',
'js/yui/assets/skins/sam/container.css' ]
diff --git a/extensions/MozProjectReview/template/en/default/bug/create/create-moz-project-review.html.tmpl b/extensions/MozProjectReview/template/en/default/bug/create/create-moz-project-review.html.tmpl
index d3a2a7253..748ed2845 100644
--- a/extensions/MozProjectReview/template/en/default/bug/create/create-moz-project-review.html.tmpl
+++ b/extensions/MozProjectReview/template/en/default/bug/create/create-moz-project-review.html.tmpl
@@ -10,6 +10,7 @@
[% PROCESS global/header.html.tmpl
title = "Mozilla Project Review"
+ generate_api_token = 1
style_urls = [ 'extensions/MozProjectReview/web/style/moz_project_review.css' ]
javascript_urls = [ 'js/field.js', 'js/util.js',
'extensions/MozProjectReview/web/js/moz_project_review.js' ]
diff --git a/extensions/MyDashboard/template/en/default/pages/mydashboard.html.tmpl b/extensions/MyDashboard/template/en/default/pages/mydashboard.html.tmpl
index 350c8d0aa..eda53ebe4 100644
--- a/extensions/MyDashboard/template/en/default/pages/mydashboard.html.tmpl
+++ b/extensions/MyDashboard/template/en/default/pages/mydashboard.html.tmpl
@@ -10,6 +10,7 @@
[% PROCESS global/header.html.tmpl
title = "My Dashboard"
+ generate_api_token = 1
style_urls = [ "extensions/MyDashboard/web/styles/mydashboard.css",
"extensions/ProdCompSearch/web/styles/prod_comp_search.css" ]
yui = ["json", "connection"],
diff --git a/extensions/ProductDashboard/template/en/default/pages/productdashboard.html.tmpl b/extensions/ProductDashboard/template/en/default/pages/productdashboard.html.tmpl
index ac588ac26..c8d3111fa 100644
--- a/extensions/ProductDashboard/template/en/default/pages/productdashboard.html.tmpl
+++ b/extensions/ProductDashboard/template/en/default/pages/productdashboard.html.tmpl
@@ -33,6 +33,7 @@
[% filtered_product = product.name FILTER html %]
[% PROCESS global/header.html.tmpl
title = "Product Dashboard: $filtered_product"
+ generate_api_token = 1
style_urls = [ "skins/standard/buglist.css",
"js/yui/assets/skins/sam/paginator.css",
"extensions/ProductDashboard/web/styles/productdashboard.css" ]
diff --git a/extensions/REMO/template/en/default/bug/create/create-mozreps.html.tmpl b/extensions/REMO/template/en/default/bug/create/create-mozreps.html.tmpl
index 420c6a8cd..6a5794121 100644
--- a/extensions/REMO/template/en/default/bug/create/create-mozreps.html.tmpl
+++ b/extensions/REMO/template/en/default/bug/create/create-mozreps.html.tmpl
@@ -20,11 +20,12 @@
[% PROCESS global/variables.none.tmpl %]
[% PROCESS global/header.html.tmpl
- title = "Mozilla Reps - Application Form"
- style_urls = [ "extensions/REMO/web/styles/moz_reps.css" ]
- yui = [ "autocomplete" ]
- jquery = []
- javascript_urls = [ "extensions/REMO/web/js/moz_reps.js", "js/field.js", "js/util.js"]
+ title = "Mozilla Reps - Application Form"
+ generate_api_token = 1
+ style_urls = [ "extensions/REMO/web/styles/moz_reps.css" ]
+ yui = [ "autocomplete" ]
+ jquery = []
+ javascript_urls = [ "extensions/REMO/web/js/moz_reps.js", "js/field.js", "js/util.js"]
%]
<noscript>
diff --git a/extensions/REMO/template/en/default/bug/create/create-remo-budget.html.tmpl b/extensions/REMO/template/en/default/bug/create/create-remo-budget.html.tmpl
index 6e393612c..5f5291d32 100644
--- a/extensions/REMO/template/en/default/bug/create/create-remo-budget.html.tmpl
+++ b/extensions/REMO/template/en/default/bug/create/create-remo-budget.html.tmpl
@@ -10,6 +10,7 @@
[% PROCESS global/header.html.tmpl
title = "Mozilla Reps Budget Request Form"
+ generate_api_token = 1
style_urls = [ 'extensions/REMO/web/styles/moz_reps.css' ]
javascript_urls = [ 'extensions/REMO/web/js/form_validate.js',
'js/util.js',
diff --git a/extensions/REMO/template/en/default/bug/create/create-remo-swag.html.tmpl b/extensions/REMO/template/en/default/bug/create/create-remo-swag.html.tmpl
index 70fba6cb8..9cec10f38 100644
--- a/extensions/REMO/template/en/default/bug/create/create-remo-swag.html.tmpl
+++ b/extensions/REMO/template/en/default/bug/create/create-remo-swag.html.tmpl
@@ -10,6 +10,7 @@
[% PROCESS global/header.html.tmpl
title = "Mozilla Reps Swag Request Form"
+ generate_api_token = 1
javascript_urls = [ 'extensions/REMO/web/js/swag.js',
'extensions/REMO/web/js/form_validate.js',
'js/field.js',
diff --git a/extensions/REMO/template/en/default/pages/remo-form-payment.html.tmpl b/extensions/REMO/template/en/default/pages/remo-form-payment.html.tmpl
index 0f5f206d3..ad5cbdb45 100644
--- a/extensions/REMO/template/en/default/pages/remo-form-payment.html.tmpl
+++ b/extensions/REMO/template/en/default/pages/remo-form-payment.html.tmpl
@@ -22,6 +22,7 @@
[% PROCESS global/header.html.tmpl
title = "Mozilla Reps Payment Form"
+ generate_api_token = 1
style_urls = [ 'extensions/REMO/web/styles/moz_reps.css' ]
javascript_urls = [ 'extensions/REMO/web/js/form_validate.js',
'js/util.js',
diff --git a/extensions/Review/template/en/default/pages/review_history.html.tmpl b/extensions/Review/template/en/default/pages/review_history.html.tmpl
index 32ac83ceb..98acf4cb8 100644
--- a/extensions/Review/template/en/default/pages/review_history.html.tmpl
+++ b/extensions/Review/template/en/default/pages/review_history.html.tmpl
@@ -10,6 +10,7 @@
[% PROCESS global/header.html.tmpl
title = "Review History"
+ generate_api_token = 1
style_urls = [ "extensions/Review/web/styles/review_history.css" ]
javascript_urls = [ 'js/yui3/yui/yui-min.js',
'extensions/Review/web/js/review_history.js',
diff --git a/extensions/Splinter/template/en/default/pages/splinter.html.tmpl b/extensions/Splinter/template/en/default/pages/splinter.html.tmpl
index 9b759ab6e..bfb6e2fcb 100644
--- a/extensions/Splinter/template/en/default/pages/splinter.html.tmpl
+++ b/extensions/Splinter/template/en/default/pages/splinter.html.tmpl
@@ -25,6 +25,7 @@
[% PROCESS global/header.html.tmpl
title = "Patch Review"
+ generate_api_token = 1
header = "Patch Review"
style_urls = [ "js/yui/assets/skins/sam/container.css",
"js/yui/assets/skins/sam/button.css",
diff --git a/extensions/UserProfile/template/en/default/pages/user_profile.html.tmpl b/extensions/UserProfile/template/en/default/pages/user_profile.html.tmpl
index d690e40df..617ee1f2b 100644
--- a/extensions/UserProfile/template/en/default/pages/user_profile.html.tmpl
+++ b/extensions/UserProfile/template/en/default/pages/user_profile.html.tmpl
@@ -15,6 +15,7 @@
[% END %]
[% PROCESS global/header.html.tmpl
title = "User Profile: $filtered_identity"
+ generate_api_token = 1
style_urls = [ "extensions/UserProfile/web/styles/user_profile.css" ]
yui = [ 'autocomplete' ]
javascript_urls = [ "js/field.js" ]
diff --git a/template/en/default/account/prefs/prefs.html.tmpl b/template/en/default/account/prefs/prefs.html.tmpl
index 65649b814..289a155ea 100644
--- a/template/en/default/account/prefs/prefs.html.tmpl
+++ b/template/en/default/account/prefs/prefs.html.tmpl
@@ -39,6 +39,7 @@
[% PROCESS global/header.html.tmpl
title = "User Preferences"
subheader = filtered_login
+ generate_api_token = 1
style_urls = ['skins/standard/admin.css']
javascript_urls = ['js/util.js', 'js/field.js', 'js/TUI.js']
doc_section = "userpreferences.html"
diff --git a/template/en/default/admin/components/create.html.tmpl b/template/en/default/admin/components/create.html.tmpl
index c3b691d83..a95d45399 100644
--- a/template/en/default/admin/components/create.html.tmpl
+++ b/template/en/default/admin/components/create.html.tmpl
@@ -29,6 +29,7 @@
yui = [ 'autocomplete' ]
javascript_urls = [ "js/field.js" ]
title = title
+ generate_api_token = 1
%]
<form method="post" action="editcomponents.cgi">
diff --git a/template/en/default/admin/components/edit.html.tmpl b/template/en/default/admin/components/edit.html.tmpl
index 5236186cc..874310ac8 100644
--- a/template/en/default/admin/components/edit.html.tmpl
+++ b/template/en/default/admin/components/edit.html.tmpl
@@ -33,6 +33,7 @@
[% END %]
[% PROCESS global/header.html.tmpl
title = title
+ generate_api_token = 1
yui = [ 'autocomplete' ]
javascript_urls = [ "js/field.js" ]
%]
diff --git a/template/en/default/admin/products/create.html.tmpl b/template/en/default/admin/products/create.html.tmpl
index 3af81fb23..d2167c64b 100644
--- a/template/en/default/admin/products/create.html.tmpl
+++ b/template/en/default/admin/products/create.html.tmpl
@@ -24,6 +24,7 @@
[% PROCESS global/header.html.tmpl
title = title
+ generate_api_token = 1
style_urls = ['skins/standard/admin.css']
javascript_urls = ['js/util.js']
%]
diff --git a/template/en/default/admin/sudo.html.tmpl b/template/en/default/admin/sudo.html.tmpl
index 676959c34..c96a68ec1 100644
--- a/template/en/default/admin/sudo.html.tmpl
+++ b/template/en/default/admin/sudo.html.tmpl
@@ -22,6 +22,7 @@
[% PROCESS global/header.html.tmpl
title = "Begin sudo session"
+ generate_api_token = 1
style_urls = ['skins/standard/admin.css']
doc_section = "useradmin.html#impersonatingusers"
%]
diff --git a/template/en/default/attachment/create.html.tmpl b/template/en/default/attachment/create.html.tmpl
index ad2b13a99..0380f7ddd 100644
--- a/template/en/default/attachment/create.html.tmpl
+++ b/template/en/default/attachment/create.html.tmpl
@@ -33,6 +33,7 @@
title = title
header = header
subheader = subheader
+ generate_api_token = 1
style_urls = [ 'skins/standard/attachment.css' ]
yui = [ 'autocomplete' ]
javascript_urls = [ "js/attachment.js", 'js/field.js', "js/util.js", "js/TUI.js" ]
diff --git a/template/en/default/attachment/edit.html.tmpl b/template/en/default/attachment/edit.html.tmpl
index e29c45c94..9a1763642 100644
--- a/template/en/default/attachment/edit.html.tmpl
+++ b/template/en/default/attachment/edit.html.tmpl
@@ -37,6 +37,7 @@
title = title
header = header
subheader = subheader
+ generate_api_token = 1
doc_section = "attachments.html"
javascript_urls = ['js/attachment.js', 'js/field.js']
style_urls = ['skins/standard/attachment.css']
diff --git a/template/en/default/bug/create/create.html.tmpl b/template/en/default/bug/create/create.html.tmpl
index 4e37e20bf..e258a0d73 100644
--- a/template/en/default/bug/create/create.html.tmpl
+++ b/template/en/default/bug/create/create.html.tmpl
@@ -30,6 +30,7 @@
[% PROCESS global/header.html.tmpl
title = title
+ generate_api_token = 1
yui = [ 'autocomplete', 'calendar', 'datatable', 'button' ]
style_urls = [ 'skins/standard/attachment.css',
'skins/standard/enter_bug.css',
diff --git a/template/en/default/bug/show-header.html.tmpl b/template/en/default/bug/show-header.html.tmpl
index 062e1aa82..4fc1ebe0f 100644
--- a/template/en/default/bug/show-header.html.tmpl
+++ b/template/en/default/bug/show-header.html.tmpl
@@ -36,6 +36,7 @@
[% title = title _ "($bug.alias) " %]
[% END %]
[% title = title _ filtered_desc %]
+[% generate_api_token = 1 %]
[% header = "$terms.Bug&nbsp;$bug.bug_id" %]
[% header_addl_info = "Last modified: $filtered_timestamp" %]
[% yui = ['autocomplete', 'calendar'] %]
diff --git a/template/en/default/bug/summarize-time.html.tmpl b/template/en/default/bug/summarize-time.html.tmpl
index 21c26e8c8..0166539ea 100644
--- a/template/en/default/bug/summarize-time.html.tmpl
+++ b/template/en/default/bug/summarize-time.html.tmpl
@@ -29,6 +29,7 @@
[% PROCESS global/header.html.tmpl
title = title
+ generate_api_token = 1
header = header
style_urls = ["skins/standard/summarize-time.css"]
doc_section = "timetracking.html"
diff --git a/template/en/default/global/header.html.tmpl b/template/en/default/global/header.html.tmpl
index 3151a96dd..5528a96c2 100644
--- a/template/en/default/global/header.html.tmpl
+++ b/template/en/default/global/header.html.tmpl
@@ -35,6 +35,7 @@
# style_urls: list. List of URLs to CSS style sheets.
# message: string. A message to display to the user. May contain HTML.
# atomlink: Atom link URL, May contain HTML
+ # generate_api_token: generate a token which can be used to make authenticated webservice calls
#%]
[% IF message %]
@@ -52,6 +53,7 @@
no_yui = 0
jquery = []
jquery_css = []
+ generate_api_token = 0
%]
[% IF NOT no_yui %]
@@ -226,7 +228,7 @@
version_required:
'You must select a Version for this [% terms.bug %].'
}
- [% IF javascript_urls.containsany(['js/bug.js', 'js/field.js', 'js/comment-tagging.js']) %]
+ [% IF generate_api_token %]
, api_token: '[% get_api_token FILTER js FILTER html %]'
[% END %]
};
diff --git a/template/en/default/list/list.html.tmpl b/template/en/default/list/list.html.tmpl
index e7b635395..73e58c30f 100644
--- a/template/en/default/list/list.html.tmpl
+++ b/template/en/default/list/list.html.tmpl
@@ -45,6 +45,7 @@
[% url_filtered_title = title FILTER uri %]
[% PROCESS global/header.html.tmpl
title = title
+ generate_api_token = dotweak
style = style
atomlink = "buglist.cgi?$urlquerypart&title=$url_filtered_title&ctype=atom"
yui = [ 'autocomplete', 'calendar' ]
diff --git a/template/en/default/request/queue.html.tmpl b/template/en/default/request/queue.html.tmpl
index e9862f7c3..d1920a132 100644
--- a/template/en/default/request/queue.html.tmpl
+++ b/template/en/default/request/queue.html.tmpl
@@ -25,6 +25,7 @@
[% PROCESS global/header.html.tmpl
title="Request Queue"
+ generate_api_token = 1
onload="var f = document.request_form; selectProduct(f.product, f.component, null, null, 'Any');"
javascript_urls=["js/productform.js", "js/field.js"]
style_urls = ['skins/standard/buglist.css']
diff --git a/template/en/default/search/search-advanced.html.tmpl b/template/en/default/search/search-advanced.html.tmpl
index 780d54edd..f42a9cb00 100644
--- a/template/en/default/search/search-advanced.html.tmpl
+++ b/template/en/default/search/search-advanced.html.tmpl
@@ -42,6 +42,7 @@ function remove_token() {
[% PROCESS global/header.html.tmpl
title = "Search for $terms.bugs"
+ generate_api_token = 1
onload = "doOnSelectProduct(0);"
javascript = js_data
yui = [ 'autocomplete', 'calendar' ]
diff --git a/template/en/default/search/search-create-series.html.tmpl b/template/en/default/search/search-create-series.html.tmpl
index 3ca68ac49..85d54e51c 100644
--- a/template/en/default/search/search-create-series.html.tmpl
+++ b/template/en/default/search/search-create-series.html.tmpl
@@ -32,6 +32,7 @@
[% PROCESS global/header.html.tmpl
title = "Create New Data Set"
+ generate_api_token = 1
onload = "doOnSelectProduct(0);"
yui = [ 'autocomplete', 'calendar' ]
javascript = js_data
diff --git a/template/en/default/search/search-report-graph.html.tmpl b/template/en/default/search/search-report-graph.html.tmpl
index 3c894cf73..383e10220 100644
--- a/template/en/default/search/search-report-graph.html.tmpl
+++ b/template/en/default/search/search-report-graph.html.tmpl
@@ -31,6 +31,7 @@ var queryform = "reportform"
[% PROCESS global/header.html.tmpl
title = "Generate Graphical Report"
+ generate_api_token = 1
onload = "doOnSelectProduct(0); chartTypeChanged()"
yui = [ 'autocomplete', 'calendar' ]
javascript = js_data
diff --git a/template/en/default/search/search-report-table.html.tmpl b/template/en/default/search/search-report-table.html.tmpl
index 7e087e7fe..872773b07 100644
--- a/template/en/default/search/search-report-table.html.tmpl
+++ b/template/en/default/search/search-report-table.html.tmpl
@@ -31,6 +31,7 @@ var queryform = "reportform"
[% PROCESS global/header.html.tmpl
title = "Generate Tabular Report"
+ generate_api_token = 1
onload = "doOnSelectProduct(0)"
yui = [ 'autocomplete', 'calendar' ]
javascript = js_data