Files
iTop/portal/index.php
Molkobain 83ba909c08 N°2112 Remove legacy end-user portal
- Accessing the /portal URL redirects to the new portal (/pages/exec.php?exec_module=itop-portal-base&...)
- Removed /itop_design/portals/portal[@id="legacy_portal"] from standard datamodel, adapt your XML accordingly
- Removed /itop_design/constants/constant[@id^="PORTAL_"] from standard datamodel, adapt your XML accordingly
- Removed PortalWebPage & TransactionException classes
- Added a warning in setup when no portal is selected
2019-07-17 15:40:43 +02:00

65 lines
1.8 KiB
PHP

<?php
/**
* Copyright (C) 2013-2019 Combodo SARL
*
* This file is part of iTop.
*
* iTop is free software; you can redistribute it and/or modify
* it under the terms of the GNU Affero General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* iTop 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 Affero General Public License for more details.
*
* You should have received a copy of the GNU Affero General Public License
*
*
*/
require_once('../approot.inc.php');
require_once(APPROOT.'/application/application.inc.php');
try
{
require_once(APPROOT.'/application/startup.inc.php');
require_once(APPROOT.'/application/loginwebpage.class.inc.php');
LoginWebPage::DoLogin(false /* bMustBeAdmin */, true /* IsAllowedToPortalUsers */); // Check user rights and prompt if needed
}
catch(Exception $e)
{
require_once(APPROOT.'/setup/setuppage.class.inc.php');
$oP = new SetupPage(Dict::S('UI:PageTitle:FatalError'));
$oP->add("<h1>".Dict::S('UI:FatalErrorMessage')."</h1>\n");
$oP->error(Dict::Format('UI:Error_Details', $e->getMessage()));
$oP->output();
if (MetaModel::IsLogEnabledIssue())
{
if (MetaModel::IsValidClass('EventIssue'))
{
try
{
$oLog = new EventIssue();
$oLog->Set('message', $e->getMessage());
$oLog->Set('userinfo', '');
$oLog->Set('issue', 'PHP Exception');
$oLog->Set('impact', 'Page could not be displayed');
$oLog->Set('callstack', $e->getTrace());
$oLog->Set('data', array());
$oLog->DBInsertNoReload();
}
catch(Exception $e)
{
IssueLog::Error("Failed to log issue into the DB");
}
}
IssueLog::Error($e->getMessage());
}
}