diff --git a/htdocs/telephonie/config/perms.php b/htdocs/telephonie/config/perms.php new file mode 100644 index 00000000000..d1f2febea94 --- /dev/null +++ b/htdocs/telephonie/config/perms.php @@ -0,0 +1,117 @@ + + * + * 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$ + */ + +/** + \file htdocs/telephonie/config/xdsl.php + \ingroup telephonie + \brief Page configuration telephonie + \version $Revision$ +*/ + +require("./pre.inc.php"); +require_once(DOL_DOCUMENT_ROOT.'/fourn/fournisseur.class.php'); +require_once(DOL_DOCUMENT_ROOT.'/telephonie/adsl/fournisseurxdsl.class.php'); + +$langs->load("admin"); +$langs->load("suppliers"); +$langs->load("products"); + +if (!$user->admin) accessforbidden(); + +if ($_GET["action"] == "all") +{ + + $sql_d = "DELETE FROM ".MAIN_DB_PREFIX."societe_perms;"; + + if ($resql_d = $db->query( $sql_d) ) + { + $socs = array(); + + $sql_s = "SELECT rowid FROM ".MAIN_DB_PREFIX."societe;"; + + if ( $resql_s = $db->query( $sql_s) ) + { + while ($row_s = $db->fetch_row($resql_s)) + { + array_push($socs, $row_s[0]); + } + $db->free($resql); + } + + $sql = "SELECT rowid FROM ".MAIN_DB_PREFIX."user;"; + + if ( $resql = $db->query( $sql) ) + { + while ($row = $db->fetch_row($resql)) + { + $sql_i = "INSERT INTO ".MAIN_DB_PREFIX."societe_perms "; + $sql_i.= " (fk_soc,fk_user,pread,pwrite,pperms) "; + $sql_i.= " VALUES ($socs[0],$row[0],1,1,1) "; + + $resql_i = $db->query( $sql_i ); + + } + $db->free($resql); + } + } + + Header("Location: perms.php"); +} + +/* + * + * + * + */ +llxHeader('','Téléphonie - Configuration - Permissions'); + +$h=0; +$head[$h][0] = DOL_URL_ROOT."/telephonie/config/perms.php"; +$head[$h][1] = $langs->trans("Specials"); +$hselected = $h; +$h++; + +dolibarr_fiche_head($head, $hselected, "Definitions des permissions"); + +print_titre("Actions speciales"); + +print ''; + +print ''; +print ''; +print ''; +print "\n"; + + +$var=!$var; +print ""; +print ''; + + + +print '
Actions-
Toutes les permissions a tout le mondeAppliquer'; +print '
'; +print ''; + +$db->close(); + +llxFooter(); +?>