From 4b1c6a2acf9bf6afa853b623b804d65927d95e5f Mon Sep 17 00:00:00 2001 From: Benjamin Renard Date: Mon, 14 Oct 2019 12:14:20 +0200 Subject: [PATCH] LSaccessRightsMatrixView : show rights of default LSprofiles self and user --- .../addons/LSaddons.LSaccessRightsMatrixView.php | 12 +++++++++++- .../templates/default/LSaccessRightsMatrixView.tpl | 4 ++-- 2 files changed, 13 insertions(+), 3 deletions(-) diff --git a/public_html/includes/addons/LSaddons.LSaccessRightsMatrixView.php b/public_html/includes/addons/LSaddons.LSaccessRightsMatrixView.php index 11f1698e..8111b175 100644 --- a/public_html/includes/addons/LSaddons.LSaccessRightsMatrixView.php +++ b/public_html/includes/addons/LSaddons.LSaccessRightsMatrixView.php @@ -58,7 +58,12 @@ function LSaddon_LSaccessRightsMatrixView_support() { } function LSaccessRightsMatrixView() { - $LSprofiles = LSsession :: $ldapServer["LSprofiles"]; + $LSprofiles = array( + 'user' => _('All connected users'), + ); + if (isset(LSsession :: $ldapServer["LSprofiles"]) && is_array(LSsession :: $ldapServer["LSprofiles"])) + foreach(LSsession :: $ldapServer["LSprofiles"] as $LSprofile => $LSprofile_conf) + $LSprofiles[$LSprofile] = $LSprofile; $LSobjects = array(); foreach (LSsession :: $ldapServer["LSaccess"] as $LSobject) { if (!LSsession :: loadLSobject($LSobject)) @@ -67,6 +72,8 @@ function LSaccessRightsMatrixView() { foreach(LSconfig :: get("LSobjects.$LSobject.attrs", array()) as $attr_name => $attr_config) { $raw_attr_rights = LSconfig :: get('rights', array(), 'array', $attr_config); $attr_rights = array(); + if ($LSobject == LSsession :: $ldapServer["authObjectType"]) + $attr_rights['self'] = LSconfig :: get('self', False, null, $raw_attr_rights); foreach(array_keys($LSprofiles) as $LSprofile) { $attr_rights[$LSprofile] = LSconfig :: get($LSprofile, False, null, $raw_attr_rights); } @@ -85,6 +92,9 @@ function LSaccessRightsMatrixView() { reset($LSobjects); $LSobject = (isset($_REQUEST['LSobject']) && array_key_exists($_REQUEST['LSobject'], $LSobjects)?$_REQUEST['LSobject']:key($LSobjects)); + if ($LSobject == LSsession :: $ldapServer["authObjectType"]) + $LSprofiles = array_merge(array('self' => _('The user him-self')), $LSprofiles); + LStemplate :: assign('pagetitle', _('Access rights matrix')); LStemplate :: assign('LSprofiles', $LSprofiles); LStemplate :: assign('LSobjects', $LSobjects); diff --git a/public_html/templates/default/LSaccessRightsMatrixView.tpl b/public_html/templates/default/LSaccessRightsMatrixView.tpl index f322c19a..1e97b488 100644 --- a/public_html/templates/default/LSaccessRightsMatrixView.tpl +++ b/public_html/templates/default/LSaccessRightsMatrixView.tpl @@ -13,8 +13,8 @@ - {foreach $LSprofiles as $name => $conf} - + {foreach $LSprofiles as $name => $label} + {/foreach}
{tr msg="Attributes / Profiles"}{$name}{$label}