00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
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>
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
00039 CgiForm (char *templatePath, char *foot);
00040
00041
00042 ~CgiForm ();
00043
00044
00045 void display (char *file);
00046 void display (char *file, MacroSystem ¯o);
00047
00048 void quit (int status = 0, char *msg = "");
00049
00050
00051 void printRegForm (char *domain);
00052 void printRegisteredInfoPage (int accountId, char *uPassword, char *aPassword);
00053
00054
00055 void printAuthForm ();
00056
00057
00058 void printAcctForm (char *md5hash, userAccount *acct);
00059
00060
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