dolibarr /htdocs/admin/system/constall.php

Language PHP Lines 241
MD5 Hash d4376b082cdf77aa99c6846c84e44e85
Repository https://github.com/asterix14/dolibarr.git View Raw File
  1
  2
  3
  4
  5
  6
  7
  8
  9
 10
 11
 12
 13
 14
 15
 16
 17
 18
 19
 20
 21
 22
 23
 24
 25
 26
 27
 28
 29
 30
 31
 32
 33
 34
 35
 36
 37
 38
 39
 40
 41
 42
 43
 44
 45
 46
 47
 48
 49
 50
 51
 52
 53
 54
 55
 56
 57
 58
 59
 60
 61
 62
 63
 64
 65
 66
 67
 68
 69
 70
 71
 72
 73
 74
 75
 76
 77
 78
 79
 80
 81
 82
 83
 84
 85
 86
 87
 88
 89
 90
 91
 92
 93
 94
 95
 96
 97
 98
 99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
<?php
/* Copyright (C) 2003      Rodolphe Quiedeville <rodolphe@quiedeville.org>
 * Copyright (C) 2004-2011 Laurent Destailleur  <eldy@users.sourceforge.net>
 * Copyright (C) 2009      Regis Houssin        <regis@dolibarr.fr>
 *
 * 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 <http://www.gnu.org/licenses/>.
 */

/**
 *		\file 		htdocs/admin/system/constall.php
 *		\brief      Page to show all Dolibarr setup (config file and database constants)
 */

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',
                            'separator',
                            '?dolibarr_lib_ADODB_PATH',
                            '?dolibarr_lib_TCPDF_PATH',
                            '?dolibarr_lib_FPDFI_PATH',
                            '?dolibarr_lib_NUSOAP_PATH',
                            '?dolibarr_lib_PHPEXCEL_PATH',
                            '?dolibarr_lib_GEOIP_PATH',
							'?dolibarr_lib_ODTPHP_PATH',
                            '?dolibarr_lib_ODTPHP_PATHTOPCLZIP',
                            '?dolibarr_font_DOL_DEFAULT_TTF',
                            '?dolibarr_font_DOL_DEFAULT_TTF_BOLD'
						);
$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',
					'separator',
                    'dolibarr_lib_ADODB_PATH',
                    'dolibarr_lib_TCPDF_PATH',
                    'dolibarr_lib_FPDFI_PATH',
                    'dolibarr_lib_NUSOAP_PATH',
                    'dolibarr_lib_PHPEXCEL_PATH',
                    'dolibarr_lib_GEOIP_PATH',
					'dolibarr_lib_ODTPHP_PATH',
                    'dolibarr_lib_ODTPHP_PATHTOPCLZIP',
                    'dolibarr_font_DOL_DEFAULT_TTF',
                    'dolibarr_font_DOL_DEFAULT_TTF_BOLD'
					);
$var=true;
print '<table class="noborder" width="100%">';
print '<tr class="liste_titre"><td width="280">'.$langs->trans("Label").'</td>';
print '<td>'.$langs->trans("Parameter").'</td>';
print '<td>'.$langs->trans("Value").'</td>';
print '</tr>'."\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))
	{
        $newkey = preg_replace('/^\?/','',$key);

        if (preg_match('/^\?/',$key) && empty(${$newkey}))
        {
            $i++;
            continue;    // We discard parametes starting with ?
        }

        if ($newkey == 'separator' && $lastkeyshown == 'separator')
        {
            $i++;
            continue;
        }

		$var=!$var;
		print "<tr ".$bc[$var].">";
		if ($newkey == 'separator')
		{
			print '<td colspan="3">&nbsp;</td>';
		}
		else
		{
			// Label
			print "<td>".$configfilelib[$i].'</td>';
			// Key
			print '<td>'.$newkey.'</td>';
			// Value
			print "<td>";
			if ($newkey == 'dolibarr_main_db_pass') print preg_replace('/./i','*',${$newkey});
			else if ($newkey == 'dolibarr_main_url_root' && preg_match('/__auto__/',${$newkey})) print ${$newkey}.' => '.constant('DOL_MAIN_URL_ROOT');
			else if ($newkey == 'dolibarr_main_url_root_alt' && preg_match('/__auto__/',${$newkey})) print ${$newkey}.' => '.constant('DOL_MAIN_URL_ROOT_ALT');
			else print ${$newkey};
			print "</td>";
		}
		print "</tr>\n";
		$lastkeyshown=$newkey;
	}
	$i++;
}
print '</table>';
print '<br>';



// Parameters in database
print_titre($langs->trans("Database"));
print '<table class="noborder">';
print '<tr class="liste_titre">';
print '<td>'.$langs->trans("Parameter").'</td>';
print '<td>'.$langs->trans("Value").'</td>';
if (empty($conf->multicompany->enabled) || !$user->entity) print '<td>'.$langs->trans("Entity").'</td>';	// If superadmin or multicompany disabled
print "</tr>\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 '<tr '.$bc[$var].'>';
    	print '<td>'.$obj->name.'</td>'."\n";
    	print '<td>'.$obj->value.'</td>'."\n";
    	if (empty($conf->multicompany->enabled) || !$user->entity) print '<td>'.$obj->entity.'</td>'."\n";	// If superadmin or multicompany disabled
    	print "</tr>\n";

    	$i++;
    }
}

print '</table>';

$db->close();

llxFooter();
?>
Back to Top