]> saetta.ns0.it Git - zakauthe/plugins/ldap/commitdiff
Use of libzakconfi.
authorAndrea Zagli <azagli@libero.it>
Tue, 1 Nov 2016 08:40:44 +0000 (09:40 +0100)
committerAndrea Zagli <azagli@libero.it>
Tue, 1 Nov 2016 08:43:15 +0000 (09:43 +0100)
src/aute_ldap.c

index 072a3e2cb6cdab2c9d8e10f442497e1a76ac7bcc..84e9e4fdaeb8c5fc15cf914df1da5be426663917 100644 (file)
@@ -34,15 +34,15 @@ static GtkWidget *txt_password_nuova;
 static GtkWidget *txt_password_conferma;
 
 /* PRIVATE */
-#ifdef HAVE_LIBCONFI
+#ifdef HAVE_LIBZAKCONFI
 static gboolean
-get_connection_parameters_from_confi (Confi *confi, gchar **host, gchar **base_dn, gchar **user_field)
+get_connection_parameters_from_confi (ZakConfi *confi, gchar **host, gchar **base_dn, gchar **user_field)
 {
        gboolean ret = TRUE;
 
-       *host = confi_path_get_value (confi, "aute/aute-ldap/ldap/host");
-       *base_dn = confi_path_get_value (confi, "aute/aute-ldap/ldap/base_dn");
-       *user_field = confi_path_get_value (confi, "aute/aute-ldap/ldap/user_field");
+       *host = zak_confi_path_get_value (confi, "libzakauthe/libzaautheldap/ldap/host");
+       *base_dn = zak_confi_path_get_value (confi, "libzakauthe/libzakautheldap/ldap/base_dn");
+       *user_field = zak_confi_path_get_value (confi, "libzakauthe/libzakautheldap/ldap/user_field");
 
        if (*host == NULL
            || strcmp (g_strstrip (*host), "") == 0
@@ -87,12 +87,12 @@ static gchar
        base_dn = NULL;
        user_field = NULL;
 
-#ifdef HAVE_LIBCONFI
+#ifdef HAVE_LIBZAKCONFI
        /* the first and only parameters must be a Confi object */
        /* leggo i parametri di connessione dalla configurazione */
-       if (IS_CONFI (parameters->data))
+       if (ZAK_IS_CONFI (parameters->data))
                {
-                       if (!get_connection_parameters_from_confi (CONFI (parameters->data), &host, &base_dn, &user_field))
+                       if (!get_connection_parameters_from_confi (ZAK_CONFI (parameters->data), &host, &base_dn, &user_field))
                                {
                                        host = NULL;
                                        base_dn = NULL;
@@ -155,14 +155,14 @@ static gchar
        retldap = ldap_initialize (&ldap, host);
        if (retldap != LDAP_SUCCESS)
                {
-                       g_warning ("Errore nell'inizializzazione.\n%s\n", ldap_err2string (retldap));
+                       g_warning ("Error on ldap initialization.\n%s\n", ldap_err2string (retldap));
                        return NULL;
                }
 
        retldap = ldap_set_option (ldap, LDAP_OPT_PROTOCOL_VERSION, &version);
        if (retldap != LDAP_OPT_SUCCESS)
                {
-                       g_warning ("Errore nell'impostazione della versione del protocollo.\n%s\n", ldap_err2string (retldap));
+                       g_warning ("Error on setting ldap protocol version.\n%s\n", ldap_err2string (retldap));
                        return NULL;
                }
 
@@ -170,7 +170,7 @@ static gchar
        retldap = ldap_simple_bind_s (ldap, user_dn, password);
        if (retldap != LDAP_SUCCESS)
                {
-                       g_warning ("Errore nel bind.\n%s\n", ldap_err2string (retldap));
+                       g_warning ("Error on ldap bind.\n%s\n", ldap_err2string (retldap));
                        return NULL;
                }
 
@@ -206,7 +206,7 @@ static gchar
        retldap = ldap_unbind (ldap);
        if (retldap != LDAP_SUCCESS)
                {
-                       g_warning ("Errore nell'unbind.\n%s\n", ldap_err2string (retldap));
+                       g_warning ("Error on ldap unbind.\n%s\n", ldap_err2string (retldap));
                        return NULL;
                }
 
@@ -223,7 +223,7 @@ gchar
        error = NULL;
 
        GtkBuilder *gtkbuilder = gtk_builder_new ();
-       if (!gtk_builder_add_from_file (gtkbuilder, GUIDIR "/auteldap.gui", &error))
+       if (!gtk_builder_add_from_file (gtkbuilder, GUIDIR "/zakautheldap.gui", &error))
                {
                        return NULL;
                }