Commit e84a651f authored by Côme Bernigaud's avatar Côme Bernigaud Committed by Benoit Mortier
Browse files

Fixes #3450 Added EJBCA plugin

parent 75b4084f
<?php
/*
* This code is part of FusionDirectory (http://www.fusiondirectory.org)
* Copyright (C) 2014 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 ejbcaCertificate extends simplePlugin
{
var $mainTab = TRUE;
var $objectclasses = array();
public static function plInfo()
{
return array(
'plShortName' => _('EJBCA certificate'),
'plDescription' => _('EJBCA certificate'),
'plObjectType' => array('ejbcaCertificate' => array(
'name' => _('EJBCA certificate'),
'filter' => 'userCertificate;binary=*',
'ou' => get_ou('ejbcaRDN'),
'icon' => 'geticon.php?context=applications&icon=ejbca&size=16'
)),
'plProvidedAcls' => parent::generatePlProvidedAcls(self::getAttributesInfo())
);
}
static function getAttributesInfo ()
{
return array(
'main' => array(
'name' => _('Certificate'),
'attrs' => array(
new BaseSelectorAttribute (get_ou('ejbcaRDN')),
new HostNameAttribute (
_('Name'), _('Common name'),
'cn', TRUE
),
new FileDownloadAttribute (
_('Certificate'), _('Certificate content'),
'userCertificate;binary', TRUE,
'.der'
),
)
),
);
}
function __construct (&$config, $dn = NULL, $object = NULL)
{
parent::__construct($config, $dn, $object);
}
function renderAttributes($readOnly = FALSE)
{
parent::renderAttributes(TRUE);
}
function save()
{
}
}
?>
<?php
/*
* This code is part of FusionDirectory (http://www.fusiondirectory.org/)
* Copyright (C) 2014 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 ejbcaManagement extends simpleManagement
{
protected $objectTypes = array('ejbcaCertificate');
protected $autoActions = FALSE;
protected $skipSnapHandler = TRUE;
protected $autoFilterAttributes = array('dn', 'cn', 'description', 'userCertificate');
public static function plInfo()
{
return array(
'plShortName' => _('EJBCA'),
'plDescription' => _('EJBCA certificates management'),
'plIcon' => 'geticon.php?context=applications&icon=ejbca&size=48',
'plSection' => 'admin',
'plManages' => array('ejbcaCertificate'),
'plProvidedAcls' => array()
);
}
function configureHeadpage ()
{
parent::configureHeadpage();
unset($this->headpage->xmlData['actionmenu']['action'][0]);
}
}
?>
<?php
/*
* This code is part of FusionDirectory (http://www.fusiondirectory.org)
* Copyright (C) 2014 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., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*/
simpleManagement::mainInc('ejbcaManagement');
?>
<?php
/*
This code is part of FusionDirectory (http://www.fusiondirectory.org/)
Copyright (C) 2014 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 ejbcaConfig extends simplePlugin
{
var $objectclasses = array("fdEjbcaPluginConf");
static function plInfo()
{
return array(
"plShortName" => _("EJBCA plugin configuration"),
"plDescription" => _("FusionDirectory ejbca plugin configuration"),
"plSelfModify" => FALSE,
"plCategory" => array("configuration"),
"plObjectType" => array("smallConfig"),
"plProvidedAcls" => parent::generatePlProvidedAcls(self::getAttributesInfo())
);
}
static function getAttributesInfo ()
{
return array(
'main' => array(
'name' => _('EJBCA plugin'),
'attrs' => array(
new StringAttribute (
_('EJBCA RDN'), _('Branch in which ejbca certificates are stored'),
'fdEjbcaRDN', TRUE,
'ou=certificates'
),
)
),
);
}
}
?>
##
## ejbca-fd.schema - Needed by Fusion Directory for managing ejbca certificates
##
# Attributes
attributetype ( 1.3.6.1.4.1.38414.47.1.1 NAME 'fdEjbcaRDN'
DESC 'FusionDirectory - ejbca certificates branch'
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.47.2.1 NAME 'fdEjbcaPluginConf'
DESC 'FusionDirectory ejbca plugin configuration'
SUP top AUXILIARY
MUST ( cn )
MAY ( fdEjbcaRDN ) )
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