notice.php 2.2 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061
  1. <?php
  2. /* Copyright (C) 2016-2021 Laurent Destailleur <eldy@users.sourceforge.net>
  3. *
  4. * This program is free software; you can redistribute it and/or modify
  5. * it under the terms of the GNU General Public License as published by
  6. * the Free Software Foundation; either version 3 of the License, or
  7. * (at your option) any later version.
  8. *
  9. * This program is distributed in the hope that it will be useful,
  10. * but WITHOUT ANY WARRANTY; without even the implied warranty of
  11. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  12. * GNU General Public License for more details.
  13. *
  14. * You should have received a copy of the GNU General Public License
  15. * along with this program. If not, see <https://www.gnu.org/licenses/>.
  16. */
  17. /**
  18. * \file htdocs/public/notice.php
  19. * \brief Dolibarr public page to show a notice.
  20. * Default notice is a message to say network connection is off. Some parameters can be used to show another message:
  21. * /public/notice.php?lang=xx_XX&transkey=translation_key (key must be inside file main.lang, error.lang or other.lang)
  22. * /public/notice.php?transphrase=sentence_to_show
  23. */
  24. if (!defined('NOLOGIN')) {
  25. define("NOLOGIN", 1); // This means this output page does not require to be logged.
  26. }
  27. if (!defined('NOCSRFCHECK')) {
  28. define("NOCSRFCHECK", 1); // We accept to go on this page from external web site.
  29. }
  30. if (!defined('NOIPCHECK')) {
  31. define('NOIPCHECK', '1'); // Do not check IP defined into conf $dolibarr_main_restrict_ip
  32. }
  33. if (!defined('NOSESSION')) {
  34. define('NOSESSION', '1');
  35. }
  36. if (!defined('NOBROWSERNOTIF')) {
  37. define('NOBROWSERNOTIF', '1');
  38. }
  39. // Load Dolibarr environment
  40. require '../main.inc.php';
  41. /**
  42. * View
  43. */
  44. if (!GETPOST('transkey', 'alphanohtml') && !GETPOST('transphrase', 'alphanohtml')) {
  45. print 'Sorry, it seems your internet connexion is off.<br>';
  46. print 'You need to be connected to network to use this software.<br>';
  47. } else {
  48. $langs->loadLangs(array("error", "other"));
  49. if (GETPOST('transphrase', 'alphanohtml')) {
  50. print dol_escape_htmltag(GETPOST('transphrase', 'alphanohtml'));
  51. } elseif (GETPOST('transkey', 'alphanohtml')) {
  52. print dol_escape_htmltag($langs->trans(GETPOST('transkey', 'alphanohtml')));
  53. }
  54. }