2007-08-21 [colin] 2.10.0cvs142
[claws.git] / src / ldapctrl.h
index 8b4fa2dddfaebabadf030233eabe848821109d34..a5d031c42eb27d9b5baabf0b60838a376270f213 100644 (file)
@@ -1,10 +1,10 @@
 /*
  * Sylpheed -- a GTK+ based, lightweight, and fast e-mail client
 /*
  * Sylpheed -- a GTK+ based, lightweight, and fast e-mail client
- * Copyright (C) 2003-2006 Match Grun and the Sylpheed-Claws team
+ * Copyright (C) 2003-2007 Match Grun and the Claws Mail team
  *
  * 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
  *
  * 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
- * the Free Software Foundation; either version 2 of the License, or
+ * the Free Software Foundation; either version 3 of the License, or
  * (at your option) any later version.
  *
  * This program is distributed in the hope that it will be useful,
  * (at your option) any later version.
  *
  * This program is distributed in the hope that it will be useful,
@@ -13,8 +13,8 @@
  * GNU General Public License for more details.
  *
  * You should have received a copy of the GNU General Public License
  * GNU General Public License for more details.
  *
  * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
+ * 
  */
 
 /*
  */
 
 /*
@@ -34,6 +34,7 @@
  * Constants.
  */
 #define LDAPCTL_DFL_PORT        389
  * Constants.
  */
 #define LDAPCTL_DFL_PORT        389
+#define LDAPCTL_DFL_SSL_PORT        636
 #define LDAPCTL_MAX_ENTRIES     30
 #define LDAPCTL_DFL_TIMEOUT     30
 #define LDAPCTL_DFL_QUERY_AGE   600
 #define LDAPCTL_MAX_ENTRIES     30
 #define LDAPCTL_DFL_TIMEOUT     30
 #define LDAPCTL_DFL_QUERY_AGE   600
 #define LDAPCTL_ATTR_COMMONNAME "cn"
 #define LDAPCTL_ATTR_GIVENNAME  "givenName"
 #define LDAPCTL_ATTR_SURNAME    "sn"
 #define LDAPCTL_ATTR_COMMONNAME "cn"
 #define LDAPCTL_ATTR_GIVENNAME  "givenName"
 #define LDAPCTL_ATTR_SURNAME    "sn"
+#define LDAPCTL_ATTR_PHONE     "telephoneNumber"
+#define LDAPCTL_ATTR_DISPLAYNAME "displayName"
 
 
-#define LDAPCTL_DFL_ATTR_LIST   "mail, cn, givenName, sn"
+#define LDAPCTL_DFL_ATTR_LIST   "mail, cn, givenName, sn, displayName"
 
 /*
  * Search matching options.
 
 /*
  * Search matching options.
@@ -68,10 +71,12 @@ struct _LdapControl {
        gint      matchingOption;
        gint      version;
        gboolean  enableTLS;
        gint      matchingOption;
        gint      version;
        gboolean  enableTLS;
+       gboolean  enableSSL;
        gchar     *attribEMail;
        gchar     *attribCName;
        gchar     *attribFName;
        gchar     *attribLName;
        gchar     *attribEMail;
        gchar     *attribCName;
        gchar     *attribFName;
        gchar     *attribLName;
+       gchar     *attribDName;
        GList     *listCriteria;
        pthread_mutex_t *mutexCtl;
 };
        GList     *listCriteria;
        pthread_mutex_t *mutexCtl;
 };
@@ -88,21 +93,22 @@ void ldapctl_set_timeout    ( LdapControl* ctl, const gint value );
 void ldapctl_set_max_query_age ( LdapControl* ctl, const gint value );
 void ldapctl_set_matching_option( LdapControl* ctl, const gint value );
 void ldapctl_set_tls           ( LdapControl* ctl, const gboolean value );
 void ldapctl_set_max_query_age ( LdapControl* ctl, const gint value );
 void ldapctl_set_matching_option( LdapControl* ctl, const gint value );
 void ldapctl_set_tls           ( LdapControl* ctl, const gboolean value );
-void ldapctl_set_criteria_list ( LdapControl* ctl, GList *value );
+void ldapctl_set_ssl           ( LdapControl* ctl, const gboolean value );
 GList *ldapctl_get_criteria_list( const LdapControl* ctl );
 void ldapctl_criteria_list_clear( LdapControl *ctl );
 void ldapctl_criteria_list_add ( LdapControl *ctl, gchar *attr );
 GList *ldapctl_get_criteria_list( const LdapControl* ctl );
 void ldapctl_criteria_list_clear( LdapControl *ctl );
 void ldapctl_criteria_list_add ( LdapControl *ctl, gchar *attr );
-void ldapctl_default_attributes        ( LdapControl *ctl );
-void ldapctl_clear             ( LdapControl *ctl );
 void ldapctl_free              ( LdapControl *ctl );
 void ldapctl_free              ( LdapControl *ctl );
-void ldapctl_default_values    ( LdapControl *ctl );
 void ldapctl_print             ( const LdapControl *ctl, FILE *stream );
 void ldapctl_copy              ( const LdapControl *ctlFrom,
                                  LdapControl *ctlTo );
 gchar *ldapctl_format_criteria ( LdapControl *ctl, const gchar *searchVal );
 char **ldapctl_attribute_array ( LdapControl *ctl );
 void ldapctl_print             ( const LdapControl *ctl, FILE *stream );
 void ldapctl_copy              ( const LdapControl *ctlFrom,
                                  LdapControl *ctlTo );
 gchar *ldapctl_format_criteria ( LdapControl *ctl, const gchar *searchVal );
 char **ldapctl_attribute_array ( LdapControl *ctl );
+char **ldapctl_full_attribute_array( LdapControl *ctl );
 void ldapctl_free_attribute_array( char **ptrArray );
 void ldapctl_parse_ldap_search ( LdapControl *ctl, gchar *criteria );
 void ldapctl_free_attribute_array( char **ptrArray );
 void ldapctl_parse_ldap_search ( LdapControl *ctl, gchar *criteria );
+gchar *ldapctl_get_default_criteria(void);
+GList *ldapctl_get_default_criteria_list();
+gboolean ldapctl_compare_list(GList *l1, GList *l2);
 
 #endif /* USE_LDAP */
 
 
 #endif /* USE_LDAP */