Changeset 160 for trunk/gsdl/src/recpt


Ignore:
Timestamp:
1999-02-12T15:40:18+13:00 (25 years ago)
Author:
sjboddie
Message:

Added page action

Location:
trunk/gsdl/src/recpt
Files:
2 added
3 edited

Legend:

Unmodified
Added
Removed
  • trunk/gsdl/src/recpt/Makefile

    r158 r160  
    3636
    3737HEADERS = receptionist.h cgiwrapper.h cgiargs.h action.h \
    38           converter.h recptconfig.h cgiutils.h htmlgen.h statusaction.h
     38          converter.h recptconfig.h cgiutils.h htmlgen.h statusaction.h pageaction.h
    3939
    4040SOURCES = receptionist.cpp cgiwrapper.cpp cgiargs.cpp recptmain.cpp action.cpp \
    41           converter.cpp recptconfig.cpp cgiutils.cpp htmlgen.cpp statusaction.cpp
     41          converter.cpp recptconfig.cpp cgiutils.cpp htmlgen.cpp statusaction.cpp pageaction.cpp
    4242
    4343OBJECTS = receptionist.o cgiwrapper.o cgiargs.o recptmain.o action.o \
    44           converter.o recptconfig.o cgiutils.o htmlgen.o statusaction.o
     44          converter.o recptconfig.o cgiutils.o htmlgen.o statusaction.o pageaction.o
    4545
    4646EXEC    = recpt
     
    7474cgiwrapper.o: ../../lib/gsdlconf.h ../../lib/site.h cgiwrapper.h
    7575cgiwrapper.o: receptionist.h ../../lib/text_t.h cgiargs.h ../../lib/display.h
    76 cgiwrapper.o: action.h recptconfig.h statusaction.h
     76cgiwrapper.o: action.h recptconfig.h statusaction.h pageaction.h
    7777cgiwrapper.o: ../../packages/fcgi/include/fcgiapp.h
    7878cgiwrapper.o: ../../packages/fcgi/include/fcgi_config.h
     
    9797statusaction.o: ../../lib/text_t.h cgiargs.h ../../lib/display.h
    9898statusaction.o: receptionist.h
     99pageaction.o: pageaction.h ../../lib/gsdlconf.h ../../lib/site.h action.h
     100pageaction.o: ../../lib/text_t.h cgiargs.h ../../lib/display.h
     101pageaction.o: receptionist.h
  • trunk/gsdl/src/recpt/cgiwrapper.cpp

    r158 r160  
    1212/*
    1313   $Log$
     14   Revision 1.6  1999/02/12 02:40:17  sjboddie
     15
     16   Added page action
     17
    1418   Revision 1.5  1999/02/11 01:24:04  rjmcnab
    1519
     
    4953#include "action.h"
    5054#include "statusaction.h"
     55#include "pageaction.h"
    5156#include <stdlib.h>
    5257
     
    312317  outconvertclass text_t2ascii;
    313318
    314   // the the list of actions
     319  // the list of actions
    315320  statusaction *astatusaction = new statusaction;
    316321  if (astatusaction != NULL) {
     
    318323    recpt.add_action (astatusaction);
    319324  }
     325
     326  pageaction *apageaction = new pageaction;
     327  if (apageaction != NULL) {
     328    apageaction->set_receptionist (&recpt);
     329    recpt.add_action (apageaction);
     330  }
     331
    320332
    321333  // set defaults
  • trunk/gsdl/src/recpt/statusaction.cpp

    r159 r160  
    1212/*
    1313   $Log$
     14   Revision 1.4  1999/02/12 02:40:18  sjboddie
     15
     16   Added page action
     17
    1418   Revision 1.3  1999/02/11 23:07:00  sjboddie
    1519
     
    6165
    6266bool statusaction::do_action (cgiargsclass &args, outconvertclass &outconvert,
    63                   ostream &textout, ostream &/*logout*/) {
     67                  ostream &textout, ostream &logout) {
     68
    6469  textout << outconvert << "<html>\n";
    6570  textout << outconvert << "<head>\n";
     
    187192  }
    188193
     194  ifstream errin (GSDL_GSDLHOME "/etc/errout.txt");
     195  if (initin) {
     196    textout << outconvert << "<p>The error log, " GSDL_GSDLHOME "/etc/errout.txt, contains the\n";
     197    textout << outconvert << "following information:\n\n";
     198    text_t errorpage = "<p><pre>\n";
     199
     200    char c;
     201    errin.get(c);
     202    while (!errin.eof ()) {
     203      errorpage.push_back(c);
     204      errin.get(c);
     205    }
     206   
     207    errorpage += "</pre>\n";
     208    errin.close();
     209    textout << outconvert << errorpage;
     210
     211  } else {
     212    textout << outconvert << "Couldn't read error log, " GSDL_GSDLHOME "/etc/errout.txt.\n";
     213  }
     214
    189215  textout << outconvert << "</body>\n";
    190216  textout << outconvert << "</html>\n";
Note: See TracChangeset for help on using the changeset viewer.