Ignore:
Timestamp:
1999-07-11T10:18:26+12:00 (25 years ago)
Author:
rjmcnab
Message:

Added calls to define_external_cgiargs.

File:
1 edited

Legend:

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

    r297 r362  
    1212/*
    1313   $Log$
     14   Revision 1.17  1999/07/10 22:18:26  rjmcnab
     15   Added calls to define_external_cgiargs.
     16
    1417   Revision 1.16  1999/06/27 21:49:03  sjboddie
    1518   fixed a couple of version conflicts - tidied up some small things
     
    261264  add_default_args (argsinfo, args, logout);
    262265
     266 
     267  // get the input encoding
     268  text_t &arg_w = args["w"];
     269  inconvertclass defaultinconvert;
     270  inconvertclass *inconvert = converters.get_inconverter (arg_w);
     271  if (inconvert == NULL) inconvert = &defaultinconvert;
     272
     273  // see if the next page will have a different encoding
     274  if (args.getarg("nw") != NULL) arg_w = args["nw"];
     275
     276  // convert arguments which aren't in unicode to unicode
     277  args_tounicode (args, *inconvert);
     278
     279
     280  // decide on the output conversion class (needed for checking the external
     281  // cgi arguments)
     282  rzwsoutconvertclass defaultoutconverter;
     283  rzwsoutconvertclass *outconverter = converters.get_outconverter (arg_w);
     284  if (outconverter == NULL) outconverter = &defaultoutconverter;
     285  outconverter->reset();
     286
     287
    263288  // check the main cgi arguments
    264289  if (!check_mainargs (args, logout)) return false;
     
    275300  }
    276301
    277   // get the input encoding
    278   text_t &arg_w = args["w"];
    279   inconvertclass defaultinconvert;
    280   inconvertclass *inconvert = converters.get_inconverter (arg_w);
    281   if (inconvert == NULL) inconvert = &defaultinconvert;
    282 
    283   // see if the next page will have a different encoding
    284   if (args.getarg("nw") != NULL) args["w"] = args["nw"];
    285 
    286   // convert arguments which aren't in unicode to unicode
    287   args_tounicode (args, *inconvert);
     302  // check external cgi arguments for each action
     303  actionptrmap::iterator actionhere = actions.begin ();
     304  actionptrmap::iterator actionend = actions.end ();
     305  while (actionhere != actionend) {
     306    assert ((*actionhere).second.a != NULL);
     307    if ((*actionhere).second.a != NULL) {
     308      if (!(*actionhere).second.a->check_external_cgiargs (argsinfo, args, *outconverter,
     309                               configinfo.saveconf, logout))
     310    return false;
     311    }
     312    actionhere++;
     313  }
     314
     315  // the action might have changed but we will assume that
     316  // the cgiargs were checked properly when the change was made
    288317
    289318  return true;
     
    399428// returns the compressed argument ("e") corresponding to the argument
    400429// list. This can be used to save preferences between sessions.
    401 text_t receptionist::get_compressed_arg (cgiargsclass &args, outconvertclass &outconvert,
    402                      ostream &logout) {
    403  
     430text_t receptionist::get_compressed_arg (cgiargsclass &args, ostream &logout) {
     431  // decide on the output conversion class
     432  text_t &arg_w = args["w"];
     433  rzwsoutconvertclass defaultoutconverter;
     434  rzwsoutconvertclass *outconverter = converters.get_outconverter (arg_w);
     435  if (outconverter == NULL) outconverter = &defaultoutconverter;
     436  outconverter->reset();
     437
    404438  text_t compressed_args;
    405439  if (compress_save_args (argsinfo, configinfo.saveconf, args,
    406               compressed_args, outconvert, logout))
     440              compressed_args, *outconverter, logout))
    407441    return compressed_args;
    408   else
    409     return "";
     442
     443  return "";
    410444}
    411445
     
    634668}
    635669
    636 void receptionist::define_general_macros (cgiargsclass &args, outconvertclass &outconvert,
     670void receptionist::define_general_macros (cgiargsclass &args, outconvertclass &/*outconvert*/,
    637671                      ostream &logout) {
    638672  disp.setmacro ("gwcgi", "Global", configinfo.gwcgi);
    639673  disp.setmacro ("httpimg", "Global", configinfo.httpimg);
    640674  disp.setmacro ("httpprefix", "Global", configinfo.httpprefix);
    641   disp.setmacro("compressedoptions", "Global", get_compressed_arg(args, outconvert, logout));
     675  disp.setmacro("compressedoptions", "Global", get_compressed_arg(args, logout));
    642676
    643677  // set _cgiargX_ macros for each cgi argument
Note: See TracChangeset for help on using the changeset viewer.