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:
@@ -86,11 +86,33 @@ void System::Init()
|
||||
}
|
||||
|
||||
|
||||
void System::PutUrlProto(bool can_use_ssl, std::wstring & str, bool clear_str)
|
||||
{
|
||||
bool ssl = false;
|
||||
|
||||
if( clear_str )
|
||||
str.clear();
|
||||
|
||||
if( can_use_ssl )
|
||||
{
|
||||
if( !config->use_ssl_only_for_logged_users || cur->session->puser )
|
||||
{
|
||||
str += config->url_ssl_proto;
|
||||
ssl = true;
|
||||
}
|
||||
}
|
||||
|
||||
if( !ssl )
|
||||
str += config->url_proto;
|
||||
}
|
||||
|
||||
|
||||
// !! mozna zrobic jakas obsluge kiedy nie mozemy sie redirectnac, np gdy wystapil blad
|
||||
// !! moze zwracac jakas wartosc?
|
||||
void System::RedirectTo(const Item & item, const wchar_t * postfix)
|
||||
{
|
||||
cur->request->redirect_to = config->base_url;
|
||||
PutUrlProto(config->use_ssl, cur->request->redirect_to);
|
||||
cur->request->redirect_to += config->base_url;
|
||||
|
||||
if( item.type == Item::dir )
|
||||
{
|
||||
@@ -112,7 +134,8 @@ void System::RedirectTo(const Item & item, const wchar_t * postfix)
|
||||
|
||||
void System::RedirectTo(long item_id, const wchar_t * postfix)
|
||||
{
|
||||
cur->request->redirect_to = config->base_url;
|
||||
PutUrlProto(config->use_ssl, cur->request->redirect_to);
|
||||
cur->request->redirect_to += config->base_url;
|
||||
Item * pdir = dirs.GetDir(item_id);
|
||||
|
||||
if( pdir )
|
||||
@@ -148,7 +171,8 @@ void System::RedirectTo(long item_id, const wchar_t * postfix)
|
||||
|
||||
void System::RedirectTo(const std::wstring & url)
|
||||
{
|
||||
cur->request->redirect_to = config->base_url;
|
||||
PutUrlProto(config->use_ssl, cur->request->redirect_to);
|
||||
cur->request->redirect_to += config->base_url;
|
||||
|
||||
if( !url.empty() && url[0] == '/' )
|
||||
{
|
||||
|
Reference in New Issue
Block a user