diff options
Diffstat (limited to 'e-util/e-passwords.c')
-rw-r--r-- | e-util/e-passwords.c | 21 |
1 files changed, 21 insertions, 0 deletions
diff --git a/e-util/e-passwords.c b/e-util/e-passwords.c index 3798819f22..d64f7a33dc 100644 --- a/e-util/e-passwords.c +++ b/e-util/e-passwords.c @@ -102,6 +102,7 @@ static GHashTable *passwords = NULL; static GtkDialog *password_dialog; static EDList request_list = E_DLIST_INITIALISER(request_list); static int idle_id; +static int ep_online_state = TRUE; static char *decode_base64 (char *base64); static int base64_encode_close(unsigned char *in, int inlen, gboolean break_lines, unsigned char *out, int *state, int *save); @@ -538,6 +539,23 @@ e_passwords_shutdown (void) } /** + * e_passwords_set_online: + * @state: + * + * Set the offline-state of the application. This is a work-around + * for having the backends fully offline aware, and returns a + * cancellation response instead of prompting for passwords. + * + * FIXME: This is not a permanent api, review post 2.0. + **/ +void +e_passwords_set_online(int state) +{ + ep_online_state = state; + /* TODO: we could check that a request is open and close it, or maybe who cares */ +} + +/** * e_passwords_forget_passwords: * * Forgets all cached passwords, in memory and on disk. @@ -698,6 +716,9 @@ e_passwords_ask_password (const char *title, const char *component_name, char *passwd; EPassMsg *msg = ep_msg_new(ep_ask_password); + if ((type & E_PASSWORDS_ONLINE) && !ep_online_state) + return NULL; + msg->title = title; msg->component = component_name; msg->key = key; |