Commit b0004b3b authored by Mechtilde's avatar Mechtilde

New upstream version 4.0.0~beta1

parent 6ea3e685
......@@ -66,7 +66,7 @@
completedefaultindex="true"
forcecomplete="true"
minresultsforpopup="1"
onblur="if (this.localName == 'textbox') document.getBindingParent(this).onBlurInput(event);"
onblur="if (this.localName === 'textbox') document.getBindingParent(this).onBlurInput(event);"
ignoreblurwhilesearching="true"
oninput="this.setAttribute('dirty', 'true');">
</xul:textbox>
......@@ -138,7 +138,7 @@
numRowsAdded++;
}
}
if (numRowsAdded == 0) {
if (numRowsAdded === 0) {
this.appendAttendee(null, listbox, template, false);
}
......
This diff is collapsed.
......@@ -48,8 +48,11 @@
xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul">
<script type="application/javascript" src="chrome://exchangecalendar/content/calendar-event-dialog.js"/>
<script type="application/javascript" src="chrome://calendar/content/calendar-event-dialog.js"/>
<!-- Override default attendees command for Options menu -->
<command id="cmd_attendees"
oncommand="exchWebService.eventDialog.editAttendees();"/>
oncommand="exchToolsEventDialog.editAttendees();"/>
<rows id="event-grid-rows" insertbefore = "event-grid-alarmrow">
<row id="exchWebService-owner-row" collapsed="true" insertafter="event-grid-title-row">
<label value="&exchWebService.owner.label;"/>
......@@ -57,49 +60,7 @@
</row>
<row id="event-grid-category-color-row">
<hbox id="event-grid-category-box">
<menulist id="item-calendar" oncommand="tmpEventDialog.selectedCalendarChanged(this);"/>
</hbox>
</row>
<separator id="exchWebService-details-separator" hidden="true" class="groove" insertafter="event-grid-todo-status-row"/>
<row id="exchWebService-details-row1" align="center"
collapsed="true" insertafter="exchWebService-details-separator">
<label value="&exchWebService.totalWork.label;"
disable-on-readonly="true"/>
<hbox align="center">
<textbox id="exchWebService-totalWork-count"
increment="10" min="0" type="number" size="3" value="0" disable-on-readonly="true"/>
<label value="&exchWebService.mileage.label;"
disable-on-readonly="true"/>
<textbox id="exchWebService-mileage-count" value="" disable-on-readonly="true"/>
</hbox>
</row>
<row id="exchWebService-details-row2" align="center"
collapsed="true" insertafter="exchWebService-details-row1">
<label value="&exchWebService.actualWork.label;"
disable-on-readonly="true"/>
<hbox align="center">
<textbox id="exchWebService-actualWork-count"
increment="10" min="0" type="number" size="3" value="0" disable-on-readonly="true"/>
<label value="&exchWebService.billingInformation.label;"
disable-on-readonly="true"/>
<textbox id="exchWebService-billingInformation-count" value="" disable-on-readonly="true"/>
</hbox>
</row>
<row id="exchWebService-details-row3" align="center"
collapsed="true" insertafter="exchWebService-details-row2">
<label value="&exchWebService.companies.label;"
disable-on-readonly="true"/>
<textbox id="exchWebService-companies-count" value="" disable-on-readonly="true"/>
</row>
</rows>
<rows flex="1" id="event-grid-rows" >
<row id="exchWebService-owner-row" collapsed="true" insertafter="event-grid-title-row">
<label value="&exchWebService.owner.label;"/>
<label id="exchWebService-owner-label" value=""/>
</row>
<row id="event-grid-category-color-row">
<hbox id="event-grid-category-box">
<menulist id="item-calendar" oncommand="tmpEventDialog.selectedCalendarChanged(this);"/>
<menulist id="item-calendar" oncommand="exchToolsEventDialog.selectedCalendarChanged(this);"/>
</hbox>
</row>
<separator id="exchWebService-details-separator" hidden="true" class="groove" insertafter="event-grid-todo-status-row"/>
......@@ -138,11 +99,11 @@
xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul" id="event-grid-tabbox" selectedIndex="2" flex="1">
<tabpanels id="event-grid-tabpanels" flex="1" selectedIndex="2">
<tabpanel id="event-grid-tabpanel-description">
<itemBodyEditor id="exchWebService-body-editor"
flex="1"
insertafter="item-description"
<itemBodyEditor id="exchWebService-body-editor"
flex="1"
insertafter="item-description"
disable-on-readonly="true"/>
</tabpanel>
</tabpanel>
</tabpanels>
</tabbox>
</overlay>
\ No newline at end of file
</overlay>
......@@ -445,7 +445,7 @@
accesskey="&event.menu.options.accesskey;">
<menupopup id="options-menupopup"
onpopupshowing="onPopupShowing(this)">
<menuitem id="options-attendess-menuitem"
<menuitem id="options-attendees-menuitem"
label="&event.menu.options.attendees.label;"
accesskey="&event.menu.options.attendees.accesskey;"
command="cmd_attendees"
......
......@@ -208,18 +208,16 @@ function msgHdrGetTags (aMsgHdr) {
function msgHdrSetTags (aMsgHdr, aTags) {
let oldTagList = msgHdrGetTags(aMsgHdr);
let oldTags = {}; // hashmap
for each (let [, tag] in Iterator(oldTagList))
for (let tag of oldTagList)
oldTags[tag.key] = null;
let newTags = {};
let newTagList = aTags;
for each (let [, tag] in Iterator(newTagList))
for (let tag of newTagList)
newTags[tag.key] = null;
let toAdd = [x.key for each ([, x] in Iterator(newTagList))
if (!(x.key in oldTags))];
let toRemove = [x.key for each ([, x] in Iterator(oldTagList))
if (!(x.key in newTags))];
let toAdd = newTagList.filter( tag => !(tag.key in oldTags));
let toRemove = oldTagList.filter( tag => !(tag.key in newTags));
let folder = aMsgHdr.folder;
let msgHdr = toXPCOMArray([aMsgHdr], Ci.nsIMutableArray);
......
/* ***** BEGIN LICENSE BLOCK *****
* Version: GPL 3.0
*
* The contents of this file are subject to the General Public License
* 3.0 (the "License"); you may not use this file except in compliance with
* the License. You may obtain a copy of the License at
* http://www.gnu.org/licenses/gpl.html
*
* Software distributed under the License is distributed on an "AS IS" basis,
* WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
* for the specific language governing rights and limitations under the
* License.
*
* -- Global Functions for Exchange Calendar and Exchange Contacts.
* -- For Thunderbird.
*
* Author: Michel Verbraak (info@1st-setup.nl)
* Website: http://www.1st-setup.nl/wordpress/?page_id=133
* email: info@1st-setup.nl
*
*
* ***** BEGIN LICENSE BLOCK *****/
var Cc = Components.classes;
var Ci = Components.interfaces;
var Cu = Components.utils;
var Cr = Components.results;
var components = Components;
Cu.import("resource://gre/modules/XPCOMUtils.jsm");
Cu.import("resource:///modules/Services.jsm");
Cu.import("resource://exchangecalendar/ecFunctions.js");
var EXPORTED_SYMBOLS = [];
if (! exchWebService) var exchWebService = {};
exchWebService.accountFunctions = {
prefs: Cc["@mozilla.org/preferences-service;1"]
.getService(Ci.nsIPrefService)
.getBranch("extensions.exchangeWebServices.accounts."),
logInfo: function _logInfo(message)
{
exchWebService.commonFunctions.LOG("[exchWebService.accountFunctions] "+message + " ("+exchWebService.commonFunctions.STACKshort()+")");
},
getAccountIds: function _getAccountIds()
{
var ids = exchWebService.commonFunctions.safeGetCharPref(this.prefs, "ids", "");
this.logInfo("ids:"+ids);
return ids.split(",");
},
getAccounts: function _getAccounts()
{
var result = {};
var ids = this.getAccountIds()
for (var index in ids) {
if (ids[index] != "") {
this.logInfo("id:"+ids[index]);
result[ids[index]] = {};
this.getAccountById(ids[index], result[ids[index]]);
}
}
return result;
},
getAccountById: function _getAccountById(aId, aAccount)
{
var result = false;
this.logInfo("id:"+aId);
var children = this.prefs.getChildList(aId+".",{});
if (children.length > 0) {
result = true;
aAccount["id"] = aId;
for (var index in children) {
var attribute = children[index].substr(children[index].indexOf(".")+1);
switch (this.prefs.getPrefType(children[index])) {
case this.prefs.PREF_STRING:
aAccount[attribute] = this.prefs.getCharPref(children[index]);
break;
case this.prefs.PREF_INT:
aAccount[attribute] = this.prefs.getIntPref(children[index]);
break;
case this.prefs.PREF_BOOL:
aAccount[attribute] = this.prefs.getBoolPref(children[index]);
break;
}
}
}
return result;
},
getAccountByServer: function _getAccountByServer(aServer)
{
var accounts = this.getAccounts();
var account = null;
for (var index in accounts) {
if ((accounts[index].server) && (accounts[index].server.toLowerCase() == aServer.toLowerCase())) {
return accounts[index];
}
}
},
saveAccount: function _saveAccount(aAccount)
{
for (var index in aAccount) {
switch (typeof(aAccount[index])) {
case "string":
this.prefs.setCharPref(aAccount.id+"."+index, aAccount[index]);
break;
case "number":
this.prefs.setIntPref(aAccount.id+"."+index, aAccount[index]);
break;
default:
this.logInfo("Unknown object index:"+index);
}
}
// Check if the ids all ready exists. If not add it.
var ids = this.getAccountIds();
var idExists = false;
for (var index in ids) {
if (ids[index] == aAccount.id) {
idExists = true;
break;
}
}
if (!idExists) {
ids.push(aAccount.id);
ids = ids.join(",");
this.prefs.setCharPref("ids", ids);
}
},
removeAccount: function _removeAccount(aAccount)
{
if (aAccount.id) {
this.removeAccountById(aAccount.id);
}
},
removeAccountById: function _removeAccountById(aAccountId)
{
this.prefs.deleteBranch(aAccountId);
// Remove from ids list.
var oldIds = this.getAccountIds();
var newIds = [];
for (var index in oldIds) {
if (oldIds[index] != aAccountId) {
newIds.push(oldIds[index]);
}
}
if (newIds.length > 0) {
newIds = newIds.join(",");
}
else {
newIds = "";
}
this.prefs.setCharPref("ids", newIds);
},
}
This diff is collapsed.
......@@ -5,13 +5,13 @@
<Description about="urn:mozilla:install-manifest">
<em:id>exchangecalendar@extensions.1st-setup.nl</em:id>
<em:version>3.9.0</em:version>
<em:version>4.0.0-beta1</em:version>
<em:targetApplication>
<Description>
<!-- Thunderbird -->
<em:id>{3550f703-e582-4d05-9a08-453d09bdfdc6}</em:id>
<em:minVersion>12.0</em:minVersion>
<em:maxVersion>50.*</em:maxVersion>
<em:maxVersion>52.*</em:maxVersion>
</Description>
</em:targetApplication>
......@@ -20,7 +20,7 @@
<!-- Seamonkey -->
<em:id>{92650c4d-4b8e-4d2a-b7eb-24ecf4f6b63a}</em:id>
<em:minVersion>2.6</em:minVersion>
<em:maxVersion>2.26.*</em:maxVersion>
<em:maxVersion>2.46.*</em:maxVersion>
</Description>
</em:targetApplication>
......
......@@ -109,8 +109,6 @@ mivExchangeAuthPrompt2.prototype = {
// var realm = aRealm;
var realm = "Exchange Web Service";
//this.logInfo("getPassword: useCached:"+useCached);
if (!realm) {
this.logInfo("getPassword: No realm specified. Trying to get it from the URL.");
var ioService = Cc["@mozilla.org/network/io-service;1"].getService(Ci.nsIIOService);
......@@ -129,7 +127,7 @@ mivExchangeAuthPrompt2.prototype = {
if we have password from cache or manager, and we have a password in the channel. We are going to match them.
Because when they are equal then the cached and stored password were wrong. Otherwise we did not get here.
When no password at al always ask. */
When no password at all always ask. */
var password;
if (this.passwordCache[username+"|"+aURL+"|"+realm]) {
......@@ -166,17 +164,18 @@ mivExchangeAuthPrompt2.prototype = {
this.logInfo("getPassword: password(2)=********");
}
if ((password) && (aChannel) && (aChannel.URI.password) && (decodeURIComponent(aChannel.URI.password) != "")) {
if ((password) && (aChannel) && (aChannel.URI.password)
&& (decodeURIComponent(aChannel.URI.password) != "")) {
this.logInfo("getPassword: There was a password in cache or passwordManager and one on the channel. Going to see if they are the same.");
if ((password == decodeURIComponent(aChannel.URI.password)) && (!useCached)) {
if ((password === decodeURIComponent(aChannel.URI.password)) && (!useCached)) {
this.logInfo("getPassword: There was a password in cache or passwordManager and one on the channel. And they are the same. Going to ask user to provide a new password.");
if ((this.details[aURL]) && (this.details[aURL].ntlmCount == 1)) {
if ((this.details[aURL]) && (this.details[aURL].ntlmCount === 1)) {
this.logInfo("getPassword: There was a password in cache or passwordManager and one on the channel. And they are the same. But it is a first pass on an NTLM authentication. Using stored password and going to see if it can be used.");
}
else {
this.logInfo("getPassword: There was a password in cache or passwordManager and one on the channel. And they are the same. Going to ask user to provide a new password.");
var channel = aChannel.QueryInterface(Ci.nsIHttpChannel);
if( channel.responseStatus == 401 ){
if( channel.responseStatus === 401 ){
password=null;
this.logInfo("getPassword: Login Failed, Going to ask user to provide a new password.");
}
......@@ -261,17 +260,23 @@ mivExchangeAuthPrompt2.prototype = {
asyncPromptAuthNotifyCallback: function _asyncPromptAuthNotifyCallback(aURL)
{
if (!this.details[aURL]) {
this.logInfo("asyncPromptAuthNotifyCallback: This is strange, We do not have this URL '"+aURL+"' in queue");
this.logInfo("asyncPromptAuthNotifyCallback: This is strange, We do not have this URL '"
+ aURL + "' in queue");
return;
}
if (this.details[aURL].showing) {
this.logInfo("asyncPromptAuthNotifyCallback: Allready showing a prompt or trying to get the password for URL '"+aURL+"'. Not going to try again until the active one has finished.");
this.logInfo("asyncPromptAuthNotifyCallback: Already showing a prompt or trying to get the password for URL '"
+ aURL + "'. Not going to try again until the active one has finished.");
return;
}
else {
this.details[aURL].showing = true;
}
if (this.details[aURL].queue.length == 0) {
this.logInfo("asyncPromptAuthNotifyCallback: This is strange, We do not have a request in queue for URL '"+aURL+"'.");
if (this.details[aURL].queue.length === 0) {
this.logInfo("asyncPromptAuthNotifyCallback: This is strange, We do not have a request in queue for URL '"
+ aURL +"'.");
return;
}
......@@ -279,7 +284,9 @@ mivExchangeAuthPrompt2.prototype = {
// We grab the first one from the queue.
var request = this.details[aURL].queue.shift();
this.logInfo("asyncPromptAuthNotifyCallback: Removed request from queue["+aURL+"]. There are now '"+this.details[aURL].queue.length+"' requests in queue left.");
this.logInfo("asyncPromptAuthNotifyCallback: Removed request from queue["
+ aURL + "]. There are now '"
+ this.details[aURL].queue.length + "' requests in queue left.");
var aChannel = request.channel;
var aCallback = request.callback;
var aContext = request.context;
......@@ -288,7 +295,9 @@ mivExchangeAuthPrompt2.prototype = {
var canUseBasicAuth = false;
if (this.details[aURL].previousFailedCount > 4) { // Maybe make this a user preference
this.logInfo("asyncPromptAuthNotifyCallback: We have more than '"+this.details[aURL].previousFailedCount+"' previous failed for '"+aURL+"'.");
this.logInfo("asyncPromptAuthNotifyCallback: We have more than '"
+ this.details[aURL].previousFailedCount + "' previous failed for '"
+ aURL +"'.");
aCallback.onAuthCancelled(aContext, false);
return;
}
......@@ -309,7 +318,7 @@ mivExchangeAuthPrompt2.prototype = {
username = this.globalFunctions.trim(decodeURIComponent(aChannel.URI.username));
}
if (username == "") {
if (username === "") {
// We do not have a username. We need to prompt for one.
// This should always be filled in. So for now we error.
this.logInfo("asyncPromptAuthNotifyCallback: username is empty. This is not allowed.");
......@@ -319,25 +328,25 @@ mivExchangeAuthPrompt2.prototype = {
this.logInfo("asyncPromptAuthNotifyCallback: username="+username);
if (!error) {
// Trying to get realm from response header. This is used when basic authentication is available.
// Trying to get realm from response header.
// This is used when basic authentication is available.
var realm = "exchange.server";
try {
var acceptedAuthentications = aChannel.getResponseHeader("WWW-Authenticate");
acceptedAuthentications = acceptedAuthentications.split("\n");
for each (var index in acceptedAuthentications) {
this.logInfo("asyncPromptAuthNotifyCallback: WWW-Authenticate:"+index);
if (index.indexOf("realm=") > -1) {
realm = index.substr(index.indexOf("realm=")+6);
while (realm.indexOf('"') > -1) {
realm = realm.replace('"', "");
}
this.logInfo("asyncPromptAuthNotifyCallback: Found a realm going to use it. realm="+realm);
for (let acceptAuth of acceptedAuthentications) {
this.logInfo("asyncPromptAuthNotifyCallback: WWW-Authenticate:" + acceptAuth);
if (acceptAuth.indexOf("realm=") > -1) {
realm = acceptAuth.substr(index.indexOf("realm=") + 6);
realm = realm.replace(/"/g, "");
this.logInfo("asyncPromptAuthNotifyCallback: Found a realm going to use it. realm=" + realm);
canUseBasicAuth = true;
}
}
}
catch(err) {
this.logInfo("asyncPromptAuthNotifyCallback: NO WWW-Authenticate in response header!?");
this.logInfo("asyncPromptAuthNotifyCallback: WWW-Authenticate HTTP response header not found !");
}
// try to get password.
......@@ -350,7 +359,7 @@ mivExchangeAuthPrompt2.prototype = {
error = true;
}
if ((!password) || (password == null)) {
if ((!password)) {
error = true;
}
else {
......@@ -359,8 +368,8 @@ mivExchangeAuthPrompt2.prototype = {
}
}
// Return credentials we have obtained
if (!error) {
// Return credentials we have obtained
if (!(authInfo.flags & Ci.nsIAuthInformation.ONLY_PASSWORD)) {
this.logInfo("asyncPromptAuthNotifyCallback: authInfo wants username and password and possibly domainname.");
if (authInfo.flags & Ci.nsIAuthInformation.NEED_DOMAIN) {
......@@ -379,7 +388,7 @@ mivExchangeAuthPrompt2.prototype = {
else {
this.logInfo("asyncPromptAuthNotifyCallback: We do not have a domainname part in the username. Specifying empty one.");
authInfo.username = username;
}
}
}
else {
authInfo.username = username;
......@@ -416,9 +425,7 @@ mivExchangeAuthPrompt2.prototype = {
}
}
}
//this.details[aURL].showing = false;
this.details[aURL].showing = false;
},
asyncPromptAuthCancelCallback: function _asyncPromptAuthCallBack(aReason, aURL, aUUID)
......@@ -564,11 +571,11 @@ mivExchangeAuthPrompt2.prototype = {
try {
var acceptedAuthentications = aChannel.getResponseHeader("WWW-Authenticate");
acceptedAuthentications = acceptedAuthentications.split("\n");
for each (var index in acceptedAuthentications) {
this.logInfo("promptAuth: WWW-Authenticate:"+index);
if (index.indexOf("realm=") > -1) {
realm = index.substr(index.indexOf("realm=")+6);
this.logInfo("promptAuth: Found a realm going to use it. realm="+realm);
for (let authenticateHeader of acceptedAuthentications) {
this.logInfo("promptAuth: WWW-Authenticate:" + authenticateHeader);
if (authenticateHeader.indexOf("realm=") > -1) {
realm = index.substr(authenticateHeader.indexOf("realm=")+6);
this.logInfo("promptAuth: Found a realm going to use it. realm=" + realm);
}
}
}
......@@ -625,7 +632,7 @@ mivExchangeAuthPrompt2.prototype = {
.getService(Ci.nsILoginManager);
var logins = loginManager.findLogins({}, aURL, null, aRealm);
for each (var loginInfo in logins) {
for (let loginInfo of logins) {
if (loginInfo.username == aUsername) {
this.logInfo("passwordManagerGet found password for: username="+aUsername+", aURL="+aURL+", aRealm="+aRealm);
return { result: true, password: loginInfo.password};
......@@ -654,12 +661,12 @@ mivExchangeAuthPrompt2.prototype = {
if (logins.length > 0) {
var modified = false;
for each (let loginInfo in logins) {
if (loginInfo.username == aUsername) {
for (let loginInfo of logins) {
if (loginInfo.username === aUsername) {
this.logInfo("Login credentials updated:username="+aUsername+", aURL="+aURL+", aRealm="+aRealm);
loginManager.removeLogin(loginInfo);
modified = true;
break;
break;
}
}
if (!modified) {
......@@ -699,7 +706,7 @@ mivExchangeAuthPrompt2.prototype = {
if (logins.length > 0) {
var modified = false;
for each (let loginInfo in logins) {
for (let loginInfo of logins) {
if (loginInfo.username == aUsername) {
this.logInfo("Login credentials updated:username="+aUsername+", aURL="+aURL+", aRealm="+aRealm);
loginManager.modifyLogin(loginInfo, newLoginInfo);
......
......@@ -5570,8 +5570,10 @@ if (this.debug) this.logInfo(" ;;;; rrule:"+rrule.icalProperty.icalString);
var proposeEnd = this.tryToSetDateValue(input.proposeEnd,"");
var proposeNewTime = false;
input.proposeStart = cal.toRFC3339(proposeStart.getInTimezone(this.globalFunctions.ecUTC()));
input.proposeEnd = cal.toRFC3339(proposeEnd.getInTimezone( this.globalFunctions.ecUTC()));
if (proposeStart)
input.proposeStart = cal.toRFC3339(proposeStart.getInTimezone(this.globalFunctions.ecUTC()));
if (proposeEnd)
input.proposeEnd = cal.toRFC3339(proposeEnd.getInTimezone( this.globalFunctions.ecUTC()));
if( input.proposeStart && input.proposeEnd ){
proposeNewTime = true;
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment