Index: t3lib/class.t3lib_beuserauth.php =================================================================== --- t3lib/class.t3lib_beuserauth.php (revision 8082) +++ t3lib/class.t3lib_beuserauth.php (working copy) @@ -231,7 +231,7 @@ */ function checkCLIuser() { // First, check if cliMode is enabled: - if (defined('TYPO3_cliMode') && TYPO3_cliMode) { + if (TYPO3_REQUESTTYPE & TYPO3_REQUESTTYPE_CLI) { if (!$this->user['uid']) { if (substr($GLOBALS['MCONF']['name'],0,5)=='_CLI_') { $userName = strtolower($GLOBALS['MCONF']['name']); @@ -387,7 +387,7 @@ if (!$adminOnlyMode || $this->isAdmin()) { $isUserAllowedToLogin = TRUE; // Backend user is allowed if adminOnly is set to 2 (CLI) and a CLI process is running: - } elseif ($adminOnlyMode == 2 && defined('TYPO3_cliMode') && TYPO3_cliMode) { + } elseif ($adminOnlyMode == 2 && (TYPO3_REQUESTTYPE & TYPO3_REQUESTTYPE_CLI)) { $isUserAllowedToLogin = TRUE; } Index: t3lib/class.t3lib_div.php =================================================================== --- t3lib/class.t3lib_div.php (revision 8082) +++ t3lib/class.t3lib_div.php (working copy) @@ -4199,6 +4199,8 @@ */ public static function getHostname($requestHost=TRUE) { $host = ''; + // If not called from the command-line, resolve on getIndpEnv() + // Note that TYPO3_REQUESTTYPE is not used here as it may not yet be defined if ($requestHost && (!defined('TYPO3_cliMode') || !TYPO3_cliMode)) { $host = self::getIndpEnv('HTTP_HOST'); } @@ -5593,6 +5595,7 @@ global $TYPO3_CONF_VARS; // for CLI logging name is : + // Note that TYPO3_REQUESTTYPE is not used here as it may not yet be defined if (defined('TYPO3_cliMode') && TYPO3_cliMode) { $TYPO3_CONF_VARS['SC_OPTIONS']['t3lib/class.t3lib_div.php']['systemLogHost'] = self::getHostname($requestHost=FALSE).':'.PATH_site; } Index: typo3/init.php =================================================================== --- typo3/init.php (revision 8082) +++ typo3/init.php (working copy) @@ -233,7 +233,7 @@ // ************************* // CLI dispatch processing // ************************* -if (defined('TYPO3_cliMode') && TYPO3_cliMode && basename(PATH_thisScript)=='cli_dispatch.phpsh') { +if ((TYPO3_REQUESTTYPE & TYPO3_REQUESTTYPE_CLI) && basename(PATH_thisScript) == 'cli_dispatch.phpsh') { // First, take out the first argument (cli-key) $temp_cliScriptPath = array_shift($_SERVER['argv']); $temp_cliKey = array_shift($_SERVER['argv']); @@ -266,7 +266,7 @@ t3lib_BEfunc::typo3printError('Backend locked', 'Backend and Install Tool are locked for maintenance. [BE][adminOnly] is set to "' . intval($TYPO3_CONF_VARS['BE']['adminOnly']) . '".'); exit; } -if (!(defined('TYPO3_cliMode') && TYPO3_cliMode) && @is_file(PATH_typo3conf.'LOCK_BACKEND')) { +if (!(TYPO3_REQUESTTYPE & TYPO3_REQUESTTYPE_CLI) && @is_file(PATH_typo3conf . 'LOCK_BACKEND')) { if (TYPO3_PROCEED_IF_NO_USER == 2) { // ajax poll for login, let him pass } else { @@ -284,7 +284,7 @@ // ********************** // Check IP // ********************** -if (trim($TYPO3_CONF_VARS['BE']['IPmaskList']) && !(defined('TYPO3_cliMode') && TYPO3_cliMode)) { +if (trim($TYPO3_CONF_VARS['BE']['IPmaskList']) && !(TYPO3_REQUESTTYPE & TYPO3_REQUESTTYPE_CLI)) { if (!t3lib_div::cmpIP(t3lib_div::getIndpEnv('REMOTE_ADDR'), $TYPO3_CONF_VARS['BE']['IPmaskList'])) { header('Status: 404 Not Found'); // Send Not Found header - if the webserver can make use of it... header('Location: http://'); // Just point us away from here... @@ -296,7 +296,7 @@ // ********************** // Check SSL (https) // ********************** -if (intval($TYPO3_CONF_VARS['BE']['lockSSL']) && !(defined('TYPO3_cliMode') && TYPO3_cliMode)) { +if (intval($TYPO3_CONF_VARS['BE']['lockSSL']) && !(TYPO3_REQUESTTYPE & TYPO3_REQUESTTYPE_CLI)) { if(intval($TYPO3_CONF_VARS['BE']['lockSSLPort'])) { $sslPortSuffix = ':'.intval($TYPO3_CONF_VARS['BE']['lockSSLPort']); } else { @@ -372,7 +372,7 @@ // ******************************* // Checks for proper browser // ******************************* -if (!$CLIENT['BROWSER'] && !(defined('TYPO3_cliMode') && TYPO3_cliMode)) { +if (!$CLIENT['BROWSER'] && !(TYPO3_REQUESTTYPE & TYPO3_REQUESTTYPE_CLI)) { t3lib_BEfunc::typo3PrintError ('Browser error','Your browser version looks incompatible with this TYPO3 version!',0); exit; } @@ -428,7 +428,7 @@ // **************** // CLI processing // **************** -if (defined('TYPO3_cliMode') && TYPO3_cliMode) { +if (TYPO3_REQUESTTYPE & TYPO3_REQUESTTYPE_CLI) { // Status output: if (!strcmp($_SERVER['argv'][1],'status')) { echo "Status of TYPO3 CLI script:\n\n"; Index: typo3/sysext/scheduler/class.tx_scheduler_task.php =================================================================== --- typo3/sysext/scheduler/class.tx_scheduler_task.php (revision 8082) +++ typo3/sysext/scheduler/class.tx_scheduler_task.php (working copy) @@ -325,7 +325,7 @@ // Define the context in which the script is running $context = 'BE'; - if (defined('TYPO3_cliMode') && TYPO3_cliMode) { + if (TYPO3_REQUESTTYPE & TYPO3_REQUESTTYPE_CLI) { $context = 'CLI'; } Index: typo3/sysext/scheduler/cli/scheduler_cli_dispatch.php =================================================================== --- typo3/sysext/scheduler/cli/scheduler_cli_dispatch.php (revision 8082) +++ typo3/sysext/scheduler/cli/scheduler_cli_dispatch.php (working copy) @@ -32,7 +32,7 @@ * * $Id$ */ -if (defined('TYPO3_cliMode') && TYPO3_cliMode && basename(PATH_thisScript) == 'cli_dispatch.phpsh') { +if ((TYPO3_REQUESTTYPE & TYPO3_REQUESTTYPE_CLI) && basename(PATH_thisScript) == 'cli_dispatch.phpsh') { $hasTask = true; // Create an instance of the scheduler object /**