static gchar
*controllo (GSList *parameters)
{
- gchar *utente = "";
+ gchar *user_dn;
+ gchar *utente;
gchar *password;
gchar *password_nuova;
int version;
int retldap;
+ user_dn = "";
+
utente = g_strstrip (g_strdup (gtk_entry_get_text (GTK_ENTRY (txt_utente))));
password = g_strstrip (g_strdup (gtk_entry_get_text (GTK_ENTRY (txt_password))));
if (param != NULL && param->data != NULL)
{
base_dn = g_strdup ((gchar *)param->data);
- base_dn = g_strstrip (host);
+ base_dn = g_strstrip (base_dn);
if (g_strcmp0 (base_dn, "") == 0)
{
base_dn = NULL;
{
return NULL;
}
-
ldap = NULL;
version = 3;
return NULL;
}
- retldap = ldap_simple_bind_s (ldap,
- g_strdup_printf ("%s=%s,%s", user_field, utente, base_dn), password);
+ user_dn = g_strdup_printf ("%s=%s,%s", user_field, utente, base_dn);
+ retldap = ldap_simple_bind_s (ldap, user_dn, password);
if (retldap != LDAP_SUCCESS)
{
g_warning ("Errore nel bind.\n%s\n", ldap_err2string (retldap));
return NULL;
}
- return utente;
+ return user_dn;
}
/* PUBLIC */
params = g_slist_append (params, argv[1]);
params = g_slist_append (params, argv[2]);
+ params = g_slist_append (params, argv[3]);
+ params = g_slist_append (params, argv[4]);
aute_set_config (aute, params);