+#ifndef LDAP_GET_OPT /* a temporary fix for usability with (old) U-MICH api */
+char* Gtk_LdapServer::getOptDescription(int option) {
+ debug("Gtk_LdapServer::getOptDescription(%i) ", option);
+ char *c;
+ switch (option) {
+ case LDAP_OPT_API_INFO: c = "API info"; break;
+ case LDAP_OPT_CLIENT_CONTROLS: c = "Client controls"; break;
+ case LDAP_OPT_DEREF: c = "Dereference"; break;
+ case LDAP_OPT_DESC: c = "Description"; break;
+ case LDAP_OPT_DNS: c = "DNS Lookup"; break;
+ case LDAP_OPT_ERROR_NUMBER: c = "Error number"; break;
+ case LDAP_OPT_ERROR_STRING: c = "Error string"; break;
+ case LDAP_OPT_SIZELIMIT: c = "Size limit"; break;
+ case LDAP_OPT_TIMELIMIT: c = "Time limit"; break;
+ case LDAP_OPT_REFERRALS: c = "Referrals"; break;
+ case LDAP_OPT_RESTART: c = "Started"; break;
+ case LDAP_OPT_PROTOCOL_VERSION: c = "Protocol version"; break;
+ case LDAP_OPT_HOST_NAME: c = "Host name"; break;
+ case LDAP_OPT_SERVER_CONTROLS: c = "Server controls"; break;
+ default: c = "No description"; break;
+ }
+ debug("%s\n", c);
+ return c;
+}
+
+int Gtk_LdapServer::getOptType(int option) {
+ debug("Gtk_LdapServer::getOptType(%i) ", option);
+ /* types:
+ * 0 = int, 1 = string, 2 = boolean,
+ * 3 = range, 4 = LDAPAPIInfo, 5 = unknown
+ */
+ int type;
+ switch(option) {
+ /* ints */
+ case LDAP_OPT_DEREF:
+ case LDAP_OPT_DESC:
+ case LDAP_OPT_ERROR_NUMBER:
+ case LDAP_OPT_PROTOCOL_VERSION: type = 0; break;
+ /* strings */
+ case LDAP_OPT_ERROR_STRING:
+ case LDAP_OPT_HOST_NAME: type = 1; break;
+ /* bools */
+ case LDAP_OPT_REFERRALS:
+ case LDAP_OPT_DNS:
+ case LDAP_OPT_RESTART: type = 2; break;
+ /* range */
+ case LDAP_OPT_SIZELIMIT:
+ case LDAP_OPT_TIMELIMIT: type = 3; break;
+ /* api */
+ case LDAP_OPT_API_INFO: type = 4; break;
+ /* unknowns */
+ case LDAP_OPT_SERVER_CONTROLS:
+ case LDAP_OPT_CLIENT_CONTROLS:
+ default: type = 5; break;
+ }
+ debug("%i\n", type);
+ return type;
+}
+#endif /* LDAP_GET_OPT */
+
+int Gtk_LdapServer::getOptions() {
+ debug("Gtk_LdapServer::getOptions()\n");
+ if (this->notebook != NULL) return 0;
+#ifdef LDAP_GET_OPT /* a temporary fix for usability with (old) U-MICH api */
+ Gtk_Label *label;
+ label = new Gtk_Label("This tool has been compiled with (old) U-MICH API (no LDAP_GET_OPT)\nCompile with the latest -devel (from OpenLDAP cvs tree)\nto get some nice options here");
+ this->notebook = new Gtk_Frame("LDAP Options");
+ this->notebook->add(*label);
+ //label->show();
+ //this->notebook->show();
+ this->notebook->show_all();
+ return 0;
+#else
+ LDAPAPIInfo api;
+ Gtk_HBox *hbox, *mini_hbox;
+ Gtk_VBox *vbox, *mini_vbox;
+ Gtk_Table *table;