Fixed bug #15580: Add calls to logDeprecatedFunction() for more deprecated functions...
[Packages/TYPO3.CMS.git] / typo3 / sysext / cms / tslib / class.tslib_extdirecteid.php
1 <?php
2 /***************************************************************
3 * Copyright notice
4 *
5 * (c) 2010 Stefan Galinski <stefan.galinski@gmail.com>
6 *
7 * All rights reserved
8 *
9 * This script is part of the TYPO3 project. The TYPO3 project is
10 * free software; you can redistribute it and/or modify
11 * it under the terms of the GNU General Public License as published by
12 * the Free Software Foundation; either version 2 of the License, or
13 * (at your option) any later version.
14 *
15 * The GNU General Public License can be found at
16 * http://www.gnu.org/copyleft/gpl.html.
17 *
18 * This script is distributed in the hope that it will be useful,
19 * but WITHOUT ANY WARRANTY; without even the implied warranty of
20 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
21 * GNU General Public License for more details.
22 *
23 * This copyright notice MUST APPEAR in all copies of the script!
24 ***************************************************************/
25
26 require_once(PATH_site . 'typo3/classes/class.typo3ajax.php');
27
28 /**
29 * eID controller for ExtDirect
30 *
31 * @author Stefan Galinski <stefan.galinski@gmail.com>
32 * @package TYPO3
33 */
34 class tslib_ExtDirectEid {
35 /**
36 * Ajax Instance
37 *
38 * @property TYPO3AJAX
39 * @var TYPO3AJAX
40 */
41 protected $ajaxObjext = NULL;
42
43 /**
44 * Routes the given eID action to the related ExtDirect method with the necessary
45 * ajax object.
46 *
47 * @return void
48 */
49 public function routeAction() {
50 $GLOBALS['LANG'] = t3lib_div::makeInstance('language');
51 $GLOBALS['LANG']->init();
52
53 tslib_eidtools::connectDB();
54
55 $ajaxID = t3lib_div::_GP('action');
56 $ajaxScript = $GLOBALS['TYPO3_CONF_VARS']['BE']['AJAX']['ExtDirect::' . $ajaxID];
57 $this->ajaxObject = t3lib_div::makeInstance('TYPO3AJAX', 'ExtDirect::' . $ajaxID);
58
59 $parameters = array();
60 t3lib_div::callUserFunction($ajaxScript, $parameters, $this->ajaxObject, FALSE, TRUE);
61 }
62
63 /**
64 * Returns true if the associated action in _GET is allowed.
65 *
66 * @return boolean
67 */
68 public function actionIsAllowed() {
69 if (!in_array(t3lib_div::_GP('action'), array('route', 'getAPI'))) {
70 return FALSE;
71 }
72
73 return TRUE;
74 }
75
76 /**
77 * Renders/Echoes the ajax output
78 *
79 * @return void
80 */
81 public function render() {
82 $this->ajaxObject->render();
83 }
84 }
85
86 ?>