本文整理汇总了C++中CConfigFile::loadConfig方法的典型用法代码示例。如果您正苦于以下问题:C++ CConfigFile::loadConfig方法的具体用法?C++ CConfigFile::loadConfig怎么用?C++ CConfigFile::loadConfig使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类CConfigFile
的用法示例。
在下文中一共展示了CConfigFile::loadConfig方法的11个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: init
void eMountMgr::init()
{
t_mount mp;
mountPoints.clear();
CConfigFile *config = new CConfigFile(',');
if (config->loadConfig(MOUNTCONFIGFILE))
{
for (int i = 0; true; i++)
{
if (config->getString(eString().sprintf("localdir_%d", i)) != "")
{
mp.localDir = config->getString(eString().sprintf("localdir_%d", i));
mp.fstype = config->getInt32(eString().sprintf("fstype_%d", i));
mp.password = config->getString(eString().sprintf("password_%d", i));
mp.userName = config->getString(eString().sprintf("username_%d", i));
mp.mountDir = config->getString(eString().sprintf("mountdir_%d", i));
mp.automount = config->getInt32(eString().sprintf("automount_%d", i));
mp.options = config->getString(eString().sprintf("options_%d", i));
mp.description = config->getString(eString().sprintf("description_%d", i));
eString sip = config->getString(eString().sprintf("ip_%d", i));
sscanf(sip.c_str(), "%d.%d.%d.%d", &mp.ip[0], &mp.ip[1], &mp.ip[2], &mp.ip[3]);
mp.id = i;
eMountPoint m = eMountPoint(mp);
m.mp.mounted = m.isMounted();
mountPoints.push_back(m);
}
else
break;
}
}
delete config;
addMountedFileSystems();
}
示例2: func_mount_get_list
//=============================================================================
// y-func : Functions for Neutrino
//=============================================================================
//-------------------------------------------------------------------------
// y-func : mount_get_list
//-------------------------------------------------------------------------
std::string CNeutrinoYParser::func_mount_get_list(CyhookHandler *, std::string)
{
CConfigFile *Config = new CConfigFile(',');
std::string ysel, ytype, yip, ylocal_dir, ydir, ynr, yresult;
int yitype;
Config->loadConfig(NEUTRINO_CONFIGFILE);
for(unsigned int i=0; i <= 7; i++)
{
ynr=itoa(i);
ysel = ((i==0) ? "checked=\"checked\"" : "");
yitype = Config->getInt32("network_nfs_type_"+ynr,0);
ytype = ( (yitype==0) ? "NFS" :((yitype==1) ? "CIFS" : "FTPFS") );
yip = Config->getString("network_nfs_ip_"+ynr,"");
ydir = Config->getString("network_nfs_dir_"+ynr,"");
ylocal_dir = Config->getString("network_nfs_local_dir_"+ynr,"");
if(ydir != "")
ydir="("+ydir+")";
yresult += string_printf("<input type='radio' name='R1' value='%d' %s />%d %s - %s %s %s<br/>",
i,ysel.c_str(),i,ytype.c_str(),yip.c_str(),ylocal_dir.c_str(), ydir.c_str());
}
delete Config;
return yresult;
}
示例3: ReadSettings
void CFBCallMonitor::ReadSettings()
{
CConfigFile *bpfbconfig = new CConfigFile(',');
bpfbconfig->clear();
bpfbconfig->loadConfig(CONFIG_FILE);
FB_IP_STRG = bpfbconfig->getString("FRITZBOXIP", "fritz.box");
FB_PORT_STRG = bpfbconfig->getString("TELDPORT", "1012");
FB_ZIEL1_STRG = bpfbconfig->getString("Ziel_1", "01234567890");
FB_ZIEL1N_STRG = bpfbconfig->getString("Ziel_1_name", "Nummer_1");
FB_ZIEL2_STRG = bpfbconfig->getString("Ziel_2", "01234567890");
FB_ZIEL2N_STRG = bpfbconfig->getString("Ziel_2_name", "Nummer_2");
FB_ZIEL3_STRG = bpfbconfig->getString("Ziel_3", "01234567890");
FB_ZIEL3N_STRG = bpfbconfig->getString("Ziel_3_name", "Nummer_3");
FB_BOXIP_STRG = bpfbconfig->getString("ip", "127.0.0.1");
FB_BOXUSERNAME_STRG = bpfbconfig->getString("loginname", "root");
FB_BOXPASSWORD_STRG = bpfbconfig->getString("passwort", "root");
FB_DEBUG = bpfbconfig->getInt32("debug", 0);
FB_ALLE = bpfbconfig->getInt32("Alle", 0);
FB_MONRING = bpfbconfig->getInt32("monRing", 1);
FB_MONDISCONNECT = bpfbconfig->getInt32("monDisconnect", 1);
FB_MUTERING = bpfbconfig->getInt32("muteRing", 1);
FB_POPUP = bpfbconfig->getInt32("popup", 0);
FB_INVERS = bpfbconfig->getInt32("invers", 1);
}
示例4: func_set_language
//-------------------------------------------------------------------------
// y-func : get_header_data
//-------------------------------------------------------------------------
std::string CyParser::func_set_language(CyhookHandler *, std::string para) {
if (para != "") {
CConfigFile *Config = new CConfigFile(',');
Config->loadConfig(HTTPD_CONFIGFILE);
Config->setString("Language.selected", para);
Config->saveConfig(HTTPD_CONFIGFILE);
yhttpd_reload_config();
}
return "";
}
示例5: init
void eNetworkMountMgr::init()
{
eDebug("[MOUNT] init");
eMountPoint mp;
mountPoints.clear();
CConfigFile *config = new CConfigFile(',');
if (config->loadConfig(MOUNTCONFIGFILE))
{
unsigned int i = 0;
eString extra_options;
while (config->getString(eString().sprintf("localdir_%d", i)) != "")
{
mp.localDir = config->getString(eString().sprintf("localdir_%d", i));
mp.localDir = fixNonRecommendedMountpoint(mp.localDir);
mp.fstype = (enum eMountPoint::mountType)config->getInt32(eString().sprintf("fstype_%d", i));
mp.password = config->getString(eString().sprintf("password_%d", i));
mp.userName = config->getString(eString().sprintf("username_%d", i));
mp.mountDir = config->getString(eString().sprintf("mountdir_%d", i));
mp.automount = config->getInt32(eString().sprintf("automount_%d", i));
mp.options = config->getString(eString().sprintf("options_%d", i));
mp.linuxExtensions = config->getInt32(eString().sprintf("linuxextensions_%d", i), 1);
// Compatibility for extra_options in mount.conf
extra_options = config->getString(eString().sprintf("extra_options_%d", i));
if(extra_options.length() > 0)
{
mp.options = mp.options + "," + extra_options;
}
mp.description = config->getString(eString().sprintf("description_%d", i));
mp.remoteHost = config->getString(eString().sprintf("ip_%d", i));
mp.id = i;
eDebug("[MOUNT] adding %d - %s", i, mp.localDir.c_str());
eMountPoint m = eMountPoint(mp);
eDebug("[MOUNT] checkmounted");
m.setMounted(m.isReallyMounted());
#ifndef ENABLE_DEVMOUNTS
// Keep this if. Although it's "impossible" to read dev mounts from the
// config file, somebody could have an old file and we don't want to add them.
if (mp.fstype != eMountPoint::deviceMount)
#endif
mountPoints.push_back(m);
i++;
}
}
delete config;
//addMountedFileSystems();
save();
}
示例6: HasData
bool CBuildInfo::HasData()
{
v_info.clear();
#ifdef USED_COMPILER
build_info_t compiler = {BI_TYPE_ID_USED_COMPILER, LOCALE_BUILDINFO_COMPILED_WITH, USED_COMPILER};
v_info.push_back(compiler);
#endif
#ifdef USED_CXXFLAGS
string cxxflags = USED_CXXFLAGS;
cxxflags = trim(cxxflags);
// Remove double spaces
size_t pos = cxxflags.find(" ");
while (pos != string::npos) {
cxxflags.erase(pos, 1);
pos = cxxflags.find(" ", pos);
}
build_info_t flags = {BI_TYPE_ID_USED_CXXFLAGS, LOCALE_BUILDINFO_COMPILER_FLAGS, cxxflags};
v_info.push_back(flags);
#endif
#ifdef USED_BUILD
build_info_t build = {BI_TYPE_ID_USED_BUILD , LOCALE_BUILDINFO_COMPILED_ON, USED_BUILD};
v_info.push_back(build);
#endif
CComponentsText utext;
build_info_t kernel = {BI_TYPE_ID_USED_KERNEL, LOCALE_BUILDINFO_KERNEL, utext.getTextFromFile("/proc/version")};
v_info.push_back(kernel);
#if 0
CConfigFile data ('\t');
data.loadConfig("/.version");
build_info_t creator = {BI_TYPE_ID_CREATOR, LOCALE_BUILDINFO_CREATOR, data.getString("creator", "n/a")};
v_info.push_back(creator);
#endif
if (v_info.empty()){
DisplayInfoMessage("No Informations available. Please report!");
return false;
}
return true;
}
示例7: func_mount_set_values
//-------------------------------------------------------------------------
// y-func : mount_set_values
//-------------------------------------------------------------------------
std::string CNeutrinoYParser::func_mount_set_values(CyhookHandler *hh, std::string)
{
CConfigFile *Config = new CConfigFile(',');
std::string ynr, yresult;
Config->loadConfig(NEUTRINO_CONFIGFILE);
ynr = hh->ParamList["nr"];
Config->setString("network_nfs_type_"+ynr,hh->ParamList["type"]);
Config->setString("network_nfs_ip_"+ynr,hh->ParamList["ip"]);
Config->setString("network_nfs_dir_"+ynr,hh->ParamList["dir"]);
Config->setString("network_nfs_local_dir_"+ynr,hh->ParamList["localdir"]);
Config->setString("network_nfs_mac_"+ynr,hh->ParamList["mac"]);
Config->setString("network_nfs_mount_options1_"+ynr,hh->ParamList["opt1"]);
Config->setString("network_nfs_mount_options2_"+ynr,hh->ParamList["opt2"]);
Config->setString("network_nfs_automount_"+ynr,hh->ParamList["automount"]);
Config->setString("network_nfs_username_"+ynr,hh->ParamList["username"]);
Config->setString("network_nfs_password_"+ynr,hh->ParamList["password"]);
Config->saveConfig(NEUTRINO_CONFIGFILE);
delete Config;
return yresult;
}
示例8: func_set_timer_form
//.........这里部分代码省略.........
if(timer.apids & TIMERD_APIDS_ALT)
hh->ParamList["TIMERD_APIDS_ALT"] = "y";
if(timer.apids & TIMERD_APIDS_AC3)
hh->ParamList["TIMERD_APIDS_AC3"] = "y";
}
else
hh->ParamList["stop_mday"] = "0";
// event type
std::string sel;
for(int i=1; i<=8;i++)
{
if (i != (int)CTimerd::__TIMER_NEXTPROGRAM)
{
std::string zType = NeutrinoAPI->timerEventType2Str((CTimerd::CTimerEventTypes) i);
if(cmd != "new")
sel = (i==(int)timer.eventType) ? "selected=\"selected\"" : "";
else
sel = (i==(int)CTimerd::TIMER_RECORD) ? "selected=\"selected\"" : "";
hh->ParamList["timertype"] +=
string_printf("<option value=\"%d\" %s>%s\n",i,sel.c_str(),zType.c_str());
}
}
// Repeat types
std::string zRep;
sel = "";
for(int i=0; i<=6;i++)
{
if(i!=(int)CTimerd::TIMERREPEAT_BYEVENTDESCRIPTION)
{
zRep = NeutrinoAPI->timerEventRepeat2Str((CTimerd::CTimerEventRepeat) i);
if(cmd != "new")
sel = (((int)timer.eventRepeat) == i) ? "selected=\"selected\"" : "";
hh->ParamList["repeat"] +=
string_printf("<option value=\"%d\" %s>%s</option>\n",i,sel.c_str(),zRep.c_str());
}
}
// Repeat Weekdays
zRep = NeutrinoAPI->timerEventRepeat2Str(CTimerd::TIMERREPEAT_WEEKDAYS);
if(timer.eventRepeat >= CTimerd::TIMERREPEAT_WEEKDAYS && cmd != "new")
sel = "selected=\"selected\"";
else
sel = "";
hh->ParamList["repeat"] +=
string_printf("<option value=\"%d\" %s>%s</option>\n",(int)CTimerd::TIMERREPEAT_WEEKDAYS, sel.c_str(), zRep.c_str());
// Weekdays
std::string weekdays;
NeutrinoAPI->Timerd->setWeekdaysToStr(timer.eventRepeat, weekdays);
hh->ParamList["weekdays"]= weekdays;
// timer repeats
if (timer.eventRepeat == CTimerd::TIMERREPEAT_ONCE)
hh->ParamList["TIMERREPEAT_ONCE"] = "y";
hh->ParamList["timer_repeatCount"] = itoa(timer.repeatCount);
// program row
t_channel_id current_channel = (cmd == "new") ? CZapit::getInstance()->GetCurrentChannelID() : timer.channel_id;
CBouquetManager::ChannelIterator cit = g_bouquetManager->tvChannelsBegin();
for (; !(cit.EndOfChannels()); cit++) {
if (((*cit)->flags & CZapitChannel::REMOVED) || (*cit)->flags & CZapitChannel::NOT_FOUND)
continue;
sel = ((*cit)->channel_id == current_channel) ? "selected=\"selected\"" : "";
hh->ParamList["program_row"] +=
string_printf("<option value=\""
PRINTF_CHANNEL_ID_TYPE_NO_LEADING_ZEROS
"\" %s>%s</option>\n",
(*cit)->channel_id, sel.c_str(), (*cit)->getName().c_str());
}
cit = g_bouquetManager->radioChannelsBegin();
for (; !(cit.EndOfChannels()); cit++) {
if (((*cit)->flags & CZapitChannel::REMOVED) || (*cit)->flags & CZapitChannel::NOT_FOUND)
continue;
sel = ((*cit)->channel_id == current_channel) ? "selected=\"selected\"" : "";
hh->ParamList["program_row"] +=
string_printf("<option value=\""
PRINTF_CHANNEL_ID_TYPE_NO_LEADING_ZEROS
"\" %s>%s</option>\n",
(*cit)->channel_id, sel.c_str(), (*cit)->getName().c_str());
}
// recordingDir
hh->ParamList["RECORD_DIR_MAXLEN"] = itoa(RECORD_DIR_MAXLEN-1);
if(cmd != "new") {
if(timer.eventType == CTimerd::TIMER_RECORD)
hh->ParamList["timer_recordingDir"] = timer.recordingDir;
}
else
{
// get Default Recordingdir
CConfigFile *Config = new CConfigFile(',');
Config->loadConfig(NEUTRINO_CONFIGFILE);
hh->ParamList["timer_recordingDir"] = Config->getString("network_nfs_recordingdir", "/mnt/filme");
delete Config;
}
hh->ParamList["standby"] = (cmd == "new")? "0" : ((timer.standby_on)?"1":"0");
hh->ParamList["message"] = (cmd == "new")? "" : timer.message;
hh->ParamList["pluginname"] = (cmd == "new")? "" : timer.pluginName;
return "";
}
示例9: loadTimersFromConfig
void loadTimersFromConfig()
{
CConfigFile *config = new CConfigFile(',');
if(!config->loadConfig(CONFIGFILE))
{
/* set defaults if no configuration file exists */
dprintf("%s not found\n", CONFIGFILE);
}
else
{
vector<int> savedIDs;
savedIDs = config->getInt32Vector ("IDS");
dprintf("%d timer(s) in config\n",savedIDs.size());
for(unsigned int i=0; i < savedIDs.size(); i++)
{
stringstream ostr;
ostr << savedIDs[i];
string id=ostr.str();
CTimerd::CTimerEventTypes type=(CTimerd::CTimerEventTypes)config->getInt32 ("EVENT_TYPE_"+id,0);
time_t now = time(NULL);
switch(type)
{
case CTimerd::TIMER_SHUTDOWN :
{
CTimerEvent_Shutdown *event=
new CTimerEvent_Shutdown(config, savedIDs[i]);
if((event->alarmTime >= now) || (event->stopTime > now))
{
CTimerManager::getInstance()->addEvent(event,false);
}
else if(event->eventRepeat != CTimerd::TIMERREPEAT_ONCE)
{
// old periodic timers need to be rescheduled
event->eventState = CTimerd::TIMERSTATE_HASFINISHED;
CTimerManager::getInstance()->addEvent(event,false);
}
else
{
dprintf("Timer too old %d/%d\n",(int)now,(int) event->alarmTime);
delete event;
}
break;
}
case CTimerd::TIMER_NEXTPROGRAM :
{
CTimerEvent_NextProgram *event=
new CTimerEvent_NextProgram(config, savedIDs[i]);
if((event->alarmTime >= now) || (event->stopTime > now))
{
CTimerManager::getInstance()->addEvent(event,false);
}
else if(event->eventRepeat != CTimerd::TIMERREPEAT_ONCE)
{
// old periodic timers need to be rescheduled
event->eventState = CTimerd::TIMERSTATE_HASFINISHED;
CTimerManager::getInstance()->addEvent(event,false);
}
else
{
dprintf("Timer too old %d/%d\n",(int)now,(int) event->alarmTime);
delete event;
}
break;
}
case CTimerd::TIMER_ZAPTO :
{
CTimerEvent_Zapto *event=
new CTimerEvent_Zapto(config, savedIDs[i]);
if((event->alarmTime >= now) || (event->stopTime > now))
{
CTimerManager::getInstance()->addEvent(event,false);
}
else if(event->eventRepeat != CTimerd::TIMERREPEAT_ONCE)
{
// old periodic timers need to be rescheduled
event->eventState = CTimerd::TIMERSTATE_HASFINISHED;
CTimerManager::getInstance()->addEvent(event,false);
}
else
{
dprintf("Timer too old %d/%d\n",(int)now,(int) event->alarmTime);
delete event;
}
break;
}
case CTimerd::TIMER_STANDBY :
{
CTimerEvent_Standby *event=
new CTimerEvent_Standby(config, savedIDs[i]);
if((event->alarmTime >= now) || (event->stopTime > now))
{
CTimerManager::getInstance()->addEvent(event,false);
}
else if(event->eventRepeat != CTimerd::TIMERREPEAT_ONCE)
{
// old periodic timers need to be rescheduled
event->eventState = CTimerd::TIMERSTATE_HASFINISHED;
CTimerManager::getInstance()->addEvent(event,false);
}
//.........这里部分代码省略.........
示例10: ReadConfig
//-----------------------------------------------------------------------------
// Read Webserver Configurationfile
// Call "Hooks_ReadConfig" so Hooks can read/write own Configuration Values
//-----------------------------------------------------------------------------
void Cyhttpd::ReadConfig(void) {
log_level_printf(3, "ReadConfig Start\n");
CConfigFile *Config = new CConfigFile(',');
bool have_config = false;
if (access(HTTPD_CONFIGFILE, R_OK) == 0)
have_config = true;
Config->loadConfig(HTTPD_CONFIGFILE);
// convert old config files
if (have_config) {
if (Config->getInt32("configfile.version", 0) == 0) {
CConfigFile OrgConfig = *Config;
Config->clear();
Config->setInt32("server.log.loglevel", OrgConfig.getInt32(
"LogLevel", 0));
Config->setInt32("configfile.version", CONF_VERSION);
Config->setString("webserver.websites", "WebsiteMain");
Config->setBool("webserver.threading", OrgConfig.getBool("THREADS",
true));
Config->setInt32("WebsiteMain.port", OrgConfig.getInt32("Port",
HTTPD_STANDARD_PORT));
Config->setString("WebsiteMain.directory", OrgConfig.getString(
"PrivatDocRoot", PRIVATEDOCUMENTROOT));
if (!OrgConfig.getString("PublicDocRoot", "").empty())
Config->setString("WebsiteMain.override_directory",
OrgConfig.getString("PublicDocRoot",
PRIVATEDOCUMENTROOT));
// mod_auth
Config->setString("mod_auth.username", OrgConfig.getString(
"AuthUser", AUTHUSER));
Config->setString("mod_auth.password", OrgConfig.getString(
"AuthPassword", AUTHPASSWORD));
Config->setString("mod_auth.no_auth_client", OrgConfig.getString(
"NoAuthClient", ""));
Config->setString("mod_auth.authenticate", OrgConfig.getString(
"Authenticate", "false"));
Config->setString("mod_sendfile.mime_types", HTTPD_SENDFILE_EXT);
Config->saveConfig(HTTPD_CONFIGFILE);
}
// Add Defaults for Version 2
if (Config->getInt32("configfile.version") < 2) {
Config->setString("mod_sendfile.mime_types", HTTPD_SENDFILE_EXT);
Config->setInt32("configfile.version", CONF_VERSION);
Config->setString("mod_sendfile.sendAll", "false");
Config->saveConfig(HTTPD_CONFIGFILE);
}
// Add Defaults for Version 4
if (Config->getInt32("configfile.version") < 4) {
Config->setInt32("configfile.version", CONF_VERSION);
Config->setString("Language.selected", HTTPD_DEFAULT_LANGUAGE);
Config->setString("Language.directory", HTTPD_LANGUAGEDIR);
if (Config->getString("WebsiteMain.hosted_directory", "").empty())
Config->setString("WebsiteMain.hosted_directory", HOSTEDDOCUMENTROOT);
Config->saveConfig(HTTPD_CONFIGFILE);
}
}
// configure debugging & logging
if (CLogging::getInstance()->LogLevel == 0)
CLogging::getInstance()->LogLevel = Config->getInt32("server.log.loglevel", 0);
if (CLogging::getInstance()->LogLevel > 0)
CLogging::getInstance()->setDebug(true);
// get variables
webserver->init(Config->getInt32("WebsiteMain.port", HTTPD_STANDARD_PORT),
Config->getBool("webserver.threading", true));
// informational use
ConfigList["WebsiteMain.port"] = itoa(Config->getInt32("WebsiteMain.port",
HTTPD_STANDARD_PORT));
ConfigList["webserver.threading"] = Config->getString(
"webserver.threading", "true");
ConfigList["configfile.version"] = Config->getInt32("configfile.version",
CONF_VERSION);
ConfigList["server.log.loglevel"] = itoa(Config->getInt32(
"server.log.loglevel", 0));
ConfigList["server.no_keep-alive_ips"] = Config->getString(
"server.no_keep-alive_ips", "");
webserver->conf_no_keep_alive_ips = Config->getStringVector(
"server.no_keep-alive_ips");
// MainSite
ConfigList["WebsiteMain.directory"] = Config->getString(
"WebsiteMain.directory", PRIVATEDOCUMENTROOT);
ConfigList["WebsiteMain.override_directory"] = Config->getString(
"WebsiteMain.override_directory", PUBLICDOCUMENTROOT);
ConfigList["WebsiteMain.hosted_directory"] = Config->getString(
"WebsiteMain.hosted_directory", HOSTEDDOCUMENTROOT);
ConfigList["Tuxbox.DisplayLogos"] = Config->getString("Tuxbox.DisplayLogos", "true");
// Check location of logos
if (Config->getString("Tuxbox.LogosURL", "").empty()) {
if (access(ConfigList["WebsiteMain.override_directory"] + "/logos", R_OK) == 0) {
Config->setString("Tuxbox.LogosURL", ConfigList["WebsiteMain.override_directory"] + "/logos");
have_config = false; //save config
//.........这里部分代码省略.........
示例11: ReadConfig
//-----------------------------------------------------------------------------
// Read Webserver Configurationfile
// Call "Hooks_ReadConfig" so Hooks can read/write own Configuration Values
//-----------------------------------------------------------------------------
void Cyhttpd::ReadConfig(void)
{
log_level_printf(3,"ReadConfig Start\n");
CConfigFile *Config = new CConfigFile(',');
bool have_config = false;
if(access(HTTPD_CONFIGFILE,4) == 0)
have_config = true;
Config->loadConfig(HTTPD_CONFIGFILE);
// convert old config files
if(have_config)
if(Config->getInt32("Port", 0) != 0)
{
CConfigFile OrgConfig = *Config;
Config->clear();
Config->setInt32("server.log.loglevel", OrgConfig.getInt32("LogLevel", 0));
Config->setString("configfile.version", "1");
Config->setString("webserver.websites", "WebsiteMain");
Config->setBool("webserver.threading", OrgConfig.getBool("THREADS", true));
Config->setInt32("WebsiteMain.port",OrgConfig.getInt32("Port", HTTPD_STANDARD_PORT));
Config->setString("WebsiteMain.directory", OrgConfig.getString("PrivatDocRoot", PRIVATEDOCUMENTROOT));
if(OrgConfig.getString("PublicDocRoot", "") != "")
Config->setString("WebsiteMain.override_directory", OrgConfig.getString("PublicDocRoot", PRIVATEDOCUMENTROOT));
if(OrgConfig.getString("HostedDocRoot", "") != "")
Config->setString("WebsiteMain.special_locations", "/hosted/="+OrgConfig.getString("HostedDocRoot", PRIVATEDOCUMENTROOT));
if(OrgConfig.getString("HostedDocRoot", "") != "")
Config->setString("Tuxbox.HostedDocumentRoot", OrgConfig.getString("HostedDocRoot", PRIVATEDOCUMENTROOT));
// mod_auth
Config->setString("mod_auth.username", OrgConfig.getString("AuthUser", AUTHUSER));
Config->setString("mod_auth.password", OrgConfig.getString("AuthPassword", AUTHPASSWORD));
Config->setString("mod_auth.no_auth_client", OrgConfig.getString("NoAuthClient", ""));
Config->setString("mod_auth.authenticate", OrgConfig.getString("Authenticate", "false"));
Config->setString("mod_sendfile.mime_types", HTTPD_SENDFILE_EXT);
Config->saveConfig(HTTPD_CONFIGFILE);
}
// configure debugging & logging
if(CLogging::getInstance()->LogLevel == 0)
CLogging::getInstance()->LogLevel = Config->getInt32("server.log.loglevel", 0);
// get variables
webserver->init(Config->getInt32("WebsiteMain.port", HTTPD_STANDARD_PORT), Config->getBool("webserver.threading", true));
// informational use
ConfigList["WebsiteMain.port"]= itoa(Config->getInt32("WebsiteMain.port", HTTPD_STANDARD_PORT));
ConfigList["webserver.threading"]= Config->getString("webserver.threading", "true");
ConfigList["configfile.version"]= Config->getString("configfile.version", "1");
ConfigList["server.log.loglevel"]= itoa(Config->getInt32("server.log.loglevel", 0));
ConfigList["server.no_keep-alive_ips"]= Config->getString("server.no_keep-alive_ips", "");
webserver->conf_no_keep_alive_ips = Config->getStringVector("server.no_keep-alive_ips");
// MainSite
ConfigList["PrivatDocumentRoot"]= Config->getString("WebsiteMain.directory", PRIVATEDOCUMENTROOT);
ConfigList["PublicDocumentRoot"]= Config->getString("WebsiteMain.override_directory", PUBLICDOCUMENTROOT);
ConfigList["HostedDocumentRoot"]= Config->getString("Tuxbox.HostedDocumentRoot", HOSTEDDOCUMENTROOT);
#ifdef Y_CONFIG_USE_OPEN_SSL
ConfigList["SSL"] = Config->getString("WebsiteMain.ssl", "false");
ConfigList["SSL_pemfile"] = Config->getString("WebsiteMain.ssl_pemfile", SSL_PEMFILE);
ConfigList["SSL_CA_file"] = Config->getString("WebsiteMain.ssl_ca_file", SSL_CA_FILE);
CySocket::SSL_pemfile = ConfigList["SSL_pemfile"];
CySocket::SSL_CA_file = ConfigList["SSL_CA_file"];
if(ConfigList["SSL"] == "true")
CySocket::initSSL();
#endif
ConfigList["server.user_name"]= Config->getString("server.user_name", "");
ConfigList["server.group_name"]= Config->getString("server.group_name", "");
ConfigList["server.chroot"]= Config->getString("server.chroot", "");
// Read App specifig settings by Hook
CyhookHandler::Hooks_ReadConfig(Config, ConfigList);
// Save if new defaults are set
if (!have_config)
Config->saveConfig(HTTPD_CONFIGFILE);
log_level_printf(3,"ReadConfig End\n");
delete Config;
}