Files

141 lines
4.5 KiB
PHP

<?php
namespace HermannTelser\Gutachten\Eid;
ini_set('display_errors', 1);
ini_set('display_startup_errors', 1);
ini_set('memory_limit', '-1');
set_time_limit(0);
//error_reporting(E_ALL);
error_reporting(E_ALL & ~E_NOTICE);
use HermannTelser\Gutachten\DB\Delete\_DeleteController;
use HermannTelser\Gutachten\DB\Insert\_InsertController;
use HermannTelser\Gutachten\DB\MariaDB;
use HermannTelser\Gutachten\DB\Select\_SelectController;
use HermannTelser\Gutachten\DB\Update\_UpdateController;
use HermannTelser\Gutachten\Downloads\_DownloadController;
use HermannTelser\Gutachten\Settings\_SettingsController;
use HermannTelser\Gutachten\Uploads\_UploadsController;
use HermannTelser\Gutachten\Utility\Message;
use TYPO3\CMS\Core\Utility\GeneralUtility;
use TYPO3\CMS\Frontend\Controller\TypoScriptFrontendController;
use TYPO3\CMS\Frontend\Utility\EidUtility;
/* * *************************************************************
*
* Copyright notice
*
* (c) 2017 Hermann Telser <hermann.telser@gmail.com>
*
* All rights reserved
*
* This script is part of the TYPO3 project. The TYPO3 project is
* free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 3 of the License, or
* (at your option) any later version.
*
* The GNU General Public License can be found at
* http://www.gnu.org/copyleft/gpl.html.
*
* This script 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 General Public License for more details.
*
* This copyright notice MUST APPEAR in all copies of the script!
*
/var/www/html/gutachten.nuhodds.com/public/typo3conf/ext/gutachten/Classes
* ************************************************************* */
if (!\defined('PATH_typo3conf')) {
die('Could not access this script directly!');
}
class TxGutachten
{
public static $debug = 0;
public function __construct()
{
global $TYPO3_CONF_VARS;
$pid = 3;
// @var $GLOBALS['TSFE'] \TYPO3\CMS\Frontend\Controller\TypoScriptFrontendController
$GLOBALS['TSFE'] = GeneralUtility::makeInstance(TypoScriptFrontendController::class, $TYPO3_CONF_VARS, $pid, 0);
EidUtility::initLanguage();
$GLOBALS['TSFE']->initFEuser();
EidUtility::initTCA();
$GLOBALS['TSFE']->set_no_cache();
//###########################################
// SESSION
//###########################################
$feUserObj = EidUtility::initFEuser();
$username = $feUserObj->user['username'];
if ('' == $username) {
if ('download' == $_GET['mode']) {
echo '<html><header><script>document.location.href="index.php";</script></header></html>';
} else {
header('Content-Type: application/json');
$arr[] = [
'logout' => 1,
];
echo json_encode($arr);
}
exit;
}
new MariaDB();
}
/*
* @return array
https://developmentgutachten.nuhodds.com/index.php?eID=tx_gutachten&controller=download_controller&&action=pdf_excel&projekt_aktive=814
find /var/www/OTHER/ext_gutachten_js -type f -exec sed -i 's/standards_controller/select_controller/g' {} \;
*/
public function switch()
{
switch (GeneralUtility::_GP('controller')) {
case 'download_controller':
new _DownloadController();
break;
case 'uploads_controller':
new _UploadsController();
break;
case 'settings_controller':
new _SettingsController();
break;
case 'select_controller':
new _SelectController();
break;
case 'update_controller':
new _UpdateController();
break;
case 'insert_controller':
new _InsertController();
break;
case 'delete_controller':
new _DeleteController();
break;
default:
Message::error(
__FILE__,
__LINE__,
'no controller switch defined'
);
break;
}
header('Content-Type: application/json');
echo json_encode($arr);
exit();
}
}