diff --git a/Changelog.md b/Changelog.md index b785d6c4d023631f15e22e4f742c97fabe337620..4381127a20e32e39e914fcf6ecceffb2046fde7c 100644 --- a/Changelog.md +++ b/Changelog.md @@ -1,4 +1,4 @@ -## %"FusionDirectory 1.4" - 2023-05-02 +## %"FusionDirectory 1.4" - 2023-06-13 ### Added @@ -63,6 +63,8 @@ - fd#6207 Creation of new Class - Tasks Object - standard - fd#6231 [Tasks-Dashboard] - Develop a new dashboard for tasks to allow granular status report on sub-tasks - fd#6241 [Icons] Proper icons for tasks - task dashboard - mail template +- fd#6281 [PluginManager] - move the plugin tab from dasboard to the left menu under dashboard section +- fd#6282 [Core] - Re-structuration of sections and related menu entries #### fusiondirectory-plugins - fd-plugins#2912 the autofs plugin should be updated to support autofs5 @@ -126,6 +128,10 @@ - fd-plugins#6214 [Subscriptions] - Adds proper icons to the icons folder. - fd-plugins#6220 [Webauthn] - Create one file named variables_webauthn allowing the load all requirements - helping patching for supported distributions - fd-plugins#6226 [Public-form] - Updates plugin in order to be fully compatible with securimage library +- fd-plugins#6233 [Supann] - FranceConnect object class to be changed. +- fd-plugins#6234 [Supann] - Class entity - OU name is set to be unique but this is not mandatory +- fd-plugins#6236 [Plugins] - Re-structuration of sections and related menu entries +- fd-plugins#6238 [Plugins] - Add icons to subcritpions plugin ### Changed @@ -174,6 +180,8 @@ - fd#6266 CAS library 1.6 need a new parameter - fd#6267 [Core] - Update the reference from our old tools naming convention to the new ones. - fd#6268 change the path in the apache configuration to point to /usr/share/fusiondirectory directly +- fd#6283 [PluginManager] objectType is of tasks and should be changed to its own type +- fd#6286 [Core] - Tasks management class should be set outside dashboard #### fusiondirectory-plugins - fd-plugins#3360 update class_sieve.inc to the latest version 0.1.0 @@ -224,6 +232,7 @@ - fd#6153 Remove samba domain caching from core - fd#6254 [Core] - Remove fusiondirectory-insert-schema written in Perl from the branch. - fd#6255 [Manpages] - Removes Perl manpages from Core +- fd#6280 Remove dashboard completely from FusionDirectory #### fusiondirectory-plugins - fd-plugins#5980 removing puppert plugin from 1.4-dev @@ -337,6 +346,7 @@ - fd#6263 [Core] - Adapts core-fd schema to use the same OID for tasks, mailTemplate - fd#6264 [Core] - Removes un-required modules from Mail Template and Tasks, such as the Macro plugin. - fd#6265 [Core] - Fixes some transifex issues +- fd#6276 Error CAS after saving configuration #### fusiondirectory-plugins - fd-plugins#4013 Ppolicy functions that not work diff --git a/html/themes/breezy/icons/48/apps/pluginManager.png b/html/themes/breezy/icons/48/apps/pluginManager.png new file mode 100644 index 0000000000000000000000000000000000000000..aac43b2c33b7b7c85adb5db13601ff26c5434b9b Binary files /dev/null and b/html/themes/breezy/icons/48/apps/pluginManager.png differ diff --git a/include/class_config.inc b/include/class_config.inc index 2b1bedbc6337dcb1b98fdcf4484298f404365f86..e8eb7c8f0e1cfbd76d4834771bc318d065b3f1c8 100644 --- a/include/class_config.inc +++ b/include/class_config.inc @@ -1155,7 +1155,7 @@ class config } } unset($infos); - $this->data['SECTIONS']['personal'] = ['NAME' => _('My account'), 'PRIORITY' => 40]; + $this->data['SECTIONS']['personal'] = ['NAME' => _('My account'), 'PRIORITY' => 60]; $personal = []; foreach ($this->data['TABS']['USERTABS'] as $tab) { if ($plist->info[$tab['CLASS']]['plSelfModify']) { diff --git a/plugins/addons/dashboard/class_dashboard.inc b/plugins/addons/dashboard/class_dashboard.inc deleted file mode 100644 index 0b958b9c4f8a6a586c9bc9822f6472119bfec176..0000000000000000000000000000000000000000 --- a/plugins/addons/dashboard/class_dashboard.inc +++ /dev/null @@ -1,138 +0,0 @@ -<?php -/* - This code is part of FusionDirectory (http://www.fusiondirectory.org) - Copyright (C) 2010 Antoine Gallavardin - Copyright (C) 2011-2016 FusionDirectory project - - 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 dashboard extends simplePlugin -{ - static function plInfo (): array - { - return [ - 'plShortName' => _('Dashboard'), - 'plTitle' => _('Dashboard'), - 'plDescription' => _('Statistics and various information'), - 'plIcon' => 'geticon.php?context=applications&icon=utilities-system-monitor&size=48', - 'plObjectType' => [ - 'dashboard' => [ - 'name' => _('Dashboard'), - 'tabClass' => 'dashboardTabs', - 'mainAttr' => FALSE - ] - ], - 'plSection' => ['reporting' => ['name' => _('Reporting'), 'priority' => 40]], - 'plPriority' => 10, - - 'plProvidedAcls' => [ - 'dashboard' => _('See dashboard') - ] - ]; - } - - static function getAttributesInfo (): array - { - return [ - 'stats' => [ - 'name' => _('Statistics'), - 'attrs' => [new FakeAttribute('stats')], - 'template' => get_template_path('main_stats.tpl', TRUE, dirname(__FILE__)), - ], - ]; - } - - function __construct ($dn = NULL, $object = NULL, $parent = NULL, $mainTab = FALSE) - { - parent::__construct($dn, $object, $parent, $mainTab); - - $this->stats = $this->overview_stats(); - } - - /* Compute some statistics */ - function overview_stats () - { - global $config; - $stats = []; - foreach ($config->data['OBJECTS'] as $type => $infos) { - try { - $nb = count(objects::ls($type, NULL, NULL, '', TRUE)); - } catch (EmptyFilterException $e) { - $nb = 0; - } catch (FusionDirectoryException $e) { - $nb = 0; - $error = new FusionDirectoryError( - htmlescape(sprintf( - _('Statistics for type "%s" could not be computed because of the following error: %s'), - $type, - $e->getMessage() - )), - 0, - $e - ); - $error->display(); - } - if ($nb == 0) { - continue; - } - $node = [ - 'name' => $infos['name'], - 'nb' => $nb - ]; - if (isset($infos['icon'])) { - $node['img'] = $infos['icon']; - } else { - $node['img'] = 'images/empty.png'; - } - if (isset($infos['management']) && ($infos['management'] != '')) { - $pInfos = pluglist::pluginInfos($infos['management']); - $node['href'] = 'main.php?plug='.$pInfos['INDEX'].'&reset=1'; - $section = $pInfos['plSection']; - if (is_array($section)) { - $section = key($section); - } - $node['priority'] = $config->data['SECTIONS'][$section]['PRIORITY'] * 100 + (isset($pInfos['plPriority']) ? $pInfos['plPriority'] : 99); - } else { - $node['priority'] = 10000; - } - $stats[] = $node; - } - - usort($stats, - function ($a, $b) - { - return ($a['priority'] <=> $b['priority']); - } - ); - - return $stats; - } - - static function mainInc ($classname = NULL, $entry_dn = NULL, $tabs = TRUE, $edit_mode = FALSE, $objectType = FALSE) - { - global $config; - - if ($classname === NULL) { - $classname = get_called_class(); - } - - if ($entry_dn === NULL) { - $entry_dn = $config->current['BASE']; - } - - parent::mainInc($classname, $entry_dn, $tabs, $edit_mode, $objectType); - } -} diff --git a/plugins/addons/dashboard/class_dashboardPasswords.inc b/plugins/addons/dashboard/class_dashboardPasswords.inc deleted file mode 100644 index 888bfdf8288cdff1f0989affa756777cbf9049db..0000000000000000000000000000000000000000 --- a/plugins/addons/dashboard/class_dashboardPasswords.inc +++ /dev/null @@ -1,117 +0,0 @@ -<?php -/* - This code is part of FusionDirectory (http://www.fusiondirectory.org) - Copyright (C) 2016-2017 FusionDirectory project - - 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 dashboardPassword extends simplePlugin -{ - static function plInfo (): array - { - return [ - 'plShortName' => _('Passwords'), - 'plDescription' => _('Statistics about passwords'), - 'plObjectType' => ['dashboard'], - 'plPriority' => 12, - - 'plProvidedAcls' => [] - ]; - } - - static function getAttributesInfo (): array - { - return [ - 'pwds' => [ - 'name' => _('Passwords statistics'), - 'attrs' => [new FakeAttribute('pwds_stats')], - 'template' => get_template_path('pwd_stats.tpl', TRUE, dirname(__FILE__)), - ], - ]; - } - - function __construct ($dn = NULL, $object = NULL, $parent = NULL, $mainTab = FALSE) - { - parent::__construct($dn, $object, $parent, $mainTab); - - $this->pwds_stats = $this->computeStats(); - } - - function computeStats () - { - global $config; - - $temp = passwordMethod::get_available_methods(); - - $allowedMethods = $config->get_cfg_value('passwordAllowedHashes', $temp['name']); - $defaultMethod = $config->get_cfg_value('passwordDefaultHash', 'ssha'); - $forceDefault = ($config->get_cfg_value('forcePasswordDefaultHash', 'FALSE') == 'TRUE'); - try { - $users = objects::ls('user', ['userPassword' => '1', 'dn' => 'raw'], NULL, '', TRUE); - } catch (LDAPFailureException $e) { - $error = new FusionDirectoryError( - htmlescape(sprintf( - _('Password statistics could not be computed because of the following LDAP error: %s'), - $e->getMessage() - )), - 0, - $e - ); - $error->display(); - $users = []; - } - $nb_accounts = count($users); - $nb_locked_accounts = 0; - $methods_stats = []; - foreach ($users as $attrs) { - $userPassword = ''; - if (isset($attrs['userPassword'])) { - $userPassword = $attrs['userPassword']; - } - $method = passwordMethod::get_method($userPassword); - $methodName = $method->get_hash(); - if ($method->is_locked('', $userPassword)) { - $nb_locked_accounts++; - } - if (!isset($methods_stats[$methodName])) { - $methods_stats[$methodName] = [ - 'nb' => 0, - 'name' => $methodName, - ]; - if ($methodName == $defaultMethod) { - $methods_stats[$methodName]['style'] = 'default'; - } elseif ($methodName == 'clear') { - $methods_stats[$methodName]['style'] = 'clear'; - } elseif ($forceDefault || !in_array($methodName, $allowedMethods)) { - $methods_stats[$methodName]['style'] = 'forbidden'; - } else { - $methods_stats[$methodName]['style'] = 'none'; - } - } - $methods_stats[$methodName]['nb']++; - } - - return [ - 'methods' => $methods_stats, - 'nb' => $nb_accounts, - 'img' => 'geticon.php?context=types&icon=user&size=16', - 'locked_accounts' => [ - 'nb' => $nb_locked_accounts, - 'img' => 'geticon.php?context=status&icon=object-locked&size=16' - ], - ]; - } -} diff --git a/plugins/addons/dashboard/class_dashboardTabs.inc b/plugins/addons/dashboard/class_dashboardTabs.inc deleted file mode 100644 index f8f12e8a3d4bd7b7487f57295ef6b6ec8bcd2d7b..0000000000000000000000000000000000000000 --- a/plugins/addons/dashboard/class_dashboardTabs.inc +++ /dev/null @@ -1,35 +0,0 @@ -<?php -/* - This code is part of FusionDirectory (http://www.fusiondirectory.org/) - Copyright (C) 2011-2019 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 dashboardTabs extends simpleTabs_noSpecial -{ - function __construct ($type, $dn, $copied_object = NULL) - { - parent::__construct($type, $dn, $copied_object); - if (!class_available('dhcpService') && !class_available('dnsZone')) { - unset($this->by_object['dashboardNetwork']); - unset($this->by_name['dashboardNetwork']); - } - } - - function save () - { - } -} diff --git a/plugins/addons/dashboard/class_dashboardUsers.inc b/plugins/addons/dashboard/class_dashboardUsers.inc deleted file mode 100644 index b7a3856c774e661a89972f1f7bc37cb8faf6436c..0000000000000000000000000000000000000000 --- a/plugins/addons/dashboard/class_dashboardUsers.inc +++ /dev/null @@ -1,292 +0,0 @@ -<?php -/* - This code is part of FusionDirectory (http://www.fusiondirectory.org) - Copyright (C) 2010 Antoine Gallavardin - Copyright (C) 2011-2016 FusionDirectory project - - 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 dashboardUsers extends simplePlugin -{ - static function plInfo (): array - { - return [ - 'plShortName' => _('Users'), - 'plDescription' => _('Statistics about users'), - 'plObjectType' => ['dashboard'], - 'plPriority' => 10, - - 'plProvidedAcls' => [] - ]; - } - - static function getAttributesInfo (): array - { - return [ - 'userstats' => [ - 'name' => _('Users statistics'), - 'attrs' => [new FakeAttribute('users_stats')], - 'template' => get_template_path('users_stats.tpl', TRUE, dirname(__FILE__)), - ], - 'groupstats' => [ - 'name' => _('Groups statistics'), - 'attrs' => [new FakeAttribute('groups_stats')], - 'template' => get_template_path('groups_stats.tpl', TRUE, dirname(__FILE__)), - ], - 'expired_accounts' => [ - 'name' => _('Expired accounts'), - 'attrs' => [new FakeAttribute('expired')], - 'template' => get_template_path('users_accounts.tpl', TRUE, dirname(__FILE__)), - ], - ]; - } - - function __construct ($dn = NULL, $object = NULL, $parent = NULL, $mainTab = FALSE) - { - parent::__construct($dn, $object, $parent, $mainTab); - - $this->expiredAccountsColumns = [ - 'user' => [ - 'uid' => _('Login'), - 'cn' => _('Name'), - 'telephoneNumber' => _('Phone number'), - 'expirationDate' => _('Expiration date'), - ], - 'manager' => [ - 'manager_cn' => _('Name'), - 'manager_mail' => _('Email'), - 'manager_phone' => _('Phone number'), - ] - ]; - $this->users_stats = $this->computeUsersStats(); - $this->groups_stats = $this->computeGroupsStats(); - $this->expired = $this->expired_accounts_info(); - } - - function computeUsersStats () - { - global $config; - /* User statistics */ - try { - $nb_accounts = count(objects::ls('user', NULL, NULL, '', TRUE)); - $nb_mail_accounts = count(objects::ls('user', NULL, NULL, '(objectClass=gosaMailAccount)', TRUE)); - $nb_posix_accounts = count(objects::ls('user', NULL, NULL, '(objectClass=posixAccount)', TRUE)); - $nb_samba_accounts = count(objects::ls('user', NULL, NULL, '(objectClass=sambaSamAccount)', TRUE)); - } catch (LDAPFailureException $e) { - $error = new FusionDirectoryError( - htmlescape(sprintf( - _('User statistics could not be computed because of the following LDAP error: %s'), - $e->getMessage() - )), - 0, - $e - ); - $error->display(); - $nb_accounts = 0; - $nb_mail_accounts = 0; - $nb_posix_accounts = 0; - $nb_samba_accounts = 0; - } - - return [ - 'accounts' => [ - ['name' => 'mail', 'nb' => $nb_mail_accounts, 'img' => 'geticon.php?context=applications&icon=internet-mail&size=16'], - ['name' => 'posix', 'nb' => $nb_posix_accounts, 'img' => 'geticon.php?context=applications&icon=os-linux&size=16'], - ['name' => 'samba', 'nb' => $nb_samba_accounts, 'img' => 'geticon.php?context=applications&icon=os-windows&size=16'] - ], - 'nb' => $nb_accounts, - 'img' => 'geticon.php?context=types&icon=user&size=16', - ]; - } - - function computeGroupsStats () - { - global $config; - /* Group statistics */ - try { - $nb_groups = count(objects::ls('group', NULL, NULL, '', TRUE)); - $nb_mail_groups = count(objects::ls('group', NULL, NULL, '(objectClass=fdGroupMail)', TRUE)); - $nb_samba_groups = count(objects::ls('group', NULL, NULL, '(objectClass=sambaGroupMapping)', TRUE)); - } catch (LDAPFailureException $e) { - $error = new FusionDirectoryError( - htmlescape(sprintf( - _('Group statistics could not be computed because of the following LDAP error: %s'), - $e->getMessage() - )), - 0, - $e - ); - $error->display(); - $nb_groups = 0; - $nb_mail_groups = 0; - $nb_samba_groups = 0; - } catch (NonExistingObjectTypeException $e) { - /* Posix plugin is not installed */ - $nb_groups = 0; - $nb_mail_groups = 0; - $nb_samba_groups = 0; - } - - return [ - 'groups' => [ - ['name' => 'mail', 'nb' => $nb_mail_groups, 'img' => 'geticon.php?context=applications&icon=internet-mail&size=16'], - ['name' => 'samba', 'nb' => $nb_samba_groups, 'img' => 'geticon.php?context=applications&icon=os-windows&size=16'] - ], - 'nb' => $nb_groups, - 'img' => 'geticon.php?context=types&icon=user-group&size=16', - ]; - } - - function expired_accounts_info () - { - global $config; - - /* Begin of code for selecting expired account */ - - /* getting the date in TIMESTAMP UNIX format */ - /* 24 * 60 * 60 = 86400 */ - $today = floor(time() / 86400); - - /* Fetch global value from fusiondirectory.conf */ - $next_expired_days = $config->get_cfg_value('dashboardExpiredAccountsDays', 15); - $next_expired_date = ($today + $next_expired_days); - - if (!class_available('posixAccount')) { - /* if shadowExpire is not available no way to check expiration */ - return [ - 'columns' => $this->expiredAccountsColumns, - 'accounts' => [], - 'accounts_next_days' => [], - 'next_days' => $next_expired_days, - ]; - } - - /* search all account with all date, mail, telephone */ - try { - $attributes = [ - 'dn' => 'raw', - 'uid' => '*', - 'cn' => '*', - 'telephoneNumber' => '*', - 'manager' => '*', - 'shadowExpire' => '*', - ]; - if (class_available('mailAccount')) { - $attributes['mail'] = 'raw'; - } - $users = objects::ls('user', $attributes, NULL, '(shadowExpire=*)', TRUE); - } catch (LDAPFailureException $e) { - $error = new FusionDirectoryError( - htmlescape(sprintf( - _('Expired user information could not be computed because of the following LDAP error: %s'), - $e->getMessage() - )), - 0, - $e - ); - $error->display(); - $users = []; - } catch (FusionDirectoryException $e) { - $error = new FusionDirectoryError( - htmlescape(sprintf( - _('Expired user information could not be computed because of the following error: %s'), - $e->getMessage() - )), - 0, - $e - ); - $error->display(); - $users = []; - } - - $expired_accounts = []; - $next_expired_accounts = []; - foreach ($users as $user) { - // Test if account is expired now - if ($user['shadowExpire'][0] <= $today) { - $expired_accounts[] = static::get_user_infos($user); - } elseif ($user['shadowExpire'][0] <= $next_expired_date) { - $next_expired_accounts[] = static::get_user_infos($user); - } - } - - uasort($expired_accounts, ['dashboardUsers','compareUsers']); - uasort($next_expired_accounts, ['dashboardUsers','compareUsers']); - - return [ - 'columns' => $this->expiredAccountsColumns, - 'accounts' => $expired_accounts, - 'accounts_next_days' => $next_expired_accounts, - 'next_days' => $next_expired_days, - ]; - } - - static function get_user_infos ($attrs) - { - global $config; - - if (isset($attrs['manager'][0])) { - $ldap = $config->get_ldap_link(); - $ldap->cat($attrs['manager'][0], ['cn', 'mail', 'telephoneNumber']); - if ($manager_attrs = $ldap->fetch()) { - $manager_cn = (isset($manager_attrs['cn'][0]) ? $manager_attrs['cn'][0] : ''); - $manager_mail = (isset($manager_attrs['mail'][0]) ? $manager_attrs['mail'][0] : ''); - $manager_phone = (isset($manager_attrs['telephoneNumber'][0]) ? $manager_attrs['telephoneNumber'][0] : ''); - } else { - $manager_cn = sprintf(_('Not found (%s)'), $attrs['manager'][0]); - $manager_mail = ''; - $manager_phone = ''; - } - } else { - $manager_cn = ''; - $manager_mail = ''; - $manager_phone = ''; - } - - if (isset($attrs['shadowExpire'][0])) { - /* 24 * 60 * 60 = 86400 */ - $human_shadowExpire = date('d.m.Y', $attrs['shadowExpire'][0] * 86400); - } else { - $human_shadowExpire = ''; - } - - return [ - 'uid' => $attrs['uid'][0], - 'cn' => $attrs['cn'][0], - 'telephoneNumber' => (isset($attrs['telephoneNumber'][0]) ? $attrs['telephoneNumber'][0] : ''), - 'mail' => (isset($attrs['mail'][0]) ? $attrs['mail'][0] : ''), - 'manager_cn' => $manager_cn, - 'manager_mail' => $manager_mail, - 'manager_phone' => $manager_phone, - 'expirationDate' => $human_shadowExpire, - ]; - } - - static function compareUsers ($a, $b) - { - if ($a['expirationDate'] < $b['expirationDate']) { - return -1; - } elseif ($a['expirationDate'] > $b['expirationDate']) { - return 1; - } elseif ($a['uid'] < $b['uid']) { - return -1; - } elseif ($a['uid'] > $b['uid']) { - return 1; - } else { - return 0; - } - } -} diff --git a/plugins/addons/dashboard/groups_stats.tpl b/plugins/addons/dashboard/groups_stats.tpl deleted file mode 100644 index 56452aae5570138bf3a1e9b7f642abdb2a241d6d..0000000000000000000000000000000000000000 --- a/plugins/addons/dashboard/groups_stats.tpl +++ /dev/null @@ -1,24 +0,0 @@ -<div id="{$sectionId}" class="plugin-section"> - <span class="legend"> - {if !empty($sectionIcon)}<img src="{$sectionIcon|escape}" alt=""/>{/if}{$section|escape} - </span> - <div> - <img src="{$attributes.groups_stats.img|escape}" alt="group icon"/> - {if $attributes.groups_stats.nb > 0} - {t count=$attributes.groups_stats.nb 1=$attributes.groups_stats.nb plural="There are %1 groups:"}There is 1 group:{/t} - {else} - {t}There are no groups{/t} - {/if} - <ul> - {foreach from=$attributes.groups_stats.groups item=g} - <li style="list-style-image:url({$g.img|escape})"> - {if $g.nb > 0} - {t count=$g.nb 1=$g.name 2=$g.nb plural="%2 are %1 groups"}One of them is a %1 group{/t} - {else} - {t 1=$g.name}There is no %1 group{/t} - {/if} - </li> - {/foreach} - </ul> - </div> -</div> diff --git a/plugins/addons/dashboard/main_stats.tpl b/plugins/addons/dashboard/main_stats.tpl deleted file mode 100644 index 27ab1e8e9f55528ec970e61df1351e40ee0f7f84..0000000000000000000000000000000000000000 --- a/plugins/addons/dashboard/main_stats.tpl +++ /dev/null @@ -1,18 +0,0 @@ -<div class="plugin-section"> - <span class="legend"> - {t}Statistics{/t} - </span> - <div> - <ul style="list-style-type:none;line-height:2em;"> - {foreach from=$attributes.stats item=stat} - <li> -{if isset($stat.href)} - <a href="{$stat.href}"><img style="vertical-align:middle;" src="{$stat.img|escape}" alt=""/> {$stat.name|escape} : {$stat.nb|escape}</a> -{else} - <img style="vertical-align:middle;" src="{$stat.img|escape}" alt=""/> {$stat.name|escape} : {$stat.nb|escape} -{/if} - </li> - {/foreach} - </ul> - </div> -</div> diff --git a/plugins/addons/dashboard/pwd_stats.tpl b/plugins/addons/dashboard/pwd_stats.tpl deleted file mode 100644 index 247333b3fff4c80feb5d94d94f592eead756992e..0000000000000000000000000000000000000000 --- a/plugins/addons/dashboard/pwd_stats.tpl +++ /dev/null @@ -1,33 +0,0 @@ -<div id="{$sectionId}" class="plugin-section"> - <span class="legend"> - {if !empty($sectionIcon)}<img src="{$sectionIcon|escape}" alt=""/>{/if}{$section|escape} - </span> - <div> - <img src="{$attributes.pwds_stats.img|escape}" alt="user icon"/> - {t count=$attributes.pwds_stats.nb 1=$attributes.pwds_stats.nb plural="There are %1 users:"}There is 1 user:{/t} - <ul> - {foreach from=$attributes.pwds_stats.methods item=method} - {if $method.nb > 0} - {if $method.style == "default"} - <li style="color:green;"> - {elseif $method.style == "clear"} - <li style="color:red;"> - {elseif $method.style == "forbidden"} - <li style="color:red;"> - {else} - <li> - {/if} - {t count=$method.nb 1=$method.name 2=$method.nb plural="%2 of them use the %1 method"}One of them uses %1 method{/t} - </li> - {/if} - {/foreach} - <li style="list-style-image:url({$attributes.pwds_stats.locked_accounts.img|escape})"> - {if $attributes.pwds_stats.locked_accounts.nb > 0} - {t count=$attributes.pwds_stats.locked_accounts.nb 1=$attributes.pwds_stats.locked_accounts.nb plural="%1 of them are locked"}One of them is locked{/t} - {else} - {t}None of them are locked{/t} - {/if} - </li> - </ul> - </div> -</div> diff --git a/plugins/addons/dashboard/users_accounts.tpl b/plugins/addons/dashboard/users_accounts.tpl deleted file mode 100644 index e1cb316e5a9c2c0b3dcc21322a49048b5c45964e..0000000000000000000000000000000000000000 --- a/plugins/addons/dashboard/users_accounts.tpl +++ /dev/null @@ -1,102 +0,0 @@ -<div id="{$sectionId}" class="plugin-section fullwidth"> - <span class="legend"> - {if !empty($sectionIcon)}<img src="{$sectionIcon|escape}" alt=""/>{/if}{$section|escape} - </span> - <div> - <h1> - {if $attributes.expired.accounts|@count > 0} - {t count=$attributes.expired.accounts|@count 1=$attributes.expired.accounts|@count plural="There are %1 expired accounts"}There is one expired account{/t} - {else} - {t}There are no expired accounts{/t} - {/if} - </h1> - {if $attributes.expired.accounts|@count > 0} - <table style="width: 100%;" class="listingTable"> - <thead> - <tr style="background-color: white; text-align:center;"> - <th colspan="{$attributes.expired.columns.user|@count}" style="background-color: white; padding:5px;"> - {t}Expired accounts{/t} - </th> - <th colspan="{$attributes.expired.columns.manager|@count}" style="background-color: white; padding:5px;"> - {t}Manager concerned{/t} - </th> - </tr> - - - <tr> - {foreach from=$attributes.expired.columns.user item=colname} - <th>{$colname|escape}</th> - {/foreach} - {foreach from=$attributes.expired.columns.manager item=colname} - <th>{$colname|escape}</th> - {/foreach} - </tr> - </thead> - <tbody> - {foreach from=$attributes.expired.accounts item=account} - <tr> - {foreach from=$attributes.expired.columns.user key=colkey item=colname} - <td>{$account.$colkey|escape} </td> - {/foreach} - {foreach from=$attributes.expired.columns.manager key=colkey item=colname} - {if $colkey==manager_mail} - <td><a href="mailto:{$account.$colkey|escape}">{$account.$colkey|escape}</a></td> - {else} - <td>{$account.$colkey|escape} </td> - {/if} - {/foreach} - </tr> - {/foreach} - </tbody> - </table> - {/if} - - <h1> - {if $attributes.expired.accounts_next_days|@count > 0} - {t count=$attributes.expired.accounts_next_days|@count 1=$attributes.expired.next_days 2=$attributes.expired.accounts_next_days|@count plural="There are %2 accounts expiring in the next %1 days"}There is one account expiring in the next %1 days{/t} - {else} - {t 1=$attributes.expired.next_days}There is no account expiring in the next %1 days{/t} - {/if} - </h1> - {if $attributes.expired.accounts_next_days|@count > 0} - <table style="width: 100%;" class="listingTable"> - <thead> - <tr style="background-color: white; text-align:center;"> - <th colspan="{$attributes.expired.columns.user|@count}" style="background-color: white; padding:5px;"> - {t}Next expired accounts{/t} - </th> - <th colspan="{$attributes.expired.columns.manager|@count}" style="background-color: white; padding:5px;"> - {t}Manager concerned{/t} - </th> - </tr> - - - <tr> - {foreach from=$attributes.expired.columns.user item=colname} - <th>{$colname|escape}</th> - {/foreach} - {foreach from=$attributes.expired.columns.manager item=colname} - <th>{$colname|escape}</th> - {/foreach} - </tr> - </thead> - <tbody> - {foreach from=$attributes.expired.accounts_next_days item=account} - <tr> - {foreach from=$attributes.expired.columns.user key=colkey item=colname} - <td> {$account.$colkey|escape}</td> - {/foreach} - {foreach from=$attributes.expired.columns.manager key=colkey item=colname} - {if $colkey==manager_mail} - <td><a href="mailto:{$account.$colkey|escape}">{$account.$colkey|escape}</a></td> - {else} - <td> {$account.$colkey|escape}</td> - {/if} - {/foreach} - </tr> - {/foreach} - </tbody> - </table> - {/if} - </div> -</div> diff --git a/plugins/addons/dashboard/users_stats.tpl b/plugins/addons/dashboard/users_stats.tpl deleted file mode 100644 index 570414e058ba63b4aaf05136ecd8470a3d55280f..0000000000000000000000000000000000000000 --- a/plugins/addons/dashboard/users_stats.tpl +++ /dev/null @@ -1,24 +0,0 @@ -<div id="{$sectionId}" class="plugin-section"> - <span class="legend"> - {if !empty($sectionIcon)}<img src="{$sectionIcon|escape}" alt=""/>{/if}{$section|escape} - </span> - <div> - <img src="{$attributes.users_stats.img|escape}" alt="user icon"/> - {if $attributes.users_stats.nb > 0} - {t count=$attributes.users_stats.nb 1=$attributes.users_stats.nb plural="There are %1 users:"}There is 1 user:{/t} - {else} - {t}There are no users{/t} - {/if} - <ul> - {foreach from=$attributes.users_stats.accounts item=acc} - <li style="list-style-image:url({$acc.img|escape})"> - {if $acc.nb > 0} - {t count=$acc.nb 1=$acc.name 2=$acc.nb plural="%2 of them have a %1 account"}One of them has a %1 account{/t} - {else} - {t 1=$acc.name}None of them have a %1 account{/t} - {/if} - </li> - {/foreach} - </ul> - </div> -</div> diff --git a/plugins/config/class_DebugLevelAttribute.inc b/plugins/configuration/config/class_DebugLevelAttribute.inc similarity index 100% rename from plugins/config/class_DebugLevelAttribute.inc rename to plugins/configuration/config/class_DebugLevelAttribute.inc diff --git a/plugins/config/class_configInLdap.inc b/plugins/configuration/config/class_configInLdap.inc similarity index 100% rename from plugins/config/class_configInLdap.inc rename to plugins/configuration/config/class_configInLdap.inc diff --git a/plugins/config/class_configInLdapTabs.inc b/plugins/configuration/config/class_configInLdapTabs.inc similarity index 100% rename from plugins/config/class_configInLdapTabs.inc rename to plugins/configuration/config/class_configInLdapTabs.inc diff --git a/plugins/config/class_dashBoardConfig.inc b/plugins/configuration/config/class_dashBoardConfig.inc similarity index 100% rename from plugins/config/class_dashBoardConfig.inc rename to plugins/configuration/config/class_dashBoardConfig.inc diff --git a/plugins/config/class_hooksConfig.inc b/plugins/configuration/config/class_hooksConfig.inc similarity index 100% rename from plugins/config/class_hooksConfig.inc rename to plugins/configuration/config/class_hooksConfig.inc diff --git a/plugins/config/class_mailTemplateConfig.inc b/plugins/configuration/config/class_mailTemplateConfig.inc similarity index 100% rename from plugins/config/class_mailTemplateConfig.inc rename to plugins/configuration/config/class_mailTemplateConfig.inc diff --git a/plugins/config/class_mainPluginsConfig.inc b/plugins/configuration/config/class_mainPluginsConfig.inc similarity index 100% rename from plugins/config/class_mainPluginsConfig.inc rename to plugins/configuration/config/class_mainPluginsConfig.inc diff --git a/plugins/config/class_pluginsConfigInLdap.inc b/plugins/configuration/config/class_pluginsConfigInLdap.inc similarity index 100% rename from plugins/config/class_pluginsConfigInLdap.inc rename to plugins/configuration/config/class_pluginsConfigInLdap.inc diff --git a/plugins/config/class_recoveryConfig.inc b/plugins/configuration/config/class_recoveryConfig.inc similarity index 100% rename from plugins/config/class_recoveryConfig.inc rename to plugins/configuration/config/class_recoveryConfig.inc diff --git a/plugins/config/class_snapshotConfig.inc b/plugins/configuration/config/class_snapshotConfig.inc similarity index 100% rename from plugins/config/class_snapshotConfig.inc rename to plugins/configuration/config/class_snapshotConfig.inc diff --git a/plugins/config/class_tasksConfig.inc b/plugins/configuration/config/class_tasksConfig.inc similarity index 100% rename from plugins/config/class_tasksConfig.inc rename to plugins/configuration/config/class_tasksConfig.inc diff --git a/plugins/addons/mailtemplate/class_mailTemplate.inc b/plugins/configuration/mailtemplate/class_mailTemplate.inc similarity index 100% rename from plugins/addons/mailtemplate/class_mailTemplate.inc rename to plugins/configuration/mailtemplate/class_mailTemplate.inc diff --git a/plugins/addons/subscription/class_subscriptionInfo.inc b/plugins/configuration/subscription/class_subscriptionInfo.inc similarity index 100% rename from plugins/addons/subscription/class_subscriptionInfo.inc rename to plugins/configuration/subscription/class_subscriptionInfo.inc diff --git a/plugins/addons/tasks/class_tasks.inc b/plugins/configuration/tasks/class_tasks.inc similarity index 100% rename from plugins/addons/tasks/class_tasks.inc rename to plugins/configuration/tasks/class_tasks.inc diff --git a/plugins/addons/tasks/class_tasksGranular.inc b/plugins/configuration/tasks/class_tasksGranular.inc similarity index 100% rename from plugins/addons/tasks/class_tasksGranular.inc rename to plugins/configuration/tasks/class_tasksGranular.inc diff --git a/plugins/addons/tasks/class_tasksMail.inc b/plugins/configuration/tasks/class_tasksMail.inc similarity index 100% rename from plugins/addons/tasks/class_tasksMail.inc rename to plugins/configuration/tasks/class_tasksMail.inc diff --git a/plugins/admin/tasks/class_tasksManagement.inc b/plugins/configuration/tasks/class_tasksManagement.inc similarity index 100% rename from plugins/admin/tasks/class_tasksManagement.inc rename to plugins/configuration/tasks/class_tasksManagement.inc diff --git a/plugins/addons/dashboard/class_pluginsManager.inc b/plugins/dashboard/pluginmanager/class_pluginsManager.inc similarity index 72% rename from plugins/addons/dashboard/class_pluginsManager.inc rename to plugins/dashboard/pluginmanager/class_pluginsManager.inc index fdc8aa1599970fab9fb43630973c981e541b9d9d..c107f7017f131b47ea56b56d976d4d094a92d9bf 100644 --- a/plugins/addons/dashboard/class_pluginsManager.inc +++ b/plugins/dashboard/pluginmanager/class_pluginsManager.inc @@ -16,7 +16,7 @@ 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 pluginsManager extends simplePlugin { @@ -24,10 +24,20 @@ class pluginsManager extends simplePlugin { return [ 'plShortName' => _('Plugins'), - 'plDescription' => _('Plugins List'), - 'plObjectType' => ['dashboard'], - - 'plProvidedAcls' => [] + 'plObjectType' => [ + 'pluginManager' => [ + 'name' => _('PluginManager'), + 'mainAttr' => FALSE + ] + ], + 'plTitle' => _('Plugins Manager'), + 'plIcon' => 'geticon.php?context=applications&icon=pluginManager&size=48', + 'plSection' => ['Dashboard' => ['name' => _('Dashboard'), 'priority' => 30]], + 'plPriority' => 10, + 'plDescription' => _('Provide a reporting mechanism of installed plugins'), + 'plProvidedAcls' => [ + 'pluginManager' => _('See pluginManager') + ] ]; } @@ -35,7 +45,8 @@ class pluginsManager extends simplePlugin { return [ 'plugins' => [ - 'name' => _('Plugins'), + 'name' => _('Plugins Manager'), + 'plShortName' => _('Plugins Manager'), 'attrs' => [new FakeAttribute('pluginsList')], 'template' => get_template_path('plugins_list.tpl', TRUE, dirname(__FILE__)), ], @@ -82,4 +93,20 @@ class pluginsManager extends simplePlugin return $div->drawList(); } + + static function mainInc ($classname = NULL, $entry_dn = NULL, $tabs = FALSE, $edit_mode = FALSE, $objectType = FALSE) + { + global $config; + + if ($classname === NULL) { + $classname = get_called_class(); + } + + if ($entry_dn === NULL) { + $entry_dn = $config->current['BASE']; + } + + parent::mainInc($classname, $entry_dn, $tabs, $edit_mode, $objectType); + } + } diff --git a/plugins/addons/dashboard/plugins_list.tpl b/plugins/dashboard/pluginmanager/plugins_list.tpl similarity index 100% rename from plugins/addons/dashboard/plugins_list.tpl rename to plugins/dashboard/pluginmanager/plugins_list.tpl diff --git a/plugins/admin/tasks/class_tasksColumn.inc b/plugins/dashboard/tasks/class_tasksColumn.inc similarity index 100% rename from plugins/admin/tasks/class_tasksColumn.inc rename to plugins/dashboard/tasks/class_tasksColumn.inc diff --git a/plugins/admin/tasks/class_tasksDashboard.inc b/plugins/dashboard/tasks/class_tasksDashboard.inc similarity index 98% rename from plugins/admin/tasks/class_tasksDashboard.inc rename to plugins/dashboard/tasks/class_tasksDashboard.inc index 0b0b0b6dc18cc32e77a463299df2b2243ff5410c..bf4149c3740be5dd3f0f580e630e6e68833fa099 100644 --- a/plugins/admin/tasks/class_tasksDashboard.inc +++ b/plugins/dashboard/tasks/class_tasksDashboard.inc @@ -52,7 +52,7 @@ class tasksDashboard extends management 'plDescription' => _('Provide a reporting mechanism for tasks'), 'plTitle' => _('Tasks Dashboard'), 'plIcon' => 'geticon.php?context=applications&icon=tasks-dashboard&size=48', - 'plSection' => ['reporting' => ['name' => _('Reporting'), 'priority' => 40]], + 'plSection' => ['Dashboard' => ['name' => _('Dashboard'), 'priority' => 30]], 'plPriority' => 10, 'plManages' => ['tasksGranular'], 'plProvidedAcls' => [],