Quellcode durchsuchen

Fixes for Various Problems

own3mall vor 7 Jahren
Ursprung
Commit
9e225e8363

+ 2 - 0
includes/database_mysqli.php

@@ -2458,6 +2458,8 @@ class OGPDatabaseMySQL extends OGPDatabase
 			FROM `%1$sremote_servers` 
 			NATURAL JOIN `%1$sserver_homes` 
 			NATURAL JOIN `%1$sconfig_homes`
+			NATURAL JOIN `%1$sremote_server_ips`
+			NATURAL JOIN `%1$shome_ip_ports`
 			WHERE `home_id` = %2$d;',
 			$this->table_prefix,
 			$this->realEscapeSingle($home_id));

+ 24 - 0
includes/functions.php

@@ -871,4 +871,28 @@ function getThemePath()
 	}
 	return $path;
 }
+
+function updateAllPanelModules(){
+	if(file_exists('modules/modulemanager/module_handling.php')){
+		require_once('modules/modulemanager/module_handling.php');
+
+		$modules = $db->getInstalledModules();
+		// update module manager first
+		foreach ( $modules as $row )
+		{
+			if($row['folder'] == 'modulemanager')
+			{
+				update_module($db, $row['id'], $row['folder']);
+				break;
+			}
+		}
+		
+		foreach ( $modules as $row )
+		{
+			if($row['folder'] == 'modulemanager')//already updated
+				continue;
+			update_module($db, $row['id'], $row['folder']);
+		}
+	}
+}
 ?>

+ 3 - 0
includes/helpers.php

@@ -405,6 +405,9 @@ function runPostUpdateOperations(){
 		if(function_exists("updateCronJobsToNewApi")){
 			updateCronJobsToNewApi();
 		}
+		if(function_exists("updateAllPanelModules")){
+			updateAllPanelModules();
+		}
 	}
 }
 

+ 5 - 2
includes/view.php

@@ -56,8 +56,11 @@ class OGPView {
         
         // Our global CSS goes first so that themes can override
         $this->header_code = '<link rel="stylesheet" href="css/global.css">' . "\n";
-
-        $path = getThemePath();
+		if(function_exists("getThemePath")){
+			$path = getThemePath();
+		}else{
+			$path = 'themes/Revolution/';
+		}
 
 		$page = file_get_contents($path.'layout.html');
 		@$top = file_get_contents($path.'top.html');

+ 1 - 19
modules/modulemanager/update_modules.php

@@ -29,25 +29,7 @@ function exec_ogp_module()
 
     print "<h2>".get_lang_f('updating_modules')."</h2>";
 
-    require_once('modules/modulemanager/module_handling.php');
-
-    $modules = $db->getInstalledModules();
-    // update module manager first
-    foreach ( $modules as $row )
-	{
-		if($row['folder'] == 'modulemanager')
-		{
-			update_module($db, $row['id'], $row['folder']);
-			break;
-		}
-	}
-    
-    foreach ( $modules as $row )
-    {
-		if($row['folder'] == 'modulemanager')//already updated
-			continue;
-		update_module($db, $row['id'], $row['folder']);
-    }
+    updateAllPanelModules();
 
 	print "<p>".get_lang_f('updating_finished')."</p>";
 	

+ 1 - 0
modules/update/navigation.xml

@@ -2,4 +2,5 @@
   <page key="default" file="update.php" access="admin" />
   <page key="updating" file="updating.php" access="admin" />
   <page key="blacklist" file="blacklist.php" access="admin" />
+  <page key="postupdate" file="post_update.php" access="admin" />
 </navigation>

+ 33 - 0
modules/update/post_update.php

@@ -0,0 +1,33 @@
+<?php
+/*
+ *
+ * OGP - Open Game Panel
+ * Copyright (C) 2008 - 2018 The OGP Development Team
+ *
+ * http://www.opengamepanel.org/
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.
+ *
+ */
+
+ // todo, make checking and updating functions for updateing on the background.
+ // todo, more specified updates in smaller packages
+
+function exec_ogp_module()
+{
+	global $db, $settings;
+	runPostUpdateOperations();
+}
+?>

+ 8 - 0
modules/user_games/del_home.php

@@ -149,6 +149,14 @@ function exec_ogp_module() {
 			}
 		}
 		
+		// Delete cronjobs
+		if(file_exists('modules/cron/shared_cron_functions.php')){
+			require_once('modules/cron/shared_cron_functions.php');
+			if(function_exists("deleteJobsByHomeServerID")){
+				deleteJobsByHomeServerID($home_id);
+			}
+		}
+		
 		if ( $db->deleteGameHome($home_id) === FALSE )
 		{
 			print_failure(get_lang("failed_to_remove_gamehome_from_database"));