From 7983a0acbda7357462ead709c2bf843f23327c94 Mon Sep 17 00:00:00 2001 From: "dane dane@31f1291d-b8d6-0310-a050-a5561fc1590b" Date: Thu, 17 Mar 2005 14:52:28 +0000 Subject: 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 --- src/operserv.c | 20 ++++++++++++++------ 1 file changed, 14 insertions(+), 6 deletions(-) (limited to 'src') 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); } -- cgit