X-Git-Url: http://git.indexdata.com/?p=yazproxy-moved-to-github.git;a=blobdiff_plain;f=src%2Fmod_sample.cpp;h=e5f2bd6e409c6102d3efabaefd763f51b32f3fc6;hp=3e1df6c4295bdf9ca23b678ebcfc846f048cb4f0;hb=d7f41f16caf965adb1a5ffcdaa937787dfcc030a;hpb=850cba55769a7ed94d4da0e7c05b823e54ce3cc3 diff --git a/src/mod_sample.cpp b/src/mod_sample.cpp index 3e1df6c..e5f2bd6 100644 --- a/src/mod_sample.cpp +++ b/src/mod_sample.cpp @@ -1,4 +1,4 @@ -/* $Id: mod_sample.cpp,v 1.4 2005-06-21 18:46:04 adam Exp $ +/* $Id: mod_sample.cpp,v 1.5 2005-06-25 15:58:33 adam Exp $ Copyright (c) 1998-2005, Index Data. This file is part of the yaz-proxy. @@ -44,10 +44,10 @@ void my_destroy(void *p) } int my_authenticate(void *user_handle, - const char *target_name, - void *element_ptr, - const char *user, const char *group, const char *password, - const char *peer_IP) + const char *target_name, + void *element_ptr, + const char *user, const char *group, const char *password, + const char *peer_IP) { // see if we have an "args" attribute const char *args = 0; @@ -57,26 +57,26 @@ int my_authenticate(void *user_handle, for (attr = ptr->properties; attr; attr = attr->next) { - if (!strcmp((const char *) attr->name, "args") && - attr->children && attr->children->type == XML_TEXT_NODE) - args = (const char *) attr->children->content; + if (!strcmp((const char *) attr->name, "args") && + attr->children && attr->children->type == XML_TEXT_NODE) + args = (const char *) attr->children->content; } #endif // args holds args (or NULL if none is provided) sleep(2); fprintf(stderr, "my_authenticate: target=%s user=%s group=%s args=%s IP=%s" - "\n", - target_name ? target_name : "none", - user ? user : "none", group ? group : "none", - args ? args : "none", - peer_IP); + "\n", + target_name ? target_name : "none", + user ? user : "none", group ? group : "none", + args ? args : "none", + peer_IP); // authentication handler if (!user && !group && !password) - return YAZPROXY_RET_OK; // OK if anonymous + return YAZPROXY_RET_OK; // OK if anonymous if (user && !strcmp(user, "guest") - && password && !strcmp(password, "guest")) // or guest guest - return YAZPROXY_RET_OK; + && password && !strcmp(password, "guest")) // or guest guest + return YAZPROXY_RET_OK; return YAZPROXY_RET_PERM; // fail otherwise } @@ -92,3 +92,11 @@ Yaz_ProxyModule_entry yazproxy_module = { "Sample Module for YAZ Proxy",// description &interface0 }; +/* + * Local variables: + * c-basic-offset: 4 + * indent-tabs-mode: nil + * End: + * vim: shiftwidth=4 tabstop=8 expandtab + */ +