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

Fixes #3416 Added a webapps plugin

parent b9f5c89d
<?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 webapp extends simplePlugin
{
var $mainTab = TRUE;
var $objectclasses = array('fdWebApplication');
/* Return plugin informations for acl handling */
public static function plInfo()
{
return array(
'plShortName' => _('Web application'),
'plDescription' => _('Web applicationts names, icons and links'),
'plObjectType' => array('webapp' => array(
'name' => _('Web application'),
'filter' => 'objectClass=fdWebApplication',
'ou' => get_ou('webappsRDN'),
'icon' => 'geticon.php?context=categories&icon=applications-internet&size=16'
)),
'plProvidedAcls' => parent::generatePlProvidedAcls(self::getAttributesInfo())
);
}
static function getAttributesInfo ()
{
return array(
'main' => array(
'name' => _('Application'),
'attrs' => array(
new BaseSelectorAttribute (get_ou('webappsRDN')),
new HostNameAttribute (
_('Name'), _('Name or id for application'),
'cn', TRUE
),
new URLAttribute (
_('URL'), _('Link to this application'),
'labeledURI', TRUE
),
new StringAttribute (
_('Title'), _('Displayed name for links to this application'),
'fdApplicationTitle', FALSE
),
new ImageAttribute (
_('Icon'), _('Icon for this application'),
'fdApplicationImage', FALSE,
48, 48, 'png', TRUE
),
new PathAttribute (
_('Icon location'), _('Usual path to this application icon'),
'fdApplicationImageLocation', FALSE
),
)
),
);
}
function __construct (&$config, $dn = NULL, $object = NULL)
{
parent::__construct($config, $dn, $object);
}
/* Returns the dn of the entry */
function compute_dn()
{
return 'cn='.$this->cn.','.get_ou('webappsRDN').$this->base;
}
}
?>
<?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 webappManagement extends simpleManagement
{
protected $objectTypes = array('webapp');
public static function plInfo()
{
return array(
'plShortName' => _('Web applications'),
'plDescription' => _('Web applications management'),
'plIcon' => 'geticon.php?context=categories&icon=applications-internet&size=48',
'plSection' => 'admin',
'plManages' => array('webapp'),
'plProvidedAcls' => array()
);
}
}
?>
<?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('webappManagement');
?>
<?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 webappsConfig extends simplePlugin
{
var $objectclasses = array('fdWebappsPluginConf');
static function plInfo()
{
return array(
'plShortName' => _('Webapps plugin configuration'),
'plDescription' => _('FusionDirectory webapps plugin configuration'),
'plSelfModify' => FALSE,
'plCategory' => array('configuration'),
'plObjectType' => array('smallConfig'),
'plProvidedAcls' => parent::generatePlProvidedAcls(self::getAttributesInfo())
);
}
static function getAttributesInfo ()
{
return array(
'main' => array(
'name' => _('Webapps plugin'),
'attrs' => array(
new StringAttribute (
_('Web applications RDN'), _('Branch in which web applications infos will be stored'),
'fdWebappsRDN', TRUE,
'ou=webapps'
),
)
),
);
}
}
?>
##
## webapps-fd-conf.schema - Needed by Fusion Directory for storing web applications plugin configuration
##
# Attributes
attributetype ( 1.3.6.1.4.1.38414.47.1.1 NAME 'fdWebappsRDN'
DESC 'FusionDirectory - webapp 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.47.2.1 NAME 'fdWebappsPluginConf'
DESC 'FusionDirectory webapps plugin configuration'
SUP top AUXILIARY
MUST ( cn )
MAY ( fdWebappsRDN ) )
##
## webapps-fd.schema - Needed by Fusion Directory for managing web applications
##
# Attributes
attributetype ( 1.3.6.1.4.1.38414.46.1.1 NAME 'fdApplicationTitle'
DESC 'FusionDirectory - store the application title'
EQUALITY caseIgnoreMatch
SUBSTR caseIgnoreSubstringsMatch
SYNTAX 1.3.6.1.4.1.1466.115.121.1.15)
attributetype ( 1.3.6.1.4.1.38414.46.1.2 NAME 'fdApplicationImage'
DESC 'FusionDirectory - Keeps the application icon in png format'
SYNTAX 1.3.6.1.4.1.1466.115.121.1.28)
attributetype ( 1.3.6.1.4.1.38414.46.1.3 NAME 'fdApplicationImageLocation'
DESC 'FusionDirectory - store application image/icon location'
EQUALITY caseIgnoreMatch
SUBSTR caseIgnoreSubstringsMatch
SYNTAX 1.3.6.1.4.1.1466.115.121.1.15)
# Object Class
objectclass ( 1.3.6.1.4.1.38414.46.2.1 NAME 'fdWebApplication'
DESC 'FusionDirectory - Web Applications storage for FusionDirectory'
MUST ( cn $ labeledURI )
MAY ( fdApplicationTitle $ fdApplicationImage $ fdApplicationImageLocation ))
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