aboutsummaryrefslogtreecommitdiffstats
path: root/lib/bzpage.js
diff options
context:
space:
mode:
authorMatěj Cepl <mcepl@redhat.com>2010-07-17 09:04:48 +0200
committerMatěj Cepl <mcepl@redhat.com>2010-07-17 09:13:52 +0200
commit34ae7055a0f01306be67dc00030af93190deca55 (patch)
treebec978682872324e92aa7ffdcdcab32e99113a49 /lib/bzpage.js
parent90ae10b0d1181cedb1c31a20e2194a59896223fd (diff)
downloadbugzilla-triage-34ae7055a0f01306be67dc00030af93190deca55.tar.gz
Make XMLRPC service independent of a bugzilla instance.
- activates password dialog only for bugzillas which actually need it - XML-RPC URL is stored in data/XMLRPCdata.json Fixes #23
Diffstat (limited to 'lib/bzpage.js')
-rw-r--r--lib/bzpage.js9
1 files changed, 4 insertions, 5 deletions
diff --git a/lib/bzpage.js b/lib/bzpage.js
index 25c9498..9fa02c0 100644
--- a/lib/bzpage.js
+++ b/lib/bzpage.js
@@ -46,6 +46,7 @@ var BZPage = function BZPage(win, config) {
var that = this;
this.win = win;
this.doc = win.document;
+ this.hostname = this.win.location.hostname;
// First, preflight check ... if we are not logged in, there
// is nothing we can do.
@@ -132,14 +133,13 @@ BZPage.prototype.getBugId = function getBugId () {
BZPage.prototype.getInstalledPackages = function getInstalledPackages(cfg) {
var installedPackages = {};
var enabledPackages = [];
- var hostname = this.win.location.hostname;
// Collect enabled packages per hostname (plus default ones)
if (cfg.gJSONData && ("commentPackages" in cfg.gJSONData)) {
if ("enabledPackages" in cfg.gJSONData.configData) {
var epObject = cfg.gJSONData.configData.enabledPackages;
- if (hostname in epObject) {
- enabledPackages = enabledPackages.concat(epObject[hostname].split(/[, ]/));
+ if (this.hostname in epObject) {
+ enabledPackages = enabledPackages.concat(epObject[this.hostname].split(/[, ]/));
}
if ("any" in epObject) {
enabledPackages = enabledPackages.concat(epObject["any"].split(/[, ]/));
@@ -710,8 +710,7 @@ BZPage.prototype.getPassword = function getPassword (login) {
var passPrompt = "Enter your Bugzilla password for fixing MIME attachment types";
var switchPrompt = "Do you want to switch off features requiring password completely?";
var prefName = BTSPrefNS+"withoutPassowrd";
- var loc = this.win.location;
- var domain = loc.protocol + "//" + loc.hostname;
+ var domain = this.win.location.protocol + "//" + this.hostname;
var pass = passUtils.getPassword(login, domain, BTSPassRealm);
// pass === null means no appropriate password in the storage