From d0f7048e94abe3371aeeba6f5cd115959e332b09 Mon Sep 17 00:00:00 2001 From: Guido Günther Date: Sun, 1 Mar 2009 15:00:15 +0100 Subject: Imported Upstream version 0.8+svn128 --- src/krb5-auth-dbus.c | 32 ++++++++++++++++++++++++++++++-- 1 file changed, 30 insertions(+), 2 deletions(-) (limited to 'src/krb5-auth-dbus.c') diff --git a/src/krb5-auth-dbus.c b/src/krb5-auth-dbus.c index f658c8d..b4c8742 100644 --- a/src/krb5-auth-dbus.c +++ b/src/krb5-auth-dbus.c @@ -1,6 +1,6 @@ /* Krb5 Auth Applet -- Acquire and release kerberos tickets * - * (C) 2008 Guido Guenther + * (C) 2008,2009 Guido Guenther * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -23,13 +23,38 @@ #include #include "krb5-auth-applet.h" #include "krb5-auth-dbus.h" +#include "krb5-auth-applet-dbus-glue.h" + +static DBusGConnection *session; + +gboolean +ka_dbus_acquire_tgt (KaApplet *applet, + const gchar *principal, DBusGMethodInvocation *context) +{ + gboolean success; + + KA_DEBUG("Getting TGT for '%s'", principal); + success = ka_check_credentials(applet, principal); + dbus_g_method_return(context, success); + return TRUE; +} + + +gboolean +ka_dbus_service(KaApplet* applet) +{ + dbus_g_connection_register_g_object (session, + "/org/gnome/KrbAuthDialog", + G_OBJECT(applet)); + return TRUE; +} + gboolean ka_dbus_connect(unsigned int* status) { guint request_name_reply; unsigned int flags; - DBusGConnection *session; DBusGProxy *bus_proxy; GError* error = NULL; @@ -46,6 +71,9 @@ ka_dbus_connect(unsigned int* status) "/org/freedesktop/DBus", "org.freedesktop.DBus"); + dbus_g_object_type_install_info(KA_TYPE_APPLET, + &dbus_glib_krb5_auth_dialog_object_info); + if (!dbus_g_proxy_call (bus_proxy, "RequestName", &error, -- cgit