db = $db; } function validateUserPass($username, $password) { $count = (int)$this->db->fetchValue( 'SELECT COUNT(*) FROM konfiguration as k WHERE (k.name="caldav_username" AND k.wert=:user) OR (k.name="caldav_password" AND k.wert=:pass);', [ 'user' => $username, 'pass' => $password, ]); return $count === 2; } }