|
|
|
|
@ -1,24 +1,24 @@
|
|
|
|
|
<?php
|
|
|
|
|
/* Copyright (C) 2002-2005 Rodolphe Quiedeville <rodolphe@quiedeville.org>
|
|
|
|
|
* Copyright (C) 2002-2003 Jean-Louis Bergamo <jlb@j1b.org>
|
|
|
|
|
* Copyright (C) 2004-2012 Laurent Destailleur <eldy@users.sourceforge.net>
|
|
|
|
|
* Copyright (C) 2004 Eric Seigne <eric.seigne@ryxeo.com>
|
|
|
|
|
* Copyright (C) 2005-2012 Regis Houssin <regis.houssin@capnetworks.com>
|
|
|
|
|
* Copyright (C) 2012 Juanjo Menent <jmenent@2byte.es>
|
|
|
|
|
*
|
|
|
|
|
* 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/>.
|
|
|
|
|
*/
|
|
|
|
|
* Copyright (C) 2004-2012 Laurent Destailleur <eldy@users.sourceforge.net>
|
|
|
|
|
* Copyright (C) 2004 Eric Seigne <eric.seigne@ryxeo.com>
|
|
|
|
|
* Copyright (C) 2005-2012 Regis Houssin <regis.houssin@capnetworks.com>
|
|
|
|
|
* Copyright (C) 2012 Juanjo Menent <jmenent@2byte.es>
|
|
|
|
|
*
|
|
|
|
|
* 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/user/perms.php
|
|
|
|
|
@ -74,10 +74,10 @@ if ($user->id <> $id && ! $canreaduser) accessforbidden();
|
|
|
|
|
|
|
|
|
|
if ($action == 'addrights' && $caneditperms)
|
|
|
|
|
{
|
|
|
|
|
$edituser = new User($db);
|
|
|
|
|
$edituser = new User($db);
|
|
|
|
|
$edituser->fetch($id);
|
|
|
|
|
//$edituser->addrights($rights, $module, '', $entity); // TODO unused for the moment
|
|
|
|
|
$edituser->addrights($rights, $module);
|
|
|
|
|
//$edituser->addrights($rights, $module, '', $entity); // TODO unused for the moment
|
|
|
|
|
$edituser->addrights($rights, $module);
|
|
|
|
|
|
|
|
|
|
// Si on a touche a ses propres droits, on recharge
|
|
|
|
|
if ($id == $user->id)
|
|
|
|
|
@ -90,10 +90,10 @@ if ($action == 'addrights' && $caneditperms)
|
|
|
|
|
|
|
|
|
|
if ($action == 'delrights' && $caneditperms)
|
|
|
|
|
{
|
|
|
|
|
$edituser = new User($db);
|
|
|
|
|
$edituser = new User($db);
|
|
|
|
|
$edituser->fetch($id);
|
|
|
|
|
//$edituser->delrights($rights, $module, '', $entity); // TODO unused for the moment
|
|
|
|
|
$edituser->delrights($rights, $module);
|
|
|
|
|
//$edituser->delrights($rights, $module, '', $entity); // TODO unused for the moment
|
|
|
|
|
$edituser->delrights($rights, $module);
|
|
|
|
|
|
|
|
|
|
// Si on a touche a ses propres droits, on recharge
|
|
|
|
|
if ($id == $user->id)
|
|
|
|
|
@ -133,39 +133,39 @@ $modulesdir = dolGetModulesDirs();
|
|
|
|
|
foreach($modulesdir as $dir)
|
|
|
|
|
{
|
|
|
|
|
$handle=@opendir(dol_osencode($dir));
|
|
|
|
|
if (is_resource($handle))
|
|
|
|
|
{
|
|
|
|
|
while (($file = readdir($handle))!==false)
|
|
|
|
|
{
|
|
|
|
|
if (is_readable($dir.$file) && substr($file, 0, 3) == 'mod' && substr($file, dol_strlen($file) - 10) == '.class.php')
|
|
|
|
|
{
|
|
|
|
|
$modName = substr($file, 0, dol_strlen($file) - 10);
|
|
|
|
|
if (is_resource($handle))
|
|
|
|
|
{
|
|
|
|
|
while (($file = readdir($handle))!==false)
|
|
|
|
|
{
|
|
|
|
|
if (is_readable($dir.$file) && substr($file, 0, 3) == 'mod' && substr($file, dol_strlen($file) - 10) == '.class.php')
|
|
|
|
|
{
|
|
|
|
|
$modName = substr($file, 0, dol_strlen($file) - 10);
|
|
|
|
|
|
|
|
|
|
if ($modName)
|
|
|
|
|
{
|
|
|
|
|
include_once $dir.$file;
|
|
|
|
|
$objMod = new $modName($db);
|
|
|
|
|
if ($modName)
|
|
|
|
|
{
|
|
|
|
|
include_once $dir.$file;
|
|
|
|
|
$objMod = new $modName($db);
|
|
|
|
|
|
|
|
|
|
// Load all lang files of module
|
|
|
|
|
if (isset($objMod->langfiles) && is_array($objMod->langfiles))
|
|
|
|
|
{
|
|
|
|
|
foreach($objMod->langfiles as $domain)
|
|
|
|
|
{
|
|
|
|
|
$langs->load($domain);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
// Load all permissions
|
|
|
|
|
if ($objMod->rights_class)
|
|
|
|
|
{
|
|
|
|
|
$forceEntity=((! empty($conf->multicompany->enabled) && ! empty($fuser->entity)) ? $fuser->entity : null);
|
|
|
|
|
$ret=$objMod->insert_permissions(0, $forceEntity);
|
|
|
|
|
$modules[$objMod->rights_class]=$objMod;
|
|
|
|
|
//print "modules[".$objMod->rights_class."]=$objMod;";
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
// Load all lang files of module
|
|
|
|
|
if (isset($objMod->langfiles) && is_array($objMod->langfiles))
|
|
|
|
|
{
|
|
|
|
|
foreach($objMod->langfiles as $domain)
|
|
|
|
|
{
|
|
|
|
|
$langs->load($domain);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
// Load all permissions
|
|
|
|
|
if ($objMod->rights_class)
|
|
|
|
|
{
|
|
|
|
|
$forceEntity=((! empty($conf->multicompany->enabled) && ! empty($fuser->entity)) ? $fuser->entity : null);
|
|
|
|
|
$ret=$objMod->insert_permissions(0, $forceEntity);
|
|
|
|
|
$modules[$objMod->rights_class]=$objMod;
|
|
|
|
|
//print "modules[".$objMod->rights_class."]=$objMod;";
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
$db->commit();
|
|
|
|
|
@ -195,19 +195,19 @@ dol_syslog("get user perms", LOG_DEBUG);
|
|
|
|
|
$result=$db->query($sql);
|
|
|
|
|
if ($result)
|
|
|
|
|
{
|
|
|
|
|
$num = $db->num_rows($result);
|
|
|
|
|
$i = 0;
|
|
|
|
|
while ($i < $num)
|
|
|
|
|
{
|
|
|
|
|
$obj = $db->fetch_object($result);
|
|
|
|
|
array_push($permsuser,$obj->id);
|
|
|
|
|
$i++;
|
|
|
|
|
}
|
|
|
|
|
$db->free($result);
|
|
|
|
|
$num = $db->num_rows($result);
|
|
|
|
|
$i = 0;
|
|
|
|
|
while ($i < $num)
|
|
|
|
|
{
|
|
|
|
|
$obj = $db->fetch_object($result);
|
|
|
|
|
array_push($permsuser,$obj->id);
|
|
|
|
|
$i++;
|
|
|
|
|
}
|
|
|
|
|
$db->free($result);
|
|
|
|
|
}
|
|
|
|
|
else
|
|
|
|
|
{
|
|
|
|
|
dol_print_error($db);
|
|
|
|
|
dol_print_error($db);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// Lecture des droits groupes
|
|
|
|
|
@ -231,27 +231,27 @@ dol_syslog("get user perms", LOG_DEBUG);
|
|
|
|
|
$result=$db->query($sql);
|
|
|
|
|
if ($result)
|
|
|
|
|
{
|
|
|
|
|
$num = $db->num_rows($result);
|
|
|
|
|
$i = 0;
|
|
|
|
|
while ($i < $num)
|
|
|
|
|
{
|
|
|
|
|
$obj = $db->fetch_object($result);
|
|
|
|
|
if (! isset($permsgroupbyentity[$obj->entity]))
|
|
|
|
|
$permsgroupbyentity[$obj->entity] = array();
|
|
|
|
|
array_push($permsgroupbyentity[$obj->entity], $obj->id);
|
|
|
|
|
$i++;
|
|
|
|
|
}
|
|
|
|
|
$db->free($result);
|
|
|
|
|
$num = $db->num_rows($result);
|
|
|
|
|
$i = 0;
|
|
|
|
|
while ($i < $num)
|
|
|
|
|
{
|
|
|
|
|
$obj = $db->fetch_object($result);
|
|
|
|
|
if (! isset($permsgroupbyentity[$obj->entity]))
|
|
|
|
|
$permsgroupbyentity[$obj->entity] = array();
|
|
|
|
|
array_push($permsgroupbyentity[$obj->entity], $obj->id);
|
|
|
|
|
$i++;
|
|
|
|
|
}
|
|
|
|
|
$db->free($result);
|
|
|
|
|
}
|
|
|
|
|
else
|
|
|
|
|
{
|
|
|
|
|
dol_print_error($db);
|
|
|
|
|
dol_print_error($db);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/*
|
|
|
|
|
* Ecran ajout/suppression permission
|
|
|
|
|
*/
|
|
|
|
|
*/
|
|
|
|
|
|
|
|
|
|
print '<table class="border" width="100%">';
|
|
|
|
|
|
|
|
|
|
@ -274,9 +274,9 @@ print '</tr>'."\n";
|
|
|
|
|
|
|
|
|
|
print '</table><br>';
|
|
|
|
|
|
|
|
|
|
if ($user->admin) print info_admin($langs->trans("WarningOnlyPermissionOfActivatedModules"), 0, 1).'<br>';
|
|
|
|
|
if ($user->admin) print info_admin($langs->trans("WarningOnlyPermissionOfActivatedModules"));
|
|
|
|
|
// Show warning about external users
|
|
|
|
|
if (empty($user->societe_id)) print info_admin(showModulesExludedForExternal($modules)).'<br><br>'."\n";
|
|
|
|
|
if (empty($user->societe_id)) print info_admin(showModulesExludedForExternal($modules))."\n";
|
|
|
|
|
|
|
|
|
|
// For multicompany transversal mode
|
|
|
|
|
// TODO Place a hook here
|
|
|
|
|
@ -310,115 +310,115 @@ $sql.= " ORDER BY r.module, r.id";
|
|
|
|
|
$result=$db->query($sql);
|
|
|
|
|
if ($result)
|
|
|
|
|
{
|
|
|
|
|
$num = $db->num_rows($result);
|
|
|
|
|
$i = 0;
|
|
|
|
|
$var = True;
|
|
|
|
|
$oldmod='';
|
|
|
|
|
$num = $db->num_rows($result);
|
|
|
|
|
$i = 0;
|
|
|
|
|
$var = True;
|
|
|
|
|
$oldmod='';
|
|
|
|
|
|
|
|
|
|
while ($i < $num)
|
|
|
|
|
{
|
|
|
|
|
$obj = $db->fetch_object($result);
|
|
|
|
|
while ($i < $num)
|
|
|
|
|
{
|
|
|
|
|
$obj = $db->fetch_object($result);
|
|
|
|
|
|
|
|
|
|
// Si la ligne correspond a un module qui n'existe plus (absent de includes/module), on l'ignore
|
|
|
|
|
if (empty($modules[$obj->module]))
|
|
|
|
|
{
|
|
|
|
|
$i++;
|
|
|
|
|
continue;
|
|
|
|
|
}
|
|
|
|
|
// Si la ligne correspond a un module qui n'existe plus (absent de includes/module), on l'ignore
|
|
|
|
|
if (empty($modules[$obj->module]))
|
|
|
|
|
{
|
|
|
|
|
$i++;
|
|
|
|
|
continue;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if (isset($obj->module) && ($oldmod <> $obj->module))
|
|
|
|
|
{
|
|
|
|
|
$oldmod = $obj->module;
|
|
|
|
|
$var = !$var;
|
|
|
|
|
if (isset($obj->module) && ($oldmod <> $obj->module))
|
|
|
|
|
{
|
|
|
|
|
$oldmod = $obj->module;
|
|
|
|
|
$var = !$var;
|
|
|
|
|
|
|
|
|
|
// Rupture detectee, on recupere objMod
|
|
|
|
|
$objMod=$modules[$obj->module];
|
|
|
|
|
$picto=($objMod->picto?$objMod->picto:'generic');
|
|
|
|
|
// Rupture detectee, on recupere objMod
|
|
|
|
|
$objMod=$modules[$obj->module];
|
|
|
|
|
$picto=($objMod->picto?$objMod->picto:'generic');
|
|
|
|
|
|
|
|
|
|
if ($caneditperms && (empty($objMod->rights_admin_allowed) || empty($fuser->admin)))
|
|
|
|
|
{
|
|
|
|
|
// On affiche ligne pour modifier droits
|
|
|
|
|
print '<tr '. $bc[$var].'>';
|
|
|
|
|
print '<td class="nowrap">'.img_object('',$picto).' '.$objMod->getName();
|
|
|
|
|
print '<a name="'.$objMod->getName().'"> </a></td>';
|
|
|
|
|
print '<td align="center" class="nowrap">';
|
|
|
|
|
print '<a title="'.dol_escape_htmltag($langs->trans("All")).'" alt="'.dol_escape_htmltag($langs->trans("All")).'" href="perms.php?id='.$fuser->id.'&action=addrights&entity='.$entity.'&module='.$obj->module.'#'.$objMod->getName().'">'.$langs->trans("All")."</a>";
|
|
|
|
|
print '/';
|
|
|
|
|
print '<a title="'.dol_escape_htmltag($langs->trans("None")).'" alt="'.dol_escape_htmltag($langs->trans("None")).'" href="perms.php?id='.$fuser->id.'&action=delrights&entity='.$entity.'&module='.$obj->module.'#'.$objMod->getName().'">'.$langs->trans("None")."</a>";
|
|
|
|
|
print '</td>';
|
|
|
|
|
print '<td colspan="2"> </td>';
|
|
|
|
|
print '</tr>'."\n";
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
if ($caneditperms && (empty($objMod->rights_admin_allowed) || empty($fuser->admin)))
|
|
|
|
|
{
|
|
|
|
|
// On affiche ligne pour modifier droits
|
|
|
|
|
print '<tr '. $bc[$var].'>';
|
|
|
|
|
print '<td class="nowrap">'.img_object('',$picto).' '.$objMod->getName();
|
|
|
|
|
print '<a name="'.$objMod->getName().'"> </a></td>';
|
|
|
|
|
print '<td align="center" class="nowrap">';
|
|
|
|
|
print '<a title="'.dol_escape_htmltag($langs->trans("All")).'" alt="'.dol_escape_htmltag($langs->trans("All")).'" href="perms.php?id='.$fuser->id.'&action=addrights&entity='.$entity.'&module='.$obj->module.'#'.$objMod->getName().'">'.$langs->trans("All")."</a>";
|
|
|
|
|
print '/';
|
|
|
|
|
print '<a title="'.dol_escape_htmltag($langs->trans("None")).'" alt="'.dol_escape_htmltag($langs->trans("None")).'" href="perms.php?id='.$fuser->id.'&action=delrights&entity='.$entity.'&module='.$obj->module.'#'.$objMod->getName().'">'.$langs->trans("None")."</a>";
|
|
|
|
|
print '</td>';
|
|
|
|
|
print '<td colspan="2"> </td>';
|
|
|
|
|
print '</tr>'."\n";
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
print '<tr '. $bc[$var].'>';
|
|
|
|
|
print '<tr '. $bc[$var].'>';
|
|
|
|
|
|
|
|
|
|
// Picto and label of permission
|
|
|
|
|
print '<td>'.img_object('',$picto).' '.$objMod->getName().'</td>';
|
|
|
|
|
// Picto and label of permission
|
|
|
|
|
print '<td>'.img_object('',$picto).' '.$objMod->getName().'</td>';
|
|
|
|
|
|
|
|
|
|
// Permission and tick
|
|
|
|
|
if (! empty($fuser->admin) && ! empty($objMod->rights_admin_allowed)) // Permission own because admin
|
|
|
|
|
{
|
|
|
|
|
if ($caneditperms)
|
|
|
|
|
{
|
|
|
|
|
print '<td align="center">'.img_picto($langs->trans("Administrator"),'star').'</td>';
|
|
|
|
|
}
|
|
|
|
|
print '<td align="center" class="nowrap">';
|
|
|
|
|
print img_picto($langs->trans("Active"),'tick');
|
|
|
|
|
print '</td>';
|
|
|
|
|
}
|
|
|
|
|
else if (in_array($obj->id, $permsuser)) // Permission own by user
|
|
|
|
|
{
|
|
|
|
|
if ($caneditperms)
|
|
|
|
|
{
|
|
|
|
|
print '<td align="center"><a href="perms.php?id='.$fuser->id.'&action=delrights&rights='.$obj->id.'#'.$objMod->getName().'">'.img_edit_remove($langs->trans("Remove")).'</a></td>';
|
|
|
|
|
}
|
|
|
|
|
print '<td align="center" class="nowrap">';
|
|
|
|
|
print img_picto($langs->trans("Active"),'tick');
|
|
|
|
|
print '</td>';
|
|
|
|
|
}
|
|
|
|
|
// Permission and tick
|
|
|
|
|
if (! empty($fuser->admin) && ! empty($objMod->rights_admin_allowed)) // Permission own because admin
|
|
|
|
|
{
|
|
|
|
|
if ($caneditperms)
|
|
|
|
|
{
|
|
|
|
|
print '<td align="center">'.img_picto($langs->trans("Administrator"),'star').'</td>';
|
|
|
|
|
}
|
|
|
|
|
print '<td align="center" class="nowrap">';
|
|
|
|
|
print img_picto($langs->trans("Active"),'tick');
|
|
|
|
|
print '</td>';
|
|
|
|
|
}
|
|
|
|
|
else if (in_array($obj->id, $permsuser)) // Permission own by user
|
|
|
|
|
{
|
|
|
|
|
if ($caneditperms)
|
|
|
|
|
{
|
|
|
|
|
print '<td align="center"><a href="perms.php?id='.$fuser->id.'&action=delrights&rights='.$obj->id.'#'.$objMod->getName().'">'.img_edit_remove($langs->trans("Remove")).'</a></td>';
|
|
|
|
|
}
|
|
|
|
|
print '<td align="center" class="nowrap">';
|
|
|
|
|
print img_picto($langs->trans("Active"),'tick');
|
|
|
|
|
print '</td>';
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
else if (is_array($permsgroupbyentity[$entity]))
|
|
|
|
|
{
|
|
|
|
|
if (in_array($obj->id, $permsgroupbyentity[$entity])) // Permission own by group
|
|
|
|
|
{
|
|
|
|
|
if ($caneditperms)
|
|
|
|
|
{
|
|
|
|
|
print '<td align="center">';
|
|
|
|
|
print $form->textwithtooltip($langs->trans("Inherited"),$langs->trans("PermissionInheritedFromAGroup"));
|
|
|
|
|
print '</td>';
|
|
|
|
|
}
|
|
|
|
|
print '<td align="center" class="nowrap">';
|
|
|
|
|
print img_picto($langs->trans("Active"),'tick');
|
|
|
|
|
print '</td>';
|
|
|
|
|
}
|
|
|
|
|
else
|
|
|
|
|
{
|
|
|
|
|
// Do not own permission
|
|
|
|
|
if ($caneditperms)
|
|
|
|
|
{
|
|
|
|
|
print '<td align="center"><a href="perms.php?id='.$fuser->id.'&action=addrights&entity='.$entity.'&rights='.$obj->id.'#'.$objMod->getName().'">'.img_edit_add($langs->trans("Add")).'</a></td>';
|
|
|
|
|
}
|
|
|
|
|
print '<td> </td>';
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
else
|
|
|
|
|
{
|
|
|
|
|
// Do not own permission
|
|
|
|
|
if ($caneditperms)
|
|
|
|
|
{
|
|
|
|
|
print '<td align="center"><a href="perms.php?id='.$fuser->id.'&action=addrights&entity='.$entity.'&rights='.$obj->id.'#'.$objMod->getName().'">'.img_edit_add($langs->trans("Add")).'</a></td>';
|
|
|
|
|
}
|
|
|
|
|
print '<td> </td>';
|
|
|
|
|
}
|
|
|
|
|
else if (is_array($permsgroupbyentity[$entity]))
|
|
|
|
|
{
|
|
|
|
|
if (in_array($obj->id, $permsgroupbyentity[$entity])) // Permission own by group
|
|
|
|
|
{
|
|
|
|
|
if ($caneditperms)
|
|
|
|
|
{
|
|
|
|
|
print '<td align="center">';
|
|
|
|
|
print $form->textwithtooltip($langs->trans("Inherited"),$langs->trans("PermissionInheritedFromAGroup"));
|
|
|
|
|
print '</td>';
|
|
|
|
|
}
|
|
|
|
|
print '<td align="center" class="nowrap">';
|
|
|
|
|
print img_picto($langs->trans("Active"),'tick');
|
|
|
|
|
print '</td>';
|
|
|
|
|
}
|
|
|
|
|
else
|
|
|
|
|
{
|
|
|
|
|
// Do not own permission
|
|
|
|
|
if ($caneditperms)
|
|
|
|
|
{
|
|
|
|
|
print '<td align="center"><a href="perms.php?id='.$fuser->id.'&action=addrights&entity='.$entity.'&rights='.$obj->id.'#'.$objMod->getName().'">'.img_edit_add($langs->trans("Add")).'</a></td>';
|
|
|
|
|
}
|
|
|
|
|
print '<td> </td>';
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
else
|
|
|
|
|
{
|
|
|
|
|
// Do not own permission
|
|
|
|
|
if ($caneditperms)
|
|
|
|
|
{
|
|
|
|
|
print '<td align="center"><a href="perms.php?id='.$fuser->id.'&action=addrights&entity='.$entity.'&rights='.$obj->id.'#'.$objMod->getName().'">'.img_edit_add($langs->trans("Add")).'</a></td>';
|
|
|
|
|
}
|
|
|
|
|
print '<td> </td>';
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
$perm_libelle=($conf->global->MAIN_USE_ADVANCED_PERMS && ($langs->trans("PermissionAdvanced".$obj->id)!=("PermissionAdvanced".$obj->id))?$langs->trans("PermissionAdvanced".$obj->id):(($langs->trans("Permission".$obj->id)!=("Permission".$obj->id))?$langs->trans("Permission".$obj->id):$obj->libelle));
|
|
|
|
|
print '<td>'.$perm_libelle. '</td>';
|
|
|
|
|
$perm_libelle=($conf->global->MAIN_USE_ADVANCED_PERMS && ($langs->trans("PermissionAdvanced".$obj->id)!=("PermissionAdvanced".$obj->id))?$langs->trans("PermissionAdvanced".$obj->id):(($langs->trans("Permission".$obj->id)!=("Permission".$obj->id))?$langs->trans("Permission".$obj->id):$obj->libelle));
|
|
|
|
|
print '<td>'.$perm_libelle. '</td>';
|
|
|
|
|
|
|
|
|
|
print '</tr>'."\n";
|
|
|
|
|
print '</tr>'."\n";
|
|
|
|
|
|
|
|
|
|
$i++;
|
|
|
|
|
}
|
|
|
|
|
$i++;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
else dol_print_error($db);
|
|
|
|
|
print '</table>';
|
|
|
|
|
|