Verified Commit 0def510a authored by dockx thibault's avatar dockx thibault
Browse files

:sparkles: Feat(PluginsManager) - Adds to core.

Adds to core plugins manager developped by Gallak.
Comments and schema numbering added.
Showing with 261 additions and 0 deletions
+261 -0
# pluginsmanager-fd.schema
# Needed by Fusion Directory for managing plugins
# Attributes
attributetype ( 1.3.6.1.4.1.38414.96.1.1 NAME 'fdPluginInfoAuthors'
DESC 'FusionDirectory - Plugin authors attribute'
EQUALITY caseIgnoreIA5Match
SUBSTR caseIgnoreSubstringsMatch
SYNTAX 1.3.6.1.4.1.1466.115.121.1.26 )
# Attributes
attributetype ( 1.3.6.1.4.1.38414.96.1.2 NAME 'fdPluginInfoVersion'
DESC 'FusionDirectory - Plugin Version attribute'
EQUALITY caseIgnoreIA5Match
SUBSTR caseIgnoreSubstringsMatch
SYNTAX 1.3.6.1.4.1.1466.115.121.1.26 )
# Attributes
attributetype ( 1.3.6.1.4.1.38414.96.1.3 NAME 'fdPluginSupportHomeUrl'
DESC 'FusionDirectory - Plugin Support page url attribute'
EQUALITY caseIgnoreIA5Match
SUBSTR caseIgnoreSubstringsMatch
SYNTAX 1.3.6.1.4.1.1466.115.121.1.26 )
# Attributes
attributetype ( 1.3.6.1.4.1.38414.96.1.4 NAME 'fdPluginSupportTicketUrl'
DESC 'FusionDirectory - Plugin Suuport ticket url attribute'
EQUALITY caseIgnoreIA5Match
SUBSTR caseIgnoreSubstringsMatch
SYNTAX 1.3.6.1.4.1.1466.115.121.1.26 )
# Attributes
attributetype ( 1.3.6.1.4.1.38414.96.1.5 NAME 'fdPluginSupportDiscussionUrl'
DESC 'FusionDirectory - Pluging discussion url attribute'
EQUALITY caseIgnoreIA5Match
SUBSTR caseIgnoreSubstringsMatch
SYNTAX 1.3.6.1.4.1.1466.115.121.1.26 )
# Attributes
attributetype ( 1.3.6.1.4.1.38414.96.1.6 NAME 'fdPluginSupportSchemaUrl'
DESC 'FusionDirectory - Plugin schema url attribute needed if necessary'
EQUALITY caseIgnoreIA5Match
SUBSTR caseIgnoreSubstringsMatch
SYNTAX 1.3.6.1.4.1.1466.115.121.1.26 )
# Attributes
attributetype ( 1.3.6.1.4.1.38414.96.1.7 NAME 'fdPluginReqFdVersion'
DESC 'FusionDirectory - Plugin Fusiondirectory Version requirement attribute'
EQUALITY caseIgnoreIA5Match
SUBSTR caseIgnoreSubstringsMatch
SYNTAX 1.3.6.1.4.1.1466.115.121.1.26 )
# Attributes
attributetype ( 1.3.6.1.4.1.38414.96.1.8 NAME 'fdPluginReqPhpVersion'
DESC 'FusionDirectory - Plugin PHP Version requirement attribute'
EQUALITY caseIgnoreIA5Match
SUBSTR caseIgnoreSubstringsMatch
SYNTAX 1.3.6.1.4.1.1466.115.121.1.26 )
# Attributes
attributetype ( 1.3.6.1.4.1.38414.96.1.9 NAME 'fdPluginReqPlugin'
DESC 'FusionDirectory - Plugin Home Plugin list dependancy Attribute'
EQUALITY caseIgnoreIA5Match
SUBSTR caseIgnoreSubstringsMatch
SYNTAX 1.3.6.1.4.1.1466.115.121.1.26 )
# Attributes
attributetype ( 1.3.6.1.4.1.38414.96.1.10 NAME 'fdPluginContentPhpClass'
DESC 'FusionDirectory - Plugin Manager : list on php class provided'
EQUALITY caseIgnoreIA5Match
SUBSTR caseIgnoreSubstringsMatch
SYNTAX 1.3.6.1.4.1.1466.115.121.1.26 )
# Attributes
attributetype ( 1.3.6.1.4.1.38414.96.1.11 NAME 'fdPluginContentLdapObject'
DESC 'FusionDirectory - Plugin Manager : list on Ldap Object needed'
EQUALITY caseIgnoreIA5Match
SUBSTR caseIgnoreSubstringsMatch
SYNTAX 1.3.6.1.4.1.1466.115.121.1.26 )
# Attributes
attributetype ( 1.3.6.1.4.1.38414.96.1.12 NAME 'fdPluginContentLdapAttributes'
DESC 'FusionDirectory - Plugin Manager : list on Ldap attributes needed'
EQUALITY caseIgnoreIA5Match
SUBSTR caseIgnoreSubstringsMatch
SYNTAX 1.3.6.1.4.1.1466.115.121.1.26 )
# Attributes
attributetype ( 1.3.6.1.4.1.38414.96.1.13 NAME 'fdPluginContentFileList'
DESC 'FusionDirectory - Plugin Manager : list of file provided'
EQUALITY caseIgnoreIA5Match
SUBSTR caseIgnoreSubstringsMatch
SYNTAX 1.3.6.1.4.1.1466.115.121.1.26 )
# Attributes
attributetype ( 1.3.6.1.4.1.38414.96.1.14 NAME 'fdPluginInfoStatus'
DESC 'FusionDirectory - Plugin Manager : status of plugin : Dev / stable / dontuse '
EQUALITY caseIgnoreIA5Match
SUBSTR caseIgnoreSubstringsMatch
SYNTAX 1.3.6.1.4.1.1466.115.121.1.26 )
# Attributes
attributetype ( 1.3.6.1.4.1.38414.96.1.15 NAME 'fdPluginSupportDownloadUrl'
DESC 'FusionDirectory - Plugin direct download url '
EQUALITY caseIgnoreIA5Match
SUBSTR caseIgnoreSubstringsMatch
SYNTAX 1.3.6.1.4.1.1466.115.121.1.26 )
# Attributes
attributetype ( 1.3.6.1.4.1.38414.96.1.16 NAME 'fdPluginInfoTags'
DESC 'FusionDirectory - Plugin Tag for identiy plugins goals'
EQUALITY caseIgnoreIA5Match
SUBSTR caseIgnoreSubstringsMatch
SYNTAX 1.3.6.1.4.1.1466.115.121.1.26 )
# Attributes
attributetype ( 1.3.6.1.4.1.38414.96.1.17 NAME 'fdPluginInfoLogoUrl'
DESC 'FusionDirectory - Plugin Logo url '
EQUALITY caseIgnoreIA5Match
SUBSTR caseIgnoreSubstringsMatch
SYNTAX 1.3.6.1.4.1.1466.115.121.1.26 )
# Attributes
attributetype ( 1.3.6.1.4.1.38414.96.1.18 NAME 'fdPluginInfoScreenshotUrl'
DESC 'FusionDirectory - Plugin Screenshot Url '
EQUALITY caseIgnoreIA5Match
SUBSTR caseIgnoreSubstringsMatch
SYNTAX 1.3.6.1.4.1.1466.115.121.1.26 )
# Attributes
attributetype ( 1.3.6.1.4.1.38414.96.1.19 NAME 'fdPluginInfoLicence'
DESC 'FusionDirectory - Plugin Licence'
EQUALITY caseIgnoreIA5Match
SUBSTR caseIgnoreSubstringsMatch
SYNTAX 1.3.6.1.4.1.1466.115.121.1.26 )
# Attributes
attributetype ( 1.3.6.1.4.1.38414.96.1.20 NAME 'fdPluginInfoOrigin'
DESC 'FusionDirectory - Plugin Origin'
EQUALITY caseIgnoreIA5Match
SUBSTR caseIgnoreSubstringsMatch
SYNTAX 1.3.6.1.4.1.1466.115.121.1.26 )
# Attributes
attributetype ( 1.3.6.1.4.1.38414.96.1.21 NAME 'fdPluginSupportProvider'
DESC 'FusionDirectory - Plugin Support Provider'
EQUALITY caseIgnoreIA5Match
SUBSTR caseIgnoreSubstringsMatch
SYNTAX 1.3.6.1.4.1.1466.115.121.1.26 )
# Attributes
attributetype ( 1.3.6.1.4.1.38414.96.1.22 NAME 'fdPluginSupportContractUrl'
DESC 'FusionDirectory - Plugin Support Contract url'
EQUALITY caseIgnoreIA5Match
SUBSTR caseIgnoreSubstringsMatch
SYNTAX 1.3.6.1.4.1.1466.115.121.1.26 )
# Object Class
objectclass (1.3.6.1.4.1.38414.96.2.1 NAME 'fdPlugin'
DESC 'FusionDirectory - Plugins Manager ObjectClass'
MUST ( cn $ description $ fdPluginInfoAuthors $ fdPluginInfoVersion $ fdPluginInfoStatus $ fdPluginInfoLicence $ fdPluginInfoOrigin $ fdPluginSupportDownloadUrl $ fdPluginSupportHomeUrl $ fdPluginReqFdVersion $ fdPluginReqPhpVersion $ fdPluginSupportProvider )
MAY ( fdPluginInfoScreenshotUrl $ fdPluginInfoLogoUrl $ fdPluginInfoTags $ fdPluginSupportTicketUrl $ fdPluginSupportDiscussionUrl $ fdPluginSupportSchemaUrl $ fdPluginReqPlugin $ fdPluginContentPhpClass $ fdPluginContentLdapObject $ fdPluginContentLdapAttributes $ fdPluginContentFileList $ fdPluginSupportContractUrl ))
<?php
/*
This code is part of FusionDirectory (http://www.fusiondirectory.org)
Copyright (C) 2021 Antoine Gallavardin
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 pluginsManager extends simplePlugin
{
static function plInfo (): array
{
return [
'plShortName' => _('Plugins'),
'plDescription' => _('Plugins List'),
'plObjectType' => ['dashboard'],
'plProvidedAcls' => []
];
}
static function getAttributesInfo (): array
{
return [
'plugins' => [
//'class' => ['fullwidth'],
'name' => _('Plugins'),
'attrs' => [new FakeAttribute('pluginsList')],
'template' => get_template_path('plugins_list.tpl', TRUE, dirname(__FILE__)),
],
];
}
function __construct ($dn = NULL, $object = NULL, $parent = NULL, $mainTab = FALSE)
{
parent::__construct($dn, $object, $parent, $mainTab);
// pluginsList refers to the FakeAttribute.
// The return of drawList in plugisns_list requires an attribute definition.
$this->pluginsList = $this->plugins_list();
}
function plugins_list ()
{
global $config;
$ldap = $config->get_ldap_link();
$ldap->cd($config->current['BASE']);
$ldap->search('(objectClass=fdPlugin)', ['cn','description','fdPluginInfoVersion','fdPluginInfoAuthors','fdPluginInfoStatus','fdPluginInfoOrigin','fdPluginSupportProvider','fdPluginSupportHomeUrl','fdPluginReqPlugin']);
$id = 'pluginsStats';
$div = new divSelectBox('rows'.$id);
$smarty = get_smarty();
$div->setHeight(300);
$div->setHeaders([_('Nom'), _('Description'), _('Version'),_('Authors'),_('Status'),_('Origin'),_('Provider'),_('Dependencies'),_('Link')]);
while ($plugin = $ldap->fetch()) {
$fields = [
['string' => $plugin['cn'][0]],
['string' => $plugin['description'][0]],
['string' => $plugin['fdPluginInfoVersion'][0]],
['string' => $plugin['fdPluginInfoAuthors'][0]],
['string' => $plugin['fdPluginInfoStatus'][0]],
['string' => $plugin['fdPluginInfoOrigin'][0]],
['string' => $plugin['fdPluginSupportProvider'][0]],
['string' => $plugin['fdPluginReqPlugin'][0]],
['string' => $plugin['fdPluginSupportHomeUrl'][0]],
];
$div->addEntry($fields);
}
return $div->drawList();
}
}
<div id="{$sectionId}" class="plugin-section fullwidth"">
<span class="legend">
{if $sectionIcon}<img src="{$sectionIcon|escape}" alt=""/>{/if}{$section|escape}
</span>
<div>
{$attributes.pluginsList}
</div>
</div>
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