Changeset 2212 for trunk/gsdl/src/recpt


Ignore:
Timestamp:
2001-03-20T21:48:12+12:00 (23 years ago)
Author:
sjboddie
Message:

Fixed a bug that was causing the local library server to attempt to write
files to gsdlhome (i.e. the cd-rom drive if served from a cd) under certain
circumstances.

Location:
trunk/gsdl/src/recpt
Files:
9 edited

Legend:

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

    r1285 r2212  
    4242// configure should be called once for each configuration line
    4343void action::configure (const text_t &key, const text_tarray &cfgline) {
    44   if (key == "gsdlhome") {gsdlhome = cfgline[0];}
     44  if (key == "gsdlhome") {
     45    gsdlhome = cfgline[0];
     46    if (gdbmhome.empty()) gdbmhome = cfgline[0];
     47  }
     48  if (key == "gdbmhome") {gdbmhome = cfgline[0];}
    4549}
    4650
  • trunk/gsdl/src/recpt/action.h

    r1285 r2212  
    4848  cgiargsinfoclass argsinfo;
    4949  text_t gsdlhome;
     50  text_t gdbmhome;
    5051
    5152public:
  • trunk/gsdl/src/recpt/authenaction.cpp

    r1796 r2212  
    131131    else if (key == "keyfile") keyfile = cfgline[0];
    132132    else if (key == "keydecay") keydecay = cfgline[0].getint();
    133     else if (key == "gsdlhome") {
    134       if (usersfile.empty())
    135     usersfile = filename_cat (cfgline[0], "etc", "users.db");
    136       if (keyfile.empty())
    137     keyfile = filename_cat (cfgline[0], "etc", "key.db");
    138     }
    139133  }
    140134
     
    143137
    144138bool authenaction::init (ostream &logout) {
     139
     140  if (gdbmhome.empty()) {
     141    logout << "ERROR (authenaction::init) gdbmhome is not set\n";
     142    return false;
     143  }
     144
     145  if (usersfile.empty()) usersfile = filename_cat (gdbmhome, "etc", "users.db");
     146  if (keyfile.empty()) keyfile = filename_cat (gdbmhome, "etc", "key.db");
     147
    145148  return action::init (logout);
    146149}
  • trunk/gsdl/src/recpt/nullproto.cpp

    r2173 r2212  
    7272  // the protocol should not configure the collection set; it should be
    7373  // done direct to the collection server set
    74   if (key == "gsdlhome") {
     74  if (key == "gsdlhome" || key == "gdbmhome") {
    7575    cset->configure(key, cfgline);
    7676  }
  • trunk/gsdl/src/recpt/queryaction.cpp

    r1915 r2212  
    735735    text_t userid = args["z"];
    736736    text_tarray entries;
    737     if (get_history_info (userid, entries, gsdlhome, logout)) {
     737    if (get_history_info (userid, entries, gdbmhome, logout)) {
    738738      int count = 1;
    739739      text_tarray::iterator here = entries.begin();
     
    13971397  int hd = args.getintarg("hd");
    13981398  if (hd > 0) display=true;
    1399   if (set_history_info(userid, query, gsdlhome, display)) return true;
     1399  if (set_history_info(userid, query, gdbmhome, display)) return true;
    14001400  else return false;
    14011401
  • trunk/gsdl/src/recpt/receptionist.cpp

    r2113 r2212  
    206206    cgiarginfo *info = NULL;
    207207    if (key == "gsdlhome") configinfo.gsdlhome = cfgline[0];
     208    else if (key == "gdbmhome") configinfo.gdbmhome = cfgline[0];
    208209    else if (key == "collection") {
    209210      configinfo.collection = cfgline[0];
     
    660661  }
    661662
    662   text_t logfile = filename_cat (configinfo.gsdlhome, "etc");
    663   logfile = filename_cat (logfile, "usage.txt");
     663  text_t logfile = filename_cat (configinfo.gdbmhome, "etc", "usage.txt");
    664664
    665665  text_t logstr = script_name;
  • trunk/gsdl/src/recpt/statusaction.cpp

    r2113 r2212  
    906906                   ostream &textout, ostream &/*logout*/) {
    907907
    908   text_t maincfgfile = filename_cat (gsdlhome, "etc", "main.cfg");
     908  text_t maincfgfile = filename_cat (gdbmhome, "etc", "main.cfg");
    909909
    910910  textout << outconvert << disp << "_status:infoheader_(main.cfg)\n"
  • trunk/gsdl/src/recpt/usersaction.cpp

    r1285 r2212  
    148148  if (cfgline.size() == 1) {
    149149    if (key == "usersfile") usersfile = cfgline[0];
    150     else if (key == "gsdlhome") {
    151       if (usersfile.empty())
    152     usersfile = filename_cat (cfgline[0], "etc", "users.db");
    153     }
    154150  }
    155151
    156152  action::configure (key, cfgline);
     153}
     154
     155bool usersaction::init (ostream &logout) {
     156
     157  if (gdbmhome.empty()) {
     158    logout << "ERROR (usersaction::init) gdbmhome is not set\n";
     159    return false;
     160  }
     161
     162  if (usersfile.empty()) usersfile = filename_cat (gdbmhome, "etc", "users.db");
     163
     164  return action::init (logout);
    157165}
    158166
  • trunk/gsdl/src/recpt/usersaction.h

    r1285 r2212  
    4242
    4343  void configure (const text_t &key, const text_tarray &cfgline);
     44
     45  bool init (ostream &logout);
    4446 
    4547  text_t get_action_name () {return "um";}
Note: See TracChangeset for help on using the changeset viewer.