aboutsummaryrefslogtreecommitdiffstats
path: root/camel/camel-session.c
diff options
context:
space:
mode:
authorDan Winship <danw@src.gnome.org>2000-02-22 03:56:49 +0800
committerDan Winship <danw@src.gnome.org>2000-02-22 03:56:49 +0800
commit8ea1212d992c564a3a7849a41be9000ce50d0f6b (patch)
treeebc891496db9d1ad04a43153bd79f2b068902c07 /camel/camel-session.c
parent0eff8e4321d63ef1dce20cceae8314b3628767a4 (diff)
downloadgsoc2013-evolution-8ea1212d992c564a3a7849a41be9000ce50d0f6b.tar
gsoc2013-evolution-8ea1212d992c564a3a7849a41be9000ce50d0f6b.tar.gz
gsoc2013-evolution-8ea1212d992c564a3a7849a41be9000ce50d0f6b.tar.bz2
gsoc2013-evolution-8ea1212d992c564a3a7849a41be9000ce50d0f6b.tar.lz
gsoc2013-evolution-8ea1212d992c564a3a7849a41be9000ce50d0f6b.tar.xz
gsoc2013-evolution-8ea1212d992c564a3a7849a41be9000ce50d0f6b.tar.zst
gsoc2013-evolution-8ea1212d992c564a3a7849a41be9000ce50d0f6b.zip
Add "authenticator" to CamelSession and update things to use it.
svn path=/trunk/; revision=1890
Diffstat (limited to 'camel/camel-session.c')
-rw-r--r--camel/camel-session.c41
1 files changed, 39 insertions, 2 deletions
diff --git a/camel/camel-session.c b/camel/camel-session.c
index cf5db3c57f..f014d46596 100644
--- a/camel/camel-session.c
+++ b/camel/camel-session.c
@@ -85,9 +85,12 @@ camel_session_get_type (void)
CamelSession *
-camel_session_new (void)
+camel_session_new (CamelAuthCallback authenticator)
{
- return gtk_type_new (CAMEL_SESSION_TYPE);
+ CamelSession *session = gtk_type_new (CAMEL_SESSION_TYPE);
+
+ session->authenticator = authenticator;
+ return session;
}
/**
@@ -240,3 +243,37 @@ camel_session_get_store (CamelSession *session, const char *url_string,
g_url_free (url);
return store;
}
+
+
+
+/**
+ * camel_session_query_authenticator: query the session authenticator
+ * @session: session object
+ * @prompt: prompt to use if authenticator can query the user
+ * @secret: whether or not the data is secret (eg, a password)
+ * @service: the service this query is being made by
+ * @item: an identifier, unique within this service, for the information
+ * @ex: a CamelException
+ *
+ * This function is used by a CamelService to request authentication
+ * information it needs to complete a connection. If the authenticator
+ * stores any authentication information in configuration files, it
+ * should use @service and @item as keys to find the right piece of
+ * information. If it doesn't store authentication information in config
+ * files, it should use the given @prompt to ask the user for the
+ * information. If @secret is set, the user's input should not be
+ * echoed back. The authenticator should set @ex to
+ * CAMEL_EXCEPTION_USER_CANCEL if the user did not provide the
+ * information. The caller must g_free() the information when it is
+ * done with it.
+ *
+ * Return value: the authentication information or NULL.
+ **/
+char *
+camel_session_query_authenticator (CamelSession *session, char *prompt,
+ gboolean secret,
+ CamelService *service, char *item,
+ CamelException *ex)
+{
+ return session->authenticator (prompt, secret, service, item, ex);
+}