Commit 154fe430 authored by Dainis Abols's avatar Dainis Abols
Browse files

Added Added Exclude list for search options

parent 0ad046b2
......@@ -57,6 +57,9 @@ class loadActivePages
// Open connection
$this->mysqli = new mysqli($config['DB']['Connections']['Default']['host'], $config['DB']['Connections']['Default']['user'], $config['DB']['Connections']['Default']['password'], $config['DB']['Connections']['Default']['dbname']);
// Load excluded list
$this->excludedUids = explode(",", $config['EXTENSIONS']['lu_api']['solrDatabase']['searchExcludedUIds']);
}
/**
......@@ -71,8 +74,12 @@ class loadActivePages
if ($result = $this->executeQuery($query)) {
while ($row = $result->fetch_object()) {
if ($this->findValidTree($row->pid)) {
$this->validUids[] = $row->uid ;
// Deny, if in exluded list
if (!in_array($row->uid, $this->excludedUids)) {
// Check if valid parent
if ($this->findValidTree($row->pid)) {
$this->validUids[] = $row->uid;
}
}
}
}
......@@ -83,8 +90,12 @@ class loadActivePages
*/
public function findValidTree($pid)
{
// Deny, if in exluded list
if (in_array($pid, $this->excludedUids)) {
return false;
}
// Check if valid parent
$query = "SELECT pid FROM pages WHERE uid = {$pid} AND (`starttime` = 0 OR UNIX_TIMESTAMP() >= `starttime`) AND (`endtime` = 0 OR `endtime` >= UNIX_TIMESTAMP()) AND `hidden` = 0 AND `deleted` = 0";
if ($result = $this->executeQuery($query)) {
while ($row = $result->fetch_object()) {
if ($row->pid == 0 || $this->findValidTree($row->pid)) {
......
{
"name": "luitd/lu-api",
"version": "2.6.3",
"version": "2.6.4",
"description": "REST API Integration for TYPO3",
"type": "typo3-cms-extension",
"keywords": [
......
......@@ -19,6 +19,9 @@ endPoints.ContractsList = http://luis.lu.lv/luis/LU_uznl.html
# cat=SOLR/set; type=string; label=LU Search DB
solrDatabase.search = lusearch
# cat=SOLR/set; type=string; label=Exclude UIDs from search
solrDatabase.searchExcludedUIds =
# cat=SOLR/set; type=string; label=Programme catalogue DB
solrDatabase.programmeCatalogue = kursu_katal_program_dati
......
......@@ -14,7 +14,7 @@ $EM_CONF[$_EXTKEY] = [
'title' => 'LU API',
'description' => 'REST API Integration for TYPO3',
'category' => 'plugin',
'version' => '2.6.3',
'version' => '2.6.4',
'dependencies' => 'typo3',
'state' => 'stable',
'clearCacheOnLoad' => true,
......
......@@ -4,7 +4,7 @@
## Version
2.6.3
2.6.4
## Dependencies
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment