Coming along.
This commit is contained in:
parent
74d3229ee7
commit
616f1e64c6
BIN
Debug/main.cpp.o
BIN
Debug/main.cpp.o
Binary file not shown.
@ -8,8 +8,9 @@ Debug/main.cpp.o: main.cpp ../ServerCore/includes ../ServerCore/EPoll.h \
|
||||
../ServerCore/CommandList.h ../ServerCore/EPoll.h \
|
||||
../ServerCore/Exception.h ../ServerCore/File.h ../ServerCore/Log.h \
|
||||
../ServerCore/IPAddress.h HTTPService.h ../ServerCore/Service.h \
|
||||
HTTPSessions.h ../ServerCore/Header.h ../ServerCore/Response.h _GET.h \
|
||||
../ServerCore/Command.h ../ServerCore/Session.h _POST.h
|
||||
HTTPSessions.h ../ServerCore/Header.h ../ServerCore/Response.h \
|
||||
PageService.h HTTPHandler.h ../ServerCore/Command.h \
|
||||
../ServerCore/Session.h
|
||||
|
||||
../ServerCore/includes:
|
||||
|
||||
@ -65,10 +66,10 @@ HTTPSessions.h:
|
||||
|
||||
../ServerCore/Response.h:
|
||||
|
||||
_GET.h:
|
||||
PageService.h:
|
||||
|
||||
HTTPHandler.h:
|
||||
|
||||
../ServerCore/Command.h:
|
||||
|
||||
../ServerCore/Session.h:
|
||||
|
||||
_POST.h:
|
||||
|
@ -10,19 +10,30 @@ namespace http {
|
||||
core::Header header(request);
|
||||
core::Response response;
|
||||
|
||||
core::Log(core::LOG_DEBUG_1) << header.getPath() << " " << header.getCGIData();
|
||||
core::Log(core::LOG_DEBUG_1) << "Request: " << request;
|
||||
|
||||
HTTPSession *httpSession = ((HTTPService &)session->service).httpSessions.findSessionByHeader(header, response);
|
||||
// HTTPSession *httpSession = ((HTTPService &)session->service).httpSessions.findSessionByHeader(header, response);
|
||||
|
||||
std::stringstream content;
|
||||
((HTTPService &)session->service).pageService.processRequest(header.getPath(), content);
|
||||
if(((HTTPService &)session->service).pageList.processRequest(header.getPath() + " ", session, content)) {
|
||||
response.setProtocol(header.requestProtocol());
|
||||
response.setCode("200");
|
||||
response.setText("OK");
|
||||
response.setMimeType("text/html");
|
||||
data << response.getResponse(content.str());
|
||||
}
|
||||
|
||||
response.setProtocol(header.requestProtocol());
|
||||
response.setCode("200");
|
||||
response.setText("OK");
|
||||
response.setMimeType("text/html");
|
||||
data << response.getResponse(content.str());
|
||||
return 0;
|
||||
else {
|
||||
response.setProtocol(header.requestProtocol());
|
||||
response.setCode("404");
|
||||
response.setText("Not Found");
|
||||
response.setMimeType("text/html");
|
||||
data << response.getResponse(content.str());
|
||||
}
|
||||
|
||||
core::Log(core::LOG_DEBUG_1) << "==========Request completed.";
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
}
|
||||
|
@ -5,16 +5,16 @@
|
||||
## Debug
|
||||
ProjectName :=HTTPServer
|
||||
ConfigurationName :=Debug
|
||||
WorkspacePath :=/home/bradarant/barant
|
||||
ProjectPath :=/home/bradarant/barant/HTTPServer
|
||||
WorkspacePath :=/home/barant
|
||||
ProjectPath :=/home/barant/barant/HTTPServer
|
||||
IntermediateDirectory :=./Debug
|
||||
OutDir := $(IntermediateDirectory)
|
||||
CurrentFileName :=
|
||||
CurrentFilePath :=
|
||||
CurrentFileFullPath :=
|
||||
User :=Brad Arant
|
||||
Date :=22/05/19
|
||||
CodeLitePath :=/home/bradarant/.codelite
|
||||
User :=root
|
||||
Date :=05/30/19
|
||||
CodeLitePath :=/home/barant/.codelite
|
||||
LinkerName :=/usr/bin/x86_64-linux-gnu-g++
|
||||
SharedObjectLinkerName :=/usr/bin/x86_64-linux-gnu-g++ -shared -fPIC
|
||||
ObjectSuffix :=.o
|
||||
@ -92,7 +92,7 @@ PreBuild:
|
||||
## Objects
|
||||
##
|
||||
$(IntermediateDirectory)/main.cpp$(ObjectSuffix): main.cpp $(IntermediateDirectory)/main.cpp$(DependSuffix)
|
||||
$(CXX) $(IncludePCH) $(SourceSwitch) "/home/bradarant/barant/HTTPServer/main.cpp" $(CXXFLAGS) $(ObjectSwitch)$(IntermediateDirectory)/main.cpp$(ObjectSuffix) $(IncludePath)
|
||||
$(CXX) $(IncludePCH) $(SourceSwitch) "/home/barant/barant/HTTPServer/main.cpp" $(CXXFLAGS) $(ObjectSwitch)$(IntermediateDirectory)/main.cpp$(ObjectSuffix) $(IncludePath)
|
||||
$(IntermediateDirectory)/main.cpp$(DependSuffix): main.cpp
|
||||
@$(CXX) $(CXXFLAGS) $(IncludePCH) $(IncludePath) -MG -MP -MT$(IntermediateDirectory)/main.cpp$(ObjectSuffix) -MF$(IntermediateDirectory)/main.cpp$(DependSuffix) -MM main.cpp
|
||||
|
||||
@ -100,7 +100,7 @@ $(IntermediateDirectory)/main.cpp$(PreprocessSuffix): main.cpp
|
||||
$(CXX) $(CXXFLAGS) $(IncludePCH) $(IncludePath) $(PreprocessOnlySwitch) $(OutputSwitch) $(IntermediateDirectory)/main.cpp$(PreprocessSuffix) main.cpp
|
||||
|
||||
$(IntermediateDirectory)/HTTPSession.cpp$(ObjectSuffix): HTTPSession.cpp $(IntermediateDirectory)/HTTPSession.cpp$(DependSuffix)
|
||||
$(CXX) $(IncludePCH) $(SourceSwitch) "/home/bradarant/barant/HTTPServer/HTTPSession.cpp" $(CXXFLAGS) $(ObjectSwitch)$(IntermediateDirectory)/HTTPSession.cpp$(ObjectSuffix) $(IncludePath)
|
||||
$(CXX) $(IncludePCH) $(SourceSwitch) "/home/barant/barant/HTTPServer/HTTPSession.cpp" $(CXXFLAGS) $(ObjectSwitch)$(IntermediateDirectory)/HTTPSession.cpp$(ObjectSuffix) $(IncludePath)
|
||||
$(IntermediateDirectory)/HTTPSession.cpp$(DependSuffix): HTTPSession.cpp
|
||||
@$(CXX) $(CXXFLAGS) $(IncludePCH) $(IncludePath) -MG -MP -MT$(IntermediateDirectory)/HTTPSession.cpp$(ObjectSuffix) -MF$(IntermediateDirectory)/HTTPSession.cpp$(DependSuffix) -MM HTTPSession.cpp
|
||||
|
||||
@ -108,7 +108,7 @@ $(IntermediateDirectory)/HTTPSession.cpp$(PreprocessSuffix): HTTPSession.cpp
|
||||
$(CXX) $(CXXFLAGS) $(IncludePCH) $(IncludePath) $(PreprocessOnlySwitch) $(OutputSwitch) $(IntermediateDirectory)/HTTPSession.cpp$(PreprocessSuffix) HTTPSession.cpp
|
||||
|
||||
$(IntermediateDirectory)/HTTPSessions.cpp$(ObjectSuffix): HTTPSessions.cpp $(IntermediateDirectory)/HTTPSessions.cpp$(DependSuffix)
|
||||
$(CXX) $(IncludePCH) $(SourceSwitch) "/home/bradarant/barant/HTTPServer/HTTPSessions.cpp" $(CXXFLAGS) $(ObjectSwitch)$(IntermediateDirectory)/HTTPSessions.cpp$(ObjectSuffix) $(IncludePath)
|
||||
$(CXX) $(IncludePCH) $(SourceSwitch) "/home/barant/barant/HTTPServer/HTTPSessions.cpp" $(CXXFLAGS) $(ObjectSwitch)$(IntermediateDirectory)/HTTPSessions.cpp$(ObjectSuffix) $(IncludePath)
|
||||
$(IntermediateDirectory)/HTTPSessions.cpp$(DependSuffix): HTTPSessions.cpp
|
||||
@$(CXX) $(CXXFLAGS) $(IncludePCH) $(IncludePath) -MG -MP -MT$(IntermediateDirectory)/HTTPSessions.cpp$(ObjectSuffix) -MF$(IntermediateDirectory)/HTTPSessions.cpp$(DependSuffix) -MM HTTPSessions.cpp
|
||||
|
||||
@ -116,7 +116,7 @@ $(IntermediateDirectory)/HTTPSessions.cpp$(PreprocessSuffix): HTTPSessions.cpp
|
||||
$(CXX) $(CXXFLAGS) $(IncludePCH) $(IncludePath) $(PreprocessOnlySwitch) $(OutputSwitch) $(IntermediateDirectory)/HTTPSessions.cpp$(PreprocessSuffix) HTTPSessions.cpp
|
||||
|
||||
$(IntermediateDirectory)/HTTPHandler.cpp$(ObjectSuffix): HTTPHandler.cpp $(IntermediateDirectory)/HTTPHandler.cpp$(DependSuffix)
|
||||
$(CXX) $(IncludePCH) $(SourceSwitch) "/home/bradarant/barant/HTTPServer/HTTPHandler.cpp" $(CXXFLAGS) $(ObjectSwitch)$(IntermediateDirectory)/HTTPHandler.cpp$(ObjectSuffix) $(IncludePath)
|
||||
$(CXX) $(IncludePCH) $(SourceSwitch) "/home/barant/barant/HTTPServer/HTTPHandler.cpp" $(CXXFLAGS) $(ObjectSwitch)$(IntermediateDirectory)/HTTPHandler.cpp$(ObjectSuffix) $(IncludePath)
|
||||
$(IntermediateDirectory)/HTTPHandler.cpp$(DependSuffix): HTTPHandler.cpp
|
||||
@$(CXX) $(CXXFLAGS) $(IncludePCH) $(IncludePath) -MG -MP -MT$(IntermediateDirectory)/HTTPHandler.cpp$(ObjectSuffix) -MF$(IntermediateDirectory)/HTTPHandler.cpp$(DependSuffix) -MM HTTPHandler.cpp
|
||||
|
||||
|
@ -9,11 +9,12 @@
|
||||
<File Name="HTTPSession.cpp"/>
|
||||
<File Name="HTTPSessions.h"/>
|
||||
<File Name="HTTPSessions.cpp"/>
|
||||
<File Name="src/__index.h"/>
|
||||
<File Name="src/__setupadmin.h"/>
|
||||
<File Name="src/PageService.h" ExcludeProjConfig=""/>
|
||||
<File Name="HTTPHandler.cpp"/>
|
||||
<File Name="HTTPHandler.h"/>
|
||||
<File Name="__setupadmin.h"/>
|
||||
<File Name="__index.h"/>
|
||||
<File Name="PageList.h"/>
|
||||
<File Name="__favicon_ico.h"/>
|
||||
</VirtualDirectory>
|
||||
<Dependencies Name="Debug"/>
|
||||
<Dependencies Name="Release"/>
|
||||
|
@ -1 +1 @@
|
||||
./Debug/main.cpp.o ./Debug/HTTPSession.cpp.o ./Debug/HTTPSessions.cpp.o ./Debug/_GET.cpp.o ./Debug/src__POST.cpp.o
|
||||
./Debug/main.cpp.o ./Debug/HTTPSession.cpp.o ./Debug/HTTPSessions.cpp.o ./Debug/HTTPHandler.cpp.o
|
||||
|
@ -3,7 +3,7 @@
|
||||
|
||||
#include "Service.h"
|
||||
#include "HTTPSessions.h"
|
||||
#include "PageService.h"
|
||||
#include "PageList.h"
|
||||
#include "Exception.h"
|
||||
#include "HTTPHandler.h"
|
||||
|
||||
@ -13,15 +13,16 @@ namespace http {
|
||||
|
||||
public:
|
||||
HTTPService() {
|
||||
commands.add(httpHandler, "GET ");
|
||||
commands.add(httpHandler, "POST ");
|
||||
commands.add(getHandler, "GET");
|
||||
commands.add(postHandler, "POST");
|
||||
}
|
||||
|
||||
HTTPSessions httpSessions;
|
||||
PageService pageService;
|
||||
PageList pageList;
|
||||
|
||||
private:
|
||||
HTTPHandler httpHandler;
|
||||
HTTPHandler getHandler;
|
||||
HTTPHandler postHandler;
|
||||
|
||||
};
|
||||
|
||||
|
26
PageList.h
Normal file
26
PageList.h
Normal file
@ -0,0 +1,26 @@
|
||||
#ifndef __PageList_h__
|
||||
#define __PageList_h__
|
||||
|
||||
#include "CommandList.h"
|
||||
#include "__index.h"
|
||||
#include "__setupadmin.h"
|
||||
|
||||
namespace http {
|
||||
|
||||
class PageList : public core::CommandList {
|
||||
|
||||
public:
|
||||
PageList() {
|
||||
add(index, "/ ");
|
||||
add(setupadmin, "/setupadmin ");
|
||||
}
|
||||
|
||||
private:
|
||||
__index index;
|
||||
__setupadmin setupadmin;
|
||||
|
||||
};
|
||||
|
||||
}
|
||||
|
||||
#endif
|
85
__favicon_ico.h
Normal file
85
__favicon_ico.h
Normal file
@ -0,0 +1,85 @@
|
||||
#ifndef ____favicon_ico_h__
|
||||
#define ____favicon_ico_h__
|
||||
|
||||
namespace http {
|
||||
|
||||
class __favicon_ico : public core::Command {
|
||||
|
||||
int processCommand(std::string request, core::Session *session, std::stringstream &data) override {
|
||||
|
||||
data << header_data;
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
char *header_data =
|
||||
"````````````````````````````````````````^PH_U/([J-@W@<4T3[4R+*TQ"
|
||||
"+ZTQ6+<SA\\@UK=LWVO8\\_@P_````````````````````````````````````````"
|
||||
"````````````````````````````````[`,^IM@W.JXR)*HQ)*HQ)*HQ)*HQ)*HQ"
|
||||
")*HQ)*HQ)*HQ)*HQ)*HQ2K(RL=XX]@@_````````````````````````````````"
|
||||
"````````````````````````_@T_L=XX,ZTQ)*HQ)*HQ)*HQ5;4RFM$VM-\\X.:\\R"
|
||||
"@<4TL=XXE,XU1K$R)*HQ)*HQ)*HQ0J`RPN@Y`@\\`````````````````````````"
|
||||
"````````````````````[`0^<K\\T)*HQ)*HQ-ZTQIM@WYOX]`@\\`````````1+(R"
|
||||
"L]\\X````````_`X`W_D\\F-$V**LQ)*HQ)*HQBLHU^0D_````````````````````"
|
||||
"````````````````Z?`]5;4R)*HQ)*HQD\\XU\\@0^`````````````````0X`/:`R"
|
||||
"L-TX`@\\`````````````````Z/\\]?<0T)*HQ)*HQ;;TS]0<^````````````````"
|
||||
"````````````[`0^5;4R)*HQ+:LQP^DY`P``````````\\00^N>(X@,4T-JXQ)*HQ"
|
||||
")JHQ/*\\RBLHUP.8Y]P@_`````````0X`KMPW):HQ)*HQ;[XS^@H_````````````"
|
||||
"````````_PT_=+`T)*HQ+*PQTO$[````````^0D_I-<W+JPQ)*HQ)*HQ)*HQ)*HQ"
|
||||
")*HQ)*HQ)*HQ)*HQ.ZXQM=`X_@T_````````O.0Y)*HQ)*HQD\\XU`P\\`````````"
|
||||
"````````M-\\X)*HQ)*HQP^@Y````````Y_X]7+<S)*HQ)*HQ*JPQB\\HUN.(XSNXZ"
|
||||
"S.TZL]\\X@,4T)*HQ)*HQ)*HQ=+`T\\P4^````````J=HW)*HQ)*HQS.XZ````````"
|
||||
"````\\00^,ZTQ)*HQD<TU`P``````Y_X]1K$R)*HQ)ZLQI-<W\\P4^````````````"
|
||||
"````````````Z`$]D,TU)*HQ)*HQ7[@S\\`8^````_PT_<K\\S)*HQ4[0R_0L_````"
|
||||
"````J-DW)*HQ,:PQ\\@0^````^0D_6[<S)*HQ-ZTQT_([````````````_`X`\\`<^"
|
||||
"]@@_`@\\``````````P``P.<Y*:LQ)*HQ>\\,T_`X`````W_H\\)*HQ)*HQP><Y````"
|
||||
"^`L_/*\\R)*HQIM@W````````I-<W)*HQ):HQT_([````````\\P4^I-<W1;$R)*HQ"
|
||||
")*HQ4;0RL=XX^0D_````````O>4Y)*HQ)*HQO^8Y````````A<@U)*HQ:KPS`P\\`"
|
||||
"UO,[)*HQ)*HQYOX]````[`0^+*LQ)*HQI=<W````````X/H\\2+$R)*HQ)*HQ)*HQ"
|
||||
")*HQ)*HQ)*HQ7[@S[@(]`````@\\`AL@U)*HQ2[(R_0P_````T.`[)*HQ)*HQZO`]"
|
||||
"J-DW)*HQ5+4R`@\\`````N.$X)*HQ+:PQ\\`8^````\\@0^1K$R)*HQ)*HQ)*HQ)*HQ"
|
||||
")*HQ)*HQ)*HQ)*HQ9+HS^`L_````XOL\\)*HQ)*HQT.`[````^0D_+:LQ)*HQQ.DY"
|
||||
"@\\8T)*HQFM$V````````?L4T)*HQD<TU````````H=4V)*HQ)*HQ)*HQ)*HQ)*HQ"
|
||||
")*HQ)*HQ):HQ)*HQ)*HQN^,X`````P\\`9;LS)*HQH-0V````````;;XS)*HQHM4V"
|
||||
"4[8R)*HQMM`X`````0X`+JTQ)*HQO>0Y````_@T_-*TQ)*HQ)*HQ)*HQ)*HQ)*HQ"
|
||||
")*HQ)*HQ)*HQ)*HQ)*HQ;;XS`P```P\\`I-8W)*HQ=L$T````````F=$V)*HQA\\DU"
|
||||
"+:TQ)*HQP>8Y````]@@_)*HQ)*HQ6+<R<+\\T:+PS)*HQ)*HQ)*HQ)*HQ)*HQ)*HQ"
|
||||
")*HQ)*HQ)*HQ)*HQ)*HQ)*HQ3;0R2;,R-JXQ)*HQ0K,R````````JMDW)*HQ:;XS"
|
||||
"+:TQ)*HQP>8Y````]@@_)*HQ)*HQ>L,TG-,VE,\\V)*HQ)*HQ)*HQ)*HQ)*HQ)*HQ"
|
||||
")*HQ)*HQ)*HQ)*HQ)*HQ):HQL=\\XM-`X@,4T)*HQ0K,R````````JMDW)*HQ7KLS"
|
||||
"4[8S)*HQMM`X`````0X`+JTQ)*HQO.0Y````_@T_-*TQ)*HQ)*HQ)*HQ)*HQ)*HQ"
|
||||
")*HQ)*HQ)*HQ)*HQ)*HQ;;XS````````I-<W)*HQ=L$T````````F=$V)*HQB,DU"
|
||||
"@\\8T)*HQFM$V````````?\\4T)*HQD<TU````````H=4V)*HQ)*HQ)*HQ)*HQ)*HQ"
|
||||
")*HQ)*HQ)*HQ)*HQ)*HQN^,X`````P\\`9+HS)*HQH-0V````````;;XS)*HQHM4V"
|
||||
"J=DW)*HQ5+4R`@\\`````N.$X)*HQ+:PQ\\`8^````\\@4^1K$R)*HQ)*HQ)*HQ)*HQ"
|
||||
")*HQ)*HQ)*HQ)*HQ9+HS^`L_````XOL\\)*HQ)*HQT>`[````^0D_+:LQ)*HQQ.DY"
|
||||
"UO0[)*HQ)*HQYOX]````[`0^+*LQ)*HQI=<W````````X/H\\2;(R)*HQ)*HQ)*HQ"
|
||||
")*HQ)*HQ)*HQ7[@S[@(]`````@\\`A<@U)*HQ3+(R_0P_````T.`Z)*HQ)*HQZO`]"
|
||||
"^`L_/*\\R)*HQIM<W````````I-<W)*HQ):HQT_([````````\\P4^I-<W1;$R)*HQ"
|
||||
")*HQ4;0RL=XX^0D_````````O.0Y)*HQ)*HQP.8Y````````A,<U)*HQ:KPS`P\\`"
|
||||
"````J-DW)*HQ,:PQ\\00^````^0D_7+@S)*HQ-ZTQT_([````````````_`X`\\`<^"
|
||||
"]@@_`@\\``````````P``O^8Y**LQ)*HQ>\\,T_`X`````W_D\\)*HQ)*HQP><Y````"
|
||||
"````\\00^-*TQ)*HQD<TU`P``````Y_X]1K$R)*HQ)ZLQI-8W\\P4^````````````"
|
||||
"````````````Z`$]D,PU)*HQ)*HQ7[@S\\`8^````_PT_<K\\S)*HQ4[4R_0L_````"
|
||||
"````````M-\\X)*HQ)*HQPN@Y````````Y_X]7;@S)*HQ)*HQ*JLQB\\HUM^(XSNXZ"
|
||||
"S.TZL]\\X?\\4T)*HQ)*HQ)*HQ=+`T\\P4^````````J=DW)*HQ)*HQS>XZ````````"
|
||||
"````````_PT_=;`T)*HQ+*LQTO$[````````^0D_I=<W+ZPQ)*HQ)*HQ)*HQ)*HQ"
|
||||
")*HQ)*HQ)*HQ)*HQ/*XQM=`X_@T_````````O.0Y)*HQ)*HQD\\XU`P``````````"
|
||||
"````````````\\00^5K4R)*HQ+:LQPN@Y`P``````````\\@4^NN(X@,8T-JXQ):HQ"
|
||||
")JHQ/:`RB\\HUP><Y]`@_`````````0X`KMPW):HQ)*HQ;[XS^@H_````````````"
|
||||
"````````````````Z?`]5K4R)*HQ)*HQDLXU\\00^`````````````````0\\`B,HU"
|
||||
"B<HU`@\\`````````````````Z/\\]?<0T)*HQ)*HQ;;TS]0<^````````````````"
|
||||
"````````````````````[`0^<[`T)*HQ)*HQ-:TQIM@WYOX]`@\\`````````C<PU"
|
||||
"C<PU````````_`X`W_D\\F,`V**LQ)*HQ)*HQB\\HU^0D_````````````````````"
|
||||
"````````````````````````_@T_LMXX,ZTQ)*HQ)*HQ)*HQ5;4RFM$VM-\\X:+PS"
|
||||
":+PSL=TXE,XU1;$R)*HQ)*HQ)*HQ0J`RPN@Y`@\\`````````````````````````"
|
||||
"````````````````````````````````[`,^I]@W.JXR)*HQ)*HQ)*HQ)*HQ)*HQ"
|
||||
")*HQ)*HQ)*HQ)*HQ)*HQ2[(RLMXX]P@_````````````````````````````````"
|
||||
"````````````````````````````````````````^PH_U/,[J-@W@<8T3[4R+*TQ"
|
||||
"+ZTQ6;@SA\\@UK=LWV_<\\_@P_````````````````````````````````````````"
|
||||
"";
|
||||
|
||||
};
|
||||
}
|
||||
|
||||
#endif
|
@ -3,15 +3,20 @@
|
||||
|
||||
namespace http {
|
||||
|
||||
class __index : core::Command {
|
||||
class __index : public core::Command {
|
||||
|
||||
int processCommand(std::string request, core::Session *session, std::stringstream &data) override {
|
||||
|
||||
data << "<http><head></head><body style=\"background: #006; color: #fff;\">\
|
||||
<form action=\"setupadmin\"><div style=\"background: #44C; text: #888; padding: 20px;\"><p>You have successfully set up a JETServer.\
|
||||
<br>Session Id: " + httpSession->getSessionId() + "\
|
||||
<form action=\"setupadmin\" method=\"POST\"><div style=\"background: #44C; text: #888; padding: 20px;\"><p>You have successfully set up a JETServer.\
|
||||
<br>Session Id: \
|
||||
<br>The configuration has not yet been established for this web site.</p>\
|
||||
<button>Configure</button>\
|
||||
</div></form></body></html>";
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
};
|
||||
}
|
||||
|
||||
#endif
|
23
__setupadmin.h
Normal file
23
__setupadmin.h
Normal file
@ -0,0 +1,23 @@
|
||||
#ifndef ____setupadmin_h__
|
||||
#define ____setupadmin_h__
|
||||
|
||||
namespace http {
|
||||
|
||||
class __setupadmin : public core::Command {
|
||||
|
||||
int processCommand(std::string request, core::Session *session, std::stringstream &data) override {
|
||||
|
||||
data << "<http><head></head><body style=\"background: #006; color: #fff;\">\
|
||||
<form action=\"setupadmin\" method=\"POST\"><div style=\"background: #44C; text: #888; padding: 20px;\"><p>Please enter credential information\
|
||||
for the security officer.<br><input type=\"text\" name=\"username\" size=\"50\">\
|
||||
<br>Session Id: \
|
||||
<br>The configuration has not yet been established for this web site.</p>\
|
||||
<button>Configure</button>\
|
||||
</div></form></body></html>";
|
||||
|
||||
return true;
|
||||
}
|
||||
};
|
||||
}
|
||||
|
||||
#endif
|
@ -1,26 +0,0 @@
|
||||
#ifndef __PageService_h__
|
||||
#define __PageService_h__
|
||||
|
||||
#include "Service.h"
|
||||
#include "__index.h"
|
||||
#include "__setupadmin.h"
|
||||
|
||||
namespace http {
|
||||
|
||||
class PageService : public core::Service {
|
||||
|
||||
public:
|
||||
PageService() {
|
||||
commands.add(index, "/");
|
||||
commands.add(setupadmin, "/setupadmin");
|
||||
}
|
||||
|
||||
private:
|
||||
__index index;
|
||||
__setupadmin setupadmin;
|
||||
|
||||
};
|
||||
|
||||
}
|
||||
|
||||
#endif
|
@ -1,18 +0,0 @@
|
||||
#ifndef ____setupadmin_h__
|
||||
#define ____setupadmin_h__
|
||||
|
||||
namespace http {
|
||||
|
||||
class __setupadmin : core::Command {
|
||||
|
||||
int processCommand(std::string request, core::Session *session, std::stringstream &data) override {
|
||||
|
||||
data << "<http><head></head><body style=\"background: #006; color: #fff;\">\
|
||||
<form action=\"setupadmin\"><div style=\"background: #44C; text: #888; padding: 20px;\"><p>Please enter credential information\
|
||||
for the security officer.<br><input type=\"text\" name=\"username\" size=\"50\">\
|
||||
<br>Session Id: " + httpSession->getSessionId() + "\
|
||||
<br>The configuration has not yet been established for this web site.</p>\
|
||||
<button>Configure</button>\
|
||||
</div></form></body></html>";
|
||||
}
|
||||
}
|
Loading…
x
Reference in New Issue
Block a user