aboutsummaryrefslogtreecommitdiff
path: root/src/krb5-auth-gconf.c
diff options
context:
space:
mode:
authorGuido Günther <agx@sigxcpu.org>2009-04-18 00:24:56 +0200
committerGuido Günther <agx@sigxcpu.org>2009-04-18 00:24:56 +0200
commitd6eee4e647348875912d9c6853a8de0a7d6069ad (patch)
tree752fa2997f98bd625f83846e813c907eceed8233 /src/krb5-auth-gconf.c
parentImported Upstream version 0.8+svn141 (diff)
downloadkrb5-auth-dialog-d6eee4e647348875912d9c6853a8de0a7d6069ad.tar.gz
krb5-auth-dialog-d6eee4e647348875912d9c6853a8de0a7d6069ad.tar.bz2
krb5-auth-dialog-d6eee4e647348875912d9c6853a8de0a7d6069ad.zip
Imported Upstream version 0.9~rc1
Diffstat (limited to 'src/krb5-auth-gconf.c')
-rw-r--r--src/krb5-auth-gconf.c22
1 files changed, 21 insertions, 1 deletions
diff --git a/src/krb5-auth-gconf.c b/src/krb5-auth-gconf.c
index 25eb555..497b1a7 100644
--- a/src/krb5-auth-gconf.c
+++ b/src/krb5-auth-gconf.c
@@ -20,6 +20,7 @@
#include "config.h"
#include <gconf/gconf-client.h>
+#include <string.h>
#include "krb5-auth-applet.h"
#include "krb5-auth-gconf-tools.h"
@@ -30,7 +31,9 @@ ka_gconf_set_principal (GConfClient* client, KaApplet* applet)
{
gchar* principal = NULL;
- if(!ka_gconf_get_string (client, KA_GCONF_KEY_PRINCIPAL, &principal)) {
+ if(!ka_gconf_get_string (client, KA_GCONF_KEY_PRINCIPAL, &principal)
+ || !strlen(principal)) {
+ g_free (principal);
principal = g_strdup (g_get_user_name());
}
g_object_set(applet, "principal", principal, NULL);
@@ -54,6 +57,20 @@ ka_gconf_set_pk_userid (GConfClient* client, KaApplet* applet)
static gboolean
+ka_gconf_set_pk_anchors (GConfClient* client, KaApplet* applet)
+{
+ gchar* pk_anchors = NULL;
+
+ if(!ka_gconf_get_string (client, KA_GCONF_KEY_PK_ANCHORS, &pk_anchors)) {
+ pk_anchors = g_strdup ("");
+ }
+ g_object_set(applet, "pk_anchors", pk_anchors, NULL);
+ g_free (pk_anchors);
+ return TRUE;
+}
+
+
+static gboolean
ka_gconf_set_prompt_mins (GConfClient* client, KaApplet* applet)
{
gint prompt_mins = 0;
@@ -140,6 +157,8 @@ ka_gconf_key_changed_callback (GConfClient* client,
ka_gconf_set_show_trayicon (client, applet);
} else if (g_strcmp0 (key, KA_GCONF_KEY_PK_USERID) == 0) {
ka_gconf_set_pk_userid (client, applet);
+ } else if (g_strcmp0 (key, KA_GCONF_KEY_PK_ANCHORS) == 0) {
+ ka_gconf_set_pk_anchors(client, applet);
} else if (g_strcmp0 (key, KA_GCONF_KEY_FORWARDABLE) == 0) {
ka_gconf_set_tgt_forwardable (client, applet);
} else if (g_strcmp0 (key, KA_GCONF_KEY_RENEWABLE) == 0) {
@@ -176,6 +195,7 @@ ka_gconf_init (KaApplet* applet,
ka_gconf_set_prompt_mins (client, applet);
ka_gconf_set_show_trayicon (client, applet);
ka_gconf_set_pk_userid(client, applet);
+ ka_gconf_set_pk_anchors(client, applet);
ka_gconf_set_tgt_forwardable(client, applet);
ka_gconf_set_tgt_renewable(client, applet);
ka_gconf_set_tgt_proxiable(client, applet);
bgstack15