index.php 1.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051
  1. <?php
  2. // Copyright (C) 2010-2017 Combodo SARL
  3. //
  4. // This file is part of iTop.
  5. //
  6. // iTop is free software; you can redistribute it and/or modify
  7. // it under the terms of the GNU Affero General Public License as published by
  8. // the Free Software Foundation, either version 3 of the License, or
  9. // (at your option) any later version.
  10. //
  11. // iTop is distributed in the hope that it will be useful,
  12. // but WITHOUT ANY WARRANTY; without even the implied warranty of
  13. // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  14. // GNU Affero General Public License for more details.
  15. //
  16. // You should have received a copy of the GNU Affero General Public License
  17. // along with iTop. If not, see <http://www.gnu.org/licenses/>
  18. /**
  19. * Executes a portal without having a dedicated module.
  20. * This allows to make a portal directly from the ITSM Designer.
  21. */
  22. if (file_exists(__DIR__ . '/../../approot.inc.php'))
  23. {
  24. require_once __DIR__ . '/../../approot.inc.php'; // When in env-xxxx folder
  25. }
  26. else
  27. {
  28. require_once __DIR__ . '/../../../approot.inc.php'; // When in datamodels/x.x folder
  29. }
  30. require_once APPROOT . '/application/startup.inc.php';
  31. // If PORTAL_ID is not already defined, we look for it in a parameter
  32. if(!defined('PORTAL_ID'))
  33. {
  34. // Retrieving portal id from request params
  35. $sPortalId = utils::ReadParam('portal_id', '');
  36. if ($sPortalId == '')
  37. {
  38. echo "Missing argument 'portal_id'";
  39. exit;
  40. }
  41. // Defining portal constants
  42. define('PORTAL_MODULE_ID', $sPortalId);
  43. define('PORTAL_ID', $sPortalId);
  44. }
  45. require_once APPROOT . '/env-' . utils::GetCurrentEnvironment() . '/itop-portal-base/portal/web/index.php';