diff --git a/public_html/includes/addons/LSaddons.LSaccessRightsMatrixView.php b/public_html/includes/addons/LSaddons.LSaccessRightsMatrixView.php index 8111b175..d86fb08f 100644 --- a/public_html/includes/addons/LSaddons.LSaccessRightsMatrixView.php +++ b/public_html/includes/addons/LSaddons.LSaccessRightsMatrixView.php @@ -68,6 +68,8 @@ function LSaccessRightsMatrixView() { foreach (LSsession :: $ldapServer["LSaccess"] as $LSobject) { if (!LSsession :: loadLSobject($LSobject)) continue; + + // List attributes and rigths on their $attrs = array(); foreach(LSconfig :: get("LSobjects.$LSobject.attrs", array()) as $attr_name => $attr_config) { $raw_attr_rights = LSconfig :: get('rights', array(), 'array', $attr_config); @@ -82,9 +84,27 @@ function LSaccessRightsMatrixView() { 'rights' => $attr_rights, ); } + + // List relations and rigths on their + $relations = array(); + foreach(LSconfig :: get("LSobjects.$LSobject.LSrelation", array()) as $relation_name => $relation_config) { + $raw_relation_rights = LSconfig :: get('rights', array(), 'array', $relation_config); + $relation_rights = array(); + if ($LSobject == LSsession :: $ldapServer["authObjectType"]) + $relation_rights['self'] = LSconfig :: get('self', False, null, $raw_relation_rights); + foreach(array_keys($LSprofiles) as $LSprofile) { + $relation_rights[$LSprofile] = LSconfig :: get($LSprofile, False, null, $raw_relation_rights); + } + $relations[$relation_name] = array ( + 'label' => __(LSconfig :: get('label', $relation_name, 'string', $relation_config)), + 'rights' => $relation_rights, + ); + } + $LSobjects[$LSobject] = array ( 'label' => __(LSconfig :: get("LSobjects.$LSobject.label", $LSobject, 'string')), 'attrs' => $attrs, + 'relations' => $relations, ); } @@ -95,6 +115,8 @@ function LSaccessRightsMatrixView() { if ($LSobject == LSsession :: $ldapServer["authObjectType"]) $LSprofiles = array_merge(array('self' => _('The user him-self')), $LSprofiles); + LSdebug($LSobjects); + LStemplate :: assign('pagetitle', _('Access rights matrix')); LStemplate :: assign('LSprofiles', $LSprofiles); LStemplate :: assign('LSobjects', $LSobjects); diff --git a/public_html/lang/fr_FR.UTF8/LC_MESSAGES/ldapsaisie.mo b/public_html/lang/fr_FR.UTF8/LC_MESSAGES/ldapsaisie.mo index 0df0c30b..f4440e84 100644 Binary files a/public_html/lang/fr_FR.UTF8/LC_MESSAGES/ldapsaisie.mo and b/public_html/lang/fr_FR.UTF8/LC_MESSAGES/ldapsaisie.mo differ diff --git a/public_html/lang/fr_FR.UTF8/LC_MESSAGES/ldapsaisie.po b/public_html/lang/fr_FR.UTF8/LC_MESSAGES/ldapsaisie.po index 50a40364..9f0b65c9 100644 --- a/public_html/lang/fr_FR.UTF8/LC_MESSAGES/ldapsaisie.po +++ b/public_html/lang/fr_FR.UTF8/LC_MESSAGES/ldapsaisie.po @@ -8,7 +8,7 @@ msgstr "" "Project-Id-Version: LdapSaisie\n" "Report-Msgid-Bugs-To: \n" "POT-Creation-Date: \n" -"PO-Revision-Date: 2019-10-10 18:16+0200\n" +"PO-Revision-Date: 2019-10-14 12:33+0200\n" "Last-Translator: Benjamin Renard \n" "Language-Team: LdapSaisie \n" @@ -336,10 +336,18 @@ msgstr "" "défini." #: /home/brenard/dev/ldapsaisie_clean3/public_html/includes/addons/LSaddons.LSaccessRightsMatrixView.php:52 -#: /home/brenard/dev/ldapsaisie_clean3/public_html/includes/addons/LSaddons.LSaccessRightsMatrixView.php:88 +#: /home/brenard/dev/ldapsaisie_clean3/public_html/includes/addons/LSaddons.LSaccessRightsMatrixView.php:120 msgid "Access rights matrix" msgstr "Matrice des droits d'accès" +#: /home/brenard/dev/ldapsaisie_clean3/public_html/includes/addons/LSaddons.LSaccessRightsMatrixView.php:62 +msgid "All connected users" +msgstr "Tous les utilisateurs connectés" + +#: /home/brenard/dev/ldapsaisie_clean3/public_html/includes/addons/LSaddons.LSaccessRightsMatrixView.php:116 +msgid "The user him-self" +msgstr "L'utilisateur lui-même" + #: /home/brenard/dev/ldapsaisie_clean3/public_html/includes/addons/LSaddons.ftp.php:27 msgid "FTP Support : Pear::Net_FTP is missing." msgstr "Support FTP : Pear::Net_FTP n'est pas installé." @@ -2102,10 +2110,12 @@ msgid "Only validate data" msgstr "Validation des données uniquement" #: templates/default/LSaccessRightsMatrixView.tpl:27 +#: templates/default/LSaccessRightsMatrixView.tpl:54 msgid "Readable" msgstr "Lecture" #: templates/default/LSaccessRightsMatrixView.tpl:29 +#: templates/default/LSaccessRightsMatrixView.tpl:56 msgid "Readable / Writable" msgstr "Lecture / Écriture" @@ -2113,10 +2123,22 @@ msgstr "Lecture / Écriture" msgid "Refresh my access rights" msgstr "Rafraîchir mes droits d'accès" +#: templates/default/LSaccessRightsMatrixView.tpl:42 +msgid "Relations / Profiles" +msgstr "Relations / Profils" + #: templates/default/import.tpl:25 msgid "Result" msgstr "Résultat" +#: templates/default/LSaccessRightsMatrixView.tpl:38 +msgid "Their relations with other objects" +msgstr "Leurs relations avec les autres objets" + +#: templates/default/LSaccessRightsMatrixView.tpl:65 +msgid "This object type has no configured relation." +msgstr "Ce type d'objet n'a aucune relation de configurée." + #: templates/default/import.tpl:14 msgid "Update objects if exists" msgstr "Mise à jour des objets existants" diff --git a/public_html/lang/ldapsaisie.pot b/public_html/lang/ldapsaisie.pot index 1f6ca8d8..690dde13 100644 --- a/public_html/lang/ldapsaisie.pot +++ b/public_html/lang/ldapsaisie.pot @@ -280,10 +280,18 @@ msgid "Access Right Matrix Support : The global array %{array} is not defined." msgstr "" #: /home/brenard/dev/ldapsaisie_clean3/public_html/includes/addons/LSaddons.LSaccessRightsMatrixView.php:52 -#: /home/brenard/dev/ldapsaisie_clean3/public_html/includes/addons/LSaddons.LSaccessRightsMatrixView.php:88 +#: /home/brenard/dev/ldapsaisie_clean3/public_html/includes/addons/LSaddons.LSaccessRightsMatrixView.php:120 msgid "Access rights matrix" msgstr "" +#: /home/brenard/dev/ldapsaisie_clean3/public_html/includes/addons/LSaddons.LSaccessRightsMatrixView.php:62 +msgid "All connected users" +msgstr "" + +#: /home/brenard/dev/ldapsaisie_clean3/public_html/includes/addons/LSaddons.LSaccessRightsMatrixView.php:116 +msgid "The user him-self" +msgstr "" + #: /home/brenard/dev/ldapsaisie_clean3/public_html/includes/addons/LSaddons.ftp.php:27 msgid "FTP Support : Pear::Net_FTP is missing." msgstr "" @@ -1799,10 +1807,12 @@ msgid "Only validate data" msgstr "" #: templates/default/LSaccessRightsMatrixView.tpl:27 +#: templates/default/LSaccessRightsMatrixView.tpl:54 msgid "Readable" msgstr "" #: templates/default/LSaccessRightsMatrixView.tpl:29 +#: templates/default/LSaccessRightsMatrixView.tpl:56 msgid "Readable / Writable" msgstr "" @@ -1810,10 +1820,22 @@ msgstr "" msgid "Refresh my access rights" msgstr "" +#: templates/default/LSaccessRightsMatrixView.tpl:42 +msgid "Relations / Profiles" +msgstr "" + #: templates/default/import.tpl:25 msgid "Result" msgstr "" +#: templates/default/LSaccessRightsMatrixView.tpl:38 +msgid "Their relations with other objects" +msgstr "" + +#: templates/default/LSaccessRightsMatrixView.tpl:65 +msgid "This object type has no configured relation." +msgstr "" + #: templates/default/import.tpl:14 msgid "Update objects if exists" msgstr "" diff --git a/public_html/templates/default/LSaccessRightsMatrixView.tpl b/public_html/templates/default/LSaccessRightsMatrixView.tpl index fc19be6b..2a08ea30 100644 --- a/public_html/templates/default/LSaccessRightsMatrixView.tpl +++ b/public_html/templates/default/LSaccessRightsMatrixView.tpl @@ -34,6 +34,36 @@ {/foreach} + +

{tr msg="Their relations with other objects"}

+{if !empty($LSobjects[$LSobject]['relations'])} + + + + {foreach $LSprofiles as $name => $label} + + {/foreach} + + + {foreach $LSobjects[$LSobject]['relations'] as $name => $conf} + + + {foreach $LSprofiles as $profil => $profil_conf} + + {/foreach} + + {/foreach} + +
{tr msg="Relations / Profiles"}{$label} {if $name != $label}?{/if}
{$conf.label} ? + {if $conf.rights[$profil] == 'r'} + {tr msg="Readable"} + {elseif $conf.rights[$profil] == 'w'} + {tr msg="Readable / Writable"} + {/if} +
+{else} +

{tr msg="This object type has no configured relation."} +{/if} {include file='ls:bottom.tpl'}