Verified Commit aa6002ea authored by dockx thibault's avatar dockx thibault
Browse files

:sparkles: Feat(Tasks) - Dashboard v0.9

Includes tasks config backend.
Allows spam protection management.
Showing with 107 additions and 2 deletions
+107 -2
......@@ -374,6 +374,28 @@ attributetype ( 1.3.6.1.4.1.38414.89.1.16 NAME 'fdTasksGranularRef'
SYNTAX 1.3.6.1.4.1.1466.115.121.1.15
SINGLE-VALUE )
##### Tasks Conf #####
attributetype ( 1.3.6.1.4.1.38414.89.1.17 NAME 'fdTasksRDN'
DESC 'FusionDirectory - Tasks RDN'
EQUALITY caseExactIA5Match
SUBSTR caseExactIA5SubstringsMatch
SYNTAX 1.3.6.1.4.1.1466.115.121.1.26
SINGLE-VALUE)
attributetype ( 1.3.6.1.4.1.38414.89.1.18 NAME 'fdTasksConfLastExecTime'
DESC 'Store time of last mail tasks success - secure spam interval'
EQUALITY caseExactIA5Match
SYNTAX 1.3.6.1.4.1.1466.115.121.1.26 )
attributetype ( 1.3.6.1.4.1.38414.89.1.19 NAME 'fdTasksConfMaxEmails'
DESC 'FusionDirectory maximum emails to be processed by Orchestrator - secure spam'
SYNTAX 1.3.6.1.4.1.1466.115.121.1.27 )
attributetype ( 1.3.6.1.4.1.38414.89.1.20 NAME 'fdTasksConfIntervalEmails'
DESC 'FusionDirectory maximum emails to be processed by Orchestrator - secure spam'
SYNTAX 1.3.6.1.4.1.1466.115.121.1.27 )
##### Classes #####
objectclass ( 1.3.6.1.4.1.10098.1.2.1.19.4 NAME 'gosaDepartment' SUP top AUXILIARY
......@@ -473,3 +495,9 @@ objectclass (1.3.6.1.4.1.38414.89.2.3 NAME 'fdTasksGranular'
DESC 'FusionDirectory - Tasks granular objects'
MUST ( fdTasksGranularMaster $ cn $ fdTasksGranularMail $ fdTasksGranularMailFrom $
fdTasksGranularRef $ fdTasksGranularType $ fdTasksGranularSchedule $ fdTasksGranularStatus ))
objectclass (1.3.6.1.4.1.38414.89.2.4 NAME 'fdTasksConf'
DESC 'FusionDirectory - Tasks objects Configuration'
SUP top AUXILIARY
MUST ( cn )
MAY ( fdTasksRDN $ fdTasksConfLastExecTime $ fdTasksConfMaxEmails $ fdTasksConfIntervalEmails))
......@@ -85,7 +85,6 @@ class TasksColumn extends Column
$rmDn = preg_replace('/(?=,).*/', '', $value);
// only take the cn without dc
preg_match('/cn=(.*)/', $rmDn, $matches);
return $matches[1];
}
......
......@@ -37,7 +37,7 @@ class tasksDashboard extends management
['Column', ['attributes' => 'fdTasksGranularMail', 'label' => 'Email']],
['TasksColumn', ['attributes' => 'fdTasksGranularSchedule', 'label' => 'Schedule']],
['TasksColumn', ['attributes' => 'fdTasksGranularStatus', 'label' => 'Status']],
['ActionsColumn', ['label' => 'Actions']],
['ActionsColumn', ['label' => 'Actions']],
];
// No modification tools are required.
......
<?php
/*
This code is part of FusionDirectory (http://www.fusiondirectory.org/)
Copyright (C) 2012-2022 FusionDirectory
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA.
*/
class tasksConfig extends simplePlugin
{
static function plInfo (): array
{
return [
'plShortName' => _('Tasks'),
'plDescription' => _('FusionDirectory Tasks Configuration'),
'plObjectClass' => ['fdTasksConf'],
'plObjectType' => ['configuration'],
'plProvidedAcls' => parent::generatePlProvidedAcls(static::getAttributesInfo())
];
}
static function getAttributesInfo (): array
{
return [
'tasksConf' => [
'name' => _('Tasks Configuration'),
'attrs' => [
new StringAttribute(
_('Tasks RDN'), _('Branch in which Directory Base, Tasks will be stored'),
'fdTasksRDN', TRUE,
'ou=tasks'
),
]
],
'Mail' => [
'name' => _('Mail Anti-Spam Configuration'),
'attrs' => [
new DateTimeAttribute(
_('Schedule'), '',
'fdTasksConfLastExecTime', FALSE
),
new IntAttribute(
_('Maximum number of e-mails processed per time'), _('Select max e-mails to be proccesse'),
'fdTasksConfMaxEmails', FALSE, '', FALSE, ''
),
new IntAttribute(
_('Time interval between e-mails processing (Minutes) '), _('Select min interval time between emails processing'),
'fdTasksConfIntervalEmails', FALSE, '', FALSE, ''
),
]
],
];
}
function __construct ($dn = NULL, $object = NULL, $parent = NULL, $mainTab = FALSE)
{
global $config;
parent::__construct($dn, $object, $parent, $mainTab);
// This attribute will be updated and verified by Orchestrator
$this->attributesAccess['fdTasksConfLastExecTime']->setVisible(FALSE);
}
}
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