From 21053126af053bce2a1d3726f697e432c4f714bf Mon Sep 17 00:00:00 2001 From: Simon Rettberg Date: Mon, 24 Jun 2019 16:18:50 +0200 Subject: Remove client-side date range checking --- src/vsession.cpp | 31 ------------------------------- 1 file changed, 31 deletions(-) diff --git a/src/vsession.cpp b/src/vsession.cpp index d5cc966..b5e4e49 100644 --- a/src/vsession.cpp +++ b/src/vsession.cpp @@ -208,37 +208,6 @@ bool VSession::isActive() const { if (g_debugMode) qDebug() << "'" << shortDescription() << "' not active. Reason: active == false"; return false; } - // Check for date range - if (value.count("/") == 1) { - // try to interpret value as date range - // [YYYY-MM-DD]/[YYYY-MM-DD] - // eg. "1970-01-01/1971-01-01" from Jan 1st 1970 till Jan 1st 1971 - // "/1971-01-01" till Jan 1st 1971 - // "1970-01-01/" from Jan 1st 1970 - // "/" allways - // note: invalid dates are treated as empty dates - - QStringList list(value.split("/")); - QString from(list.value(0)); - QString till(list.value(1)); - QDate fromDate(QDate::fromString(from, Qt::ISODate)); - QDate tillDate(QDate::fromString(till, Qt::ISODate)); - - QDate today(QDate::currentDate()); - - if (fromDate.isValid() && fromDate > today) { - // fromDate is in the future - if (g_debugMode) qDebug() << "'" << shortDescription() << "' not active. Reason: fromDate is in the future"; - return false; - } - - if (tillDate.isValid() && tillDate < today) { - // tillDate is in the past - if (g_debugMode) qDebug() << "'" << shortDescription() << "' not active. Reason: tillDate is in the past"; - return false; - } - } - // Filter by LDAP data if (!UserLdapData::isEmpty()) { QDomElement el(eintrag_.namedItem("filters").firstChildElement("filter")); -- cgit v1.2.3-55-g7522