Changeset 526 for trunk/gsdl/src/recpt/receptionist.cpp
- Timestamp:
- 1999-09-03T16:39:46+12:00 (25 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/gsdl/src/recpt/receptionist.cpp
r512 r526 12 12 /* 13 13 $Log$ 14 Revision 1.28 1999/09/03 04:39:46 rjmcnab 15 Made cookies and logs optional (they are turned off by default). To 16 turn them on put 17 18 usecookies true 19 logcgiargs true 20 21 in your configuration file. 22 14 23 Revision 1.27 1999/09/02 00:27:21 rjmcnab 15 24 A few small things. … … 127 136 #include <time.h> 128 137 #include <fstream.h> 138 139 140 141 void recptconf::clear () { 142 gsdlhome.clear(); 143 collection.clear(); 144 collectdir.clear(); 145 httpprefix.clear(); 146 httpimg.clear(); 147 gwcgi.clear(); 148 macrofiles.erase(macrofiles.begin(), macrofiles.end()); 149 saveconf.clear(); 150 usecookies = false; 151 logcgiargs = false; 152 } 153 129 154 130 155 … … 239 264 else if (key == "macrofiles") configinfo.macrofiles = cfgline; 240 265 else if (key == "saveconf") configinfo.saveconf = cfgline[0]; 266 else if (key == "usecookies") configinfo.usecookies = (cfgline[0] == "true"); 267 else if (key == "logcgiargs") configinfo.logcgiargs = (cfgline[0] == "true"); 241 268 242 269 else if ((key == "argdefault") && (cfgline.size() == 2) && … … 405 432 406 433 // get the cookie 407 get_cookie(args["z"]);434 if (configinfo.usecookies) get_cookie(args["z"]); 408 435 409 436 // get the input encoding … … 478 505 } 479 506 507 cookie.clear(); 480 508 char *host = getenv("REMOTE_ADDR"); 481 509 time_t ttime = time(NULL); … … 507 535 bool receptionist::log_cgi_args (cgiargsclass &args, ostream &logout) { 508 536 509 outconvertclass text_t2ascii; 510 537 utf8outconvertclass text_t2utf8; 538 539 // see if we want to log the cgi arguments 540 if (!configinfo.logcgiargs) return true; 541 511 542 char *host; 512 543 host = getenv("REMOTE_HOST"); … … 539 570 } 540 571 541 log << text_t2 ascii<< host << " [" << ttime572 log << text_t2utf8 << host << " [" << ttime 542 573 << "] (" << argstr << ") \"" << browser << "\"\n"; 543 574 … … 617 648 618 649 // add cookie if required 619 if ( !get_cookie())650 if (configinfo.usecookies && !get_cookie()) 620 651 response_data += "\nSet-Cookie: GSDL_UID=" + args["z"] 621 652 + "; expires=25-Dec-37 00:00:00 GMT"; 622 623 653 } 624 654 }
Note:
See TracChangeset
for help on using the changeset viewer.