Main Page | Class Hierarchy | Class List | Directories | File List | Class Members

CgiForm.h

00001 /* hey emacs! -*- Mode: C++; c-file-style: "stroustrup"; indent-tabs-mode: nil -*- */
00002 /*
00003  * CgiForm.h
00004  *   Class for outputting appropriate forms.
00005  *
00006  * $Id: CgiForm.h,v 1.7 2000/12/29 05:35:05 rex Exp $
00007  *
00008  * Copyright (c) 2000 Remi Lefebvre <remi@dhis.net>
00009  *                and Benoit Joly <benoit@dhis.net>
00010  *
00011  * Licensed under the GPLv2
00012  */
00013 
00014 #ifndef CGIFORM_H
00015 #define CGIFORM_H
00016 
00017 extern "C" {
00018 #include <cgi.h>
00019 }
00020 
00021 #include <openssl/md5.h>
00022 #include <arpa/inet.h> // for string to ip conversion
00023 
00024 #include <sstream>>
00025 #include <macrosystem.hh>
00026 using namespace macrosystem;
00027 
00028 #include "Exception.h"
00029 #include "Logger.h"
00030 #include "DdtManager.h"
00031 #include "Options.h"
00032 
00033 
00034 class CgiForm
00035 {
00036   public:
00037 
00038     // default constructor
00039     CgiForm (char *templatePath, char *foot);
00040 
00041     // destructor
00042     ~CgiForm ();
00043 
00044     // print file to stdout ... for header and footer
00045     void display (char *file);
00046     void display (char *file, MacroSystem &macro);
00047 
00048     void quit (int status = 0, char *msg = "");
00049         
00050     // print registration form
00051     void printRegForm (char *domain);
00052     void printRegisteredInfoPage (int accountId, char *uPassword, char *aPassword);
00053 
00054     // print authentication form
00055     void printAuthForm ();
00056 
00057     // print the userAccounts info update form
00058     void printAcctForm (char *md5hash, userAccount *acct);
00059 
00060     // print the form to add/remove dns records
00061     void printDnsForm (char *md5hash, int hostId);
00062     
00063     void printDeleteForm (char *md5hash, int hostId);
00064 
00065   private:
00066     std::string genDropDown(char *inputName, char *values[], char *selectedValue);
00067 
00068   public:
00069     s_cgi *cgi;
00070     static char *arch[];
00071     static char *OS[];
00072 
00073   private:
00074     Logger *log;
00075     DdtManager *ddtdb;
00076 
00077     char *foot;
00078     char *templatePath;
00079 };
00080 
00081 #endif // CGIFORM_H

Generated on Tue Sep 13 01:32:46 2005 for DDT Project by  doxygen 1.4.4