Merge pull request #769 from BelleNottelling/issue763

Fix issue #763 (Logging in as "system cron job")
This commit is contained in:
Belle Aerni authored and GitHub committed 2023-02-06 16:48:46 -08:00
commit 113fb8f4a4
1 file changed
+1 -1
+1 -1
View File
@@ -397,7 +397,7 @@ $di['loggedin_client'] = function () use ($di) {
* @throws \Box_Exception If the script is running in CLI or CGI mode and there is no cron admin available.
*/
$di['loggedin_admin'] = function () use ($di) {
if ('cli' === php_sapi_name() || str_starts_with(php_sapi_name(), 'cgi')) {
if ('cli' === php_sapi_name() || !http_response_code()) {
return $di['mod_service']('staff')->getCronAdmin();
}