Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP

Comparing changes

Choose two branches to see what's changed or to start a new pull request. If you need to, you can also compare across forks.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also compare across forks.
base fork: znc/znc
base: 2cfc6ce979d9
...
head fork: znc/znc
compare: 73bc8d59594e
Checking mergeability… Don't worry, you can still create the pull request.
  • 2 commits
  • 1 file changed
  • 0 commit comments
  • 2 contributors
Commits on Mar 18, 2014
@Nothing4You Nothing4You Fix *controlpanel not checking whether the bindhost is in the whitelist e77edb4
Commits on Mar 20, 2014
@DarthGandalf DarthGandalf Merge pull request #512 from Nothing4You/fix-another-controlpanel-bin…
…dhost-issue

Fix *controlpanel not checking whether the bindhost is in the whitelist
73bc8d5
Showing with 46 additions and 0 deletions.
  1. +46 −0 modules/controlpanel.cpp
View
46 modules/controlpanel.cpp
@@ -248,6 +248,29 @@ class CAdminMod : public CModule {
}
else if (sVar == "bindhost") {
if(!pUser->DenySetBindHost() || m_pUser->IsAdmin()) {
+ if (sValue.Equals(m_pUser->GetBindHost())) {
+ PutModule("This bind host is already set!");
+ return;
+ }
+
+ const VCString& vsHosts = CZNC::Get().GetBindHosts();
+ if (!m_pUser->IsAdmin() && !vsHosts.empty()) {
+ VCString::const_iterator it;
+ bool bFound = false;
+
+ for (it = vsHosts.begin(); it != vsHosts.end(); ++it) {
+ if (sValue.Equals(*it)) {
+ bFound = true;
+ break;
+ }
+ }
+
+ if (!bFound) {
+ PutModule("You may not use this bind host. See /msg " + m_pUser->GetStatusPrefix() + "status ListBindHosts for a list");
+ return;
+ }
+ }
+
pUser->SetBindHost(sValue);
PutModule("BindHost = " + sValue);
} else {
@@ -479,6 +502,29 @@ class CAdminMod : public CModule {
PutModule("RealName = " + pNetwork->GetRealName());
} else if (sVar.Equals("bindhost")) {
if(!pUser->DenySetBindHost() || m_pUser->IsAdmin()) {
+ if (sValue.Equals(pNetwork->GetBindHost())) {
+ PutModule("This bind host is already set!");
+ return;
+ }
+
+ const VCString& vsHosts = CZNC::Get().GetBindHosts();
+ if (!m_pUser->IsAdmin() && !vsHosts.empty()) {
+ VCString::const_iterator it;
+ bool bFound = false;
+
+ for (it = vsHosts.begin(); it != vsHosts.end(); ++it) {
+ if (sValue.Equals(*it)) {
+ bFound = true;
+ break;
+ }
+ }
+
+ if (!bFound) {
+ PutModule("You may not use this bind host. See /msg " + m_pUser->GetStatusPrefix() + "status ListBindHosts for a list");
+ return;
+ }
+ }
+
pNetwork->SetBindHost(sValue);
PutModule("BindHost = " + sValue);
} else {

No commit comments for this range

Something went wrong with that request. Please try again.