fix auto-update of database in cronjob if activated
Signed-off-by: Michael Kaufmann (d00p) <d00p@froxlor.org>
This commit is contained in:
@@ -14,9 +14,11 @@
|
|||||||
* @package Install
|
* @package Install
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
if (! defined('AREA') || (defined('AREA') && AREA != 'admin') || ! isset($userinfo['loginname']) || (isset($userinfo['loginname']) && $userinfo['loginname'] == '')) {
|
if (!defined('_CRON_UPDATE')) {
|
||||||
header('Location: ../../../../index.php');
|
if (! defined('AREA') || (defined('AREA') && AREA != 'admin') || ! isset($userinfo['loginname']) || (isset($userinfo['loginname']) && $userinfo['loginname'] == '')) {
|
||||||
exit();
|
header('Location: ../../../../index.php');
|
||||||
|
exit();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (isFroxlorVersion('0.9-r0')) {
|
if (isFroxlorVersion('0.9-r0')) {
|
||||||
|
|||||||
@@ -17,13 +17,15 @@
|
|||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
|
|
||||||
if (!defined('AREA')
|
if (!defined('_CRON_UPDATE')) {
|
||||||
|| (defined('AREA') && AREA != 'admin')
|
if (!defined('AREA')
|
||||||
|| !isset($userinfo['loginname'])
|
|| (defined('AREA') && AREA != 'admin')
|
||||||
|| (isset($userinfo['loginname']) && $userinfo['loginname'] == '')
|
|| !isset($userinfo['loginname'])
|
||||||
) {
|
|| (isset($userinfo['loginname']) && $userinfo['loginname'] == '')
|
||||||
header('Location: ../index.php');
|
) {
|
||||||
exit;
|
header('Location: ../index.php');
|
||||||
|
exit;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
$updatelog = FroxlorLogger::getInstanceOf(array('loginname' => 'updater'));
|
$updatelog = FroxlorLogger::getInstanceOf(array('loginname' => 'updater'));
|
||||||
|
|||||||
@@ -205,6 +205,7 @@ if (hasUpdates($version) || hasDbUpdates($dbversion)
|
|||||||
fwrite($debugHandler, '*** WARNING *** - all new settings etc. will be stored with the default value, that might not always be right for your system!' . "\n");
|
fwrite($debugHandler, '*** WARNING *** - all new settings etc. will be stored with the default value, that might not always be right for your system!' . "\n");
|
||||||
fwrite($debugHandler, "*** WARNING *** - If you don't want this to happen in the future consider removing the --allow-autoupdate flag from the cronjob\n");
|
fwrite($debugHandler, "*** WARNING *** - If you don't want this to happen in the future consider removing the --allow-autoupdate flag from the cronjob\n");
|
||||||
// including update procedures
|
// including update procedures
|
||||||
|
define('_CRON_UPDATE', 1);
|
||||||
include_once FROXLOR_INSTALL_DIR.'/install/updatesql.php';
|
include_once FROXLOR_INSTALL_DIR.'/install/updatesql.php';
|
||||||
// pew - everything went better than expected
|
// pew - everything went better than expected
|
||||||
$cronlog->logAction(CRON_ACTION, LOG_WARNING, 'Automatic update done - you should check your settings to be sure everything is fine');
|
$cronlog->logAction(CRON_ACTION, LOG_WARNING, 'Automatic update done - you should check your settings to be sure everything is fine');
|
||||||
|
|||||||
Reference in New Issue
Block a user