diff options
author | Simon Rettberg | 2018-06-18 12:02:54 +0200 |
---|---|---|
committer | Simon Rettberg | 2018-06-18 12:02:54 +0200 |
commit | ca5c046a18f169f10a79cce5c2d0a70b6f08d9aa (patch) | |
tree | 996dba53ab98c3c1007e96b4b3b533ac03a13eb5 | |
parent | Add support for filtering by LDAP values from file (diff) | |
download | vmchooser2-ca5c046a18f169f10a79cce5c2d0a70b6f08d9aa.tar.gz vmchooser2-ca5c046a18f169f10a79cce5c2d0a70b6f08d9aa.tar.xz vmchooser2-ca5c046a18f169f10a79cce5c2d0a70b6f08d9aa.zip |
Only apply LDAP filter logic if lecture has any filters...
-rw-r--r-- | src/vsession.cpp | 18 |
1 files changed, 9 insertions, 9 deletions
diff --git a/src/vsession.cpp b/src/vsession.cpp index 04d0ac2..fc58927 100644 --- a/src/vsession.cpp +++ b/src/vsession.cpp @@ -216,16 +216,16 @@ bool VSession::isActive() const { } // Filter by LDAP data if (!UserLdapData::isEmpty()) { - QDomNode keywordsNode = eintrag_.namedItem("filters"); - for (QDomElement el(keywordsNode.firstChildElement("filter")); - !el.isNull(); - el = el.nextSiblingElement("filter")) { - if (el.attribute("type") != "LDAP") - continue; - if (UserLdapData::isAllowed(el.firstChildElement("key").text(), el.firstChildElement("value").text())) - return true; + QDomElement el(eintrag_.namedItem("filters").firstChildElement("filter")); + if (!el.isNull()) { + for (; !el.isNull(); el = el.nextSiblingElement("filter")) { + if (el.attribute("type") != "LDAP") + continue; + if (UserLdapData::isAllowed(el.firstChildElement("key").text(), el.firstChildElement("value").text())) + return true; + } + return false; } - return false; } return true; |