char *key, *password, *prompt;
key = g_strdup_printf ("%s//%s@%s", "exchange:", user, owa_url); /* FIXME */
+
password = e_passwords_get_password ("Exchange", key);
if (!password) {
prompt = g_strdup_printf (_("Enter password for %s"), user);
*remember_password = remember;
g_free (key);
- key = g_strdup_printf ("%s//%s@%s",
- "exchange:", user, exchange_params->host);
+ if (exchange_params->is_ntlm)
+ key = g_strdup_printf ("exchange://%s;auth=NTLM@%s/",
+ user, exchange_params->host);
+ else
+ key = g_strdup_printf ("exchange://%s@%s/", user, exchange_params->host);
e_passwords_add_password (key, password);
e_passwords_remember_password ("Exchange", key);
}
ExchangeHierarchy *hier;
char *internal_uri, *permanent_uri;
char *outlook_class, *storage_dir;
- const char *path;
+ char *path;
long long int folder_size;
gboolean has_subfolders;
};
g_free (folder->priv->permanent_uri);
g_free (folder->priv->outlook_class);
g_free (folder->priv->storage_dir);
+ g_free (folder->priv->path);
g_free (folder->priv);
G_OBJECT_CLASS (parent_class)->finalize (object);
return 0;
}
+static char *
+sanitize_path (const char *path)
+{
+ gchar **comps;
+ char *new_path = NULL;
+
+ if (!path)
+ return;
+
+ comps = g_strsplit (path, ";", 2);
+ if (comps[1])
+ new_path = g_strdup_printf ("%s%s", comps[0], comps[1]);
+ else if (comps[0])
+ new_path = g_strdup (comps[0]);
+
+ g_strfreev (comps);
+ return new_path;
+}
+
+
/**
* e_folder_exchange_new:
* @hier: the #ExchangeHierarchy containing the new folder
efe->priv->hier = hier;
g_object_ref (hier);
efe->priv->internal_uri = g_strdup (internal_uri);
- efe->priv->path = e2k_uri_path (e_folder_get_physical_uri (ef));
+ efe->priv->path = sanitize_path (e2k_uri_path (e_folder_get_physical_uri (ef)));
efe->priv->outlook_class = g_strdup (outlook_class);
/* Add ESources */
g_hash_table_insert (account->priv->folders,
key,
folder);
+ d(printf ("added path : %s\n", key));
table_updated = 1;
}
g_hash_table_insert (account->priv->folders,
key,
folder);
+ d(printf ("added phy path : %s\n", key));
table_updated = 1;
}
g_hash_table_insert (account->priv->folders,
key,
folder);
+ d(printf ("added int path : %s\n", key));
table_updated = 1;
}
entry->display_name);
source = g_strdup_printf ("exchange://%s@%s/", entry->mailbox,
account->exchange_server);
- physical_uri_prefix = g_strdup_printf ("exchange://%s/%s",
+ physical_uri_prefix = g_strdup_printf ("exchange://%s/;%s",
account->priv->uri_authority,
entry->email);
internal_uri_prefix = exchange_account_get_foreign_uri (account, entry,
return FALSE;
/* Set up Personal Folders hierarchy */
- phys_uri_prefix = g_strdup_printf ("exchange://%s/personal",
+ phys_uri_prefix = g_strdup_printf ("exchange://%s/;personal",
account->priv->uri_authority);
hier = exchange_hierarchy_webdav_new (account,
EXCHANGE_HIERARCHY_PERSONAL,
personal_hier = hier;
/* Favorite Public Folders */
- phys_uri_prefix = g_strdup_printf ("exchange://%s/favorites",
+ phys_uri_prefix = g_strdup_printf ("exchange://%s/;favorites",
account->priv->uri_authority);
hier = exchange_hierarchy_favorites_new (account,
_("Favorite Public Folders"),
account->priv->favorites_hierarchy = hier;
/* Public Folders */
- phys_uri_prefix = g_strdup_printf ("exchange://%s/public",
+ phys_uri_prefix = g_strdup_printf ("exchange://%s/;public",
account->priv->uri_authority);
hier = exchange_hierarchy_webdav_new (account,
EXCHANGE_HIERARCHY_PUBLIC,
exchange_account_new (EAccountList *account_list, EAccount *adata)
{
ExchangeAccount *account;
- char *enc_user, *mailbox;
+ char *enc_user, *mailbox, *old_uri_authority;
const char *param, *proto="http", *owa_path, *pf_server, *owa_url;
const char *passwd_exp_warn_period, *offline_sync;
E2kUri *uri;
account->storage_dir = g_strdup_printf ("%s/.evolution/exchange/%s@%s",
g_get_home_dir (),
uri->user, uri->host);
- account->account_filename = strrchr (account->storage_dir, '/') + 1;
- e_filename_make_safe (account->account_filename);
+ /*account->account_filename = strrchr (account->storage_dir, '/') + 1;
+ e_filename_make_safe (account->account_filename); */
/* Identity info */
account->priv->identity_name = g_strdup (adata->id->name);
/* URI, etc, info */
enc_user = e2k_uri_encode (uri->user, FALSE, "@/;:");
- account->priv->uri_authority = g_strdup_printf ("%s@%s", enc_user,
+ old_uri_authority = g_strdup_printf ("%s@%s", enc_user,
uri->host);
+ if (uri->authmech)
+ account->priv->uri_authority = g_strdup_printf ("%s;auth=%s@%s", enc_user,
+ uri->authmech, uri->host);
+ else
+ account->priv->uri_authority = g_strdup_printf ("%s@%s", enc_user,
+ uri->host);
g_free (enc_user);
+ account->account_filename = account->priv->uri_authority;
+
account->priv->source_uri = g_strdup_printf ("exchange://%s/", account->priv->uri_authority);
/* Backword compatibility; FIXME, we should just migrate the
* password from this to source_uri.
*/
- account->priv->password_key = g_strdup_printf ("exchange://%s", account->priv->uri_authority);
+ account->priv->password_key = g_strdup_printf ("exchange://%s", old_uri_authority);
+ g_free (old_uri_authority);
account->priv->username = g_strdup (uri->user);
if (uri->domain)