/*
* mod_msff.c: Microsoft Free Fridays: reject MSIE on Friday.
*
* Michael Anthony Happy "
""
"Microsoft-Free Friday!
In support of freedom of choice in browser software, this" " web site is Microsoft-Free on Fridays. Please use any" " browser except MSIE to access this web site today.
\n" "\n" "\n"); } } static int msff (request_rec *r) { int ret = 0; time_t now; struct tm *tmp; char *agent = 0; const char *foo; char *p; foo = ap_table_get (r->headers_in, "User-Agent"); if (foo) { agent = ap_pstrdup (r->pool, foo); for (p = agent; *p; ++p) { if (isupper (*p)) { *p = tolower (*p); } } } if (agent && strstr (agent, "msie") && ! strstr (agent, "opera") && ! strstr (agent, "oregano")) { time (&now); tmp = localtime (&now); if (tmp->tm_wday == 5) { ret = 1; } } return ret; } static int handle_msff (request_rec *r) { if (msff (r)) { dump_message (r); return OK; } else { return DECLINED; } } module MODULE_VAR_EXPORT msff_module; static const command_rec msff_cmds[] = { { NULL } }; static const handler_rec msff_handlers[] = { { "*/*", handle_msff }, { NULL } }; module MODULE_VAR_EXPORT msff_module = { STANDARD_MODULE_STUFF, NULL, /* initializer */ NULL, /* dir config creater */ NULL, /* dir merger --- default is to override */ NULL, /* server config */ NULL, /* merge server config */ msff_cmds, /* command table */ msff_handlers, /* handlers */ NULL, /* filename translation */ NULL, /* check_user_id */ NULL, /* check auth */ NULL, /* check access */ NULL, /* type_checker */ NULL, /* fixups */ NULL, /* logger */ NULL, /* header parser */ NULL, /* child_init */ NULL, /* child_exit */ NULL /* post read-request */ };