diff options
| author | Robin Burchell w00t@inspircd.org <Robin Burchell w00t@inspircd.org@5417fbe8-f217-4b02-8779-1006273d7864> | 2008-11-02 23:50:53 +0000 |
|---|---|---|
| committer | Robin Burchell w00t@inspircd.org <Robin Burchell w00t@inspircd.org@5417fbe8-f217-4b02-8779-1006273d7864> | 2008-11-02 23:50:53 +0000 |
| commit | ec9dafb778cae465379f64bf0a0f997dbb4603ab (patch) | |
| tree | 2a908a3c4bcd4f1fa7e137766ff1349909b13f1c /src/nickserv.c | |
| parent | 232d1b5e88c62ef3e2dae4a03353da817a3b89dc (diff) | |
Rip out SQL. It's utterly useless in current implementation.
git-svn-id: http://anope.svn.sourceforge.net/svnroot/anope/trunk@1502 5417fbe8-f217-4b02-8779-1006273d7864
Diffstat (limited to 'src/nickserv.c')
| -rw-r--r-- | src/nickserv.c | 164 |
1 files changed, 0 insertions, 164 deletions
diff --git a/src/nickserv.c b/src/nickserv.c index 695bd86e8..efb803393 100644 --- a/src/nickserv.c +++ b/src/nickserv.c @@ -751,113 +751,6 @@ void save_ns_req_dbase(void) #undef SAFE -void save_ns_rdb_dbase(void) -{ -#ifdef USE_RDB - int i; - NickAlias *na; - NickCore *nc; - - if (!rdb_open()) - return; - - if (rdb_tag_table("anope_ns_core") == 0) { - alog("Unable to tag 'anope_ns_core' - NickServ RDB save failed."); - rdb_close(); - return; - } - if (rdb_tag_table("anope_ns_alias") == 0) { - alog("Unable to tag 'anope_ns_alias' - NickServ RDB save failed."); - rdb_close(); - return; - } - if (rdb_tag_table("anope_ns_access") == 0) { - alog("Unable to tag 'anope_ns_access' - NickServ RDB save failed."); - rdb_close(); - return; - } - if (rdb_tag_table_where("anope_ms_info", "serv='NICK'") == 0) { - alog("Unable to tag 'anope_ms_info' - NickServ RDB save failed."); - rdb_close(); - return; - } - - for (i = 0; i < 1024; i++) { - for (nc = nclists[i]; nc; nc = nc->next) { - if (rdb_save_ns_core(nc) == 0) { - alog("Unable to save NickCore for '%s' - NickServ RDB save failed.", nc->display); - rdb_close(); - return; - } - } /* for (nc) */ - } /* for (i) */ - - for (i = 0; i < 1024; i++) { - for (na = nalists[i]; na; na = na->next) { - if (rdb_save_ns_alias(na) == 0) { - alog("Unable to save NickAlias for '%s' - NickServ RDB save failed.", na->nick); - rdb_close(); - return; - } - } /* for (na) */ - } /* for (i) */ - - if (rdb_clean_table("anope_ns_core") == 0) { - alog("Unable to clean table 'anope_ns_core' - NickServ RDB save failed."); - rdb_close(); - return; - } - if (rdb_clean_table("anope_ns_alias") == 0) { - alog("Unable to clean table 'anope_ns_alias' - NickServ RDB save failed."); - rdb_close(); - return; - } - if (rdb_clean_table("anope_ns_access") == 0) { - alog("Unable to clean table 'anope_ns_access' - NickServ RDB save failed."); - rdb_close(); - return; - } - if (rdb_clean_table_where("anope_ms_info", "serv='NICK'") == 0) - alog("Unable to clean table 'anope_ms_info' - NickServ RDB save failed."); - - rdb_close(); -#endif -} - -void save_ns_req_rdb_dbase(void) -{ -#ifdef USE_RDB - int i; - NickRequest *nr; - - if (!rdb_open()) - return; - - if (rdb_tag_table("anope_ns_request") == 0) { - alog("Unable to tag table 'anope_ns_request' - NickServ Request RDB save failed."); - rdb_close(); - return; - } - - for (i = 0; i < 1024; i++) { - for (nr = nrlists[i]; nr; nr = nr->next) { - if (rdb_save_ns_req(nr) == 0) { - /* Something went wrong - abort saving */ - alog("Unable to save NickRequest (nick '%s') - NickServ Request RDB save failed.", nr->nick); - rdb_close(); - return; - } - } - } - - if (rdb_clean_table("anope_ns_request") == 0) - alog("Unable to clean table 'anope_ns_request' - NickServ Request RDB save failed."); - - rdb_close(); -#endif - -} - /*************************************************************************/ /* Check whether a user is on the access list of the nick they're using If @@ -1303,19 +1196,6 @@ void change_core_display(NickCore * nc, char *newdisplay) alog("%s: changing %s nickname group display to %s", s_NickServ, nc->display, newdisplay); -#ifdef USE_RDB - /* Reflect this change in the database right away. This - * ensures that we know how to deal with this "new" nick - * on the next /OS UPDATE might need it on /NS DROP too... - */ - if (rdb_open()) { - if (rdb_ns_set_display(newdisplay, nc->display) == 0) { - alog("Unable to update display for %s - Nick Display RDB update failed.", nc->display); - } - rdb_close(); - } -#endif - /* Remove the core from the list */ if (nc->next) nc->next->prev = nc->prev; @@ -1340,10 +1220,6 @@ void change_core_display(NickCore * nc, char *newdisplay) static int delcore(NickCore * nc) { int i; -#ifdef USE_RDB - static char clause[128]; - char *q_display; -#endif /* (Hopefully complete) cleanup */ cs_remove_nick(nc); os_remove_nick(nc); @@ -1359,30 +1235,6 @@ static int delcore(NickCore * nc) /* Log .. */ alog("%s: deleting nickname group %s", s_NickServ, nc->display); -#ifdef USE_RDB - /* Reflect this change in the database right away. */ - if (rdb_open()) { - q_display = rdb_quote(nc->display); - snprintf(clause, sizeof(clause), "display='%s'", q_display); - if (rdb_scrub_table("anope_ns_access", clause) == 0) - alog("Unable to scrub table 'anope_ns_access' - RDB update failed."); - else if (rdb_scrub_table("anope_ns_core", clause) == 0) - alog("Unable to scrub table 'anope_ns_core' - RDB update failed."); - else if (rdb_scrub_table("anope_cs_access", clause) == 0) - alog("Unable to scrub table 'anope_cs_access' - RDB update failed."); - else { - /* I'm unsure how to clean up the OS ADMIN/OPER list on the db */ - /* I wish the "display" primary key would be the same on all tables */ - snprintf(clause, sizeof(clause), - "receiver='%s' AND serv='NICK'", q_display); - if (rdb_scrub_table("anope_ms_info", clause) == 0) - alog("Unable to scrub table 'anope_ms_info' - RDB update failed."); - } - rdb_close(); - free(q_display); - } -#endif - /* Now we can safely free it. */ free(nc->display); @@ -1447,10 +1299,6 @@ int delnickrequest(NickRequest * nr) int delnick(NickAlias * na) { -#ifdef USE_RDB - static char clause[128]; - char *q_nick; -#endif /* First thing to do: remove any timeout belonging to the nick we're deleting */ clean_ns_timeouts(na); @@ -1490,18 +1338,6 @@ int delnick(NickAlias * na) else nalists[HASH(na->nick)] = na->next; -#ifdef USE_RDB - /* Reflect this change in the database right away. */ - if (rdb_open()) { - q_nick = rdb_quote(na->nick); - snprintf(clause, sizeof(clause), "nick='%s'", q_nick); - if (rdb_scrub_table("anope_ns_alias", clause) == 0) - alog("Unable to scrub table 'anope_ns_alias' - RDB update failed"); - rdb_close(); - free(q_nick); - } -#endif - free(na->nick); if (na->last_usermask) free(na->last_usermask); |
