mahara-contributors team mailing list archive
-
mahara-contributors team
-
Mailing list archive
-
Message #56724
[Bug 1851699] Re: cron.php with '$cfg->urlsecret' dosen't work on cronjob under PHP FastCGI enviroment.
Hmm, in simplesamlphp they do this check as:
if (php_sapi_name() === 'cli' || defined('STDIN')) {
...
}
As there are a few places in mahara where we check the CLI we should
make a function to check this.
I'll update the patch to handle these places.
- can you please test https://reviews.mahara.org/#/c/10578/3 to see if
the changes work for your environment please?
--
You received this bug notification because you are a member of Mahara
Contributors, which is subscribed to Mahara.
Matching subscriptions: Subscription for all Mahara Contributors -- please ask on #mahara-dev or mahara.org forum before editing or unsubscribing it!
https://bugs.launchpad.net/bugs/1851699
Title:
cron.php with '$cfg->urlsecret' dosen't work on cronjob under PHP
FastCGI enviroment.
Status in Mahara:
New
Bug description:
When we set $cfg->urlsecret on config.php, cron.php doesn't work on
cronjob under PHP FastCGI environment.
So we need to add one more condition to cron.php as below.
File to modify:
lib/cron.php
Line:
40
[before]
if (php_sapi_name() != 'cli' && get_config('urlsecret') !== null) {
$urlsecret = param_alphanumext('urlsecret', -1);
if ($urlsecret !== get_config('urlsecret')) {
die_info(get_string('accessdeniednourlsecret', 'error'));
}
}
[after]
if (php_sapi_name() != 'cli' && substr(php_sapi_name(), 0, 3) !== 'cgi' && get_config('urlsecret') !== null) {
$urlsecret = param_alphanumext('urlsecret', -1);
if ($urlsecret !== get_config('urlsecret')) {
die_info(get_string('accessdeniednourlsecret', 'error'));
}
}
Ref:
[PHP: php_sapi_name - Manual]
https://www.php.net/manual/en/function.php-sapi-name.php
To manage notifications about this bug go to:
https://bugs.launchpad.net/mahara/+bug/1851699/+subscriptions
References