* Copyright (C) 2003 Eric Seigne * Copyright (C) 2004-2010 Laurent Destailleur * Copyright (C) 2004 Sebastien Di Cintio * Copyright (C) 2004 Benoit Mortier * Copyright (C) 2011-2012 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/externalsite/admin/index.php * \ingroup externalsite * \brief Page to setup module external site */ if (!defined('NOSCANPOSTFORINJECTION')) { define('NOSCANPOSTFORINJECTION', '1'); // Do not check anti CSRF attack test } // Load Dolibarr environment require '../../main.inc.php'; require_once DOL_DOCUMENT_ROOT.'/core/lib/admin.lib.php'; if (!$user->admin) { accessforbidden(); } // Load translation files required by the page $langs->loadLangs(array('admin', 'other', 'externalsite')); $action = GETPOST('action', 'aZ09'); /* * Actions */ // Sauvegardes parameters if ($action == 'update') { $i = 0; $db->begin(); $label = GETPOST('EXTERNALSITE_LABEL', 'alphanohtml'); // exturl can be an url or a HTML string $exturl = GETPOST('EXTERNALSITE_URL', 'restricthtml'); $exturl = dol_string_onlythesehtmltags($exturl, 1, 1, 0, 1, array(), 1); $exturl = dol_string_onlythesehtmlattributes($exturl); $i += dolibarr_set_const($db, 'EXTERNALSITE_LABEL', trim($label), 'chaine', 0, '', $conf->entity); $i += dolibarr_set_const($db, 'EXTERNALSITE_URL', trim($exturl), 'chaine', 0, '', $conf->entity); if ($i >= 2) { $db->commit(); setEventMessages($langs->trans("SetupSaved"), null, 'mesgs'); } else { $db->rollback(); setEventMessages($db->lasterror(), null, 'errors'); } } /** * View */ llxHeader('', '', '', '', 0, 0, '', '', '', 'mod-externalsite page-index'); $linkback = ''.$langs->trans("BackToModuleList").''; print load_fiche_titre($langs->trans("ExternalSiteSetup"), $linkback, 'title_setup'); print '
'; print ''.$langs->trans("Module100Desc")."
\n"; print '
'; print '
'; print ''; print ''; print ""; print ""; print ""; print ""; print ""; print ""; print ''; print '"; print ""; print ""; print ""; print ''; print '"; print ''; print ""; print ""; print "
".$langs->trans("Parameter")."".$langs->trans("Value")."".$langs->trans("Examples")."
'.$langs->trans("Label")."global->EXTERNALSITE_LABEL))."\" size=\"12\">".$langs->trans("ExampleMyMenuEntry")."
'.$langs->trans("ExternalSiteURL")."http://localhost/myurl/"; print "
https://wikipedia.org/"; print "
<iframe>...</iframe>"; print "
"; print $form->buttonsSaveCancel("Save", ''); print "
\n"; llxFooter(); $db->close();