An error occurred while loading the file. Please try again.
-
Côme Chilliet authored
issue #5775
bb8ab402
<?php
/*
This code is part of FusionDirectory (http://www.fusiondirectory.org/)
Copyright (C) 2003-2010 Cajus Pollmeier
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.
*/
/*!
* \file class_acl.inc
* Source code for Class ACL
*/
/*!
* \brief This class contains all the function needed to manage acl
*/
class acl
{
static function plInfo()
{
return array(
'plShortName' => _('ACL'),
'plDescription' => _('Manage access control lists'),
'plCategory' => array(
'acl' => array(
'description' => _('ACL').' & '._('ACL roles'),
'objectClass' => array('gosaAcl','gosaRole')
)
),
'plObjectType' => array(),
'plProvidedAcls' => array()
);
}
/*!
* \brief Function sort an array by elements priority
*
* \param Array $list Array to be sorted
*/
static function sort_by_priority($list)
{
uksort($list,
function ($a, $b)
{
$infos_a = pluglist::pluginInfos(preg_replace('|^[^/]*/|', '', $a));
$infos_b = pluglist::pluginInfos(preg_replace('|^[^/]*/|', '', $b));
$pa = (isset($infos_a['plPriority']) ? $infos_a['plPriority'] : 0);
$pb = (isset($infos_b['plPriority']) ? $infos_b['plPriority'] : 0);
if ($pa == $pb) {
return 0;
}
return ($pa < $pb ? -1 : 1);
}
);
return $list;