Commit d4a10f5e authored by Côme Chilliet's avatar Côme Chilliet

feat(autofs5) Add specific plugin for autofs5

issue #2912
parent f447ebc7
<?php
/*
This code is part of FusionDirectory (http://www.fusiondirectory.org/)
Copyright (C) 2013-2020 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 autofs5Management extends management
{
static function plInfo (): array
{
return [
'plShortName' => _('Auto fs'),
'plTitle' => _('Auto fs management'),
'plDescription' => _('Manage auto fs maps'),
'plIcon' => 'geticon.php?context=applications&icon=autofs&size=48',
'plSection' => 'systems',
'plPriority' => 5,
'plManages' => ['automountMap'],
];
}
}
<?php
/*
This code is part of FusionDirectory (http://www.fusiondirectory.org/)
Copyright (C) 2013-2020 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 automountMap extends simplePlugin
{
static function plInfo (): array
{
return [
'plShortName' => _('Autofs map'),
'plDescription' => _('Autofs map'),
'plObjectClass' => ['automountMap'],
'plObjectType' => ['automountMap' => [
'name' => _('Autofs map'),
'ou' => get_ou('autofs5RDN'),
'icon' => 'geticon.php?context=applications&icon=autofs-map&size=16',
'mainAttr' => 'ou',
]],
'plSearchAttrs' => ['ou'],
'plProvidedAcls' => parent::generatePlProvidedAcls(static::getAttributesInfo())
];
}
static function getAttributesInfo (): array
{
return [
'main' => [
'name' => _('Map'),
'attrs' => [
new BaseSelectorAttribute(get_ou('autofs5RDN')),
new HostNameAttribute(
_('Name'), _('Name of the map'),
'ou', TRUE
),
],
],
'entries' => [
'name' => _('Entries'),
'attrs' => [
new SubNodesAttribute(
_('Entries'), _('Entries in the automount table'),
'automountEntries', 'automount',
[
new StringAttribute(
_('Path'), _('Absolute (direct) or relative (indirect) path for this entry'),
'cn', TRUE,
'', '',
'/^[a-z0-9\.\-\/]*$/i'
),
new TextAreaAttribute(
_('Options'), _("The entry of this directory for the automount daemon.\n For instance 'auto.u' or '-fstype=nfs domaine.tld:/mount/directory'"),
'automountInformation', TRUE
),
new StringAttribute(
_('Description'), _('Description of this entry'),
'description', FALSE
),
]
),
]
]
];
}
}
<?php
/*
This code is part of FusionDirectory (http://www.fusiondirectory.org/)
Copyright (C) 2012-2020 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 autofs5Config extends simplePlugin
{
static function plInfo (): array
{
return [
'plShortName' => _('Autofs configuration'),
'plDescription' => _('FusionDirectory autofs plugin configuration'),
'plObjectClass' => ['fdAutofs5PluginConf'],
'plCategory' => ['configuration'],
'plObjectType' => ['smallConfig'],
'plProvidedAcls' => parent::generatePlProvidedAcls(static::getAttributesInfo())
];
}
static function getAttributesInfo (): array
{
return [
'main' => [
'name' => _('AutoFS'),
'attrs' => [
new StringAttribute(
_('AutoFS RDN'), _('Branch in which automount info will be stored'),
'fdAutofs5RDN', TRUE,
'ou=autofs'
),
]
],
];
}
}
##
## autofs5-fd.schema - Needed by Fusion Directory for managing automount
##
# Attributes
attributetype ( 1.3.6.1.4.1.38414.77.1.1 NAME 'fdAutofs5RDN'
DESC 'FusionDirectory - autofs5 RDN'
EQUALITY caseExactIA5Match
SUBSTR caseExactIA5SubstringsMatch
SYNTAX 1.3.6.1.4.1.1466.115.121.1.26
SINGLE-VALUE)
# Object Class
objectclass ( 1.3.6.1.4.1.38414.77.2.1 NAME 'fdAutofs5PluginConf'
DESC 'FusionDirectory autofs5 plugin configuration'
SUP top AUXILIARY
MUST ( cn )
MAY ( fdAutofs5RDN ) )
This diff is collapsed.
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<!-- Created with Inkscape (http://www.inkscape.org/) -->
<svg
xmlns:dc="http://purl.org/dc/elements/1.1/"
xmlns:cc="http://creativecommons.org/ns#"
xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
xmlns:svg="http://www.w3.org/2000/svg"
xmlns="http://www.w3.org/2000/svg"
xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd"
xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape"
width="16"
height="16"
id="svg2"
version="1.1"
inkscape:version="0.91 r13725"
viewBox="0 0 16 16"
sodipodi:docname="autofs.svg"
inkscape:export-filename="autofs.png"
inkscape:export-xdpi="90"
inkscape:export-ydpi="90">
<defs
id="defs4">
<style
type="text/css"
id="current-color-scheme">
.ColorScheme-Text {
color:#4d4d4d;
}
.ColorScheme-Background {
color:#eff0f1;
}
.ColorScheme-Highlight {
color:#3daee9;
}
.ColorScheme-ViewText {
color:#31363b;
}
.ColorScheme-ViewBackground {
color:#fcfcfc;
}
.ColorScheme-ViewHover {
color:#93cee9;
}
.ColorScheme-ViewFocus{
color:#3daee9;
}
.ColorScheme-ButtonText {
color:#31363b;
}
.ColorScheme-ButtonBackground {
color:#eff0f1;
}
.ColorScheme-ButtonHover {
color:#93cee9;
}
.ColorScheme-ButtonFocus{
color:#3daee9;
}
</style>
</defs>
<sodipodi:namedview
id="base"
pagecolor="#ffffff"
bordercolor="#666666"
borderopacity="1.0"
inkscape:pageopacity="0.0"
inkscape:pageshadow="2"
inkscape:zoom="44.8"
inkscape:cx="4.909555"
inkscape:cy="8.369756"
inkscape:document-units="px"
inkscape:current-layer="layer1"
showgrid="true"
inkscape:showpageshadow="false"
borderlayer="true"
units="px"
inkscape:window-width="1880"
inkscape:window-height="1051"
inkscape:window-x="0"
inkscape:window-y="0"
inkscape:window-maximized="1">
<inkscape:grid
type="xygrid"
id="grid4062" />
<sodipodi:guide
position="2,14.000017"
orientation="12,0"
id="guide4066" />
<sodipodi:guide
position="2,2.0000174"
orientation="0,12"
id="guide4068" />
<sodipodi:guide
position="14,2.0000174"
orientation="-12,0"
id="guide4070" />
<sodipodi:guide
position="14,14.000017"
orientation="0,-12"
id="guide4072" />
</sodipodi:namedview>
<metadata
id="metadata7">
<rdf:RDF>
<cc:Work
rdf:about="">
<dc:format>image/svg+xml</dc:format>
<dc:type
rdf:resource="http://purl.org/dc/dcmitype/StillImage" />
<dc:title></dc:title>
</cc:Work>
</rdf:RDF>
</metadata>
<g
inkscape:label="Capa 1"
inkscape:groupmode="layer"
id="layer1"
transform="translate(0,-1036.3622)">
<path
style="opacity:1;fill:currentColor;fill-opacity:1;stroke:none"
d="M 2 2 L 2 14 L 3 14 L 13 14 L 14 14 L 14 2 L 2 2 z M 3 3 L 13 3 L 13 10 L 13 11 L 8 11 L 8 12 L 6 12 L 6 11 L 3 11 L 3 10 L 3 3 z M 4 4 L 4 10 L 12 10 L 12 4 L 4 4 z M 5 5 L 6 5 L 6 7 L 10 7 L 10 5 L 11 5 L 11 9 L 5 9 L 5 5 z M 3 12 L 5 12 L 5 13 L 3 13 L 3 12 z M 9 12 L 12 12 L 12 13 L 9 13 L 9 12 z "
transform="translate(0,1036.3622)"
id="rect4142"
class="ColorScheme-Text" />
</g>
</svg>
This diff is collapsed.
Markdown is supported
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