user->WriteServ("005 %s %s", user->nick, line->c_str());
}
-bool ServerConfig::CheckOnce(char* tag)
+bool ServerConfig::CheckOnce(const char* tag)
{
int count = ConfValueEnum(this->config_data, tag);
std::string nameserver;
// attempt to look up their nameserver from /etc/resolv.conf
conf->GetInstance()->Log(DEFAULT,"WARNING: <dns:server> not defined, attempting to find working server in /etc/resolv.conf...");
- ifstream resolv("/etc/resolv.conf");
+ std::ifstream resolv("/etc/resolv.conf");
bool found_server = false;
if (resolv.is_open())
*/
for (ClassVector::iterator item = conf->Classes.begin(); item != conf->Classes.end(); ++item)
{
- ConnectClass* c = *item;
- if ((*name && (c->GetName() == name)) || (*allow && (c->GetHost() == allow)) || (*deny && (c->GetHost() == deny)))
+ ConnectClass* cc = *item;
+ if ((*name && (cc->GetName() == name)) || (*allow && (cc->GetHost() == allow)) || (*deny && (cc->GetHost() == deny)))
{
/* reenable class so users can be shoved into it :P */
- c->SetDisabled(false);
+ cc->SetDisabled(false);
conf->GetInstance()->Log(DEFAULT, "Not adding class, it already exists!");
return true;
}
ClassVector::iterator item = conf->Classes.begin();
for (; item != conf->Classes.end(); ++item)
{
- ConnectClass* c = *item;
- conf->GetInstance()->Log(DEBUG,"Class: %s", c->GetName().c_str());
- if (c->GetName() == parent)
+ ConnectClass* cc = *item;
+ conf->GetInstance()->Log(DEBUG,"Class: %s", cc->GetName().c_str());
+ if (cc->GetName() == parent)
{
- ConnectClass* newclass = new ConnectClass(name, c);
+ ConnectClass* newclass = new ConnectClass(name, cc);
newclass->Update(timeout, flood, *allow ? allow : deny, pingfreq, password, threshold, sendq, recvq, localmax, globalmax, maxchans, port, limit);
conf->Classes.push_back(newclass);
break;
{
if (*allow)
{
- ConnectClass* c = new ConnectClass(name, timeout, flood, allow, pingfreq, password, hashtype, threshold, sendq, recvq, localmax, globalmax, maxchans);
- c->limit = limit;
- c->SetPort(port);
- conf->Classes.push_back(c);
+ ConnectClass* cc = new ConnectClass(name, timeout, flood, allow, pingfreq, password, hashtype, threshold, sendq, recvq, localmax, globalmax, maxchans);
+ cc->limit = limit;
+ cc->SetPort(port);
+ conf->Classes.push_back(cc);
}
else
{
- ConnectClass* c = new ConnectClass(name, deny);
- c->SetPort(port);
- conf->Classes.push_back(c);
+ ConnectClass* cc = new ConnectClass(name, deny);
+ cc->SetPort(port);
+ conf->Classes.push_back(cc);
}
}
errstr.clear();
/* These tags MUST occur and must ONLY occur once in the config file */
- static char* Once[] = { "server", "admin", "files", "power", "options", NULL };
+ static const char* Once[] = { "server", "admin", "files", "power", "options", NULL };
/* These tags can occur ONCE or not at all */
InitialConfig Values[] = {
v = n.str();
}
-ValueItem::ValueItem(char* value)
-{
- v = value;
-}
-
-void ValueItem::Set(char* value)
+ValueItem::ValueItem(const char* value)
{
v = value;
}