added: some more orphans to polish default locale
added: new options to the config: url_proto: default: http:// url_ssl_proto: default: https:// use_ssl, use_ssl_static, use_ssl_common (whether or not to use SSL protocol) use_ssl_only_for_logged_users now we are able to use SSL encryption (https) together with normal connections removed: config option: base_server git-svn-id: svn://ttmath.org/publicrep/winix/trunk@755 e52654a7-88a9-db11-a3e9-0013d4bc506e
This commit is contained in:
@@ -26,6 +26,32 @@ adduser.o: ../core/group.h ../core/loadavg.h ../core/thumb.h
|
||||
adduser.o: ../core/basethread.h ../core/threadmanager.h
|
||||
adduser.o: ../core/sessionmanager.h ../core/sessioncontainer.h
|
||||
adduser.o: ../core/system.h ../core/htmlfilter.h ../core/request.h
|
||||
config.o: templates.h ../../ezc/src/ezc.h ../../ezc/src/utf8.h
|
||||
config.o: ../../ezc/src/generator.h ../../ezc/src/pattern.h
|
||||
config.o: ../../ezc/src/item.h ../../ezc/src/funinfo.h
|
||||
config.o: ../../ezc/src/functions.h ../../ezc/src/stringconv.h misc.h
|
||||
config.o: localefilter.h locale.h ../core/confparser.h htmltextstream.h
|
||||
config.o: ../core/textstream.h ../core/user.h patterncacher.h ../core/item.h
|
||||
config.o: indexpatterns.h ../core/config.h ../core/confparser.h
|
||||
config.o: ../core/htmlfilter.h ../core/cur.h ../core/request.h
|
||||
config.o: ../core/requesttypes.h ../core/error.h ../core/config.h
|
||||
config.o: ../core/textstream.h ../templates/htmltextstream.h
|
||||
config.o: ../core/session.h ../core/user.h ../core/plugindata.h
|
||||
config.o: ../core/rebus.h ../core/mount.h ../core/system.h ../core/dirs.h
|
||||
config.o: ../core/dircontainer.h ../db/db.h ../db/dbbase.h ../db/dbconn.h
|
||||
config.o: ../db/dbtextstream.h ../core/error.h ../db/dbitemquery.h
|
||||
config.o: ../db/dbitemcolumns.h ../core/group.h ../core/dircontainer.h
|
||||
config.o: ../core/ugcontainer.h ../core/log.h ../core/logmanipulators.h
|
||||
config.o: ../core/slog.h ../core/cur.h ../templates/locale.h
|
||||
config.o: ../notify/notify.h ../notify/notifypool.h ../templates/misc.h
|
||||
config.o: ../notify/notifythread.h ../core/basethread.h ../core/synchro.h
|
||||
config.o: ../notify/templatesnotify.h ../core/users.h ../core/ugcontainer.h
|
||||
config.o: ../core/lastcontainer.h ../core/mounts.h ../core/mountparser.h
|
||||
config.o: ../core/crypt.h ../core/run.h ../core/users.h ../core/groups.h
|
||||
config.o: ../core/group.h ../core/loadavg.h ../core/thumb.h
|
||||
config.o: ../core/basethread.h ../core/threadmanager.h
|
||||
config.o: ../core/sessionmanager.h ../core/sessioncontainer.h
|
||||
config.o: ../core/system.h ../core/htmlfilter.h
|
||||
dir.o: templates.h ../../ezc/src/ezc.h ../../ezc/src/utf8.h
|
||||
dir.o: ../../ezc/src/generator.h ../../ezc/src/pattern.h ../../ezc/src/item.h
|
||||
dir.o: ../../ezc/src/funinfo.h ../../ezc/src/functions.h
|
||||
@@ -214,6 +240,31 @@ localefilter.o: ../../ezc/src/generator.h ../../ezc/src/pattern.h
|
||||
localefilter.o: ../../ezc/src/item.h ../../ezc/src/funinfo.h
|
||||
localefilter.o: ../../ezc/src/functions.h ../../ezc/src/stringconv.h
|
||||
localefilter.o: ../core/misc.h ../core/requesttypes.h
|
||||
login.o: templates.h ../../ezc/src/ezc.h ../../ezc/src/utf8.h
|
||||
login.o: ../../ezc/src/generator.h ../../ezc/src/pattern.h
|
||||
login.o: ../../ezc/src/item.h ../../ezc/src/funinfo.h
|
||||
login.o: ../../ezc/src/functions.h ../../ezc/src/stringconv.h misc.h
|
||||
login.o: localefilter.h locale.h ../core/confparser.h htmltextstream.h
|
||||
login.o: ../core/textstream.h ../core/user.h patterncacher.h ../core/item.h
|
||||
login.o: indexpatterns.h ../core/config.h ../core/confparser.h
|
||||
login.o: ../core/htmlfilter.h ../core/cur.h ../core/request.h
|
||||
login.o: ../core/requesttypes.h ../core/error.h ../core/config.h
|
||||
login.o: ../core/textstream.h ../templates/htmltextstream.h ../core/session.h
|
||||
login.o: ../core/user.h ../core/plugindata.h ../core/rebus.h ../core/mount.h
|
||||
login.o: ../core/system.h ../core/dirs.h ../core/dircontainer.h ../db/db.h
|
||||
login.o: ../db/dbbase.h ../db/dbconn.h ../db/dbtextstream.h ../core/error.h
|
||||
login.o: ../db/dbitemquery.h ../db/dbitemcolumns.h ../core/group.h
|
||||
login.o: ../core/dircontainer.h ../core/ugcontainer.h ../core/log.h
|
||||
login.o: ../core/logmanipulators.h ../core/slog.h ../core/cur.h
|
||||
login.o: ../templates/locale.h ../notify/notify.h ../notify/notifypool.h
|
||||
login.o: ../templates/misc.h ../notify/notifythread.h ../core/basethread.h
|
||||
login.o: ../core/synchro.h ../notify/templatesnotify.h ../core/users.h
|
||||
login.o: ../core/ugcontainer.h ../core/lastcontainer.h ../core/mounts.h
|
||||
login.o: ../core/mountparser.h ../core/crypt.h ../core/run.h ../core/users.h
|
||||
login.o: ../core/groups.h ../core/group.h ../core/loadavg.h ../core/thumb.h
|
||||
login.o: ../core/basethread.h ../core/threadmanager.h
|
||||
login.o: ../core/sessionmanager.h ../core/sessioncontainer.h ../core/system.h
|
||||
login.o: ../core/htmlfilter.h
|
||||
ls.o: templates.h ../../ezc/src/ezc.h ../../ezc/src/utf8.h
|
||||
ls.o: ../../ezc/src/generator.h ../../ezc/src/pattern.h ../../ezc/src/item.h
|
||||
ls.o: ../../ezc/src/funinfo.h ../../ezc/src/functions.h
|
||||
|
@@ -1 +1 @@
|
||||
o = adduser.o dir.o doc.o filters.o htmltextstream.o indexpatterns.o insert.o item.o last.o locale.o localefilter.o ls.o misc.o mount.o patterncacher.o priv.o rebus.o slog.o stat.o sys.o template.o templates.o upload.o uptime.o user.o who.o winix.o
|
||||
o = adduser.o config.o dir.o doc.o filters.o htmltextstream.o indexpatterns.o insert.o item.o last.o locale.o localefilter.o login.o ls.o misc.o mount.o patterncacher.o priv.o rebus.o slog.o stat.o sys.o template.o templates.o upload.o uptime.o user.o who.o winix.o
|
||||
|
74
templates/config.cpp
Executable file
74
templates/config.cpp
Executable file
@@ -0,0 +1,74 @@
|
||||
/*
|
||||
* This file is a part of Winix
|
||||
* and is not publicly distributed
|
||||
*
|
||||
* Copyright (c) 2011, Tomasz Sowa
|
||||
* All rights reserved.
|
||||
*
|
||||
*/
|
||||
|
||||
#include "templates.h"
|
||||
|
||||
|
||||
|
||||
namespace TemplatesFunctions
|
||||
{
|
||||
|
||||
/*
|
||||
some config options
|
||||
*/
|
||||
|
||||
|
||||
void config_use_ssl(Info & i)
|
||||
{
|
||||
i.res = config->use_ssl;
|
||||
}
|
||||
|
||||
|
||||
void config_use_ssl_static(Info & i)
|
||||
{
|
||||
i.res = config->use_ssl_static;
|
||||
}
|
||||
|
||||
|
||||
void config_use_ssl_common(Info & i)
|
||||
{
|
||||
i.res = config->use_ssl_common;
|
||||
}
|
||||
|
||||
|
||||
void config_url_proto(Info & i)
|
||||
{
|
||||
i.out << config->url_proto;
|
||||
}
|
||||
|
||||
|
||||
void config_url_ssl_proto(Info & i)
|
||||
{
|
||||
i.out << config->url_ssl_proto;
|
||||
}
|
||||
|
||||
|
||||
void config_base_url(Info & i)
|
||||
{
|
||||
i.out << config->base_url;
|
||||
}
|
||||
|
||||
|
||||
void config_base_url_static(Info & i)
|
||||
{
|
||||
i.out << config->base_url_static;
|
||||
}
|
||||
|
||||
|
||||
void config_base_url_common(Info & i)
|
||||
{
|
||||
i.out << config->base_url_common;
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
} // namespace TemplatesFunctions
|
||||
|
||||
|
@@ -73,18 +73,7 @@ void dir_parent_without_slash(Info & i)
|
||||
// bo inaczej i tak bylo by 'access denied'
|
||||
void dir_can_read_exec(Info & i)
|
||||
{
|
||||
bool result = true;
|
||||
|
||||
for(size_t a=0 ; a<cur->request->dir_tab.size() ; ++a)
|
||||
{
|
||||
if( !system->HasReadExecAccess(*cur->request->dir_tab[a]) )
|
||||
{
|
||||
result = false;
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
i.res = result;
|
||||
i.res = system->HasReadExecAccessToPath(cur->request->dir_tab);
|
||||
}
|
||||
|
||||
|
||||
@@ -249,6 +238,7 @@ void dir_tab_url(Info & i)
|
||||
|
||||
void dir_tab_link(Info & i)
|
||||
{
|
||||
doc_proto(i);
|
||||
i.out << config->base_url;
|
||||
|
||||
for(size_t a = 0 ; a <= dir_index && a < cur->request->dir_tab.size() ; ++a)
|
||||
|
@@ -17,7 +17,7 @@ namespace TemplatesFunctions
|
||||
{
|
||||
|
||||
|
||||
|
||||
static std::wstring doc_proto_str;
|
||||
|
||||
|
||||
|
||||
@@ -48,22 +48,44 @@ void doc_title(Info & i)
|
||||
|
||||
|
||||
|
||||
void doc_proto(Info & i)
|
||||
{
|
||||
system->PutUrlProto(config->use_ssl, doc_proto_str);
|
||||
i.out << doc_proto_str;
|
||||
}
|
||||
|
||||
|
||||
void doc_proto_static(Info & i)
|
||||
{
|
||||
system->PutUrlProto(config->use_ssl_static, doc_proto_str);
|
||||
i.out << doc_proto_str;
|
||||
}
|
||||
|
||||
|
||||
void doc_proto_common(Info & i)
|
||||
{
|
||||
system->PutUrlProto(config->use_ssl_common, doc_proto_str);
|
||||
i.out << doc_proto_str;
|
||||
}
|
||||
|
||||
|
||||
void doc_base_url(Info & i)
|
||||
{
|
||||
doc_proto(i);
|
||||
i.out << config->base_url;
|
||||
}
|
||||
|
||||
|
||||
void doc_base_url_static(Info & i)
|
||||
{
|
||||
doc_proto_static(i);
|
||||
i.out << config->base_url_static;
|
||||
}
|
||||
|
||||
|
||||
void doc_base_url_common(Info & i)
|
||||
{
|
||||
doc_proto_common(i);
|
||||
i.out << config->base_url_common;
|
||||
}
|
||||
|
||||
|
@@ -163,6 +163,7 @@ void item_url_is(Info & i)
|
||||
|
||||
void item_link(Info & i)
|
||||
{
|
||||
doc_proto(i);
|
||||
i.out << config->base_url;
|
||||
item_dir(i);
|
||||
item_url(i);
|
||||
@@ -461,6 +462,7 @@ void item_tab_link(Info & i)
|
||||
{
|
||||
if( item_index < cur->request->item_tab.size() )
|
||||
{
|
||||
doc_proto(i);
|
||||
i.out << config->base_url;
|
||||
item_tab_dir(i);
|
||||
item_tab_url(i);
|
||||
|
46
templates/login.cpp
Executable file
46
templates/login.cpp
Executable file
@@ -0,0 +1,46 @@
|
||||
/*
|
||||
* This file is a part of Winix
|
||||
* and is not publicly distributed
|
||||
*
|
||||
* Copyright (c) 2011, Tomasz Sowa
|
||||
* All rights reserved.
|
||||
*
|
||||
*/
|
||||
|
||||
#include "templates.h"
|
||||
|
||||
|
||||
|
||||
namespace TemplatesFunctions
|
||||
{
|
||||
|
||||
|
||||
void login_path(Info & i)
|
||||
{
|
||||
if( config->use_ssl )
|
||||
i.out << config->url_ssl_proto;
|
||||
else
|
||||
i.out << config->url_proto;
|
||||
|
||||
i.out << config->base_url;
|
||||
|
||||
if( system->HasReadExecAccessToPath(cur->request->dir_tab) )
|
||||
{
|
||||
dir(i);
|
||||
|
||||
if( cur->request->is_item && system->HasReadAccess(cur->request->item) )
|
||||
i.out << cur->request->item.url << '/';
|
||||
}
|
||||
else
|
||||
{
|
||||
i.out << '/';
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
} // namespace TemplatesFunctions
|
||||
|
||||
|
@@ -142,6 +142,19 @@ void Templates::CreateFunctions()
|
||||
ezc_functions.Insert("adduser_last_email", adduser_last_email);
|
||||
|
||||
|
||||
/*
|
||||
config
|
||||
*/
|
||||
ezc_functions.Insert("config_use_ssl", config_use_ssl);
|
||||
ezc_functions.Insert("config_use_ssl_static", config_use_ssl_static);
|
||||
ezc_functions.Insert("config_use_ssl_common", config_use_ssl_common);
|
||||
ezc_functions.Insert("config_url_proto", config_url_proto);
|
||||
ezc_functions.Insert("config_url_ssl_proto", config_url_ssl_proto);
|
||||
ezc_functions.Insert("config_base_url", config_base_url);
|
||||
ezc_functions.Insert("config_base_url_static", config_base_url_static);
|
||||
ezc_functions.Insert("config_base_url_common", config_base_url_common);
|
||||
|
||||
|
||||
/*
|
||||
dir
|
||||
*/
|
||||
@@ -198,6 +211,9 @@ void Templates::CreateFunctions()
|
||||
doc
|
||||
*/
|
||||
ezc_functions.Insert("doc_title", doc_title);
|
||||
ezc_functions.Insert("doc_proto", doc_proto);
|
||||
ezc_functions.Insert("doc_proto_static", doc_proto_static);
|
||||
ezc_functions.Insert("doc_proto_common", doc_proto_common);
|
||||
ezc_functions.Insert("doc_base_url", doc_base_url);
|
||||
ezc_functions.Insert("doc_base_url_static", doc_base_url_static);
|
||||
ezc_functions.Insert("doc_base_url_common", doc_base_url_common);
|
||||
@@ -313,6 +329,12 @@ void Templates::CreateFunctions()
|
||||
ezc_functions.Insert("last_tab_end", last_tab_end);
|
||||
|
||||
|
||||
/*
|
||||
login
|
||||
*/
|
||||
ezc_functions.Insert("login_path", login_path);
|
||||
|
||||
|
||||
/*
|
||||
mount
|
||||
*/
|
||||
|
@@ -70,6 +70,19 @@ namespace TemplatesFunctions
|
||||
void adduser_last_email(Info & i);
|
||||
|
||||
|
||||
/*
|
||||
config
|
||||
*/
|
||||
void config_use_ssl(Info & i);
|
||||
void config_use_ssl_static(Info & i);
|
||||
void config_use_ssl_common(Info & i);
|
||||
void config_url_proto(Info & i);
|
||||
void config_url_ssl_proto(Info & i);
|
||||
void config_base_url(Info & i);
|
||||
void config_base_url_static(Info & i);
|
||||
void config_base_url_common(Info & i);
|
||||
|
||||
|
||||
/*
|
||||
dir
|
||||
*/
|
||||
@@ -116,6 +129,9 @@ namespace TemplatesFunctions
|
||||
doc
|
||||
*/
|
||||
void doc_title(Info & i);
|
||||
void doc_proto(Info & i);
|
||||
void doc_proto_static(Info & i);
|
||||
void doc_proto_common(Info & i);
|
||||
void doc_base_url(Info & i);
|
||||
void doc_base_url_static(Info & i);
|
||||
void doc_base_url_common(Info & i);
|
||||
@@ -242,6 +258,12 @@ namespace TemplatesFunctions
|
||||
void last_tab_end(Info & i);
|
||||
|
||||
|
||||
/*
|
||||
login
|
||||
*/
|
||||
void login_path(Info & i);
|
||||
|
||||
|
||||
/*
|
||||
mount
|
||||
*/
|
||||
|
Reference in New Issue
Block a user