From ce008188db8a355aa62ca80fae71519e9ac92439 Mon Sep 17 00:00:00 2001 From: Rodolphe Quiedeville Date: Thu, 29 Jul 2004 15:01:29 +0000 Subject: [PATCH] Nouveau fichier --- htdocs/admin/perms.php | 101 ++++++++++++++++++++++ htdocs/theme/rodolphe/img/edit_add.png | Bin 0 -> 423 bytes htdocs/theme/rodolphe/img/edit_remove.png | Bin 0 -> 239 bytes 3 files changed, 101 insertions(+) create mode 100644 htdocs/admin/perms.php create mode 100644 htdocs/theme/rodolphe/img/edit_add.png create mode 100644 htdocs/theme/rodolphe/img/edit_remove.png diff --git a/htdocs/admin/perms.php b/htdocs/admin/perms.php new file mode 100644 index 00000000000..419bd1e8db4 --- /dev/null +++ b/htdocs/admin/perms.php @@ -0,0 +1,101 @@ + + * + * 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., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. + * + * $Id$ + * $Source$ + */ +require("./pre.inc.php"); + +if (!$user->admin) + accessforbidden(); + +if ($_GET["action"] == 'add') +{ + $sql = "UPDATE ".MAIN_DB_PREFIX."rights_def SET bydefault=1 WHERE id =".$_GET["pid"]; + $db->query($sql); +} + +if ($_GET["action"] == 'remove') +{ + $sql = "UPDATE ".MAIN_DB_PREFIX."rights_def SET bydefault=0 WHERE id =".$_GET["pid"]; + $db->query($sql); +} + +llxHeader(); + +print_titre("Permissions par défaut"); + +print ''; + +# Affiche lignes des constantes + +$sql = "SELECT r.id, r.libelle, r.module, r.bydefault FROM ".MAIN_DB_PREFIX."rights_def as r"; +$sql .= " WHERE type <> 'a'"; +$sql .= " ORDER BY r.id ASC"; + +$result = $db->query($sql); +if ($result) +{ + $num = $db->num_rows(); + $i = 0; + $var=True; + $old = ""; + while ($i < $num) + { + $obj = $db->fetch_object( $i); + $var=!$var; + + if ($old <> $obj->module) + { + print ''; + print ''; + print ''; + print ''; + print ''; + print "\n"; + $old = $obj->module; + } + + print ''; + print ''; + $i++; + } +} + +print '
'.$langs->trans("Permission").''.$langs->trans("Module").''.$langs->trans("Défaut").' 
'.$obj->libelle . ''.$obj->module . ''; + if ($obj->bydefault == 1) + { + + print ''; + print ''; + print ''; + print 'Enlever'; + } + else + { + print ' '; + print ''; + print ''; + print 'Ajouter'; + } + + print '
'; + +$db->close(); + +llxFooter(); +?> diff --git a/htdocs/theme/rodolphe/img/edit_add.png b/htdocs/theme/rodolphe/img/edit_add.png new file mode 100644 index 0000000000000000000000000000000000000000..19c76cf0474de621ef50d14219bc77d6081a6900 GIT binary patch literal 423 zcmeAS@N?(olHy`uVBq!ia0vp^0wB!61|;P_|4#%`Y)RhkE)4%caKYZ?lYt_f1s;*b zK-vS0-A-oPF)%P{dAc};RNOineAX;ZYtBQjzvq)u6?V_uw#$K{nLBv z6&mcOUAa{K|HP`OXO;Kzopr0Bqm0ga7~l literal 0 HcmV?d00001 diff --git a/htdocs/theme/rodolphe/img/edit_remove.png b/htdocs/theme/rodolphe/img/edit_remove.png new file mode 100644 index 0000000000000000000000000000000000000000..30aa655c8e7fec253662d1298c1a09db5b8a55a4 GIT binary patch literal 239 zcmeAS@N?(olHy`uVBq!ia0vp^0wB!61|;P_|4#%`Y)RhkE)4%caKYZ?lYt_f1s;*b zK-vS0-A-oP0U1S}E{-7;w~`YiSef}HBqbyyA|oOyfYeOS%fJ4=pKo8kZ-a-22b+fG z>S@M?hJ{8327lDAJ*xlzuXca=_cC>EV`FY}ZSBW6 z(*Q_Mc+&X)|NlR~zP{$|ZLSazU}c!aCd1CVG(8e%yI_fHL`iUdT1k0gQ7S`leoAHm V5Knn5egP=S;OXk;vd$@?2>`x6PLBWp literal 0 HcmV?d00001