+int Yaz_ProxyConfig::global_client_authentication(const char *user,
+ const char *group,
+ const char *password,
+ const char *peer_IP)
+{
+ int ret = YAZPROXY_RET_NOT_ME;
+#if YAZ_HAVE_XSLT
+ if (!m_cp->m_proxyPtr)
+ return 1;
+ xmlNodePtr ptr;
+ for (ptr = m_cp->m_proxyPtr->children; ptr; ptr = ptr->next)
+ {
+ if (ptr->type == XML_ELEMENT_NODE &&
+ !strcmp((const char *) ptr->name, "client-authentication"))
+ {
+ struct _xmlAttr *attr;
+ const char *module_name = 0;
+ for (attr = ptr->properties; attr; attr = attr->next)
+ {
+ if (!strcmp((const char *) attr->name, "module") &&
+ attr->children && attr->children->type == XML_TEXT_NODE)
+ module_name = (const char *) attr->children->content;
+ }
+ ret = m_cp->m_modules.authenticate(module_name,
+ NULL, ptr,
+ user, group, password,
+ peer_IP
+ );
+ if (ret != YAZPROXY_RET_NOT_ME)
+ break;
+ }
+ }
+#endif
+ if (ret == YAZPROXY_RET_PERM)
+ return 0;
+ return 1;
+}
+