mirror of
https://github.com/inverse-inc/sogo.git
synced 2026-06-24 19:34:17 +00:00
Monotone-Parent: 6303f532fa4bb3c36fe2f298f62f659c4fc71b18
Monotone-Revision: c111ae7ec8c39efb8d0cc56ff4627bb958ff0cc8 Monotone-Author: wsourdeau@inverse.ca Monotone-Date: 2012-04-18T20:03:07
This commit is contained in:
@@ -1266,11 +1266,18 @@ function accessToSubscribedFolder(serverFolder) {
|
||||
|
||||
var parts = serverFolder.split(":");
|
||||
if (parts.length > 1) {
|
||||
var username = parts[0];
|
||||
var paths = parts[1].split("/");
|
||||
folder = "/" + parts[0].asCSSIdentifier() + "_" + paths[2];
|
||||
if (username == UserLogin) {
|
||||
folder = paths[1];
|
||||
}
|
||||
else {
|
||||
folder = "/" + username.asCSSIdentifier() + "_" + paths[1];
|
||||
}
|
||||
}
|
||||
else
|
||||
else {
|
||||
folder = serverFolder;
|
||||
}
|
||||
|
||||
return folder;
|
||||
}
|
||||
@@ -2095,6 +2102,53 @@ function _showSelectDialog(title, label, options, button, callbackFcn, callbackA
|
||||
dialog.appear({ duration: 0.2 });
|
||||
}
|
||||
|
||||
function showAuthenticationDialog(label, callback) {
|
||||
log("* showAuthenticationDialog");
|
||||
log(backtrace());
|
||||
|
||||
var div = $("bgDialogDiv");
|
||||
if (div && div.visible() && div.getOpacity() > 0) {
|
||||
log("push");
|
||||
dialogsStack.push(_showAuthenticationDialog.bind(this, label, callback));
|
||||
}
|
||||
else {
|
||||
log("show");
|
||||
_showAuthenticationDialog(label, callback);
|
||||
}
|
||||
}
|
||||
|
||||
function _showAuthenticationDialog(label, callback) {
|
||||
var dialog = dialogs[label];
|
||||
if (dialog) {
|
||||
$("bgDialogDiv").show();
|
||||
var inputs = dialog.getElementsByTagName("input");
|
||||
for (var i = 0; i < inputs.length; i++) {
|
||||
inputs[i].value = "";
|
||||
}
|
||||
}
|
||||
else {
|
||||
var fields = createElement("p", null, ["prompt"]);
|
||||
fields.appendChild(document.createTextNode(_("Username:")));
|
||||
var un_input = createElement("input", null, "textField",
|
||||
{ type: "text", "value": "" });
|
||||
fields.appendChild(un_input);
|
||||
fields.appendChild(document.createTextNode(_("Password:")));
|
||||
var pw_input = createElement("input", null, "textField",
|
||||
{ type: "password", "value": "" });
|
||||
fields.appendChild(pw_input);
|
||||
function callbackWrapper() {
|
||||
callback(un_input.value, pw_input.value);
|
||||
}
|
||||
fields.appendChild(createButton(null, _("OK"), callbackWrapper));
|
||||
fields.appendChild(createButton(null, _("Cancel"), disposeDialog));
|
||||
dialog = createDialog(null, label, null, fields, "none");
|
||||
document.body.appendChild(dialog);
|
||||
dialogs[label] = dialog;
|
||||
}
|
||||
dialog.appear({ duration: 0.2,
|
||||
afterFinish: function () { dialog.down("input").focus(); } });
|
||||
}
|
||||
|
||||
function disposeDialog() {
|
||||
$$("DIV.dialog").each(function(div) {
|
||||
if (div.visible() && div.getOpacity() == 1)
|
||||
|
||||
Reference in New Issue
Block a user