Ignore:
Timestamp:
1999-09-03T16:39:46+12:00 (25 years ago)
Author:
rjmcnab
Message:

Made cookies and logs optional (they are turned off by default). To
turn them on put

usecookies true
logcgiargs true

in your configuration file.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/gsdl/src/recpt/receptionist.cpp

    r512 r526  
    1212/*
    1313   $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
    1423   Revision 1.27  1999/09/02 00:27:21  rjmcnab
    1524   A few small things.
     
    127136#include <time.h>
    128137#include <fstream.h>
     138
     139
     140
     141void 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
    129154
    130155
     
    239264    else if (key == "macrofiles") configinfo.macrofiles = cfgline;
    240265    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");
    241268
    242269    else if ((key == "argdefault") && (cfgline.size() == 2) &&
     
    405432
    406433  // get the cookie
    407   get_cookie(args["z"]);
     434  if (configinfo.usecookies) get_cookie(args["z"]);
    408435 
    409436  // get the input encoding
     
    478505  }
    479506
     507  cookie.clear();
    480508  char *host = getenv("REMOTE_ADDR");
    481509  time_t ttime = time(NULL);
     
    507535bool receptionist::log_cgi_args (cgiargsclass &args, ostream &logout) {
    508536
    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 
    511542  char *host;
    512543  host = getenv("REMOTE_HOST");
     
    539570  }
    540571
    541   log << text_t2ascii << host << " [" << ttime
     572  log << text_t2utf8 << host << " [" << ttime
    542573      << "] (" << argstr << ") \"" << browser << "\"\n";
    543574   
     
    617648
    618649    // add cookie if required
    619     if (!get_cookie())
     650    if (configinfo.usecookies && !get_cookie())
    620651      response_data += "\nSet-Cookie: GSDL_UID=" + args["z"]
    621652    + "; expires=25-Dec-37 00:00:00 GMT";
    622    
    623653  }
    624654}
Note: See TracChangeset for help on using the changeset viewer.