diff options
author | dane dane@31f1291d-b8d6-0310-a050-a5561fc1590b <dane dane@31f1291d-b8d6-0310-a050-a5561fc1590b@5417fbe8-f217-4b02-8779-1006273d7864> | 2005-03-17 14:52:28 +0000 |
---|---|---|
committer | dane dane@31f1291d-b8d6-0310-a050-a5561fc1590b <dane dane@31f1291d-b8d6-0310-a050-a5561fc1590b@5417fbe8-f217-4b02-8779-1006273d7864> | 2005-03-17 14:52:28 +0000 |
commit | 7983a0acbda7357462ead709c2bf843f23327c94 (patch) | |
tree | b63db43a0c540b1f275ffa0fd6f43c023b211674 /src | |
parent | e8275af54abfcc0df890ccebdd4ccb95b451099a (diff) |
BUILD : 1.7.8 (633) BUGS : none NOTES : OS SET SQL ON shall warn about SQL disabled in services.conf
git-svn-id: svn://svn.anope.org/anope/trunk@633 31f1291d-b8d6-0310-a050-a5561fc1590b
git-svn-id: http://anope.svn.sourceforge.net/svnroot/anope/trunk@481 5417fbe8-f217-4b02-8779-1006273d7864
Diffstat (limited to 'src')
-rw-r--r-- | src/operserv.c | 20 |
1 files changed, 14 insertions, 6 deletions
diff --git a/src/operserv.c b/src/operserv.c index 2f595b038..42b1b94b5 100644 --- a/src/operserv.c +++ b/src/operserv.c @@ -4564,15 +4564,23 @@ static int do_set(User * u) #ifdef USE_MYSQL } else if (stricmp(option, "SQL") == 0) { if (stricmp(setting, "on") == 0) { - if (rdb_init()) { - notice_lang(s_OperServ, u, OPER_SET_SQL_ON); + if (!MysqlHost) { + notice_lang(s_OperServ, u, OPER_SET_SQL_ERROR_DISABLED); } else { - notice_lang(s_OperServ, u, OPER_SET_SQL_ERROR_INIT); + if (rdb_init()) { + notice_lang(s_OperServ, u, OPER_SET_SQL_ON); + } else { + notice_lang(s_OperServ, u, OPER_SET_SQL_ERROR_INIT); + } } } else if (stricmp(setting, "off") == 0) { - /* could call rdb_close() but that does nothing - TSL */ - do_mysql = 0; - notice_lang(s_OperServ, u, OPER_SET_SQL_OFF); + if (!MysqlHost) { + notice_lang(s_OperServ, u, OPER_SET_SQL_ERROR_DISABLED); + } else { + /* could call rdb_close() but that does nothing - TSL */ + do_mysql = 0; + notice_lang(s_OperServ, u, OPER_SET_SQL_OFF); + } } else { notice_lang(s_OperServ, u, OPER_SET_SQL_ERROR); } |