diff options
author | Gluzskiy Alexandr <sss123next@list.ru> | 2016-08-23 00:37:29 +0300 |
---|---|---|
committer | Gluzskiy Alexandr <sss123next@list.ru> | 2016-08-23 00:37:29 +0300 |
commit | f6c032d137eb625f02acde302dd0688f6a781cee (patch) | |
tree | 5ad6cddec73c1b72013ad9d9d11b923285fc2030 /media-sound | |
parent | f8e50a0e3f50940f45f9b3e278925f4bd93d74a3 (diff) |
murmur: more detailed acl editing log
Diffstat (limited to 'media-sound')
-rw-r--r-- | media-sound/murmur/files/acl_edit_log.patch | 78 |
1 files changed, 74 insertions, 4 deletions
diff --git a/media-sound/murmur/files/acl_edit_log.patch b/media-sound/murmur/files/acl_edit_log.patch index 784cd9c..e4a6517 100644 --- a/media-sound/murmur/files/acl_edit_log.patch +++ b/media-sound/murmur/files/acl_edit_log.patch @@ -1,13 +1,14 @@ diff --git a/src/murmur/Messages.cpp b/src/murmur/Messages.cpp -index 529f287..f4a5de9 100644 +index 529f287..43ab378 100644 --- a/src/murmur/Messages.cpp +++ b/src/murmur/Messages.cpp -@@ -1326,19 +1326,38 @@ void Server::msgACL(ServerUser *uSource, MumbleProto::ACL &msg) { +@@ -1326,19 +1326,70 @@ void Server::msgACL(ServerUser *uSource, MumbleProto::ACL &msg) { QHash<QString, QSet<int> > hOldTemp; + log(uSource, QString("Updating ACL in channel %1").arg(*c)); + log("old groups and acl follows:"); ++ log("old groups:"); + foreach(g, c->qhGroups) { + log(QString("group: ") + g->qsName + " have following users: "); @@ -25,11 +26,41 @@ index 529f287..f4a5de9 100644 delete g; } ++ log("old acls:"); ++ ++ QString acls_string; ++ foreach(a, c->qlACL) + { -+ //TODO: print acl ++ acls_string += a->qsGroup; ++ acls_string += "|"; ++ acls_string += getUserName(a->iUserId); ++ acls_string += ":"; ++ QString tmp; ++ acls_string += tmp.sprintf("%s%s%s%s%s%s%s%s%s%s%s%s%s%s%s%s", a->pAllow.testFlag(ChanACL::None)?"None,":"", a->pAllow.testFlag(ChanACL::Write)?"Write,":"", \ ++ a->pAllow.testFlag(ChanACL::Traverse)?"Traverse,":"", a->pAllow.testFlag(ChanACL::Enter)?"Enter,":"", a->pAllow.testFlag(ChanACL::Speak)?"Speak,":"", \ ++ a->pAllow.testFlag(ChanACL::MuteDeafen)?"Mute,":"", a->pAllow.testFlag(ChanACL::Move)?"Move,":"", a->pAllow.testFlag(ChanACL::MakeChannel)?"MakeChannel,":"", \ ++ a->pAllow.testFlag(ChanACL::LinkChannel)?"LinkChannel,":"", a->pAllow.testFlag(ChanACL::Whisper)?"Whisper,":"", a->pAllow.testFlag(ChanACL::TextMessage)?"TextMessage,":"", \ ++ a->pAllow.testFlag(ChanACL::MakeTempChannel)?"MakeTempChannel,":"", a->pAllow.testFlag(ChanACL::Kick)?"Kick,":"", a->pAllow.testFlag(ChanACL::Ban)?"Ban,":"", \ ++ a->pAllow.testFlag(ChanACL::Register)?"Register,":"", a->pAllow.testFlag(ChanACL::SelfRegister)?"SelfRegister,":""); ++ acls_string.remove(acls_string.length() -1, 1); ++ acls_string += "_"; ++ acls_string += tmp.sprintf("%s%s%s%s%s%s%s%s%s%s%s%s%s%s%s%s", a->pDeny.testFlag(ChanACL::None)?"None,":"", a->pDeny.testFlag(ChanACL::Write)?"Write,":"", \ ++ a->pDeny.testFlag(ChanACL::Traverse)?"Traverse,":"", a->pDeny.testFlag(ChanACL::Enter)?"Enter,":"", a->pDeny.testFlag(ChanACL::Speak)?"Speak,":"", \ ++ a->pDeny.testFlag(ChanACL::MuteDeafen)?"Mute,":"", a->pDeny.testFlag(ChanACL::Move)?"Move,":"", a->pDeny.testFlag(ChanACL::MakeChannel)?"MakeChannel,":"", \ ++ a->pDeny.testFlag(ChanACL::LinkChannel)?"LinkChannel,":"", a->pDeny.testFlag(ChanACL::Whisper)?"Whisper,":"", a->pDeny.testFlag(ChanACL::TextMessage)?"TextMessage,":"", \ ++ a->pDeny.testFlag(ChanACL::MakeTempChannel)?"MakeTempChannel,":"", a->pDeny.testFlag(ChanACL::Kick)?"Kick,":"", a->pDeny.testFlag(ChanACL::Ban)?"Ban,":"", \ ++ a->pDeny.testFlag(ChanACL::Register)?"Register,":"", a->pDeny.testFlag(ChanACL::SelfRegister)?"SelfRegister,":""); ++ acls_string.remove(acls_string.length() -1, 1); ++ acls_string += "; "; ++ ++ delete a; + } ++ acls_string.remove(acls_string.length() -2, 2); ++ log(acls_string); ++ ++ acls_string.clear(); c->qhGroups.clear(); c->qlACL.clear(); @@ -37,11 +68,12 @@ index 529f287..f4a5de9 100644 c->bInheritACL = msg.inherit_acls(); + log("new groups and acl follows:"); ++ log("new groups:"); + for (int i = 0; i < msg.groups_size(); ++i) { const MumbleProto::ACL_ChanGroup &group = msg.groups(i); g = new Group(c, u8(group.name())); -@@ -1350,6 +1369,18 @@ void Server::msgACL(ServerUser *uSource, MumbleProto::ACL &msg) { +@@ -1350,9 +1401,23 @@ void Server::msgACL(ServerUser *uSource, MumbleProto::ACL &msg) { for (int j = 0; j < group.remove_size(); ++j) if (!getUserName(group.remove(j)).isEmpty()) g->qsRemove << group.remove(j); @@ -60,3 +92,41 @@ index 529f287..f4a5de9 100644 g->qsTemporary = hOldTemp.value(g->qsName); } ++ log("new acls:"); ++ + for (int i = 0; i < msg.acls_size(); ++i) { + const MumbleProto::ACL_ChanACL &mpacl = msg.acls(i); + if (mpacl.has_user_id() && getUserName(mpacl.user_id()).isEmpty()) +@@ -1367,7 +1432,32 @@ void Server::msgACL(ServerUser *uSource, MumbleProto::ACL &msg) { + a->qsGroup = u8(mpacl.group()); + a->pDeny = static_cast<ChanACL::Permissions>(mpacl.deny()) & ChanACL::All; + a->pAllow = static_cast<ChanACL::Permissions>(mpacl.grant()) & ChanACL::All; ++ //TODO: log acls ++ acls_string += a->qsGroup; ++ acls_string += "|"; ++ acls_string += getUserName(a->iUserId); ++ acls_string += ":"; ++ QString tmp; ++ acls_string += tmp.sprintf("%s%s%s%s%s%s%s%s%s%s%s%s%s%s%s%s", a->pAllow.testFlag(ChanACL::None)?"None,":"", a->pAllow.testFlag(ChanACL::Write)?"Write,":"", \ ++ a->pAllow.testFlag(ChanACL::Traverse)?"Traverse,":"", a->pAllow.testFlag(ChanACL::Enter)?"Enter,":"", a->pAllow.testFlag(ChanACL::Speak)?"Speak,":"", \ ++ a->pAllow.testFlag(ChanACL::MuteDeafen)?"Mute,":"", a->pAllow.testFlag(ChanACL::Move)?"Move,":"", a->pAllow.testFlag(ChanACL::MakeChannel)?"MakeChannel,":"", \ ++ a->pAllow.testFlag(ChanACL::LinkChannel)?"LinkChannel,":"", a->pAllow.testFlag(ChanACL::Whisper)?"Whisper,":"", a->pAllow.testFlag(ChanACL::TextMessage)?"TextMessage,":"", \ ++ a->pAllow.testFlag(ChanACL::MakeTempChannel)?"MakeTempChannel,":"", a->pAllow.testFlag(ChanACL::Kick)?"Kick,":"", a->pAllow.testFlag(ChanACL::Ban)?"Ban,":"", \ ++ a->pAllow.testFlag(ChanACL::Register)?"Register,":"", a->pAllow.testFlag(ChanACL::SelfRegister)?"SelfRegister,":""); ++ acls_string.remove(acls_string.length() -1, 1); ++ acls_string += "_"; ++ acls_string += tmp.sprintf("%s%s%s%s%s%s%s%s%s%s%s%s%s%s%s%s", a->pDeny.testFlag(ChanACL::None)?"None,":"", a->pDeny.testFlag(ChanACL::Write)?"Write,":"", \ ++ a->pDeny.testFlag(ChanACL::Traverse)?"Traverse,":"", a->pDeny.testFlag(ChanACL::Enter)?"Enter,":"", a->pDeny.testFlag(ChanACL::Speak)?"Speak,":"", \ ++ a->pDeny.testFlag(ChanACL::MuteDeafen)?"Mute,":"", a->pDeny.testFlag(ChanACL::Move)?"Move,":"", a->pDeny.testFlag(ChanACL::MakeChannel)?"MakeChannel,":"", \ ++ a->pDeny.testFlag(ChanACL::LinkChannel)?"LinkChannel,":"", a->pDeny.testFlag(ChanACL::Whisper)?"Whisper,":"", a->pDeny.testFlag(ChanACL::TextMessage)?"TextMessage,":"", \ ++ a->pDeny.testFlag(ChanACL::MakeTempChannel)?"MakeTempChannel,":"", a->pDeny.testFlag(ChanACL::Kick)?"Kick,":"", a->pDeny.testFlag(ChanACL::Ban)?"Ban,":"", \ ++ a->pDeny.testFlag(ChanACL::Register)?"Register,":"", a->pDeny.testFlag(ChanACL::SelfRegister)?"SelfRegister,":""); ++ acls_string.remove(acls_string.length() -1, 1); ++ acls_string += ", "; + } ++ acls_string.remove(acls_string.length() -2, 2); ++ log(acls_string); ++ + } + + clearACLCache(); |