Fixed bug #3472: No image rendering in T3 V4.3 alpha3.
[TYPO3CMS/Extensions/sr_freecap.git] / pi3 / audioCaptcha.php
1 <?php
2 /***************************************************************
3 * Copyright notice
4 *
5 * (c) 2008-2009 Stanislas Rolland <typo3(arobas)sjbr.ca>
6 * All rights reserved
7 *
8 * This script is part of the Typo3 project. The Typo3 project is
9 * free software; you can redistribute it and/or modify
10 * it under the terms of the GNU General Public License as published by
11 * the Free Software Foundation; either version 2 of the License, or
12 * (at your option) any later version.
13 *
14 * The GNU General Public License can be found at
15 * http://www.gnu.org/copyleft/gpl.html.
16 *
17 * This script is distributed in the hope that it will be useful,
18 * but WITHOUT ANY WARRANTY; without even the implied warranty of
19 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
20 * GNU General Public License for more details.
21 *
22 * This copyright notice MUST APPEAR in all copies of the script!
23 ***************************************************************/
24 /**
25 * This script invokes SysTurn speech generation
26 *
27 */
28
29 error_reporting (E_ALL ^ E_NOTICE);
30 define('PATH_thisScript',str_replace('//','/', str_replace('\\','/', (php_sapi_name()=='cgi'||php_sapi_name()=='xcgi'||php_sapi_name()=='isapi' ||php_sapi_name()=='cgi-fcgi')&&((!empty($_SERVER['ORIG_PATH_TRANSLATED'])&&isset($_SERVER['ORIG_PATH_TRANSLATED']))?$_SERVER['ORIG_PATH_TRANSLATED']:$_SERVER['PATH_TRANSLATED'])? ((!empty($_SERVER['ORIG_PATH_TRANSLATED'])&&isset($_SERVER['ORIG_PATH_TRANSLATED']))?$_SERVER['ORIG_PATH_TRANSLATED']:$_SERVER['PATH_TRANSLATED']):((!empty($_SERVER['ORIG_SCRIPT_FILENAME'])&&isset($_SERVER['ORIG_SCRIPT_FILENAME']))?$_SERVER['ORIG_SCRIPT_FILENAME']:$_SERVER['SCRIPT_FILENAME']))));
31 if (!defined('PATH_site')) define('PATH_site', dirname(dirname(dirname(dirname(dirname(PATH_thisScript))))).'/');
32 if (!defined('PATH_t3lib')) define('PATH_t3lib', PATH_site.'t3lib/');
33 define('PATH_typo3conf', PATH_site.'typo3conf/');
34 define('TYPO3_mainDir', 'typo3/');
35 if (!defined('PATH_typo3')) define('PATH_typo3', PATH_site.TYPO3_mainDir);
36 if (!defined('PATH_tslib')) {
37 if (@is_dir(PATH_site.'typo3/sysext/cms/tslib/')) {
38 define('PATH_tslib', PATH_site.'typo3/sysext/cms/tslib/');
39 } elseif (@is_dir(PATH_site.'tslib/')) {
40 define('PATH_tslib', PATH_site.'tslib/');
41 }
42 }
43 define('TYPO3_MODE','FE');
44 define('TYPO3_OS', stristr(PHP_OS,'win')&&!stristr(PHP_OS,'darwin')?'WIN':'');
45
46 require_once(PATH_t3lib.'class.t3lib_div.php');
47 require_once(PATH_t3lib.'class.t3lib_extmgm.php');
48 require_once(PATH_t3lib.'config_default.php');
49 require_once(PATH_typo3conf.'localconf.php');
50 require_once(PATH_tslib.'class.tslib_fe.php');
51 require_once(PATH_t3lib.'class.t3lib_tstemplate.php');
52 require_once(PATH_t3lib.'class.t3lib_page.php');
53 require_once(PATH_tslib.'class.tslib_content.php');
54 require_once(t3lib_extMgm::extPath('sr_freecap').'pi3/class.tx_srfreecap_pi3.php');
55 require_once(PATH_t3lib.'class.t3lib_userauth.php');
56 require_once(PATH_tslib.'class.tslib_feuserauth.php');
57 require_once(PATH_t3lib.'class.t3lib_cs.php');
58
59 if (!defined ('TYPO3_db')) die ('The configuration file was not included.');
60 if (isset($_GET['GLOBALS']) || isset($_POST['GLOBALS']) || isset($_FILES['GLOBALS']) || isset($_COOKIE['GLOBALS'])) die('You cannot set the GLOBALS-array from outside this script.');
61
62 // *********************
63 // Autoloader
64 // *********************
65 if (t3lib_div::int_from_ver($GLOBALS['TYPO_VERSION']) >= 4003000) {
66 require_once(PATH_t3lib . 'class.t3lib_autoloader.php');
67 t3lib_autoloader::registerAutoloader();
68 }
69
70 require_once(PATH_t3lib.'class.t3lib_db.php');
71 $GLOBALS['TYPO3_DB'] = t3lib_div::makeInstance('t3lib_DB');
72
73 require_once(PATH_t3lib.'class.t3lib_timetrack.php');
74 $GLOBALS['TT'] = new t3lib_timeTrack;
75
76 // ***********************************
77 // Creating a $TSFE object
78 // ***********************************
79 $TSFEclassName = t3lib_div::makeInstanceClassName('tslib_fe');
80 $id = t3lib_div::_GET('id');
81 if (!isset($id)) $id = 0;
82 $id = htmlspecialchars($id);
83 $GLOBALS['TSFE'] = new $TSFEclassName($TYPO3_CONF_VARS, $id, '0', 1, '', '','','');
84 $GLOBALS['TSFE']->connectToDB();
85 $GLOBALS['TSFE']->initFEuser();
86 $GLOBALS['TSFE']->determineId();
87 // *******************************************
88 // Get compressed $TCA-Array();
89 // After this, we should now have a valid $TCA, though minimized
90 // *******************************************
91 $GLOBALS['TSFE']->getCompressedTCarray();
92 $GLOBALS['TSFE']->initTemplate();
93 $GLOBALS['TSFE']->tmpl->getFileName_backPath = PATH_site;
94
95 // ******************************************************
96 // Get config if not already gotten
97 // After this, we should have a valid config-array ready
98 // ******************************************************
99 $GLOBALS['TSFE']->getConfigArray();
100
101 // *******************************************
102 // Setting language and locale
103 // *******************************************
104 $GLOBALS['TT']->push('Setting language and locale','');
105 $GLOBALS['TSFE']->settingLanguage();
106 $GLOBALS['TSFE']->settingLocale();
107 $GLOBALS['TT']->pull();
108
109 // *******************************************
110 // Invoke the freecap plugin
111 // *******************************************
112 $freecap = t3lib_div::makeInstance('tx_srfreecap_pi3');
113 $freecap->cObj = t3lib_div::makeInstance('tslib_cObj');
114 $conf = $GLOBALS['TSFE']->tmpl->setup['plugin.'][$freecap->prefixId.'.'];
115 $freecap->main($conf);
116 ?>