fix logging in checklastguid() when not called from cronjob
This commit is contained in:
@@ -31,7 +31,14 @@
|
|||||||
*/
|
*/
|
||||||
function checkLastGuid($froxlor_guid = 0)
|
function checkLastGuid($froxlor_guid = 0)
|
||||||
{
|
{
|
||||||
global $cronlog;
|
global $log, $cronlog;
|
||||||
|
|
||||||
|
$mylog = null;
|
||||||
|
if (isset($cronlog) && $cronlog instanceof FroxlorLogger) {
|
||||||
|
$mylog = $cronlog;
|
||||||
|
} else {
|
||||||
|
$mylog = $log;
|
||||||
|
}
|
||||||
|
|
||||||
$group_lines = array();
|
$group_lines = array();
|
||||||
$group_guids = array();
|
$group_guids = array();
|
||||||
@@ -74,19 +81,19 @@ function checkLastGuid($froxlor_guid = 0)
|
|||||||
|
|
||||||
if($update_to_guid > $froxlor_guid)
|
if($update_to_guid > $froxlor_guid)
|
||||||
{
|
{
|
||||||
$cronlog->logAction(CRON_ACTION, LOG_NOTICE, 'Updating froxlor last guid to '.$update_to_guid);
|
$mylog->logAction(CRON_ACTION, LOG_NOTICE, 'Updating froxlor last guid to '.$update_to_guid);
|
||||||
saveSetting('system', 'lastguid', $update_to_guid);
|
saveSetting('system', 'lastguid', $update_to_guid);
|
||||||
$settings['system']['lastguid'] = $update_to_guid;
|
$settings['system']['lastguid'] = $update_to_guid;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
$cronlog->logAction(CRON_ACTION, LOG_NOTICE, 'File /etc/group not readable; cannot check for latest guid');
|
$mylog->logAction(CRON_ACTION, LOG_NOTICE, 'File /etc/group not readable; cannot check for latest guid');
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
$cronlog->logAction(CRON_ACTION, LOG_NOTICE, 'File /etc/group not readable; cannot check for latest guid');
|
$mylog->logAction(CRON_ACTION, LOG_NOTICE, 'File /etc/group not readable; cannot check for latest guid');
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
|
|||||||
Reference in New Issue
Block a user