changed: we should use SSL connection for such functions as:
adduser, login git-svn-id: svn://ttmath.org/publicrep/winix/trunk@766 e52654a7-88a9-db11-a3e9-0013d4bc506e
This commit is contained in:
parent
39923d6617
commit
f113e2ef31
|
@ -478,21 +478,21 @@ system.o: threadmanager.h ../templates/templates.h
|
||||||
system.o: ../templates/patterncacher.h ../templates/indexpatterns.h
|
system.o: ../templates/patterncacher.h ../templates/indexpatterns.h
|
||||||
system.o: ../templates/patterns.h ../templates/changepatterns.h ../core/cur.h
|
system.o: ../templates/patterns.h ../templates/changepatterns.h ../core/cur.h
|
||||||
system.o: ../core/system.h ../core/sessionmanager.h ../core/htmlfilter.h
|
system.o: ../core/system.h ../core/sessionmanager.h ../core/htmlfilter.h
|
||||||
system.o: ../functions/functionbase.h ../core/request.h ../core/synchro.h
|
|
||||||
system.o: plugin.h pluginmsg.h sessionmanager.h sessioncontainer.h
|
|
||||||
system.o: ../functions/functions.h ../functions/functionbase.h
|
system.o: ../functions/functions.h ../functions/functionbase.h
|
||||||
system.o: ../functions/functionparser.h ../functions/adduser.h
|
system.o: ../core/request.h ../core/synchro.h ../functions/functionparser.h
|
||||||
system.o: ../functions/cat.h ../functions/chmod.h ../functions/privchanger.h
|
system.o: ../functions/adduser.h ../functions/cat.h ../functions/chmod.h
|
||||||
system.o: ../functions/chown.h ../functions/ckeditor.h ../functions/cp.h
|
system.o: ../functions/privchanger.h ../functions/chown.h
|
||||||
system.o: ../functions/default.h ../functions/download.h ../functions/emacs.h
|
system.o: ../functions/ckeditor.h ../functions/cp.h ../functions/default.h
|
||||||
system.o: ../functions/last.h ../functions/login.h ../functions/logout.h
|
system.o: ../functions/download.h ../functions/emacs.h ../functions/last.h
|
||||||
system.o: ../functions/ln.h ../functions/ls.h ../functions/mkdir.h
|
system.o: ../functions/login.h ../functions/logout.h ../functions/ln.h
|
||||||
system.o: ../functions/mv.h ../functions/nicedit.h ../functions/node.h
|
system.o: ../functions/ls.h ../functions/mkdir.h ../functions/mv.h
|
||||||
system.o: ../functions/passwd.h ../functions/priv.h ../functions/reload.h
|
system.o: ../functions/nicedit.h ../functions/node.h ../functions/passwd.h
|
||||||
system.o: ../functions/rm.h ../functions/sort.h ../functions/specialdefault.h
|
system.o: ../functions/priv.h ../functions/reload.h ../functions/rm.h
|
||||||
|
system.o: ../functions/sort.h ../functions/specialdefault.h
|
||||||
system.o: ../functions/stat.h ../functions/subject.h ../functions/template.h
|
system.o: ../functions/stat.h ../functions/subject.h ../functions/template.h
|
||||||
system.o: ../functions/tinymce.h ../functions/uname.h ../functions/upload.h
|
system.o: ../functions/tinymce.h ../functions/uname.h ../functions/upload.h
|
||||||
system.o: ../functions/uptime.h ../functions/who.h ../functions/vim.h
|
system.o: ../functions/uptime.h ../functions/who.h ../functions/vim.h
|
||||||
|
system.o: plugin.h pluginmsg.h sessionmanager.h sessioncontainer.h
|
||||||
textstream.o: textstream.h misc.h item.h requesttypes.h
|
textstream.o: textstream.h misc.h item.h requesttypes.h
|
||||||
threadmanager.o: threadmanager.h basethread.h synchro.h log.h textstream.h
|
threadmanager.o: threadmanager.h basethread.h synchro.h log.h textstream.h
|
||||||
threadmanager.o: logmanipulators.h slog.h cur.h request.h requesttypes.h
|
threadmanager.o: logmanipulators.h slog.h cur.h request.h requesttypes.h
|
||||||
|
|
23
core/app.cpp
23
core/app.cpp
|
@ -60,6 +60,7 @@ App::App()
|
||||||
system.SetCur(&cur);
|
system.SetCur(&cur);
|
||||||
system.SetDb(&db);
|
system.SetDb(&db);
|
||||||
system.SetSynchro(&synchro);
|
system.SetSynchro(&synchro);
|
||||||
|
system.SetFunctions(&functions);
|
||||||
|
|
||||||
templates.SetConfig(&config);
|
templates.SetConfig(&config);
|
||||||
templates.SetCur(&cur);
|
templates.SetCur(&cur);
|
||||||
|
@ -199,6 +200,22 @@ return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
bool App::ShouldChangeToSSL()
|
||||||
|
{
|
||||||
|
if( !config.use_ssl || cur.request->using_ssl )
|
||||||
|
return false;
|
||||||
|
|
||||||
|
if( cur.request->function == &functions.fun_login ||
|
||||||
|
cur.request->function == &functions.fun_adduser )
|
||||||
|
return true;
|
||||||
|
|
||||||
|
if( config.use_ssl_only_for_logged_users && !cur.session->puser )
|
||||||
|
return false;
|
||||||
|
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
void App::ProcessRequestThrow()
|
void App::ProcessRequestThrow()
|
||||||
{
|
{
|
||||||
ReadRequest();
|
ReadRequest();
|
||||||
|
@ -218,15 +235,15 @@ void App::ProcessRequestThrow()
|
||||||
}
|
}
|
||||||
|
|
||||||
plugin.Call(WINIX_SESSION_CHANGED);
|
plugin.Call(WINIX_SESSION_CHANGED);
|
||||||
|
functions.Parse(); // parsing directories,files,functions and parameters
|
||||||
|
|
||||||
if( (config.use_ssl && (!config.use_ssl_only_for_logged_users || cur.session->puser)) && !cur.request->using_ssl )
|
if( ShouldChangeToSSL() )
|
||||||
{
|
{
|
||||||
BaseUrlRedirect(303);
|
BaseUrlRedirect(303);
|
||||||
log << log3 << "App: BaseUrlRedirect from: " << cur.request->env_http_host << " to SSL connection" << logend;
|
log << log3 << "App: this operation should be used in SSL connection" << logend;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
functions.Parse(); // parsing directories,files,functions and parameters
|
|
||||||
cur.mount = system.mounts.CalcCurMount();
|
cur.mount = system.mounts.CalcCurMount();
|
||||||
|
|
||||||
if( system.mounts.pmount->type != system.mounts.MountTypeStatic() )
|
if( system.mounts.pmount->type != system.mounts.MountTypeStatic() )
|
||||||
|
|
|
@ -126,6 +126,7 @@ private:
|
||||||
void ProcessRequest();
|
void ProcessRequest();
|
||||||
void BaseUrlRedirect(int code);
|
void BaseUrlRedirect(int code);
|
||||||
bool BaseUrlRedirect();
|
bool BaseUrlRedirect();
|
||||||
|
bool ShouldChangeToSSL();
|
||||||
void MakePage();
|
void MakePage();
|
||||||
void Make();
|
void Make();
|
||||||
void SaveSessionsIfNeeded(); // !! wywalic do menagera sesji??
|
void SaveSessionsIfNeeded(); // !! wywalic do menagera sesji??
|
||||||
|
|
|
@ -11,7 +11,7 @@
|
||||||
#include "misc.h"
|
#include "misc.h"
|
||||||
#include "error.h"
|
#include "error.h"
|
||||||
#include "templates/templates.h"
|
#include "templates/templates.h"
|
||||||
#include "functions/functionbase.h"
|
#include "functions/functions.h"
|
||||||
#include "plugin.h"
|
#include "plugin.h"
|
||||||
|
|
||||||
|
|
||||||
|
@ -40,6 +40,11 @@ void System::SetSynchro(Synchro * psynchro)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
void System::SetFunctions(Functions * pfunctions)
|
||||||
|
{
|
||||||
|
functions = pfunctions;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
void System::Init()
|
void System::Init()
|
||||||
|
@ -92,7 +97,10 @@ bool ssl = false;
|
||||||
|
|
||||||
if( can_use_ssl )
|
if( can_use_ssl )
|
||||||
{
|
{
|
||||||
if( !config->use_ssl_only_for_logged_users || cur->session->puser )
|
if( !config->use_ssl_only_for_logged_users ||
|
||||||
|
cur->session->puser ||
|
||||||
|
cur->request->function == &functions->fun_login ||
|
||||||
|
cur->request->function == &functions->fun_adduser)
|
||||||
{
|
{
|
||||||
str += config->url_ssl_proto;
|
str += config->url_ssl_proto;
|
||||||
ssl = true;
|
ssl = true;
|
||||||
|
|
|
@ -27,6 +27,7 @@
|
||||||
#include "notify/notify.h"
|
#include "notify/notify.h"
|
||||||
|
|
||||||
|
|
||||||
|
class Functions;
|
||||||
|
|
||||||
|
|
||||||
// file system
|
// file system
|
||||||
|
@ -71,6 +72,7 @@ public:
|
||||||
void SetConfig(Config * pconfig);
|
void SetConfig(Config * pconfig);
|
||||||
void SetDb(Db * pdb);
|
void SetDb(Db * pdb);
|
||||||
void SetSynchro(Synchro * psynchro);
|
void SetSynchro(Synchro * psynchro);
|
||||||
|
void SetFunctions(Functions * pfunctions);
|
||||||
void Init();
|
void Init();
|
||||||
|
|
||||||
void AddParams(const ParamTab & param_tab, std::wstring & str, bool clear_str = true);
|
void AddParams(const ParamTab & param_tab, std::wstring & str, bool clear_str = true);
|
||||||
|
@ -142,6 +144,7 @@ private:
|
||||||
Db * db;
|
Db * db;
|
||||||
Config * config;
|
Config * config;
|
||||||
Synchro * synchro;
|
Synchro * synchro;
|
||||||
|
Functions * functions;
|
||||||
|
|
||||||
Item item_temp;
|
Item item_temp;
|
||||||
std::wstring link_to_temp, name_temp;
|
std::wstring link_to_temp, name_temp;
|
||||||
|
|
|
@ -44,6 +44,7 @@ blockquote:before, blockquote:after {
|
||||||
content: "";
|
content: "";
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
blockquote {
|
blockquote {
|
||||||
margin-left: 40px;
|
margin-left: 40px;
|
||||||
margin-right: 40px;
|
margin-right: 40px;
|
||||||
|
@ -67,6 +68,55 @@ strong {
|
||||||
font-weight: bold;
|
font-weight: bold;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
ul > li {
|
||||||
|
list-style-type: bullet;
|
||||||
|
margin-left: 2em;
|
||||||
|
padding: 0.4em 0 0.4em 15px;
|
||||||
|
}
|
||||||
|
|
||||||
|
ol > li {
|
||||||
|
list-style-type: decimal;
|
||||||
|
margin-left: 3em;
|
||||||
|
padding: 0.4em 0 0.4em 5px;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
* html ul li {
|
||||||
|
list-style-type: bullet;
|
||||||
|
margin-left: 2em;
|
||||||
|
padding: 0.4em 0 0.4em 15px;
|
||||||
|
}
|
||||||
|
|
||||||
|
* html ol li {
|
||||||
|
list-style-type: decimal;
|
||||||
|
margin-left: 3em;
|
||||||
|
padding: 0.4em 0 0.4em 5px;
|
||||||
|
}
|
||||||
|
|
||||||
|
span.strikethrough {
|
||||||
|
text-decoration: line-through;
|
||||||
|
}
|
||||||
|
|
||||||
|
span.underline {
|
||||||
|
text-decoration: underline;
|
||||||
|
}
|
||||||
|
|
||||||
|
table {
|
||||||
|
margin-left: 3em;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
table th {
|
||||||
|
font-weight: bold;
|
||||||
|
padding-right: 2em;
|
||||||
|
}
|
||||||
|
|
||||||
|
table td {
|
||||||
|
padding-right: 2em;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
/* */
|
/* */
|
||||||
|
|
||||||
p.withnext {
|
p.withnext {
|
||||||
|
|
|
@ -69,10 +69,12 @@ font-weight: bold;
|
||||||
|
|
||||||
ul li {
|
ul li {
|
||||||
list-style-type: bullet;
|
list-style-type: bullet;
|
||||||
|
margin-left: 2em;
|
||||||
}
|
}
|
||||||
|
|
||||||
ol li {
|
ol li {
|
||||||
list-style-type: decimal;
|
list-style-type: decimal;
|
||||||
|
margin-left: 2em;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* ---------------------- index template -------------------------- */
|
/* ---------------------- index template -------------------------- */
|
||||||
|
|
Loading…
Reference in New Issue