- ConfigReader Conf;
-
- databaseid = Conf.ReadValue("sqlauth", "dbid", 0); /* Database ID, given to the SQL service provider */
- freeformquery = Conf.ReadValue("sqlauth", "query", 0); /* Field name where username can be found */
- killreason = Conf.ReadValue("sqlauth", "killreason", 0); /* Reason to give when access is denied to a user (put your reg details here) */
- allowpattern = Conf.ReadValue("sqlauth", "allowpattern",0 ); /* Allow nicks matching this pattern without requiring auth */
- verbose = Conf.ReadFlag("sqlauth", "verbose", 0); /* Set to true if failed connects should be reported to operators */
+ ConfigTag* conf = ServerInstance->Config->ConfValue("sqlauth");
+ std::string dbid = conf->getString("dbid");
+ if (dbid.empty())
+ SQL.SetProvider("SQL");
+ else
+ SQL.SetProvider("SQL/" + dbid);
+ freeformquery = conf->getString("query");
+ killreason = conf->getString("killreason");
+ allowpattern = conf->getString("allowpattern");
+ verbose = conf->getBool("verbose");