Jump to content
Froxlor Forum
  • 0

update 0.9.1 to 0.9.2 fails


Restless

Question

Hello,

 

im new here and switched to froxler after using syscp.

 

Today i want to update to release 0.9.2 but if i update froxlor, i become an error:

 

 

Updating from 0.9.1 to 0.9.2
Checking whether last-system-guid is sane
Fatal error: Call to a member function logAction() on a non-object in /var/www/froxlor/lib/functions/system/function.checklastguid.php on line 77

 

 

(froxlor 0.9.1 works fine)

 

System:

Debian Lenny 5

Apache 2

Froxlor 0.9.1

 

hope someone can help me ;)

Link to post
Share on other sites

3 answers to this question

Recommended Posts

ouch, just realized checkLastGuid() is a cron-function and therefore uses the cron-logger, quickfix:

 

open file: /var/www/froxlor/lib/functions/system/function.checklastguid.php

 

and change to:

(basically only the first few lines and then $cronlog => $mylog)

 

function checkLastGuid($froxlor_guid = 0)
{
global $log, $cronlog;

$mylog = null;
if (isset($cronlog) && $cronlog instanceof FroxlorLogger) {
	$mylog = $cronlog;
} else {
	$mylog = $log;
}

$group_lines = array();
$group_guids = array();
$update_to_guid = 0;

$g_file = '/etc/group';

if(file_exists($g_file))
{
	if(is_readable($g_file))
	{
		if(true == ($groups = file_get_contents($g_file)))
		{
			$group_lines = explode("\n", $groups);

			foreach($group_lines as $group)
			{
				$group_guids[] = explode(":", $group);
			}

			foreach($group_guids as $idx => $group)
			{
				/**
				 * nogroup | nobody have very high guids
				 * ignore them
				 */
				if($group[0] == 'nogroup'
					|| $group[0] == 'nobody'
				) {
					continue;
				}

				$guid = isset($group[2]) ? (int)$group[2] : 0;

				if($guid > $froxlor_guid)
				{
					$update_to_guid = $guid;
				}
			}

			if($update_to_guid > $froxlor_guid)
			{
				$mylog->logAction(CRON_ACTION, LOG_NOTICE, 'Updating froxlor last guid to '.$update_to_guid);
				saveSetting('system', 'lastguid', $update_to_guid);
				$settings['system']['lastguid'] = $update_to_guid;
			}
		}
		else
		{
			$mylog->logAction(CRON_ACTION, LOG_NOTICE, 'File /etc/group not readable; cannot check for latest guid');
		}
	}
	else
	{
		$mylog->logAction(CRON_ACTION, LOG_NOTICE, 'File /etc/group not readable; cannot check for latest guid');
	}
}
else
{
	$mylog->logAction(CRON_ACTION, LOG_NOTICE, 'File /etc/group does not exist; cannot check for latest guid');
}
}

Link to post
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...