* Copyright (C) 2004-2010 Laurent Destailleur * Copyright (C) 2009 Regis Houssin * * 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. */ /** * \file htdocs/admin/system/constall.php * \brief Page d'info de toutes les constantes * \version $Id$ */ require("../../main.inc.php"); $langs->load("admin"); $langs->load("user"); $langs->load("install"); if (!$user->admin) accessforbidden(); /* * View */ llxHeader(); print_fiche_titre($langs->trans("SummaryConst"),'','setup'); print_titre($langs->trans("ConfigurationFile")); // Parameters in conf.php file $configfileparameters=array( // 'separator', 'dolibarr_main_url_root', 'dolibarr_main_document_root', 'dolibarr_main_data_root', 'separator', 'dolibarr_main_db_host', 'dolibarr_main_db_port', 'dolibarr_main_db_name', 'dolibarr_main_db_type', 'dolibarr_main_db_user', 'dolibarr_main_db_pass', 'dolibarr_main_db_character_set', 'dolibarr_main_db_collation', 'separator', 'dolibarr_main_authentication', 'separator', 'dolibarr_main_auth_ldap_login_attribute', 'dolibarr_main_auth_ldap_host', 'dolibarr_main_auth_ldap_port', 'dolibarr_main_auth_ldap_version', 'dolibarr_main_auth_ldap_dn', 'dolibarr_main_auth_ldap_admin_login', 'dolibarr_main_auth_ldap_admin_pass', 'dolibarr_main_auth_ldap_debug' ); $configfilelib=array( // 'separator', $langs->trans("URLRoot"), $langs->trans("DocumentRootServer"), $langs->trans("DataRootServer"), 'separator', $langs->trans("DatabaseServer"), $langs->trans("DatabasePort"), $langs->trans("DatabaseName"), $langs->trans("DriverType"), $langs->trans("DatabaseUser"), $langs->trans("DatabasePassword"), $langs->trans("DBStoringCharset"), $langs->trans("DBSortingCharset"), 'separator', $langs->trans("AuthenticationMode"), 'separator', 'dolibarr_main_auth_ldap_login_attribute', 'dolibarr_main_auth_ldap_host', 'dolibarr_main_auth_ldap_port', 'dolibarr_main_auth_ldap_version', 'dolibarr_main_auth_ldap_dn', 'dolibarr_main_auth_ldap_admin_login', 'dolibarr_main_auth_ldap_admin_pass', 'dolibarr_main_auth_ldap_debug' ); $var=true; print ''; print ''; print ''; print ''; print ''."\n"; $i=0; foreach($configfileparameters as $key) { $var=!$var; print ""; if ($key == 'separator') { print ''; } else { print "'; print ""; } print "\n"; $i++; } print '
'.$langs->trans("Label").''.$langs->trans("Parameter").''.$langs->trans("Value").'
 ".$configfilelib[$i].''.$key.'"; if ($key == 'dolibarr_main_db_pass') print preg_replace('/./i','*',${$key}); else print ${$key}; // TODO Afficher charset effectif de base $db if ($key == 'dolibarr_main_db_charset') { } print "
'; print '
'; // Parameters in database print_titre($langs->trans("Database")); print ''; print ''; print ''; print ''; if (empty($conf->multicompany->enabled) || !$user->entity) print ''; // If superadmin or multicompany disabled print "\n"; $sql = "SELECT"; $sql.= " rowid"; $sql.= ", ".$db->decrypt('name')." as name"; $sql.= ", ".$db->decrypt('value')." as value"; $sql.= ", type"; $sql.= ", note"; $sql.= ", entity"; $sql.= " FROM ".MAIN_DB_PREFIX."const"; if (empty($conf->multicompany->enabled)) { // If no multicompany mode, admins can see global and their constantes $sql.= " WHERE entity IN (0,".$conf->entity.")"; } else { // If multicompany mode, superadmin (user->entity=0) can see everything, admin are limited to their entities. if ($user->entity) $sql.= " WHERE entity IN (".$user->entity.",".$conf->entity.")"; } $sql.= " ORDER BY entity, name ASC"; $resql = $db->query($sql); if ($resql) { $num = $db->num_rows($resql); $i = 0; $var=True; while ($i < $num) { $obj = $db->fetch_object($resql); $var=!$var; print ''; print ''."\n"; print ''."\n"; if (empty($conf->multicompany->enabled) || !$user->entity) print ''."\n"; // If superadmin or multicompany disabled print "\n"; $i++; } } print '
'.$langs->trans("Parameter").''.$langs->trans("Value").''.$langs->trans("Entity").'
'.$obj->name.''.$obj->value.''.$obj->entity.'
'; $db->close(); llxFooter(); ?>