worked on cgi session stuff.
This commit is contained in:
parent
167ee75658
commit
f150389672
10
Global.h
10
Global.h
@ -1,8 +1,9 @@
|
|||||||
#ifndef __Global_h__
|
#ifndef __Global_h__
|
||||||
#define __Global_h__
|
# define __Global_h__
|
||||||
|
|
||||||
#include "MString.h"
|
# include "MString.h"
|
||||||
#include <map>
|
# include "CGIFormattedData.h"
|
||||||
|
# include <map>
|
||||||
|
|
||||||
namespace jet {
|
namespace jet {
|
||||||
|
|
||||||
@ -25,6 +26,8 @@ namespace jet {
|
|||||||
void setupFormURLEncoded(coreutils::ZString &formdata);
|
void setupFormURLEncoded(coreutils::ZString &formdata);
|
||||||
char *errorCursor = NULL;
|
char *errorCursor = NULL;
|
||||||
|
|
||||||
|
|
||||||
|
coreutils::CGIFormattedData cookies;
|
||||||
std::map<coreutils::MString, coreutils::MString> variables;
|
std::map<coreutils::MString, coreutils::MString> variables;
|
||||||
std::map<coreutils::MString, coreutils::MString> cgiVariables;
|
std::map<coreutils::MString, coreutils::MString> cgiVariables;
|
||||||
std::map<coreutils::MString, __mysql *> sessions;
|
std::map<coreutils::MString, __mysql *> sessions;
|
||||||
@ -33,6 +36,7 @@ namespace jet {
|
|||||||
char **envp;
|
char **envp;
|
||||||
bool cgi = false;
|
bool cgi = false;
|
||||||
bool session = false;
|
bool session = false;
|
||||||
|
coreutils::MString sessionId;
|
||||||
|
|
||||||
};
|
};
|
||||||
|
|
||||||
|
3
Tag.cpp
3
Tag.cpp
@ -401,6 +401,9 @@ namespace jet {
|
|||||||
} else if(variable.ifNext("%")) {
|
} else if(variable.ifNext("%")) {
|
||||||
renderVariableName(variable, name, modifier);
|
renderVariableName(variable, name, modifier);
|
||||||
return getenv(name.c_str());
|
return getenv(name.c_str());
|
||||||
|
} else if(variable.ifNext("^")) {
|
||||||
|
renderVariableName(variable, name, modifier);
|
||||||
|
return global.cookies.data[variable];
|
||||||
} else {
|
} else {
|
||||||
renderVariableName(variable, name, modifier);
|
renderVariableName(variable, name, modifier);
|
||||||
name.split(".");
|
name.split(".");
|
||||||
|
@ -1,5 +1,6 @@
|
|||||||
#include "__jet.h"
|
#include "__jet.h"
|
||||||
#include "Exception.h"
|
#include "Exception.h"
|
||||||
|
#include "Global.h"
|
||||||
#include <iostream>
|
#include <iostream>
|
||||||
#include <fstream>
|
#include <fstream>
|
||||||
#include <openssl/ssl.h>
|
#include <openssl/ssl.h>
|
||||||
@ -12,9 +13,7 @@ namespace jet {
|
|||||||
global.cgi = true;
|
global.cgi = true;
|
||||||
|
|
||||||
if(keywordDefined("sessiondir")) {
|
if(keywordDefined("sessiondir")) {
|
||||||
coreutils::ZString cookies = getenv("HTTP_COOKIE");
|
cookies = getenv("HTTP_COOKIE");
|
||||||
storeVariable("cookies", cookies, "global");
|
|
||||||
|
|
||||||
global.session = true;
|
global.session = true;
|
||||||
// if request_has_cookie then
|
// if request_has_cookie then
|
||||||
// pull sessionfile from sessiondir.
|
// pull sessionfile from sessiondir.
|
||||||
|
Loading…
x
Reference in New Issue
Block a user