summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorAdam- <Adam-@5417fbe8-f217-4b02-8779-1006273d7864>2009-10-30 02:38:06 +0000
committerAdam- <Adam-@5417fbe8-f217-4b02-8779-1006273d7864>2009-10-30 02:38:06 +0000
commit987f371c0bd02120e9ed8740b064e9fa02b83876 (patch)
tree26c031410f13d638670096ca219d59c6c19d306e /src
parent6a9fa9f4d2ead592eb51a014491ce3aaee2029e8 (diff)
Removed channel passwords and added /chanserv QOP command to add additional channel founders, aswell as access level 10000
git-svn-id: http://anope.svn.sourceforge.net/svnroot/anope/trunk@2599 5417fbe8-f217-4b02-8779-1006273d7864
Diffstat (limited to 'src')
-rw-r--r--src/channels.c14
-rw-r--r--src/chanserv.c202
-rw-r--r--src/core/bs_info.c2
-rw-r--r--src/core/cs_access.c4
-rw-r--r--src/core/cs_akick.c2
-rw-r--r--src/core/cs_drop.c4
-rw-r--r--src/core/cs_getpass.c81
-rw-r--r--src/core/cs_identify.c105
-rw-r--r--src/core/cs_logout.c129
-rw-r--r--src/core/cs_modes.c6
-rw-r--r--src/core/cs_register.c29
-rw-r--r--src/core/cs_sendpass.c109
-rw-r--r--src/core/cs_set.c66
-rw-r--r--src/core/cs_xop.c52
-rw-r--r--src/core/ns_logout.c10
-rw-r--r--src/users.c15
16 files changed, 168 insertions, 662 deletions
diff --git a/src/channels.c b/src/channels.c
index 3e921e182..8556179ea 100644
--- a/src/channels.c
+++ b/src/channels.c
@@ -1650,15 +1650,15 @@ void chan_set_correct_modes(User * user, Channel * c, int give_modes)
*/
if (give_modes && (get_ignore(user->nick) == NULL)
&& (!user->nc || !(user->nc->flags & NI_AUTOOP))) {
- if (owner && is_founder(user, ci))
+ if (owner && (IsFounder(user, ci) || check_access(user, ci, CA_AUTOOWNER)))
add_modes |= CUS_OWNER;
else if (admin && check_access(user, ci, CA_AUTOPROTECT))
add_modes |= CUS_PROTECT;
- if (check_access(user, ci, CA_AUTOOP))
+ if (op && check_access(user, ci, CA_AUTOOP))
add_modes |= CUS_OP;
- else if (ModeManager::FindChannelModeByName(CMODE_HALFOP) && check_access(user, ci, CA_AUTOHALFOP))
+ else if (halfop && check_access(user, ci, CA_AUTOHALFOP))
add_modes |= CUS_HALFOP;
- else if (check_access(user, ci, CA_AUTOVOICE))
+ else if (voice && check_access(user, ci, CA_AUTOVOICE))
add_modes |= CUS_VOICE;
}
@@ -1671,16 +1671,16 @@ void chan_set_correct_modes(User * user, Channel * c, int give_modes)
if (((ci->flags & CI_SECUREOPS) || (c->usercount == 1)
|| check_access(user, ci, CA_AUTODEOP))
&& !is_ulined(user->server->name)) {
- if (owner && (status & CUS_OWNER) && !is_founder(user, ci))
+ if (owner && (status & CUS_OWNER) && !IsFounder(user, ci))
rem_modes |= CUS_OWNER;
if (admin && (status & CUS_PROTECT)
&& !check_access(user, ci, CA_AUTOPROTECT)
&& !check_access(user, ci, CA_PROTECTME))
rem_modes |= CUS_PROTECT;
- if ((status & CUS_OP) && !check_access(user, ci, CA_AUTOOP)
+ if (op && (status & CUS_OP) && !check_access(user, ci, CA_AUTOOP)
&& !check_access(user, ci, CA_OPDEOPME))
rem_modes |= CUS_OP;
- if (ModeManager::FindChannelModeByName(CMODE_HALFOP) && (status & CUS_HALFOP)
+ if (halfop && (status & CUS_HALFOP)
&& !check_access(user, ci, CA_AUTOHALFOP)
&& !check_access(user, ci, CA_HALFOPME))
rem_modes |= CUS_HALFOP;
diff --git a/src/chanserv.c b/src/chanserv.c
index a6aee4aaf..991b708ef 100644
--- a/src/chanserv.c
+++ b/src/chanserv.c
@@ -59,6 +59,9 @@ static int def_levels[][2] = {
{ CA_BAN, 5 },
{ CA_TOPIC, ACCESS_INVALID },
{ CA_INFO, ACCESS_INVALID },
+ { CA_AUTOOWNER, ACCESS_INVALID },
+ { CA_OWNER, ACCESS_INVALID },
+ { CA_OWNERME, ACCESS_INVALID },
{ -1 }
};
@@ -67,7 +70,7 @@ LevelInfo levelinfo[] = {
{ CA_AUTODEOP, "AUTODEOP", CHAN_LEVEL_AUTODEOP },
{ CA_AUTOHALFOP, "AUTOHALFOP", CHAN_LEVEL_AUTOHALFOP },
{ CA_AUTOOP, "AUTOOP", CHAN_LEVEL_AUTOOP },
- { CA_AUTOPROTECT, "", CHAN_LEVEL_AUTOPROTECT },
+ { CA_AUTOPROTECT, "AUTOPROTECT", CHAN_LEVEL_AUTOPROTECT },
{ CA_AUTOVOICE, "AUTOVOICE", CHAN_LEVEL_AUTOVOICE },
{ CA_NOJOIN, "NOJOIN", CHAN_LEVEL_NOJOIN },
{ CA_SIGNKICK, "SIGNKICK", CHAN_LEVEL_SIGNKICK },
@@ -87,8 +90,8 @@ LevelInfo levelinfo[] = {
{ CA_INVITE, "INVITE", CHAN_LEVEL_INVITE },
{ CA_OPDEOP, "OPDEOP", CHAN_LEVEL_OPDEOP },
{ CA_OPDEOPME, "OPDEOPME", CHAN_LEVEL_OPDEOPME },
- { CA_PROTECT, "", CHAN_LEVEL_PROTECT },
- { CA_PROTECTME, "", CHAN_LEVEL_PROTECTME },
+ { CA_PROTECT, "PROTECT", CHAN_LEVEL_PROTECT },
+ { CA_PROTECTME, "PROTECTME", CHAN_LEVEL_PROTECTME },
{ CA_TOPIC, "TOPIC", CHAN_LEVEL_TOPIC },
{ CA_UNBAN, "UNBAN", CHAN_LEVEL_UNBAN },
{ CA_VOICE, "VOICE", CHAN_LEVEL_VOICE },
@@ -100,6 +103,9 @@ LevelInfo levelinfo[] = {
{ CA_GREET, "GREET", CHAN_LEVEL_GREET },
{ CA_NOKICK, "NOKICK", CHAN_LEVEL_NOKICK },
{ CA_SAY, "SAY", CHAN_LEVEL_SAY },
+ { CA_AUTOOWNER, "AUTOOWNER", CHAN_LEVEL_AUTOOWNER },
+ { CA_OWNER, "OWNER", CHAN_LEVEL_OWNER },
+ { CA_OWNERME, "OWNERME", CHAN_LEVEL_OWNERME },
{ -1 }
};
int levelinfo_maxwidth = 0;
@@ -381,7 +387,10 @@ void load_cs_dbase()
} else {
ci->successor = NULL;
}
- SAFE(read = read_buffer(ci->founderpass, f));
+
+ char nothing[PASSMAX];
+ SAFE(read = read_buffer(nothing, f)); // XXX founder pass was removed.. just here so it works
+
SAFE(read_string(&ci->desc, f));
if (!ci->desc)
ci->desc = sstrdup("");
@@ -646,7 +655,11 @@ void save_cs_dbase()
SAFE(write_string(ci->successor->display, f));
else
SAFE(write_string(NULL, f));
- SAFE(written = write_buffer(ci->founderpass, f));
+
+ char nothing[PASSMAX]; /* founder passwords were removed! */
+ strcpy(nothing, "nothing\0");
+ SAFE(written = write_buffer(nothing, f));
+
SAFE(write_string(ci->desc, f));
SAFE(write_string(ci->url, f));
SAFE(write_string(ci->email, f));
@@ -1107,8 +1120,8 @@ int check_should_owner(User * user, char *chan)
if (!ci || (ci->flags & CI_FORBIDDEN) || *chan == '+')
return 0;
- if (((ci->flags & CI_SECUREFOUNDER) && is_real_founder(user, ci))
- || (!(ci->flags & CI_SECUREFOUNDER) && is_founder(user, ci))) {
+ if (((ci->flags & CI_SECUREFOUNDER) && IsRealFounder(user, ci))
+ || (!(ci->flags & CI_SECUREFOUNDER) && IsFounder(user, ci))) {
ircdproto->SendMode(whosends(ci), chan, "+o%s %s %s", cm->ModeChar, user->nick,
user->nick);
return 1;
@@ -1613,7 +1626,7 @@ int check_access(User * user, ChannelInfo * ci, int what)
ci->last_used = time(NULL);
if (what == ACCESS_FOUNDER)
- return is_founder(user, ci);
+ return IsFounder(user, ci);
if (level >= ACCESS_FOUNDER)
return (what == CA_AUTODEOP || what == CA_NOJOIN) ? 0 : 1;
/* Hacks to make flags work */
@@ -1691,8 +1704,6 @@ int delchan(ChannelInfo * ci)
{
unsigned i;
NickCore *nc;
- User *u;
- struct u_chaninfolist *cilist, *cilist_next;
if (!ci) {
if (debug) {
@@ -1726,34 +1737,6 @@ int delchan(ChannelInfo * ci)
alog("debug: delchan() Bot has been removed moving on");
}
- if (debug >= 2) {
- alog("debug: delchan() founder cleanup");
- }
- for (i = 0; i < 1024; i++) {
- for (u = userlist[i]; u; u = u->next) {
- cilist = u->founder_chans;
- while (cilist) {
- cilist_next = cilist->next;
- if (cilist->chan == ci) {
- if (debug)
- alog("debug: Dropping founder login of %s for %s",
- u->nick, ci->name);
- if (cilist->next)
- cilist->next->prev = cilist->prev;
- if (cilist->prev)
- cilist->prev->next = cilist->next;
- else
- u->founder_chans = cilist->next;
- delete cilist;
- }
- cilist = cilist_next;
- }
- }
- }
- if (debug >= 2) {
- alog("debug: delchan() founder cleanup done");
- }
-
if (ci->next)
ci->next->prev = ci->prev;
if (ci->prev)
@@ -1862,68 +1845,67 @@ void reset_levels(ChannelInfo * ci)
/*************************************************************************/
-/* Does the given user have founder access to the channel? */
-
-int is_founder(User * user, ChannelInfo * ci)
+/** Is the user a channel founder? (owner)
+ * @param user The user
+ * @param ci The channel
+ * @return true or false
+ */
+bool IsFounder(User *user, ChannelInfo *ci)
{
- if (!user || !ci) {
- return 0;
- }
-
- if (user->isSuperAdmin) {
- return 1;
- }
-
- if (user->nc && user->nc == ci->founder) {
- if ((nick_identified(user)
- || (user->IsRecognized() && !(ci->flags & CI_SECURE))))
- return 1;
- }
- if (is_identified(user, ci))
- return 1;
- return 0;
-}
+ ChanAccess *access = NULL;
-/*************************************************************************/
+ if (!user || !ci)
+ return false;
-int is_real_founder(User * user, ChannelInfo * ci)
-{
- if (user->isSuperAdmin) {
- return 1;
+ if (IsRealFounder(user, ci))
+ return true;
+
+ if (user->nc)
+ access = ci->GetAccess(user->nc);
+ else
+ {
+ NickAlias *na = findnick(user->nick);
+ if (na)
+ access = ci->GetAccess(na->nc);
}
+
+ /* If they're QOP+ and theyre identified or theyre recognized and the channel isn't secure */
+ if (access && access->level >= ACCESS_QOP && (user->nc || (user->IsRecognized() && !(ci->flags & CI_SECURE))))
+ return true;
- if (user->nc && user->nc == ci->founder) {
- if ((nick_identified(user)
- || (user->IsRecognized() && !(ci->flags & CI_SECURE))))
- return 1;
- }
- return 0;
+ return false;
}
-/*************************************************************************/
+/** Is the user the real founder?
+ * @param user The user
+ * @param ci The channel
+ * @return true or false
+ */
+bool IsRealFounder(User *user, ChannelInfo *ci)
+{
+ if (!user || !ci)
+ return false;
-/* Has the given user password-identified as founder for the channel? */
+ if (user->isSuperAdmin)
+ return true;
-int is_identified(User * user, ChannelInfo * ci)
-{
- struct u_chaninfolist *c;
+ if (user->nc && user->nc == ci->founder)
+ return true;
- for (c = user->founder_chans; c; c = c->next) {
- if (c->chan == ci)
- return 1;
- }
- return 0;
+ return false;
}
-/*************************************************************************/
-
-/* Return the access level the given user has on the channel. If the
- * channel doesn't exist, the user isn't on the access list, or the channel
- * is CS_SECURE and the user hasn't IDENTIFY'd with NickServ, return 0. */
-int get_access(User * user, ChannelInfo * ci)
+/** Return the access level for the user on the channel.
+ * If the channel doesn't exist, the user isn't on the access list, or the
+ * channel is CI_SECURE and the user isn't identified, return 0
+ * @param user The user
+ * @param ci The cahnnel
+ * @return The level, or 0
+ */
+int get_access(User *user, ChannelInfo *ci)
{
- ChanAccess *access;
+ ChanAccess *access = NULL;
if (!ci || !user)
return 0;
@@ -1931,20 +1913,24 @@ int get_access(User * user, ChannelInfo * ci)
/* SuperAdmin always has highest level */
if (user->isSuperAdmin)
return ACCESS_SUPERADMIN;
-
- if (is_founder(user, ci))
+
+ if (IsFounder(user, ci))
return ACCESS_FOUNDER;
-
- if (!user->nc)
- return 0;
-
- if (nick_identified(user)
- || (user->IsRecognized() && !(ci->flags & CI_SECURE)))
- if ((access = ci->GetAccess(user->nc)))
- return access->level;
-
+
if (nick_identified(user))
- return 0;
+ {
+ access = ci->GetAccess(user->nc);
+ if (access)
+ return access->level;
+ }
+ else
+ {
+ NickAlias *na = findnick(user->nick);
+ if (na)
+ access = ci->GetAccess(na->nc);
+ if (access && user->IsRecognized() && !(ci->flags & CI_SECURE))
+ return access->level;
+ }
return 0;
}
@@ -1958,7 +1944,7 @@ void update_cs_lastseen(User * user, ChannelInfo * ci)
if (!ci || !user || !user->nc)
return;
- if (is_founder(user, ci) || nick_identified(user)
+ if (IsFounder(user, ci) || nick_identified(user)
|| (user->IsRecognized() && !(ci->flags & CI_SECURE)))
if ((access = ci->GetAccess(user->nc)))
access->last_seen = time(NULL);
@@ -2031,22 +2017,22 @@ const char *get_xop_level(int level)
{
ChannelMode *halfop = ModeManager::FindChannelModeByName(CMODE_HALFOP);
- if (level < ACCESS_VOP) {
+ if (level < ACCESS_VOP)
return "Err";
- } else if (halfop && level < ACCESS_HOP) {
+ else if (halfop && level < ACCESS_HOP)
return "VOP";
- } else if (!halfop && level < ACCESS_AOP) {
+ else if (!halfop && level < ACCESS_AOP)
return "VOP";
- } else if (halfop && level < ACCESS_AOP) {
+ else if (halfop && level < ACCESS_AOP)
return "HOP";
- } else if (level < ACCESS_SOP) {
+ else if (level < ACCESS_SOP)
return "AOP";
- } else if (level < ACCESS_FOUNDER) {
+ else if (level < ACCESS_QOP)
return "SOP";
- } else {
+ else if (level < ACCESS_FOUNDER)
+ return "QOP";
+ else
return "Founder";
- }
-
}
/*************************************************************************/
diff --git a/src/core/bs_info.c b/src/core/bs_info.c
index cb1590719..64d999768 100644
--- a/src/core/bs_info.c
+++ b/src/core/bs_info.c
@@ -84,7 +84,7 @@ class CommandBSInfo : public Command
}
else if ((ci = cs_findchan(query)))
{
- if (!is_founder(u, ci) && !u->nc->HasPriv("botserv/administration"))
+ if (!IsFounder(u, ci) && !u->nc->HasPriv("botserv/administration"))
{
notice_lang(s_BotServ, u, ACCESS_DENIED);
return MOD_CONT;
diff --git a/src/core/cs_access.c b/src/core/cs_access.c
index 2fbca088a..bdf32b9d7 100644
--- a/src/core/cs_access.c
+++ b/src/core/cs_access.c
@@ -315,7 +315,7 @@ class CommandCSAccess : public Command
return MOD_CONT;
}
- if (!is_founder(u, ci) && !u->nc->HasPriv("chanserv/access/modify"))
+ if (!IsFounder(u, ci) && !u->nc->HasPriv("chanserv/access/modify"))
{
notice_lang(s_ChanServ, u, ACCESS_DENIED);
return MOD_CONT;
@@ -376,7 +376,7 @@ class CommandCSLevels : public Command
this->OnSyntaxError(u);
else if (ci->flags & CI_XOP)
notice_lang(s_ChanServ, u, CHAN_LEVELS_XOP);
- else if (!is_founder(u, ci) && !u->nc->HasPriv("chanserv/access/modify"))
+ else if (!IsFounder(u, ci) && !u->nc->HasPriv("chanserv/access/modify"))
notice_lang(s_ChanServ, u, ACCESS_DENIED);
else if (cmd == "SET") {
level = strtol(s, &error, 10);
diff --git a/src/core/cs_akick.c b/src/core/cs_akick.c
index ede481bcb..c700dc21e 100644
--- a/src/core/cs_akick.c
+++ b/src/core/cs_akick.c
@@ -253,7 +253,7 @@ class CommandCSAKick : public Command
* higher access. - Viper */
for (i = 0; i < 1024; i++) {
for (u2 = userlist[i]; u2; u2 = u2->next) {
- if (is_founder(u2, ci) || (get_access(u2, ci) >= get_access(u, ci))) {
+ if (IsFounder(u2, ci) || (get_access(u2, ci) >= get_access(u, ci))) {
if (match_usermask(mask, u2)) {
notice_lang(s_ChanServ, u, ACCESS_DENIED);
delete [] mask;
diff --git a/src/core/cs_drop.c b/src/core/cs_drop.c
index a8b838f1f..3a5ca45a7 100644
--- a/src/core/cs_drop.c
+++ b/src/core/cs_drop.c
@@ -49,7 +49,7 @@ class CommandCSDrop : public Command
return MOD_CONT;
}
- if ((ci->flags & CI_SECUREFOUNDER ? !is_real_founder(u, ci) : !is_founder(u, ci)) && !u->nc->HasCommand("chanserv/drop"))
+ if ((ci->flags & CI_SECUREFOUNDER ? !IsRealFounder(u, ci) : !IsFounder(u, ci)) && !u->nc->HasCommand("chanserv/drop"))
{
notice_lang(s_ChanServ, u, ACCESS_DENIED);
return MOD_CONT;
@@ -81,7 +81,7 @@ class CommandCSDrop : public Command
* drop the channel before issuing the wallops.
*/
if (WallDrop) {
- if ((level < ACCESS_FOUNDER) || (!is_real_founder(u, ci) && ci->flags & CI_SECUREFOUNDER))
+ if ((level < ACCESS_FOUNDER) || (!IsRealFounder(u, ci) && ci->flags & CI_SECUREFOUNDER))
ircdproto->SendGlobops(s_ChanServ, "\2%s\2 used DROP on channel \2%s\2", u->nick, chan);
}
diff --git a/src/core/cs_getpass.c b/src/core/cs_getpass.c
deleted file mode 100644
index 5a17bdb7b..000000000
--- a/src/core/cs_getpass.c
+++ /dev/null
@@ -1,81 +0,0 @@
-/* ChanServ core functions
- *
- * (C) 2003-2009 Anope Team
- * Contact us at team@anope.org
- *
- * Please read COPYING and README for further details.
- *
- * Based on the original code of Epona by Lara.
- * Based on the original code of Services by Andy Church.
- *
- * $Id$
- *
- */
-/*************************************************************************/
-
-#include "module.h"
-
-class CommandCSGetPass : public Command
-{
- public:
- CommandCSGetPass() : Command("GETPASS", 1, 1, "chanserv/getpass")
- {
- this->SetFlag(CFLAG_ALLOW_SUSPENDED);
- }
-
- CommandReturn Execute(User *u, std::vector<ci::string> &params)
- {
- const char *chan = params[0].c_str();
- char tmp_pass[PASSMAX];
- ChannelInfo *ci;
-
- ci = cs_findchan(chan);
-
- if (!enc_decrypt(ci->founderpass, tmp_pass, PASSMAX - 1))
- {
- notice_lang(s_ChanServ, u, CHAN_GETPASS_UNAVAILABLE);
- return MOD_CONT;
- }
-
- alog("%s: %s!%s@%s used GETPASS on %s", s_ChanServ, u->nick, u->GetIdent().c_str(), u->host, ci->name);
- if (WallGetpass)
- {
- ircdproto->SendGlobops(s_ChanServ, "\2%s\2 used GETPASS on channel \2%s\2", u->nick, chan);
- }
- notice_lang(s_ChanServ, u, CHAN_GETPASS_PASSWORD_IS, chan, tmp_pass);
- return MOD_CONT;
- }
-
- bool OnHelp(User *u, const ci::string &subcommand)
- {
- notice_help(s_ChanServ, u, CHAN_SERVADMIN_HELP_GETPASS);
- return true;
- }
-
- void OnSyntaxError(User *u)
- {
- syntax_error(s_ChanServ, u, "GETPASS", CHAN_GETPASS_SYNTAX);
- }
-};
-
-class CSGetPass : public Module
-{
- public:
- CSGetPass(const std::string &modname, const std::string &creator) : Module(modname, creator)
- {
- this->SetAuthor("Anope");
- this->SetVersion("$Id$");
- this->SetType(CORE);
- this->AddCommand(CHANSERV, new CommandCSGetPass());
-
- char tmp_pass[PASSMAX];
- if (!enc_decrypt("tmp", tmp_pass, PASSMAX - 1))
- throw ModuleException("Incompatible with the encryption module being used");
- }
- void ChanServHelp(User *u)
- {
- notice_lang(s_ChanServ, u, CHAN_HELP_CMD_GETPASS);
- }
-};
-
-MODULE_INIT(CSGetPass)
diff --git a/src/core/cs_identify.c b/src/core/cs_identify.c
deleted file mode 100644
index 6629e2819..000000000
--- a/src/core/cs_identify.c
+++ /dev/null
@@ -1,105 +0,0 @@
-/* ChanServ core functions
- *
- * (C) 2003-2009 Anope Team
- * Contact us at team@anope.org
- *
- * Please read COPYING and README for further details.
- *
- * Based on the original code of Epona by Lara.
- * Based on the original code of Services by Andy Church.
- *
- * $Id$
- *
- */
-/*************************************************************************/
-
-#include "module.h"
-
-class CommandCSIdentify : public Command
-{
- public:
- CommandCSIdentify(const std::string &cname) : Command(cname, 2, 2)
- {
- }
-
- CommandReturn Execute(User *u, std::vector<ci::string> &params)
- {
- const char *chan = params[0].c_str();
- const char *pass = params[1].c_str();
- ChannelInfo *ci;
- struct u_chaninfolist *uc;
-
- ci = cs_findchan(chan);
-
- if (is_founder(u, ci))
- {
- notice_lang(s_ChanServ, u, NICK_ALREADY_IDENTIFIED);
- return MOD_CONT;
- }
-
- int res;
-
- if ((res = enc_check_password(pass, ci->founderpass)) == 1)
- {
- if (!is_identified(u, ci))
- {
- uc = new u_chaninfolist;
- uc->prev = NULL;
- uc->next = u->founder_chans;
- if (u->founder_chans)
- u->founder_chans->prev = uc;
- u->founder_chans = uc;
- uc->chan = ci;
- alog("%s: %s!%s@%s identified for %s", s_ChanServ, u->nick,
- u->GetIdent().c_str(), u->host, ci->name);
- }
-
- notice_lang(s_ChanServ, u, CHAN_IDENTIFY_SUCCEEDED, chan);
- }
- else if (res < 0)
- {
- alog("%s: check_password failed for %s", s_ChanServ, ci->name);
- notice_lang(s_ChanServ, u, CHAN_IDENTIFY_FAILED);
- }
- else
- {
- alog("%s: Failed IDENTIFY for %s by %s!%s@%s",
- s_ChanServ, ci->name, u->nick, u->GetIdent().c_str(), u->host);
- notice_lang(s_ChanServ, u, PASSWORD_INCORRECT);
- bad_password(u);
- }
-
- return MOD_CONT;
- }
-
- bool OnHelp(User *u, const ci::string &subcommand)
- {
- notice_help(s_ChanServ, u, CHAN_HELP_IDENTIFY);
- return true;
- }
-
- void OnSyntaxError(User *u)
- {
- syntax_error(s_ChanServ, u, "IDENTIFY", CHAN_IDENTIFY_SYNTAX);
- }
-};
-
-class CSIdentify : public Module
-{
- public:
- CSIdentify(const std::string &modname, const std::string &creator) : Module(modname, creator)
- {
- this->SetAuthor("Anope");
- this->SetVersion("$Id$");
- this->SetType(CORE);
- this->AddCommand(CHANSERV, new CommandCSIdentify("IDENTIFY"));
- // XXX: we need aliases.
- this->AddCommand(CHANSERV, new CommandCSIdentify("ID"));
- }
- void ChanServHelp(User *u)
- {
- notice_lang(s_ChanServ, u, CHAN_HELP_CMD_IDENTIFY);
- }
-};
-
-MODULE_INIT(CSIdentify)
diff --git a/src/core/cs_logout.c b/src/core/cs_logout.c
deleted file mode 100644
index e7c39b329..000000000
--- a/src/core/cs_logout.c
+++ /dev/null
@@ -1,129 +0,0 @@
-/* ChanServ core functions
- *
- * (C) 2003-2009 Anope Team
- * Contact us at team@anope.org
- *
- * Please read COPYING and README for further details.
- *
- * Based on the original code of Epona by Lara.
- * Based on the original code of Services by Andy Church.
- *
- * $Id$
- *
- */
-/*************************************************************************/
-
-#include "module.h"
-
-class CommandCSLogout : public Command
-{
- private:
- int make_unidentified(User *u, ChannelInfo *ci)
- {
- struct u_chaninfolist *uci;
-
- if (!u || !ci)
- return 0;
-
- for (uci = u->founder_chans; uci; uci = uci->next)
- {
- if (uci->chan == ci)
- {
- if (uci->next)
- uci->next->prev = uci->prev;
- if (uci->prev)
- uci->prev->next = uci->next;
- else
- u->founder_chans = uci->next;
- delete uci;
-
- return 1;
- }
- }
-
- return 0;
- }
-
- public:
- CommandCSLogout() : Command("LOGOUT", 1, 2)
- {
- }
-
- CommandReturn Execute(User *u, std::vector<ci::string> &params)
- {
- const char *chan = params[0].c_str();
- const char *nick = params.size() > 1 ? params[1].c_str() : NULL;
- ChannelInfo *ci = cs_findchan(chan);
- User *u2 = NULL;
- int is_admin = u->nc->HasCommand("chanserv/logout");
-
- if (!is_admin && !nick)
- this->OnSyntaxError(u);
- else if (nick && !(u2 = finduser(nick)))
- notice_lang(s_ChanServ, u, NICK_X_NOT_IN_USE, nick);
- else if (u2 != u && !is_real_founder(u, ci) && !is_admin)
- notice_lang(s_ChanServ, u, ACCESS_DENIED);
- else if (u2 == u && is_real_founder(u, ci))
- /* Since founders can not logout we should tell them -katsklaw */
- notice_lang(s_ChanServ, u, CHAN_LOGOUT_FOUNDER_FAILED, chan);
- else
- {
- if (u2)
- {
- if (make_unidentified(u2, ci))
- {
- notice_lang(s_ChanServ, u, CHAN_LOGOUT_SUCCEEDED, nick, chan);
- alog("%s: User %s!%s@%s has been logged out of channel %s.", s_ChanServ, u2->nick, u2->GetIdent().c_str(), u2->host, chan);
- }
- else
- notice_lang(s_ChanServ, u, CHAN_LOGOUT_NOT_LOGGEDIN, nick, chan);
- }
- else
- {
- int i;
- for (i = 0; i < 1024; i++)
- for (u2 = userlist[i]; u2; u2 = u2->next)
- make_unidentified(u2, ci);
- notice_lang(s_ChanServ, u, CHAN_LOGOUT_ALL_SUCCEEDED, chan);
- alog("%s: User %s!%s@%s logged all identified users out of channel %s.", s_ChanServ, u->nick, u->GetIdent().c_str(), u->host, chan);
- }
-
- }
- return MOD_CONT;
- }
-
- bool OnHelp(User *u, const ci::string &subcommand)
- {
- if (u->nc && u->nc->HasCommand("chanserv/logout"))
- notice_help(s_NickServ, u, CHAN_SERVADMIN_HELP_LOGOUT);
- else
- notice_help(s_NickServ, u, CHAN_HELP_LOGOUT);
- return true;
- }
-
- void OnSyntaxError(User *u)
- {
- if (u->nc->HasCommand("chanserv/logout"))
- syntax_error(s_NickServ, u, "LOGOUT", CHAN_LOGOUT_SERVADMIN_SYNTAX);
- else
- syntax_error(s_NickServ, u, "LOGOUT", CHAN_LOGOUT_SYNTAX);
- }
-};
-
-class CSLogout : public Module
-{
- public:
- CSLogout(const std::string &modname, const std::string &creator) : Module(modname, creator)
- {
- this->SetAuthor("Anope");
- this->SetVersion("$Id$");
- this->SetType(CORE);
- this->AddCommand(CHANSERV, new CommandCSLogout());
- }
- void ChanServHelp(User *u)
- {
- notice_lang(s_ChanServ, u, CHAN_HELP_CMD_LOGOUT);
- }
-};
-
-MODULE_INIT(CSLogout)
diff --git a/src/core/cs_modes.c b/src/core/cs_modes.c
index 4e8162c02..8c45e328f 100644
--- a/src/core/cs_modes.c
+++ b/src/core/cs_modes.c
@@ -76,8 +76,6 @@ static CommandReturn do_util(User *u, ChannelMode *cm, const char *chan, const c
return MOD_CONT;
}
-// XXX: Future enhancement. Default these to the sender, with an optional target arg.
-
class CommandCSOp : public Command
{
public:
@@ -329,7 +327,7 @@ class CommandCSOwner : public Command
return MOD_CONT;
}
- return do_util(u, cm, (params.size() > 0 ? params[0].c_str() : NULL), NULL, true, ACCESS_FOUNDER, ACCESS_FOUNDER, "OWNER", 0);
+ return do_util(u, cm, (params.size() > 0 ? params[0].c_str() : NULL), (params.size() > 1 ? params[1].c_str() : NULL), true, CA_OWNER, CA_OWNERME, "OWNER", 0);
}
bool OnHelp(User *u, const ci::string &subcommand)
@@ -360,7 +358,7 @@ class CommandCSDeOwner : public Command
return MOD_CONT;
}
- return do_util(u, cm, (params.size() > 0 ? params[0].c_str() : NULL), NULL, false, ACCESS_FOUNDER, ACCESS_FOUNDER, "OWNER", 0);
+ return do_util(u, cm, (params.size() > 0 ? params[0].c_str() : NULL), (params.size() > 1 ? params[1].c_str() : NULL), false, CA_OWNER, CA_OWNERME, "DEOWNER", 0);
}
bool OnHelp(User *u, const ci::string &subcommand)
diff --git a/src/core/cs_register.c b/src/core/cs_register.c
index 62737d4aa..d0f6f3765 100644
--- a/src/core/cs_register.c
+++ b/src/core/cs_register.c
@@ -18,7 +18,7 @@
class CommandCSRegister : public Command
{
public:
- CommandCSRegister() : Command("REGISTER", 3, 3)
+ CommandCSRegister() : Command("REGISTER", 2, 2)
{
this->SetFlag(CFLAG_ALLOW_UNREGISTEREDCHANNEL);
}
@@ -26,13 +26,9 @@ class CommandCSRegister : public Command
CommandReturn Execute(User *u, std::vector<ci::string> &params)
{
const char *chan = params[0].c_str();
- const char *pass = params[1].c_str();
- const char *desc = params[2].c_str();
+ const char *desc = params[1].c_str();
Channel *c;
ChannelInfo *ci;
- struct u_chaninfolist *uc;
- char founderpass[PASSMAX];
- char tmp_pass[PASSMAX];
ChannelMode *cm;
if (readonly)
@@ -57,21 +53,11 @@ class CommandCSRegister : public Command
notice_lang(s_ChanServ, u, CHAN_MUST_BE_CHANOP);
else if (CSMaxReg && u->nc->channelcount >= CSMaxReg && !u->nc->HasPriv("chanserv/no-register-limit"))
notice_lang(s_ChanServ, u, u->nc->channelcount > CSMaxReg ? CHAN_EXCEEDED_CHANNEL_LIMIT : CHAN_REACHED_CHANNEL_LIMIT, CSMaxReg);
- else if (!stricmp(u->nick, pass) || (StrictPasswords && strlen(pass) < 5))
- notice_lang(s_ChanServ, u, MORE_OBSCURE_PASSWORD);
- else if (enc_encrypt_check_len(strlen(pass), PASSMAX - 1))
- notice_lang(s_ChanServ, u, PASSWORD_TOO_LONG);
else if (!(ci = makechan(chan)))
{
alog("%s: makechan() failed for REGISTER %s", s_ChanServ, chan);
notice_lang(s_ChanServ, u, CHAN_REGISTRATION_FAILED);
}
- else if (strscpy(founderpass, pass, PASSMAX), enc_encrypt_in_place(founderpass, PASSMAX) < 0)
- {
- alog("%s: Couldn't encrypt password for %s (REGISTER)", s_ChanServ, chan);
- notice_lang(s_ChanServ, u, CHAN_REGISTRATION_FAILED);
- delchan(ci);
- }
else
{
c->ci = ci;
@@ -83,7 +69,6 @@ class CommandCSRegister : public Command
ci->last_used = ci->time_registered;
ci->founder = u->nc;
- memcpy(ci->founderpass, founderpass, PASSMAX);
ci->desc = sstrdup(desc);
if (c->topic)
{
@@ -98,16 +83,6 @@ class CommandCSRegister : public Command
alog("%s: Channel '%s' registered by %s!%s@%s", s_ChanServ, chan, u->nick, u->GetIdent().c_str(), u->host);
notice_lang(s_ChanServ, u, CHAN_REGISTERED, chan, u->nick);
- if (enc_decrypt(ci->founderpass, tmp_pass, PASSMAX - 1) == 1)
- notice_lang(s_ChanServ, u, CHAN_PASSWORD_IS, tmp_pass);
-
- uc = new u_chaninfolist;
- uc->next = u->founder_chans;
- uc->prev = NULL;
- if (u->founder_chans)
- u->founder_chans->prev = uc;
- u->founder_chans = uc;
- uc->chan = ci;
/* Implement new mode lock */
check_modes(c);
/* On most ircds you do not receive the admin/owner mode till its registered */
diff --git a/src/core/cs_sendpass.c b/src/core/cs_sendpass.c
deleted file mode 100644
index c9972bfe1..000000000
--- a/src/core/cs_sendpass.c
+++ /dev/null
@@ -1,109 +0,0 @@
-/* ChanServ core functions
- *
- * (C) 2003-2009 Anope Team
- * Contact us at team@anope.org
- *
- * Please read COPYING and README for further details.
- *
- * Based on the original code of Epona by Lara.
- * Based on the original code of Services by Andy Church.
- *
- * $Id$
- *
- */
-/*************************************************************************/
-
-#include "module.h"
-
-class CommandCSSendPass : public Command
-{
- public:
- CommandCSSendPass() : Command("SENDPASS", 1, 1)
- {
- }
-
- CommandReturn Execute(User *u, std::vector<ci::string> &params)
- {
- const char *chan = params[0].c_str();
- ChannelInfo *ci = cs_findchan(chan);
- NickCore *founder = ci->founder;;
-
- if (RestrictMail && !u->nc->HasCommand("chanserv/sendpass"))
- notice_lang(s_ChanServ, u, ACCESS_DENIED);
- else
- {
- char buf[BUFSIZE];
- char tmp_pass[PASSMAX];
- if (enc_decrypt(ci->founderpass, tmp_pass, PASSMAX - 1) == 1)
- {
- MailInfo *mail;
-
- snprintf(buf, sizeof(buf), getstring(founder, CHAN_SENDPASS_SUBJECT), ci->name);
- mail = MailBegin(u, founder, buf, s_ChanServ);
- if (!mail)
- return MOD_CONT;
-
- fprintf(mail->pipe, "%s", getstring(founder, CHAN_SENDPASS_HEAD));
- fprintf(mail->pipe, "\n\n");
- fprintf(mail->pipe, getstring(founder, CHAN_SENDPASS_LINE_1),
- ci->name);
- fprintf(mail->pipe, "\n\n");
- fprintf(mail->pipe, getstring(founder, CHAN_SENDPASS_LINE_2),
- tmp_pass);
- fprintf(mail->pipe, "\n\n");
- fprintf(mail->pipe, "%s", getstring(founder, CHAN_SENDPASS_LINE_3));
- fprintf(mail->pipe, "\n\n");
- fprintf(mail->pipe, "%s", getstring(founder, CHAN_SENDPASS_LINE_4));
- fprintf(mail->pipe, "\n\n");
- fprintf(mail->pipe, getstring(founder, CHAN_SENDPASS_LINE_5),
- NetworkName);
- fprintf(mail->pipe, "\n.\n");
-
- MailEnd(mail);
-
- alog("%s: %s!%s@%s used SENDPASS on %s", s_ChanServ, u->nick, u->GetIdent().c_str(), u->host, chan);
- notice_lang(s_ChanServ, u, CHAN_SENDPASS_OK, chan);
- }
- else
- notice_lang(s_ChanServ, u, CHAN_SENDPASS_UNAVAILABLE);
- }
- return MOD_CONT;
- }
-
- bool OnHelp(User *u, const ci::string &subcommand)
- {
- notice_help(s_ChanServ, u, CHAN_HELP_SENDPASS);
- return true;
- }
-
- void OnSyntaxError(User *u)
- {
- syntax_error(s_ChanServ, u, "SENDPASS", CHAN_SENDPASS_SYNTAX);
- }
-};
-
-class CSSendPass : public Module
-{
- public:
- CSSendPass(const std::string &modname, const std::string &creator) : Module(modname, creator)
- {
- this->SetAuthor("Anope");
- this->SetVersion("$Id$");
- this->SetType(CORE);
-
- this->AddCommand(CHANSERV, new CommandCSSendPass());
-
- if (!UseMail)
- throw ModuleException("sendpass may not be loaded if UseMail is loaded");
-
- char tmp_pass[PASSMAX];
- if (!enc_decrypt("tmp", tmp_pass, PASSMAX - 1))
- throw ModuleException("Incompatible with the encryption module being used");
- }
- void ChanServHelp(User *u)
- {
- notice_lang(s_ChanServ, u, CHAN_HELP_CMD_SENDPASS);
- }
-};
-
-MODULE_INIT(CSSendPass)
diff --git a/src/core/cs_set.c b/src/core/cs_set.c
index 716144d2c..17955dbf2 100644
--- a/src/core/cs_set.c
+++ b/src/core/cs_set.c
@@ -96,44 +96,6 @@ class CommandCSSet : public Command
return MOD_CONT;
}
- CommandReturn DoSetPassword(User * u, ChannelInfo * ci, const char *param)
- {
- int len = strlen(param);
-
- if (stricmp(u->nick, param) == 0 || (StrictPasswords && len < 5)) {
- notice_lang(s_ChanServ, u, MORE_OBSCURE_PASSWORD);
- return MOD_CONT;
- }
-
- if (enc_encrypt_check_len(len ,PASSMAX - 1)) {
- notice_lang(s_ChanServ, u, PASSWORD_TOO_LONG);
- return MOD_CONT;
- }
-
- if (enc_encrypt(param, len, ci->founderpass, PASSMAX -1) < 0) {
- alog("%s: Failed to encrypt password for %s (set)", s_ChanServ,
- ci->name);
- notice_lang(s_ChanServ, u, CHAN_SET_PASSWORD_FAILED);
- return MOD_CONT;
- }
-
- notice_lang(s_ChanServ, u, CHAN_PASSWORD_CHANGED, ci->name);
-
- if (get_access(u, ci) < ACCESS_FOUNDER) {
- alog("%s: %s!%s@%s set password as Services admin for %s",
- s_ChanServ, u->nick, u->GetIdent().c_str(), u->host, ci->name);
- if (WallSetpass)
- ircdproto->SendGlobops(s_ChanServ,
- "\2%s\2 set password as Services admin for channel \2%s\2",
- u->nick, ci->name);
- } else {
- alog("%s: %s!%s@%s changed password of %s (founder: %s)",
- s_ChanServ, u->nick, u->GetIdent().c_str(), u->host,
- ci->name, ci->founder->display);
- }
- return MOD_CONT;
- }
-
CommandReturn DoSetDesc(User * u, ChannelInfo * ci, const char *param)
{
if (ci->desc)
@@ -476,7 +438,9 @@ class CommandCSSet : public Command
/* This will probably cause wrong levels to be set, but hey,
* it's better than losing it altogether.
*/
- if (CHECKLEV(CA_AKICK) || CHECKLEV(CA_SET)) {
+ if (access->level == ACCESS_QOP) {
+ access->level = ACCESS_QOP;
+ } else if (CHECKLEV(CA_AKICK) || CHECKLEV(CA_SET)) {
access->level = ACCESS_SOP;
} else if (CHECKLEV(CA_AUTOOP) || CHECKLEV(CA_OPDEOP)
|| CHECKLEV(CA_OPDEOPME)) {
@@ -578,9 +542,9 @@ class CommandCSSet : public Command
else if (cmd == "FOUNDER") {
if (!is_servadmin
&& (ci->
- flags & CI_SECUREFOUNDER ? !is_real_founder(u,
+ flags & CI_SECUREFOUNDER ? !IsRealFounder(u,
ci) :
- !is_founder(u, ci))) {
+ !IsFounder(u, ci))) {
notice_lang(s_ChanServ, u, ACCESS_DENIED);
} else {
DoSetFounder(u, ci, param);
@@ -588,23 +552,13 @@ class CommandCSSet : public Command
} else if (cmd == "SUCCESSOR") {
if (!is_servadmin
&& (ci->
- flags & CI_SECUREFOUNDER ? !is_real_founder(u,
+ flags & CI_SECUREFOUNDER ? !IsRealFounder(u,
ci) :
- !is_founder(u, ci))) {
+ !IsFounder(u, ci))) {
notice_lang(s_ChanServ, u, ACCESS_DENIED);
} else {
DoSetSuccessor(u, ci, param);
}
- } else if (cmd == "PASSWORD") {
- if (!is_servadmin
- && (ci->
- flags & CI_SECUREFOUNDER ? !is_real_founder(u,
- ci) :
- !is_founder(u, ci))) {
- notice_lang(s_ChanServ, u, ACCESS_DENIED);
- } else {
- DoSetPassword(u, ci, param);
- }
} else if (cmd == "DESC") {
DoSetDesc(u, ci, param);
} else if (cmd == "URL") {
@@ -630,9 +584,9 @@ class CommandCSSet : public Command
} else if (cmd == "SECUREFOUNDER") {
if (!is_servadmin
&& (ci->
- flags & CI_SECUREFOUNDER ? !is_real_founder(u,
+ flags & CI_SECUREFOUNDER ? !IsRealFounder(u,
ci) :
- !is_founder(u, ci))) {
+ !IsFounder(u, ci))) {
notice_lang(s_ChanServ, u, ACCESS_DENIED);
} else {
DoSetSecureFounder(u, ci, param);
@@ -674,8 +628,6 @@ class CommandCSSet : public Command
notice_help(s_ChanServ, u, CHAN_HELP_SET_FOUNDER);
else if (subcommand == "SUCCESSOR")
notice_help(s_ChanServ, u, CHAN_HELP_SET_SUCCESSOR);
- else if (subcommand == "PASSWORD")
- notice_help(s_ChanServ, u, CHAN_HELP_SET_PASSWORD);
else if (subcommand == "DESC")
notice_help(s_ChanServ, u, CHAN_HELP_SET_DESC);
else if (subcommand == "URL")
diff --git a/src/core/cs_xop.c b/src/core/cs_xop.c
index 4fd3bcd7a..48b0b627a 100644
--- a/src/core/cs_xop.c
+++ b/src/core/cs_xop.c
@@ -25,6 +25,7 @@ enum
XOP_SOP,
XOP_VOP,
XOP_HOP,
+ XOP_QOP,
XOP_TYPES
};
@@ -98,7 +99,20 @@ int xop_msgs[XOP_TYPES][XOP_MESSAGES] = {
CHAN_HOP_DELETED_SEVERAL,
CHAN_HOP_LIST_EMPTY,
CHAN_HOP_LIST_HEADER,
- CHAN_HOP_CLEAR}
+ CHAN_HOP_CLEAR},
+ {CHAN_QOP_DISABLED,
+ CHAN_QOP_NICKS_ONLY,
+ CHAN_QOP_ADDED,
+ CHAN_QOP_MOVED,
+ CHAN_QOP_NO_SUCH_ENTRY,
+ CHAN_QOP_NOT_FOUND,
+ CHAN_QOP_NO_MATCH,
+ CHAN_QOP_DELETED,
+ CHAN_QOP_DELETED_ONE,
+ CHAN_QOP_DELETED_SEVERAL,
+ CHAN_QOP_LIST_EMPTY,
+ CHAN_QOP_LIST_HEADER,
+ CHAN_QOP_CLEAR}
};
class XOPBase : public Command
@@ -335,7 +349,7 @@ class XOPBase : public Command
return MOD_CONT;
}
- if (!is_founder(u, ci) && !u->nc->HasPriv("chanserv/access/modify"))
+ if (!IsFounder(u, ci) && !u->nc->HasPriv("chanserv/access/modify"))
{
notice_lang(s_ChanServ, u, ACCESS_DENIED);
return MOD_CONT;
@@ -392,6 +406,30 @@ class XOPBase : public Command
virtual void OnSyntaxError(User *u) = 0;
};
+class CommandCSQOP : public XOPBase
+{
+ public:
+ CommandCSQOP() : XOPBase("QOP")
+ {
+ }
+
+ CommandReturn Execute(User *u, std::vector<ci::string> &params)
+ {
+ return this->DoXop(u, params, ACCESS_QOP, xop_msgs[XOP_QOP]);
+ }
+
+ bool OnHelp(User *u, const ci::string &subcommand)
+ {
+ notice_help(s_ChanServ, u, CHAN_HELP_QOP);
+ return true;
+ }
+
+ void OnSyntaxError(User *u)
+ {
+ syntax_error(s_ChanServ, u, "QOP", CHAN_QOP_SYNTAX);
+ }
+};
+
class CommandCSAOP : public XOPBase
{
public:
@@ -497,7 +535,10 @@ class CSXOP : public Module
this->SetVersion("$Id$");
this->SetType(CORE);
- this->AddCommand(CHANSERV, new CommandCSAOP());
+ if (ModeManager::FindChannelModeByName(CMODE_OWNER))
+ this->AddCommand(CHANSERV, new CommandCSQOP());
+ if (ModeManager::FindChannelModeByName(CMODE_PROTECT))
+ this->AddCommand(CHANSERV, new CommandCSAOP());
if (ModeManager::FindChannelModeByName(CMODE_HALFOP))
this->AddCommand(CHANSERV, new CommandCSHOP());
this->AddCommand(CHANSERV, new CommandCSSOP());
@@ -505,7 +546,10 @@ class CSXOP : public Module
}
void ChanServHelp(User *u)
{
- notice_lang(s_ChanServ, u, CHAN_HELP_CMD_SOP);
+ if (ModeManager::FindChannelModeByName(CMODE_OWNER))
+ notice_lang(s_ChanServ, u, CHAN_HELP_CMD_QOP);
+ if (ModeManager::FindChannelModeByName(CMODE_PROTECT))
+ notice_lang(s_ChanServ, u, CHAN_HELP_CMD_SOP);
notice_lang(s_ChanServ, u, CHAN_HELP_CMD_AOP);
if (ModeManager::FindChannelModeByName(CMODE_HALFOP))
notice_lang(s_ChanServ, u, CHAN_HELP_CMD_HOP);
diff --git a/src/core/ns_logout.c b/src/core/ns_logout.c
index d72753208..a4d051e47 100644
--- a/src/core/ns_logout.c
+++ b/src/core/ns_logout.c
@@ -31,7 +31,6 @@ class CommandNSLogout : public Command
ci::string param = params.size() > 1 ? params[1] : "";
User *u2;
NickAlias *na;
- struct u_chaninfolist *ci, *ci2;
if (!u->nc->IsServicesOper() && nick)
this->OnSyntaxError(u);
@@ -56,15 +55,6 @@ class CommandNSLogout : public Command
alog("%s: %s!%s@%s logged out nickname %s", s_NickServ, u->nick, u->GetIdent().c_str(), u->host, u2->nick);
/* Remove founder status from this user in all channels */
- ci = u2->founder_chans;
- while (ci)
- {
- ci2 = ci->next;
- delete ci;
- ci = ci2;
- }
- u2->founder_chans = NULL;
-
if (nick)
notice_lang(s_NickServ, u, NICK_LOGOUT_X_SUCCEEDED, nick);
else
diff --git a/src/users.c b/src/users.c
index 32dadbbba..65d2f7831 100644
--- a/src/users.c
+++ b/src/users.c
@@ -43,7 +43,6 @@ User::User(const std::string &snick, const std::string &suid)
server = NULL;
nc = NULL;
chans = NULL;
- founder_chans = NULL;
invalid_pw_count = timestamp = my_signon = invalid_pw_time = lastmemosend = lastnickreg = lastmail = 0;
OnAccess = false;
@@ -225,7 +224,6 @@ void User::SetRealname(const std::string &srealname)
User::~User()
{
struct u_chanlist *c, *c2;
- struct u_chaninfolist *ci, *ci2;
char *srealname;
if (LogUsers)
@@ -288,16 +286,6 @@ User::~User()
cancel_user(this);
if (debug >= 2)
- alog("debug: User::~User(): free founder data");
- ci = this->founder_chans;
- while (ci)
- {
- ci2 = ci->next;
- delete ci;
- ci = ci2;
- }
-
- if (debug >= 2)
alog("debug: User::~User(): delete from list");
if (this->prev)
@@ -426,7 +414,6 @@ void get_user_stats(long *nusers, long *memuse)
int i;
User *user;
struct u_chanlist *uc;
- struct u_chaninfolist *uci;
for (i = 0; i < 1024; i++) {
for (user = userlist[i]; user; user = user->next) {
@@ -444,8 +431,6 @@ void get_user_stats(long *nusers, long *memuse)
mem += strlen(user->server->name) + 1;
for (uc = user->chans; uc; uc = uc->next)
mem += sizeof(*uc);
- for (uci = user->founder_chans; uci; uci = uci->next)
- mem += sizeof(*uci);
}
}
*nusers = count;