I have some code working now (mod_auth_mysql) and just want to add one tiny thing to it.
Something that should be super easy, but I've been messing with it for a couple of hours and can't figure it out as I'm not worth a flip in C++.
The code currently supports passing parameters to it like %a for IP address and other stuff...
I Just want to add a new parameter called %t to compare what I pass to the current UNIX time.
Here are what I think is the important parts of the code and the areas I believe it would be easy to insert what I want.
Somewhere in these areas I just need to get a time(NULL) to compare the %t I want to pass to it. I just don't know how to add it...
So below is how the original code is now. I just need to know how to add the new %t parameter and make it match again the current time(NULL).
Code:*****SNIP***** static char * format_remote_ip(request_rec * r, char ** parm); *****SNIP***** typedef struct { /* User formatting patterns */ char pattern; /* Pattern to match */ char * (*func)(request_rec * r, char ** parm); } format; format formats[] = {{'h', format_remote_host}, {'a', format_remote_ip}, /* In this area I need to add the 't' to do the time thing! */ *****SNIP***** static char * format_remote_ip(request_rec * r, char ** parm) { return r->connection->remote_ip; } *****SNIP*****



LinkBack URL
About LinkBacks


