summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSimon Rettberg2018-06-18 12:02:54 +0200
committerSimon Rettberg2018-06-18 12:02:54 +0200
commitca5c046a18f169f10a79cce5c2d0a70b6f08d9aa (patch)
tree996dba53ab98c3c1007e96b4b3b533ac03a13eb5
parentAdd support for filtering by LDAP values from file (diff)
downloadvmchooser2-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.cpp18
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;