]> jfr.im git - irc/rizon/znc.git/commitdiff
Lock down addnetwork/delnetwork more origin/rizon-znc-1.0
authorAdam <redacted>
Sat, 12 Jan 2013 21:47:23 +0000 (16:47 -0500)
committerAdam <redacted>
Sat, 12 Jan 2013 21:47:23 +0000 (16:47 -0500)
src/ClientCommand.cpp

index 6446404b8de3b12350b5dcadbf7b1560f7dc8ca0..54569ffe624338aab14764fbe000836d583e00e6 100644 (file)
@@ -477,9 +477,14 @@ void CClient::UserCommand(CString& sLine) {
                PutStatus("Total: " + CString(vChans.size()) + " - Joined: " + CString(uNumJoined) +
                        " - Detached: " + CString(uNumDetached) + " - Disabled: " + CString(uNumDisabled));
        } else if (sCommand.Equals("ADDNETWORK")) {
-               if (!m_pUser->IsAdmin() && !m_pUser->HasSpaceForNewNetwork()) {
+               /*if (!m_pUser->IsAdmin() && !m_pUser->HasSpaceForNewNetwork()) {
                        PutStatus("Network number limit reached. Ask an admin to increase the limit for you, or delete few old ones using /znc DelNetwork <name>");
                        return;
+               }*/
+               if (!m_pUser->IsAdmin())
+               {
+                       PutStatus("Access denied");
+                       return;
                }
 
                CString sNetwork = sLine.Token(1);
@@ -503,6 +508,17 @@ void CClient::UserCommand(CString& sLine) {
                        return;
                }
 
+               else if (!sNetwork.CaseCmp("Rizon"))
+               {
+                       PutStatus("How DARE you try to delete Rizon!");
+                       return;
+               }
+               else if (!m_pUser->IsAdmin())
+               {
+                       PutStatus("Access denied");
+                       return;
+               }
+
                if (m_pNetwork && m_pNetwork->GetName().Equals(sNetwork)) {
                        SetNetwork(NULL);
                }