2008-12-10 05:42:49 +01:00
|
|
|
/*
|
|
|
|
* This file is a part of CMSLU -- Content Management System like Unix
|
|
|
|
* and is not publicly distributed
|
|
|
|
*
|
2009-04-21 22:50:55 +02:00
|
|
|
* Copyright (c) 2008-2009, Tomasz Sowa
|
2008-12-10 05:42:49 +01:00
|
|
|
* All rights reserved.
|
|
|
|
*
|
|
|
|
*/
|
|
|
|
|
|
|
|
#include "data.h"
|
|
|
|
|
|
|
|
|
|
|
|
|
2009-04-21 22:50:55 +02:00
|
|
|
|
|
|
|
|
2008-12-10 05:42:49 +01:00
|
|
|
Data::Data()
|
|
|
|
{
|
2008-12-11 03:46:16 +01:00
|
|
|
signal_hup = false;
|
|
|
|
stdout_is_closed = false;
|
2008-12-10 05:42:49 +01:00
|
|
|
|
2008-12-11 03:46:16 +01:00
|
|
|
// the rest will be read from a config file
|
2008-12-10 05:42:49 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
2008-12-12 04:11:29 +01:00
|
|
|
void Data::SetAdditionalVariables()
|
|
|
|
{
|
|
|
|
SetHttpHost();
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
void Data::SetHttpHost()
|
|
|
|
{
|
|
|
|
if( strncmp(base_url.c_str(), "http://", 7) == 0 )
|
|
|
|
base_url_http_host = base_url.substr(7);
|
|
|
|
else
|
|
|
|
if( strncmp(base_url.c_str(), "https://", 8) == 0 )
|
|
|
|
base_url_http_host = base_url.substr(8);
|
|
|
|
else
|
2008-12-31 14:36:46 +01:00
|
|
|
base_url_http_host.clear(); // if empty the RequestController::BaseUrlRedirect() returns false and no redirecting will be done
|
2008-12-12 04:11:29 +01:00
|
|
|
}
|