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:
2011-08-17 23:09:47 +00:00
parent 3b2a1c3f25
commit ee6500ac65
28 changed files with 363 additions and 82 deletions

View File

@@ -144,12 +144,18 @@ void Config::AssignValues(bool stdout_is_closed)
db_pass = AText(L"db_pass");
item_url_empty = Text(L"item_url_empty");
base_server = Text(L"base_server");
url_proto = Text(L"url_proto", L"http://");
url_ssl_proto = Text(L"url_ssl_proto", L"https://");
use_ssl = Bool(L"use_ssl", false);
use_ssl_static = Bool(L"use_ssl_static", false);
use_ssl_common = Bool(L"use_ssl_common", false);
use_ssl_only_for_logged_users = Bool(L"use_ssl_only_for_logged_users", true);
base_url = Text(L"base_url");
base_url_static = Text(L"base_url_static");
base_url_common = Text(L"base_url_common");
NoLastSlash(base_server);
NoLastSlash(base_url);
NoLastSlash(base_url_static);
NoLastSlash(base_url_common);
@@ -218,8 +224,6 @@ void Config::AssignValues(bool stdout_is_closed)
void Config::SetAdditionalVariables()
{
SetHttpHost(base_url, base_url_http_host);
if( html_filter_orphans_mode_str == "160" )
html_filter_orphans_mode = HTMLFilter::orphan_160space;
else
@@ -283,21 +287,6 @@ void Config::CheckPasswd()
}
void Config::SetHttpHost(const std::wstring & in, std::wstring & out)
{
const char http[] = "http://";
const char https[] = "https://";
size_t http_len = sizeof(http) / sizeof(char) - 1;
size_t https_len = sizeof(https) / sizeof(char) - 1;
if( IsSubString(http, in.c_str()) )
out = in.substr(http_len);
else
if( IsSubString(https, in.c_str()) )
out = in.substr(https_len);
else
out.clear(); // if empty the RequestController::BaseUrlRedirect() returns false and no redirecting will be done
}
std::wstring Config::Text(const wchar_t * name)