Commit 69b91bbd authored by Benoit Mortier's avatar Benoit Mortier
Browse files

🚑 fix(puppet) removing puppert plugin from 1.4-dev


Signed-off-by: default avatarBenoit Mortier <benoit.mortier@opensides.be>
parent f9b6ce5a
......@@ -172,11 +172,6 @@ file_filter = public-forms/locale/<lang>/fusiondirectory.po
source_file = public-forms/locale/en/fusiondirectory.po
source_lang = en
[FusionDirectory-14.puppet]
file_filter = puppet/locale/<lang>/fusiondirectory.po
source_file = puppet/locale/en/fusiondirectory.po
source_lang = en
[FusionDirectory-14.pureftpd]
file_filter = pureftpd/locale/<lang>/fusiondirectory.po
source_file = pureftpd/locale/en/fusiondirectory.po
......
<?php
/*
This code is part of FusionDirectory (http://www.fusiondirectory.org/)
Copyright (C) 2011-2016 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 puppetNode extends simplePlugin
{
var $displayHeader = TRUE;
static function plInfo (): array
{
return [
'plShortName' => _('Puppet'),
'plDescription' => _('Support for puppet schema in order to edit puppet classes and puppet vars'),
'plSmallIcon' => 'geticon.php?context=applications&icon=puppet&size=16',
'plObjectClass' => ['puppetClient'],
'plObjectType' => ['server', 'workstation'],
'plProvidedAcls' => parent::generatePlProvidedAcls(static::getAttributesInfo())
];
}
static function getAttributesInfo (): array
{
return [
// Attributes are grouped by section
'section1' => [
'name' => _("Puppet node settings"),
'attrs' => [
new SetAttribute(
new StringAttribute(_("Puppet class"), _("Puppet Node Class"), "puppetClass")
),
new SelectAttribute(_("Parent node"), _("Puppet Parent Node"), "parentNode", FALSE),
new SelectAttribute(_("Environment"), _("Puppet Node Environment"), "environment", TRUE),
new SetAttribute(
new CompositeAttribute(
_("A variable setting for puppet"),
'puppetVar',
[
new StringAttribute('', _('Name of the variable'), 'puppetVar'),
new StringAttribute('=', _('Value of the variable'), 'puppetVarValue'),
],
// sscanf format
'%[^ =]=%[^ ]',
// sprintf format
'%s=%s',
// acl, empty string means we don't care (handle it automagically)
'',
'Puppet Vars'
)
),
]
],
];
}
function __construct ($dn = NULL, $object = NULL, $parent = NULL, $mainTab = FALSE)
{
global $config;
parent::__construct($dn, $object, $parent, $mainTab);
$ldap = $config->get_ldap_link();
$ldap->cd($config->current['BASE']);
$ldap->search('(objectClass=puppetClient)', ['cn']);
$nodes = [];
while ($attrs = $ldap->fetch()) {
$nodes[] = $attrs['cn'][0];
}
$this->attributesAccess['parentNode']->setChoices($nodes);
$ldap->search('(objectClass=puppetServer)', ['puppetAvailableEnvironment']);
$envs = [];
if ($attrs = $ldap->fetch()) {
$envs = $attrs['puppetAvailableEnvironment'];
unset($envs['count']);
}
$this->attributesAccess['environment']->setChoices($envs);
}
public function getDisplayHeaderInfos (): array
{
list($disabled, $buttonText, $text) = parent::getDisplayHeaderInfos();
if (!$this->is_account && !$disabled && empty($this->attributesAccess['environment']->getChoices())) {
$disabled = TRUE;
$text = _('You need to add the puppet service to a server to be able to use this tab');
}
return [$disabled,$buttonText,$text];
}
}
<?php
/*
This code is part of FusionDirectory (http://www.fusiondirectory.org/)
Copyright (C) 2012-2016 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 servicePuppet extends simpleService
{
static function plInfo (): array
{
return [
'plShortName' => _('Puppet server'),
'plDescription' => _('This service allows you to use a puppet server'),
'plIcon' => 'geticon.php?context=applications&icon=puppet&size=16',
'plObjectClass' => ['puppetServer'],
'plProvidedAcls' => parent::generatePlProvidedAcls(static::getAttributesInfo())
];
}
// The main function : information about attributes
static function getAttributesInfo (): array
{
return [
// Attributes are grouped by section
'main' => [
'name' => _('Puppet server'),
'attrs' => [
new SetAttribute(
new StringAttribute(
_('Environments'),
_('Available environments for puppet nodes'),
'puppetAvailableEnvironment',
TRUE
),
['production']
),
]
],
];
}
}
##
## puppet-fd.schema - Needed by Fusion Directory for managing puppet server and nodes
##
attributetype ( 1.3.6.1.4.1.38414.7.1.1 NAME 'puppetAvailableEnvironment'
DESC 'Fusiondirectory - Puppet environments that should be proposed on nodes'
EQUALITY caseIgnoreIA5Match
SYNTAX 1.3.6.1.4.1.1466.115.121.1.26 )
# Puppet Server
objectclass ( 1.3.6.1.4.1.38414.7.2.1 NAME 'puppetServer' SUP top AUXILIARY
DESC 'Fusiondirectory - Puppet server'
MUST ( puppetAvailableEnvironment ) )
attributetype ( 1.3.6.1.4.1.34380.1.1.3.10 NAME 'puppetClass'
DESC 'Puppet Node Class'
EQUALITY caseIgnoreIA5Match
SYNTAX 1.3.6.1.4.1.1466.115.121.1.26 )
attributetype ( 1.3.6.1.4.1.34380.1.1.3.9 NAME 'parentNode'
DESC 'Puppet Parent Node'
EQUALITY caseIgnoreIA5Match
SYNTAX 1.3.6.1.4.1.1466.115.121.1.26
SINGLE-VALUE )
attributetype ( 1.3.6.1.4.1.34380.1.1.3.11 NAME 'environment'
DESC 'Puppet Node Environment'
EQUALITY caseIgnoreIA5Match
SYNTAX 1.3.6.1.4.1.1466.115.121.1.26 )
attributetype ( 1.3.6.1.4.1.34380.1.1.3.12 NAME 'puppetVar'
DESC 'A variable setting for puppet'
EQUALITY caseIgnoreIA5Match
SYNTAX 1.3.6.1.4.1.1466.115.121.1.26 )
objectclass ( 1.3.6.1.4.1.34380.1.1.1.2 NAME 'puppetClient' SUP top AUXILIARY
DESC 'Puppet Client objectclass'
MAY ( puppetclass $ parentnode $ environment $ puppetvar ))
<?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="svg3049"
version="1.1"
inkscape:version="0.91 r13725"
sodipodi:docname="puppet.svg"
inkscape:export-filename="puppet.png"
inkscape:export-xdpi="90"
inkscape:export-ydpi="90">
<defs
id="defs3051">
<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>
<clipPath
id="clipPath4160"
clipPathUnits="userSpaceOnUse">
<rect
y="1023.3622"
x="7"
height="1"
width="1"
id="rect4162"
style="opacity:1;fill:currentColor;fill-opacity:1;stroke:none;stroke-opacity:1"
class="ColorScheme-Text" />
</clipPath>
<style
id="current-color-scheme-7"
type="text/css">
.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>
<style
type="text/css"
id="current-color-scheme-3">
.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="48.822612"
inkscape:cx="6.0449283"
inkscape:cy="8.1917522"
inkscape:document-units="px"
inkscape:current-layer="layer1-9"
showgrid="true"
fit-margin-top="0"
fit-margin-left="0"
fit-margin-right="0"
fit-margin-bottom="0"
inkscape:window-width="1578"
inkscape:window-height="963"
inkscape:window-x="292"
inkscape:window-y="0"
inkscape:window-maximized="0"
inkscape:showpageshadow="false"
borderlayer="true"
inkscape:snap-bbox="true"
inkscape:snap-global="true"
inkscape:object-nodes="true">
<inkscape:grid
type="xygrid"
id="grid4085" />
<sodipodi:guide
position="2.0000044,14.00003"
orientation="12,0"
id="guide4075" />
<sodipodi:guide
position="2.0000044,2.0000296"
orientation="0,12"
id="guide4077" />
<sodipodi:guide
position="14.000004,2.0000296"
orientation="-12,0"
id="guide4079" />
<sodipodi:guide
position="14.000004,14.00003"
orientation="0,-12"
id="guide4081" />
</sodipodi:namedview>
<metadata
id="metadata3054">
<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(-421.71429,-531.79074)">
<g
style="display:inline"
transform="matrix(0.30000013,0,0,0.30000013,307.14281,382.65128)"
id="layer1-75"
inkscape:label="Capa 1">
<g
inkscape:label="Capa 1"
id="layer1-7"
transform="matrix(1.4285708,0,0,1.4285708,-163.67324,-235.91308)">
<g
inkscape:label="Capa 1"
id="layer1-9"
transform="translate(-2.5589574e-6,2.2518306e-5)">
<path
inkscape:connector-curvature="0"
id="rect4193"
d="m 386.57144,517.79796 0,9.33332 9.33332,0 0,-9.33332 z m 2.33334,2.33332 4.66666,0 0,4.66667 -4.66666,0 z"
style="color:#000000;clip-rule:nonzero;display:inline;overflow:visible;visibility:visible;opacity:1;isolation:auto;mix-blend-mode:normal;color-interpolation:sRGB;color-interpolation-filters:linearRGB;solid-color:#000000;solid-opacity:1;fill:#ffae1a;fill-opacity:1;fill-rule:evenodd;stroke:none;stroke-width:1;stroke-linecap:butt;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1;marker:none;color-rendering:auto;image-rendering:auto;shape-rendering:auto;text-rendering:auto;enable-background:accumulate"
sodipodi:nodetypes="cccccccccc" />
<path
inkscape:connector-curvature="0"
id="rect4193-3"
d="m 386.57144,536.46462 0,9.33334 9.33334,0 0,-9.33334 z m 2.33334,2.33333 4.66666,0 0,4.66667 -4.66666,0 z"
style="color:#000000;clip-rule:nonzero;display:inline;overflow:visible;visibility:visible;opacity:1;isolation:auto;mix-blend-mode:normal;color-interpolation:sRGB;color-interpolation-filters:linearRGB;solid-color:#000000;solid-opacity:1;fill:#ffae1a;fill-opacity:1;fill-rule:evenodd;stroke:none;stroke-width:1;stroke-linecap:butt;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1;marker:none;color-rendering:auto;image-rendering:auto;shape-rendering:auto;text-rendering:auto;enable-background:accumulate"
sodipodi:nodetypes="cccccccccc" />
<path
sodipodi:nodetypes="ccccc"
inkscape:connector-curvature="0"
id="rect4193-6"
d="m 395.90476,527.13128 0,9.33336 9.33336,0 0,-9.33336 z"
style="color:#000000;clip-rule:nonzero;display:inline;overflow:visible;visibility:visible;opacity:1;isolation:auto;mix-blend-mode:normal;color-interpolation:sRGB;color-interpolation-filters:linearRGB;solid-color:#000000;solid-opacity:1;fill:#ffae1a;fill-opacity:1;fill-rule:evenodd;stroke:none;stroke-width:1;stroke-linecap:butt;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1;marker:none;color-rendering:auto;image-rendering:auto;shape-rendering:auto;text-rendering:auto;enable-background:accumulate" />
<path
style="fill:#ffae1a;fill-opacity:1;fill-rule:evenodd;stroke:none;stroke-width:2.33333325px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1"
d="m 393.57145,536.46462 2.33333,2.33333 2.33333,-2.33333 -2.33333,-2.33334 -2.33333,2.33334"
id="path4192"
inkscape:connector-curvature="0" />
<path
style="display:inline;fill:#ffae1a;fill-opacity:1;fill-rule:evenodd;stroke:none;stroke-width:2.33333325px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1"
d="m 393.57145,527.13128 2.33333,2.33333 2.33333,-2.33333 -2.33333,-2.33333 -2.33333,2.33333"
id="path4192-3"
inkscape:connector-curvature="0" />
</g>
</g>
</g>
</g>
</svg>
<?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="48"
height="48"
id="svg5453"
version="1.1"
inkscape:version="0.91 r13725"
sodipodi:docname="puppet.svg"
inkscape:export-filename="puppet.png"
inkscape:export-xdpi="90"
inkscape:export-ydpi="90">
<defs
id="defs5455">
<style
id="current-color-scheme"
type="text/css">
.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"
inkscape:pageshadow="2"
inkscape:zoom="7.9999996"
inkscape:cx="28.011229"
inkscape:cy="29.072572"
inkscape:document-units="px"
inkscape:current-layer="layer1-9"
showgrid="true"
fit-margin-top="0"
fit-margin-left="0"
fit-margin-right="0"
fit-margin-bottom="0"
inkscape:window-width="1880"
inkscape:window-height="1051"
inkscape:window-x="0"
inkscape:window-y="0"
inkscape:window-maximized="1"
inkscape:showpageshadow="false"
borderlayer="true"
showguides="true"
inkscape:object-nodes="true"
inkscape:snap-global="true">
<inkscape:grid
type="xygrid"
id="grid4063" />
<sodipodi:guide
position="1.1650391e-05,47.999996"
orientation="4,0"
id="guide4146" />
<sodipodi:guide
position="1.1650391e-05,43.999996"
orientation="0,48"
id="guide4148" />
<sodipodi:guide
position="48.000012,43.999996"
orientation="-4,0"
id="guide4150" />
<sodipodi:guide
position="48.000012,47.999996"
orientation="0,-48"
id="guide4152" />
<sodipodi:guide
position="1.1650391e-05,4.0000264"
orientation="4,0"
id="guide4154" />
<sodipodi:guide
position="1.1650391e-05,2.6367188e-05"
orientation="0,48"
id="guide4156" />
<sodipodi:guide
position="48.000012,2.6367188e-05"
orientation="-4,0"
id="guide4158" />
<sodipodi:guide
position="48.000012,4.0000264"
orientation="0,-48"
id="guide4160" />
<sodipodi:guide
position="48.000012,48.000026"
orientation="0,-4"
id="guide4162" />
<sodipodi:guide
position="44.000012,48.000026"
orientation="48,0"
id="guide4164" />
<sodipodi:guide
position="44.000012,2.6367188e-05"
orientation="0,4"
id="guide4166" />
<sodipodi:guide
position="48.000012,2.6367188e-05"
orientation="-48,0"
id="guide4168" />
<sodipodi:guide
position="4.0000422,48.000026"
orientation="0,-4"