From 6eedf8913262bcff9248759b813fb4ce1636fa51 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Mon, 9 Jan 2006 20:19:19 +0000 Subject: [PATCH] New: Permet export des utilisateurs Dolibarr --- htdocs/exports/export.class.php | 1 + htdocs/exports/index.php | 2 +- htdocs/includes/modules/modUser.class.php | 21 +++++++++++++++++++++ 3 files changed, 23 insertions(+), 1 deletion(-) diff --git a/htdocs/exports/export.class.php b/htdocs/exports/export.class.php index 0e8aac583b9..44295a77c48 100644 --- a/htdocs/exports/export.class.php +++ b/htdocs/exports/export.class.php @@ -96,6 +96,7 @@ class Export { $bool=$user->rights->$perm[0]->$perm[1]; } + if ($perm[0]=='user' && $user->admin) $bool=true; //print("$bool
"); // Permissions ok diff --git a/htdocs/exports/index.php b/htdocs/exports/index.php index a8af82e1873..d755d7cc01c 100644 --- a/htdocs/exports/index.php +++ b/htdocs/exports/index.php @@ -79,7 +79,7 @@ print ''; // Affiche les modules d'exports print ''; print ''; -print ''; +print ''; print ''; print ''; print ''; diff --git a/htdocs/includes/modules/modUser.class.php b/htdocs/includes/modules/modUser.class.php index 7994772e3e1..a30527fb327 100644 --- a/htdocs/includes/modules/modUser.class.php +++ b/htdocs/includes/modules/modUser.class.php @@ -1,5 +1,6 @@ + * Copyright (C) 2005 Laurent Destailleur * * 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 @@ -127,6 +128,26 @@ class modUser extends DolibarrModules $this->rights[$r][3] = 1; $this->rights[$r][4] = 'self'; $this->rights[$r][5] = 'password'; + + $r++; + $this->rights[$r][0] = 258; + $this->rights[$r][1] = 'Exporter les utilisateurs'; + $this->rights[$r][2] = 'r'; + $this->rights[$r][3] = 0; + $this->rights[$r][4] = 'user'; + $this->rights[$r][5] = 'export'; + + // Exports + //-------- + $r=0; + + $r++; + $this->export_code[$r]=$this->numero.'_'.$r; + $this->export_label[$r]='Liste des utilisateurs Dolibarr et attributs'; + $this->export_fields_array[$r]=array('u.rowid'=>"Id",'u.name'=>"Lastname",'u.firstname'=>"Firstname",'u.code'=>"Code",'u.login'=>"Login",'u.datec'=>"DateCreation",'u.tms'=>"DateLastModification",'u.admin'=>"Admin",'u.fk_socpeople'=>"IdContact",'u.note'=>"Note",'u.datelastaccess'=>'DateLastAccess'); + $this->export_sql[$r]="select ".join(',',array_keys($this->export_fields_array[$r])).' from '.MAIN_DB_PREFIX.'user as u'; + $this->export_permission[$r]=array(array("user","user","export")); + }
'.$langs->trans("Module").''.$langs->trans("Module").''.$langs->trans("ExportableDatas").'