* Copyright (C) 2013 Juanjo Menent * * 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 3 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/proxy.php * \ingroup core * \brief Page setup proxy to use for external web access */ // Load Dolibarr environment require '../main.inc.php'; require_once DOL_DOCUMENT_ROOT.'/core/lib/admin.lib.php'; require_once DOL_DOCUMENT_ROOT.'/core/class/html.formfile.class.php'; // Load translation files required by the page $langs->loadLangs(array("other", "users", "admin")); if (!$user->admin) { accessforbidden(); } $upload_dir = $conf->admin->dir_temp; /* * Actions */ if (GETPOST('action', 'aZ09') == 'set_proxy') { if (GETPOST("MAIN_USE_CONNECT_TIMEOUT") && !is_numeric(GETPOST("MAIN_USE_CONNECT_TIMEOUT"))) { setEventMessages($langs->trans("ErrorValueMustBeInteger"), null, 'errors'); $error++; } if (GETPOST("MAIN_USE_RESPONSE_TIMEOUT") && !is_numeric(GETPOST("MAIN_USE_RESPONSE_TIMEOUT"))) { setEventMessages($langs->trans("ErrorValueMustBeInteger"), null, 'errors'); $error++; } if (!$error) { $result = 0; $result += dolibarr_set_const($db, 'MAIN_USE_CONNECT_TIMEOUT', GETPOST("MAIN_USE_CONNECT_TIMEOUT"), 'chaine', 0, '', $conf->entity); $result += dolibarr_set_const($db, 'MAIN_USE_RESPONSE_TIMEOUT', GETPOST("MAIN_USE_RESPONSE_TIMEOUT"), 'chaine', 0, '', $conf->entity); $result += dolibarr_set_const($db, 'MAIN_PROXY_USE', GETPOST("MAIN_PROXY_USE"), 'chaine', 0, '', $conf->entity); $result += dolibarr_set_const($db, 'MAIN_PROXY_HOST', GETPOST("MAIN_PROXY_HOST"), 'chaine', 0, '', $conf->entity); $result += dolibarr_set_const($db, 'MAIN_PROXY_PORT', GETPOST("MAIN_PROXY_PORT"), 'chaine', 0, '', $conf->entity); $result += dolibarr_set_const($db, 'MAIN_PROXY_USER', GETPOST("MAIN_PROXY_USER"), 'chaine', 0, '', $conf->entity); $result += dolibarr_set_const($db, 'MAIN_PROXY_PASS', GETPOST("MAIN_PROXY_PASS"), 'chaine', 0, '', $conf->entity); if ($result < 5) { dol_print_error($db); } } if (!$error) { setEventMessages($langs->trans("RecordModifiedSuccessfully"), null, 'mesgs'); } } /* * View */ $form = new Form($db); $wikihelp = 'EN:Setup_Security|FR:Paramétrage_Sécurité|ES:Configuración_Seguridad'; llxHeader('', $langs->trans("Proxy"), $wikihelp, '', 0, 0, '', '', '', 'mod-admin page-proxy'); print load_fiche_titre($langs->trans("SecuritySetup"), '', 'title_setup'); print ''.$langs->trans("ProxyDesc")."
\n"; print "
\n"; print '
'; print ''; print ''; $head = security_prepare_head(); print dol_get_fiche_head($head, 'proxy', '', -1); print '
'; if ($conf->use_javascript_ajax) { print "\n".''."\n"; } // Timeout print ''; print ''; print ''; print ''; print "\n"; print ''; print ''; print ''; print ''; print ''; print ''; print ''; print ''; print ''; print ''; print ''; print ''; print ''; print ''; print ''; print ''; print ''; print ''; print ''; print ''; print ''; print ''; print ''; print ''; print ''; print ''; print ''; print ''; print '
'.$langs->trans("Parameters").''.$langs->trans("Value").'
'.$langs->trans("ConnectionTimeout").''; print ''; print 'global->MAIN_USE_CONNECT_TIMEOUT).'">'; print ' '.strtolower($langs->trans("Seconds")); print '
'.$langs->trans("ResponseTimeout").''; print ''; print ''; print ' '.strtolower($langs->trans("Seconds")); print '
'.$langs->trans("MAIN_PROXY_USE").''; print ''; print $form->selectyesno('MAIN_PROXY_USE', (getDolGlobalString('MAIN_PROXY_USE') ? $conf->global->MAIN_PROXY_USE : 0), 1); print '
'.$langs->trans("MAIN_PROXY_HOST").''; print ''; print ''; print '
'.$langs->trans("MAIN_PROXY_PORT").''; print ''; print ''; print '
'.$langs->trans("MAIN_PROXY_USER").''; print ''; print ''; print '
'.$langs->trans("MAIN_PROXY_PASS").''; print ''; print ''; print '
'; print $form->buttonsSaveCancel("Modify", ''); print dol_get_fiche_end(); print '
'; // End of page llxFooter(); $db->close();