notice.php 1.8 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849
  1. <?php
  2. /* Copyright (C) 2016-2020 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 page to show a notice.
  20. * Default notice is a message to say network connection is off.
  21. * You can also 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. define('NOCSRFCHECK', 1);
  26. define('NOLOGIN', 1);
  27. define('NOSESSION', 1);
  28. require '../main.inc.php';
  29. /**
  30. * View
  31. */
  32. if (!GETPOST('transkey', 'alphanohtml') && !GETPOST('transphrase', 'alphanohtml'))
  33. {
  34. print 'Sorry, it seems your internet connexion is off.<br>';
  35. print 'You need to be connected to network to use this software.<br>';
  36. }
  37. else
  38. {
  39. $langs->loadLangs(array("error", "other"));
  40. if (GETPOST('transphrase', 'alphanohtml')) print dol_escape_htmltag(GETPOST('transphrase', 'alphanohtml'));
  41. elseif (GETPOST('transkey', 'alphanohtml')) print dol_escape_htmltag($langs->trans(GETPOST('transkey', 'alphanohtml')));
  42. }