* Copyright (C) 2004-2011 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, see . */ /** * \file htdocs/admin/system/constall.php * \brief Page to show all Dolibarr setup (config file and database constants) * \version $Id: constall.php,v 1.24 2011/07/31 22:23:14 eldy Exp $ */ 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").' ('.$conffiletoshowshort.')'); // Parameters in conf.php file $configfileparameters=array( // 'separator', 'dolibarr_main_url_root', 'dolibarr_main_url_root_alt', 'dolibarr_main_document_root', 'dolibarr_main_document_root_alt', '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("URLRoot").' (alt)', $langs->trans("DocumentRootServer"), $langs->trans("DocumentRootServer").' (alt)', $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) { $ignore=0; if ($key == 'dolibarr_main_url_root_alt' && empty(${$key})) $ignore=1; if ($key == 'dolibarr_main_document_root_alt' && empty(${$key})) $ignore=1; if (empty($ignore)) { $var=!$var; print ""; if ($key == 'separator') { print ''; } else { // Label print "'; // Key print ''; // Value 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 if ($key == 'dolibarr_main_url_root' && preg_match('/__auto__/',${$key})) print ${$key}.' => '.constant('DOL_MAIN_URL_ROOT'); else if ($key == 'dolibarr_main_url_root_alt' && preg_match('/__auto__/',${$key})) print ${$key}.' => '.constant('DOL_MAIN_URL_ROOT_ALT'); else print ${$key}; 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(); ?>