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. * You can call this page with URL:
  22. * /public/notice.php?lang=xx_XX&transkey=translation_key (key must be inside file main.lang, error.lang or other.lang)
  23. * /public/notice.php?transphrase=url_encoded_sentence_to_show
  24. */
  25. if (!defined('NOLOGIN')) {
  26. define("NOLOGIN", 1); // This means this output page does not require to be logged.
  27. }
  28. if (!defined('NOCSRFCHECK')) {
  29. define("NOCSRFCHECK", 1); // We accept to go on this page from external web site.
  30. }
  31. if (!defined('NOIPCHECK')) {
  32. define('NOIPCHECK', '1'); // Do not check IP defined into conf $dolibarr_main_restrict_ip
  33. }
  34. if (!defined('NOSESSION')) {
  35. define('NOSESSION', '1');
  36. }
  37. if (!defined('NOBROWSERNOTIF')) {
  38. define('NOBROWSERNOTIF', '1');
  39. }
  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. }