modules: add OnAddNetwork, OnDeleteNetwork hooks.

This commit is contained in:
Ingmar Runge
2013-10-18 20:35:21 +02:00
parent 8c6b4b8d21
commit b5c898eaff
7 changed files with 54 additions and 14 deletions
+3 -2
View File
@@ -741,10 +741,11 @@ class CAdminMod : public CModule {
return;
}
if (pUser->AddNetwork(sNetwork)) {
CString sNetworkAddError;
if (pUser->AddNetwork(sNetwork, sNetworkAddError)) {
PutModule("Network [" + sNetwork + "] added for user [" + pUser->GetUserName() + "].");
} else {
PutModule("Network [" + sNetwork + "] could not be added for user [" + pUser->GetUserName() + "].");
PutModule("Network [" + sNetwork + "] could not be added for user [" + pUser->GetUserName() + "]: " + sNetworkAddError);
}
}
+3 -2
View File
@@ -861,9 +861,10 @@ public:
WebSock.PrintErrorPage("Network name should be alphanumeric");
return true;
}
pNetwork = pUser->AddNetwork(sName);
CString sNetworkAddError;
pNetwork = pUser->AddNetwork(sName, sNetworkAddError);
if (!pNetwork) {
WebSock.PrintErrorPage("Network [" + sName.Token(0) + "] already exists");
WebSock.PrintErrorPage(sNetworkAddError);
return true;
}
}