From 72695f0356210b5ca68d33d09e91c00ed9d6c2b6 Mon Sep 17 00:00:00 2001
From: tbrehm <t.brehm@ispconfig.org>
Date: Tue, 12 Feb 2013 04:55:44 -0500
Subject: [PATCH] Merged Revisions 3771-3801 from stable branch.

---
 server/server.php |   11 ++++++++++-
 1 files changed, 10 insertions(+), 1 deletions(-)

diff --git a/server/server.php b/server/server.php
index 54a4b5b..e669c6e 100644
--- a/server/server.php
+++ b/server/server.php
@@ -45,7 +45,13 @@
 	
 	if(!is_array($server_db_record)) die('Unable to load the server configuration from database.');
 	
-	$conf['last_datalog_id'] = (int) $server_db_record['updated'];
+	//* Get the number of the last processed datalog_id, if the id of the local server 
+	//* is > then the one of the remote system, then use the local ID as we might not have
+	//* reached the remote server during the last run then.
+	$local_server_db_record = $app->db->queryOneRecord("SELECT * FROM server WHERE server_id = " . $conf['server_id']);
+	$conf['last_datalog_id'] = (int) max($server_db_record['updated'],$local_server_db_record['updated']);
+	unset($local_server_db_record);
+	
 	$conf['mirror_server_id'] = (int) $server_db_record['mirror_server_id'];
 
 	// Load the ini_parser
@@ -153,6 +159,9 @@
 	$app->modules->loadModules('all');
 	//** Load the plugins that are in the plugins-enabled folder
 	$app->plugins->loadPlugins('all');
+	
+	$app->plugins->raiseAction('server_plugins_loaded', '');
+	
 	if ($tmp_num_records > 0) {
 		$app->log("Found $tmp_num_records changes, starting update process.", LOGLEVEL_DEBUG);
 		//** Go through the sys_datalog table and call the processing functions

--
Gitblit v1.9.1