Ignore:
Timestamp:
2000-12-07T18:18:21+13:00 (23 years ago)
Author:
sjboddie
Message:

Added support for the new LogEvents, EmailEvents, EmailUserEvents and
MailServer configuration options (though they haven't actually been
implemented yet).

File:
1 edited

Legend:

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

    r1305 r1762  
    5656  usecookies = false;
    5757  logcgiargs = false;
     58
     59  maintainer.clear();
     60  MailServer.clear();
     61  LogEvents = Disabled;
     62  EmailEvents = Disabled;
     63  EmailUserEvents = false;
    5864
    5965  // these default page parameters can always be overriden
     
    206212    else if (key == "usecookies") configinfo.usecookies = (cfgline[0] == "true");
    207213    else if (key == "logcgiargs") configinfo.logcgiargs = (cfgline[0] == "true");
     214    else if (key == "maintainer") configinfo.maintainer = cfgline[0];
     215    else if (key == "MailServer") configinfo.MailServer = cfgline[0];
     216    else if (key == "LogEvents") {
     217      if (cfgline[0] == "CollectorEvents") configinfo.LogEvents = CollectorEvents;
     218      else if (cfgline[0] == "AllEvents") configinfo.LogEvents = AllEvents;
     219    }
     220    else if (key == "EmailEvents") {
     221      if (cfgline[0] == "CollectorEvents") configinfo.EmailEvents = CollectorEvents;
     222      else if (cfgline[0] == "AllEvents") configinfo.EmailEvents = AllEvents;
     223    }
     224    else if (key == "EmailUserEvents") configinfo.EmailUserEvents = (cfgline[0] == "true");
    208225    else if (key == "pageparam") {
    209226      if (cfgline.size() >= 2) configinfo.pageparams[cfgline[0]] = cfgline[1];
     
    399416  }
    400417
     418  // if maintainer email address is something dodgy (for now I'll define
     419  // dodgy as being anything that doesn't contain '@') disable EmailEvents
     420  // and EmailUserEvents
     421  text_t::const_iterator maintainer_end = configinfo.maintainer.end ();
     422  text_t::const_iterator maintainer_here = findchar (configinfo.maintainer.begin(),
     423                             maintainer_end, '@');
     424  if (maintainer_here == maintainer_end) {
     425    configinfo.EmailEvents = Disabled;
     426    configinfo.EmailUserEvents = Disabled;
     427  } else {
     428    // if MailServer isn't set it should default to mail.maintainer-domain
     429    if (configinfo.MailServer.empty()) {
     430      configinfo.MailServer = "mail." + substr (maintainer_here, maintainer_end);
     431    }
     432  }
     433
    401434  // init the actions
    402435  actionptrmap::iterator actionhere = actions.begin ();
Note: See TracChangeset for help on using the changeset viewer.