Kaynağa Gözat

Merge remote-tracking branch 'refs/remotes/OpenGamePanel/master'

Adjokip 8 yıl önce
ebeveyn
işleme
6080a99042

+ 19 - 0
js/modules/cron.js

@@ -0,0 +1,19 @@
+$(document).ready(function(){
+    $("select[name='homeid_ip_port']").change(function(e){
+		checkSteamSupportAutoUpdate($(this));
+	});
+	
+	checkSteamSupportAutoUpdate($("select[name='homeid_ip_port']").first());
+});
+
+function checkSteamSupportAutoUpdate(elem){
+	var curOpt = $("option:selected", $(elem));
+	if(curOpt.attr('steam')){
+		$("option[value='steam_auto_update']", $("select[name='action']", $(elem).parent().prev())).removeAttr('disabled');
+	}else{
+		$("option[value='steam_auto_update']", $("select[name='action']", $(elem).parent().prev())).attr('disabled','disabled');
+		if($("option[value='steam_auto_update']", $("select[name='action']", $(elem).parent().prev())).is(':selected')){
+			$("select[name='action'] option:enabled:first", $(elem).parent().prev()).prop('selected', 'selected').change();
+		}
+	}
+}

+ 0 - 0
js/new file


+ 47 - 0
lang/Arabic/modules/cron.php

@@ -0,0 +1,47 @@
+<?php
+/*
+ *
+ * OGP - Open Game Panel
+ * Copyright (C) 2008 - 2017 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.
+ *
+ */
+
+define('OGP_LANG_minute', "دقيقة");
+define('OGP_LANG_hour', "ساعة");
+define('OGP_LANG_day', "يوم");
+define('OGP_LANG_month', "شهر");
+define('OGP_LANG_day_of_the_week', "يوم/أسبوع");
+define('OGP_LANG_action', "عمل");
+define('OGP_LANG_steam_auto_update', "التحديث التلقائي لSteam");
+define('OGP_LANG_stop', "إيقاف");
+define('OGP_LANG_start', "تشغيل");
+define('OGP_LANG_restart', "إعادة التشغيل");
+define('OGP_LANG_command', "الأمر");
+define('OGP_LANG_add', "إضافة");
+define('OGP_LANG_remove', "حذف");
+define('OGP_LANG_now', "الأن");
+define('OGP_LANG_schedule_new_job', "جدولة وظيفة جديدة");
+define('OGP_LANG_scheduled_jobs', "المهام المجدولة");
+define('OGP_LANG_there_are_no_scheduled_jobs', "لا توجد أية مهام مجدولة");
+define('OGP_LANG_cron_events', "أحداث الCron");
+define('OGP_LANG_refresh_interval', "الفاصل الزمني للتحديث");
+define('OGP_LANG_cron_no_servers_tied_to_account', "لا توجد خوادم لعبة تعيين مباشرة إلى حسابك.");
+define('OGP_LANG_cron_admin_link_display_text', "إدارة كرون (جميع الخوادم)");
+define('OGP_LANG_cron_admin_no_ogp_servers_to_display', "ليست هناك أي ملقمات اللعبة التي تم تكوينها حاليا في أوبن قيم بانل");
+?>

+ 24 - 20
lang/Danish/modules/cron.php

@@ -2,7 +2,7 @@
 /*
 /*
  *
  *
  * OGP - Open Game Panel
  * OGP - Open Game Panel
- * Copyright (C) 2008 - 2016 The OGP Development Team
+ * Copyright (C) 2008 - 2017 The OGP Development Team
  *
  *
  * http://www.opengamepanel.org/
  * http://www.opengamepanel.org/
  *
  *
@@ -22,22 +22,26 @@
  *
  *
  */
  */
 
 
-define('minute', "Minute");
-define('hour', "Hour");
-define('day', "Day");
-define('month', "Month");
-define('day_of_the_week', "D/Week");
-define('action', "Action");
-define('stop', "Stop");
-define('start', "Start");
-define('restart', "Restart");
-define('command', "Command");
-define('add', "Add");
-define('remove', "Remove");
-define('now', "Now");
-define('schedule_new_job', "Schedule a new job");
-define('scheduled_jobs', "Scheduled jobs");
-define('there_are_no_scheduled_jobs', "There are no scheduled jobs");
-define('cron_events', "Cron Events");
-define('refresh_interval', "Log genopfrisker interval");
-?>
+define('OGP_LANG_minute', "Minute");
+define('OGP_LANG_hour', "Hour");
+define('OGP_LANG_day', "Day");
+define('OGP_LANG_month', "Month");
+define('OGP_LANG_day_of_the_week', "D/Week");
+define('OGP_LANG_action', "Action");
+define('OGP_LANG_steam_auto_update', "Steam Auto Update");
+define('OGP_LANG_stop', "Stop");
+define('OGP_LANG_start', "Start");
+define('OGP_LANG_restart', "Restart");
+define('OGP_LANG_command', "Command");
+define('OGP_LANG_add', "Add");
+define('OGP_LANG_remove', "Remove");
+define('OGP_LANG_now', "Now");
+define('OGP_LANG_schedule_new_job', "Schedule a new job");
+define('OGP_LANG_scheduled_jobs', "Scheduled jobs");
+define('OGP_LANG_there_are_no_scheduled_jobs', "There are no scheduled jobs");
+define('OGP_LANG_cron_events', "Cron Events");
+define('OGP_LANG_refresh_interval', "Log genopfrisker interval");
+define('OGP_LANG_cron_no_servers_tied_to_account', "There are no game servers directly assigned to your account.");
+define('OGP_LANG_cron_admin_link_display_text', "Cron Administration (All Servers)");
+define('OGP_LANG_cron_admin_no_ogp_servers_to_display', "There aren't any game servers currently configured in OGP.");
+?>

+ 24 - 20
lang/English/modules/cron.php

@@ -2,7 +2,7 @@
 /*
 /*
  *
  *
  * OGP - Open Game Panel
  * OGP - Open Game Panel
- * Copyright (C) 2008 - 2016 The OGP Development Team
+ * Copyright (C) 2008 - 2017 The OGP Development Team
  *
  *
  * http://www.opengamepanel.org/
  * http://www.opengamepanel.org/
  *
  *
@@ -22,22 +22,26 @@
  *
  *
  */
  */
 
 
-define('minute', "Minute");
-define('hour', "Hour");
-define('day', "Day");
-define('month', "Month");
-define('day_of_the_week', "D/Week");
-define('action', "Action");
-define('stop', "Stop");
-define('start', "Start");
-define('restart', "Restart");
-define('command', "Command");
-define('add', "Add");
-define('remove', "Remove");
-define('now', "Now");
-define('schedule_new_job', "Schedule a new job");
-define('scheduled_jobs', "Scheduled jobs");
-define('there_are_no_scheduled_jobs', "There are no scheduled jobs");
-define('cron_events', "Cron Events");
-define('refresh_interval', "Refresh Interval");
-?>
+define('OGP_LANG_minute', "Minute");
+define('OGP_LANG_hour', "Hour");
+define('OGP_LANG_day', "Day");
+define('OGP_LANG_month', "Month");
+define('OGP_LANG_day_of_the_week', "D/Week");
+define('OGP_LANG_action', "Action");
+define('OGP_LANG_steam_auto_update', "Steam Auto Update");
+define('OGP_LANG_stop', "Stop");
+define('OGP_LANG_start', "Start");
+define('OGP_LANG_restart', "Restart");
+define('OGP_LANG_command', "Command");
+define('OGP_LANG_add', "Add");
+define('OGP_LANG_remove', "Remove");
+define('OGP_LANG_now', "Now");
+define('OGP_LANG_schedule_new_job', "Schedule a new job");
+define('OGP_LANG_scheduled_jobs', "Scheduled jobs");
+define('OGP_LANG_there_are_no_scheduled_jobs', "There are no scheduled jobs");
+define('OGP_LANG_cron_events', "Cron Events");
+define('OGP_LANG_refresh_interval', "Refresh Interval");
+define('OGP_LANG_cron_no_servers_tied_to_account', "There are no game servers directly assigned to your account.");
+define('OGP_LANG_cron_admin_link_display_text', "Cron Administration (All Servers)");
+define('OGP_LANG_cron_admin_no_ogp_servers_to_display', "There aren't any game servers currently configured in OGP.");
+?>

+ 24 - 20
lang/French/modules/cron.php

@@ -2,7 +2,7 @@
 /*
 /*
  *
  *
  * OGP - Open Game Panel
  * OGP - Open Game Panel
- * Copyright (C) 2008 - 2016 The OGP Development Team
+ * Copyright (C) 2008 - 2017 The OGP Development Team
  *
  *
  * http://www.opengamepanel.org/
  * http://www.opengamepanel.org/
  *
  *
@@ -22,22 +22,26 @@
  *
  *
  */
  */
 
 
-define('minute', "Minute");
-define('hour', "Heure");
-define('day', "Jour");
-define('month', "Mois");
-define('day_of_the_week', "J/Sem");
-define('action', "Action");
-define('stop', "Stop");
-define('start', "Start");
-define('restart', "Restart");
-define('command', "Commande");
-define('add', "Ajouter");
-define('remove', "Effacer");
-define('now', "Maintenant");
-define('schedule_new_job', "Planifier une action");
-define('scheduled_jobs', "Actions planifiées");
-define('there_are_no_scheduled_jobs', "Pas d'actions planifiées");
-define('cron_events', "Logs des Événements Planifiés");
-define('refresh_interval', "Intervalle d'actualisation");
-?>
+define('OGP_LANG_minute', "Minute");
+define('OGP_LANG_hour', "Heure");
+define('OGP_LANG_day', "Jour");
+define('OGP_LANG_month', "Mois");
+define('OGP_LANG_day_of_the_week', "J/Sem");
+define('OGP_LANG_action', "Action");
+define('OGP_LANG_steam_auto_update', "Mise à Jour Steam Automatique");
+define('OGP_LANG_stop', "Stop");
+define('OGP_LANG_start', "Start");
+define('OGP_LANG_restart', "Restart");
+define('OGP_LANG_command', "Commande");
+define('OGP_LANG_add', "Ajouter");
+define('OGP_LANG_remove', "Effacer");
+define('OGP_LANG_now', "Maintenant");
+define('OGP_LANG_schedule_new_job', "Planifier une action");
+define('OGP_LANG_scheduled_jobs', "Actions planifiées");
+define('OGP_LANG_there_are_no_scheduled_jobs', "Pas d'actions planifiées");
+define('OGP_LANG_cron_events', "Logs des Événements Planifiés");
+define('OGP_LANG_refresh_interval', "Intervalle d'actualisation");
+define('OGP_LANG_cron_no_servers_tied_to_account', "Il n'y a pas de serveur assigné sur votre compte.");
+define('OGP_LANG_cron_admin_link_display_text', "Administration Cron (Tous les Serveurs)");
+define('OGP_LANG_cron_admin_no_ogp_servers_to_display', "Il n'y a pas de serveur de jeu configuré dans OGP.");
+?>

+ 24 - 20
lang/German/modules/cron.php

@@ -2,7 +2,7 @@
 /*
 /*
  *
  *
  * OGP - Open Game Panel
  * OGP - Open Game Panel
- * Copyright (C) 2008 - 2016 The OGP Development Team
+ * Copyright (C) 2008 - 2017 The OGP Development Team
  *
  *
  * http://www.opengamepanel.org/
  * http://www.opengamepanel.org/
  *
  *
@@ -22,22 +22,26 @@
  *
  *
  */
  */
 
 
-define('minute', "Minute");
-define('hour', "Stunde");
-define('day', "Tag");
-define('month', "Monat");
-define('day_of_the_week', "Tag/Woche");
-define('action', "Aktion");
-define('stop', "Stop");
-define('start', "Start");
-define('restart', "Neustart");
-define('command', "Befehl");
-define('add', "Hinzufügen");
-define('remove', "Entfernen");
-define('now', "Jetzt");
-define('schedule_new_job', "Schedule a new job");
-define('scheduled_jobs', "Scheduled jobs");
-define('there_are_no_scheduled_jobs', "There are no scheduled jobs");
-define('cron_events', "Cron Events");
-define('refresh_interval', "Refresh Interval");
-?>
+define('OGP_LANG_minute', "Minute");
+define('OGP_LANG_hour', "Stunde");
+define('OGP_LANG_day', "Tag");
+define('OGP_LANG_month', "Monat");
+define('OGP_LANG_day_of_the_week', "Tag/Woche");
+define('OGP_LANG_action', "Aktion");
+define('OGP_LANG_steam_auto_update', "Steam Auto Update");
+define('OGP_LANG_stop', "Stop");
+define('OGP_LANG_start', "Start");
+define('OGP_LANG_restart', "Neustart");
+define('OGP_LANG_command', "Befehl");
+define('OGP_LANG_add', "Hinzufügen");
+define('OGP_LANG_remove', "Entfernen");
+define('OGP_LANG_now', "Jetzt");
+define('OGP_LANG_schedule_new_job', "Neue Aufgabe planen");
+define('OGP_LANG_scheduled_jobs', "Geplante Aufgaben");
+define('OGP_LANG_there_are_no_scheduled_jobs', "Es gibt keine geplanten Aufgaben");
+define('OGP_LANG_cron_events', "Cron Ereignisse");
+define('OGP_LANG_refresh_interval', "Aktualisierungsinterval");
+define('OGP_LANG_cron_no_servers_tied_to_account', "Ihrem Konto sind keine Spieleserver direkt zugeordnet.");
+define('OGP_LANG_cron_admin_link_display_text', "Cron Administration (Alle Server)");
+define('OGP_LANG_cron_admin_no_ogp_servers_to_display', "Derzeit sind keine Spieleserver in OGP konfiguriert.");
+?>

+ 24 - 20
lang/Hungarian/modules/cron.php

@@ -2,7 +2,7 @@
 /*
 /*
  *
  *
  * OGP - Open Game Panel
  * OGP - Open Game Panel
- * Copyright (C) 2008 - 2016 The OGP Development Team
+ * Copyright (C) 2008 - 2017 The OGP Development Team
  *
  *
  * http://www.opengamepanel.org/
  * http://www.opengamepanel.org/
  *
  *
@@ -22,22 +22,26 @@
  *
  *
  */
  */
 
 
-define('minute', "Perc");
-define('hour', "Óra");
-define('day', "Nap");
-define('month', "Hónap");
-define('day_of_the_week', "N/Hét");
-define('action', "Művelet");
-define('stop', "Leállítás");
-define('start', "Elindítás");
-define('restart', "Újraindítás");
-define('command', "Parancs");
-define('add', "Hozzáadás");
-define('remove', "Eltávolítás");
-define('now', "Most");
-define('schedule_new_job', "Új feladat ütemezése");
-define('scheduled_jobs', "Ütemezett feladatok");
-define('there_are_no_scheduled_jobs', "Nincsenek ütemezett feladatok");
-define('cron_events', "Cron események");
-define('refresh_interval', "Frissítési intervallum");
-?>
+define('OGP_LANG_minute', "Perc");
+define('OGP_LANG_hour', "Óra");
+define('OGP_LANG_day', "Nap");
+define('OGP_LANG_month', "Hónap");
+define('OGP_LANG_day_of_the_week', "N/Hét");
+define('OGP_LANG_action', "Művelet");
+define('OGP_LANG_steam_auto_update', "Steam automatikus frissítés");
+define('OGP_LANG_stop', "Leállítás");
+define('OGP_LANG_start', "Elindítás");
+define('OGP_LANG_restart', "Újraindítás");
+define('OGP_LANG_command', "Parancs");
+define('OGP_LANG_add', "Hozzáadás");
+define('OGP_LANG_remove', "Eltávolítás");
+define('OGP_LANG_now', "Most");
+define('OGP_LANG_schedule_new_job', "Új feladat ütemezése");
+define('OGP_LANG_scheduled_jobs', "Ütemezett feladatok");
+define('OGP_LANG_there_are_no_scheduled_jobs', "Nincsenek ütemezett feladatok");
+define('OGP_LANG_cron_events', "Cron események");
+define('OGP_LANG_refresh_interval', "Frissítési intervallum");
+define('OGP_LANG_cron_no_servers_tied_to_account', "Nincsenek játékszerverek közvetlenül hozzárendelve a fiókodhoz.");
+define('OGP_LANG_cron_admin_link_display_text', "Cron adminisztráció (minden szerver)");
+define('OGP_LANG_cron_admin_no_ogp_servers_to_display', "Jelenleg nincsenek játékszerverek beállítva az OGP-ben.");
+?>

+ 47 - 0
lang/Italian/modules/cron.php

@@ -0,0 +1,47 @@
+<?php
+/*
+ *
+ * OGP - Open Game Panel
+ * Copyright (C) 2008 - 2017 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.
+ *
+ */
+
+define('OGP_LANG_minute', "Minute");
+define('OGP_LANG_hour', "Hour");
+define('OGP_LANG_day', "Day");
+define('OGP_LANG_month', "Month");
+define('OGP_LANG_day_of_the_week', "D/Week");
+define('OGP_LANG_action', "Action");
+define('OGP_LANG_steam_auto_update', "Steam Auto Update");
+define('OGP_LANG_stop', "Stop");
+define('OGP_LANG_start', "Start");
+define('OGP_LANG_restart', "Restart");
+define('OGP_LANG_command', "Command");
+define('OGP_LANG_add', "Add");
+define('OGP_LANG_remove', "Remove");
+define('OGP_LANG_now', "Now");
+define('OGP_LANG_schedule_new_job', "Schedule a new job");
+define('OGP_LANG_scheduled_jobs', "Scheduled jobs");
+define('OGP_LANG_there_are_no_scheduled_jobs', "There are no scheduled jobs");
+define('OGP_LANG_cron_events', "Cron Events");
+define('OGP_LANG_refresh_interval', "Refresh Interval");
+define('OGP_LANG_cron_no_servers_tied_to_account', "There are no game servers directly assigned to your account.");
+define('OGP_LANG_cron_admin_link_display_text', "Cron Administration (All Servers)");
+define('OGP_LANG_cron_admin_no_ogp_servers_to_display', "There aren't any game servers currently configured in OGP.");
+?>

+ 47 - 0
lang/Persian/modules/cron.php

@@ -0,0 +1,47 @@
+<?php
+/*
+ *
+ * OGP - Open Game Panel
+ * Copyright (C) 2008 - 2017 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.
+ *
+ */
+
+define('OGP_LANG_minute', "دقیقه");
+define('OGP_LANG_hour', "ساعت");
+define('OGP_LANG_day', "روز");
+define('OGP_LANG_month', "ماه");
+define('OGP_LANG_day_of_the_week', "روز هفته");
+define('OGP_LANG_action', "Action");
+define('OGP_LANG_steam_auto_update', "به روزرسانی خودکار از Steam");
+define('OGP_LANG_stop', "توقف");
+define('OGP_LANG_start', "شروع");
+define('OGP_LANG_restart', "شروع دوباره");
+define('OGP_LANG_command', "دستور");
+define('OGP_LANG_add', "اضافه کردن");
+define('OGP_LANG_remove', "حذف کردن");
+define('OGP_LANG_now', "حالا");
+define('OGP_LANG_schedule_new_job', "Schedule a new job");
+define('OGP_LANG_scheduled_jobs', "Scheduled jobs");
+define('OGP_LANG_there_are_no_scheduled_jobs', "There are no scheduled jobs");
+define('OGP_LANG_cron_events', "رویداد های Cron");
+define('OGP_LANG_refresh_interval', "Refresh Interval");
+define('OGP_LANG_cron_no_servers_tied_to_account', "There are no game servers directly assigned to your account.");
+define('OGP_LANG_cron_admin_link_display_text', "Cron Administration (All Servers)");
+define('OGP_LANG_cron_admin_no_ogp_servers_to_display', "There aren't any game servers currently configured in OGP.");
+?>

+ 24 - 20
lang/Polish/modules/cron.php

@@ -2,7 +2,7 @@
 /*
 /*
  *
  *
  * OGP - Open Game Panel
  * OGP - Open Game Panel
- * Copyright (C) 2008 - 2016 The OGP Development Team
+ * Copyright (C) 2008 - 2017 The OGP Development Team
  *
  *
  * http://www.opengamepanel.org/
  * http://www.opengamepanel.org/
  *
  *
@@ -22,22 +22,26 @@
  *
  *
  */
  */
 
 
-define('minute', "Minute");
-define('hour', "Godz");
-define('day', "Dni");
-define('month', "Miesiąc");
-define('day_of_the_week', "D/Week");
-define('action', "Akcja");
-define('stop', "Stop");
-define('start', "Start");
-define('restart', "Restart");
-define('command', "Komenda");
-define('add', "Dodaj");
-define('remove', "Usunąć");
-define('now', "Teraz");
-define('schedule_new_job', "Zaplanować nowe zadanie");
-define('scheduled_jobs', "Zaplanowane zadania");
-define('there_are_no_scheduled_jobs', "Brak zaplanowanych zadań");
-define('cron_events', "Wydarzenia Cron");
-define('refresh_interval', "Powtórne Odświeżenie");
-?>
+define('OGP_LANG_minute', "Minuta");
+define('OGP_LANG_hour', "Godz");
+define('OGP_LANG_day', "Dni");
+define('OGP_LANG_month', "Miesiąc");
+define('OGP_LANG_day_of_the_week', "D/Tydzień");
+define('OGP_LANG_action', "Akcja");
+define('OGP_LANG_steam_auto_update', "Automatycznie aktualizacje Steam");
+define('OGP_LANG_stop', "Stop");
+define('OGP_LANG_start', "Start");
+define('OGP_LANG_restart', "Restart");
+define('OGP_LANG_command', "Komenda");
+define('OGP_LANG_add', "Dodaj");
+define('OGP_LANG_remove', "Usuń");
+define('OGP_LANG_now', "Teraz");
+define('OGP_LANG_schedule_new_job', "Zaplanować nowe zadanie");
+define('OGP_LANG_scheduled_jobs', "Zaplanowane zadania");
+define('OGP_LANG_there_are_no_scheduled_jobs', "Brak zaplanowanych zadań");
+define('OGP_LANG_cron_events', "Wydarzenia Cron");
+define('OGP_LANG_refresh_interval', "Powtórne Odświeżenie");
+define('OGP_LANG_cron_no_servers_tied_to_account', "There are no game servers directly assigned to your account.");
+define('OGP_LANG_cron_admin_link_display_text', "Cron Administration (All Servers)");
+define('OGP_LANG_cron_admin_no_ogp_servers_to_display', "There aren't any game servers currently configured in OGP.");
+?>

+ 47 - 0
lang/Portuguese(Brazil)/modules/cron.php

@@ -0,0 +1,47 @@
+<?php
+/*
+ *
+ * OGP - Open Game Panel
+ * Copyright (C) 2008 - 2017 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.
+ *
+ */
+
+define('OGP_LANG_minute', "Minuto");
+define('OGP_LANG_hour', "Hora");
+define('OGP_LANG_day', "Dia");
+define('OGP_LANG_month', "Mês");
+define('OGP_LANG_day_of_the_week', "D/Semana");
+define('OGP_LANG_action', "Ação");
+define('OGP_LANG_steam_auto_update', "Atualização automática do Steam");
+define('OGP_LANG_stop', "Pare");
+define('OGP_LANG_start', "Iniciar");
+define('OGP_LANG_restart', "Reiniciar");
+define('OGP_LANG_command', "Comando");
+define('OGP_LANG_add', "Adicionar");
+define('OGP_LANG_remove', "Remover");
+define('OGP_LANG_now', "Agora");
+define('OGP_LANG_schedule_new_job', "Agendar um novo trabalho");
+define('OGP_LANG_scheduled_jobs', "Trabalhos agendados");
+define('OGP_LANG_there_are_no_scheduled_jobs', "Não existem trabalhos agendados");
+define('OGP_LANG_cron_events', "Tarefas Cron");
+define('OGP_LANG_refresh_interval', "Intervalo de atualização");
+define('OGP_LANG_cron_no_servers_tied_to_account', "Não há servidores de jogos diretamente atribuídos à sua conta.");
+define('OGP_LANG_cron_admin_link_display_text', "Administração de Cron (todos os servers)");
+define('OGP_LANG_cron_admin_no_ogp_servers_to_display', "Não há nenhum servidor de jogos atualmente configurado no painel.");
+?>

+ 24 - 20
lang/Portuguese/modules/cron.php

@@ -2,7 +2,7 @@
 /*
 /*
  *
  *
  * OGP - Open Game Panel
  * OGP - Open Game Panel
- * Copyright (C) 2008 - 2016 The OGP Development Team
+ * Copyright (C) 2008 - 2017 The OGP Development Team
  *
  *
  * http://www.opengamepanel.org/
  * http://www.opengamepanel.org/
  *
  *
@@ -22,22 +22,26 @@
  *
  *
  */
  */
 
 
-define('minute', "Minute");
-define('hour', "Hour");
-define('day', "Day");
-define('month', "Month");
-define('day_of_the_week', "D/Week");
-define('action', "Action");
-define('stop', "Stop");
-define('start', "Start");
-define('restart', "Restart");
-define('command', "Command");
-define('add', "Add");
-define('remove', "Remove");
-define('now', "Now");
-define('schedule_new_job', "Schedule a new job");
-define('scheduled_jobs', "Scheduled jobs");
-define('there_are_no_scheduled_jobs', "There are no scheduled jobs");
-define('cron_events', "Cron Events");
-define('refresh_interval', "Refresh Interval");
-?>
+define('OGP_LANG_minute', "Minuto");
+define('OGP_LANG_hour', "Hora");
+define('OGP_LANG_day', "Dia");
+define('OGP_LANG_month', "Mês");
+define('OGP_LANG_day_of_the_week', "Dia de Semana");
+define('OGP_LANG_action', "Ação");
+define('OGP_LANG_steam_auto_update', "Actualização automática via STEAM");
+define('OGP_LANG_stop', "Parar");
+define('OGP_LANG_start', "Iniciar");
+define('OGP_LANG_restart', "Reiniciar");
+define('OGP_LANG_command', "Comando");
+define('OGP_LANG_add', "Adicionar");
+define('OGP_LANG_remove', "Remover");
+define('OGP_LANG_now', "Agora");
+define('OGP_LANG_schedule_new_job', "Programar uma nova tarefa");
+define('OGP_LANG_scheduled_jobs', "Tarefas programadas");
+define('OGP_LANG_there_are_no_scheduled_jobs', "Não existem tarefas programadas");
+define('OGP_LANG_cron_events', "Tarefas Cron \"agendada de trabalho com base no tempo\"");
+define('OGP_LANG_refresh_interval', "Intervalo de actualização");
+define('OGP_LANG_cron_no_servers_tied_to_account', "Ups... Não há servidores de jogos directamente ainda atribuídos à sua conta.");
+define('OGP_LANG_cron_admin_link_display_text', "Administração de tarefas Cron (todos os servers)");
+define('OGP_LANG_cron_admin_no_ogp_servers_to_display', "Não há nenhum servidor de jogos actualmente configurado no painel.");
+?>

+ 47 - 0
lang/Romanian(Romania)/modules/cron.php

@@ -0,0 +1,47 @@
+<?php
+/*
+ *
+ * OGP - Open Game Panel
+ * Copyright (C) 2008 - 2017 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.
+ *
+ */
+
+define('OGP_LANG_minute', "Minute");
+define('OGP_LANG_hour', "Hour");
+define('OGP_LANG_day', "Day");
+define('OGP_LANG_month', "Month");
+define('OGP_LANG_day_of_the_week', "D/Week");
+define('OGP_LANG_action', "Action");
+define('OGP_LANG_steam_auto_update', "Steam Auto Update");
+define('OGP_LANG_stop', "Stop");
+define('OGP_LANG_start', "Start");
+define('OGP_LANG_restart', "Restart");
+define('OGP_LANG_command', "Command");
+define('OGP_LANG_add', "Add");
+define('OGP_LANG_remove', "Remove");
+define('OGP_LANG_now', "Now");
+define('OGP_LANG_schedule_new_job', "Schedule a new job");
+define('OGP_LANG_scheduled_jobs', "Scheduled jobs");
+define('OGP_LANG_there_are_no_scheduled_jobs', "There are no scheduled jobs");
+define('OGP_LANG_cron_events', "Cron Events");
+define('OGP_LANG_refresh_interval', "Refresh Interval");
+define('OGP_LANG_cron_no_servers_tied_to_account', "There are no game servers directly assigned to your account.");
+define('OGP_LANG_cron_admin_link_display_text', "Cron Administration (All Servers)");
+define('OGP_LANG_cron_admin_no_ogp_servers_to_display', "There aren't any game servers currently configured in OGP.");
+?>

+ 24 - 20
lang/Russian/modules/cron.php

@@ -2,7 +2,7 @@
 /*
 /*
  *
  *
  * OGP - Open Game Panel
  * OGP - Open Game Panel
- * Copyright (C) 2008 - 2016 The OGP Development Team
+ * Copyright (C) 2008 - 2017 The OGP Development Team
  *
  *
  * http://www.opengamepanel.org/
  * http://www.opengamepanel.org/
  *
  *
@@ -22,22 +22,26 @@
  *
  *
  */
  */
 
 
-define('minute', "Minute");
-define('hour', "Hour");
-define('day', "Day");
-define('month', "Month");
-define('day_of_the_week', "D/Week");
-define('action', "Action");
-define('stop', "Stop");
-define('start', "Запуск");
-define('restart', "Restart");
-define('command', "RCON&nbsp;команда");
-define('add', "Add");
-define('remove', "Remove");
-define('now', "Now");
-define('schedule_new_job', "Schedule a new job");
-define('scheduled_jobs', "Scheduled jobs");
-define('there_are_no_scheduled_jobs', "There are no scheduled jobs");
-define('cron_events', "Cron Events");
-define('refresh_interval', "Интервал обновления консоли");
-?>
+define('OGP_LANG_minute', "Минуты");
+define('OGP_LANG_hour', "Часы");
+define('OGP_LANG_day', "Дни");
+define('OGP_LANG_month', "Месяц");
+define('OGP_LANG_day_of_the_week', "Неделя");
+define('OGP_LANG_action', "Действие");
+define('OGP_LANG_steam_auto_update', "Автообновление Steam");
+define('OGP_LANG_stop', "Стоп");
+define('OGP_LANG_start', "Запуск");
+define('OGP_LANG_restart', "Перезапустить");
+define('OGP_LANG_command', "RCON&nbsp;команда");
+define('OGP_LANG_add', "Добавить");
+define('OGP_LANG_remove', "Удалить");
+define('OGP_LANG_now', "Сейчас");
+define('OGP_LANG_schedule_new_job', "Запланировать новое задание");
+define('OGP_LANG_scheduled_jobs', "Запланированные задания");
+define('OGP_LANG_there_are_no_scheduled_jobs', "Запланированных заданий нет");
+define('OGP_LANG_cron_events', "События задания");
+define('OGP_LANG_refresh_interval', "Интервал обновления консоли");
+define('OGP_LANG_cron_no_servers_tied_to_account', "Для вашей учетной записи не назначен ни один игровой сервер.");
+define('OGP_LANG_cron_admin_link_display_text', "Администрирование Планировщика (все сервера)");
+define('OGP_LANG_cron_admin_no_ogp_servers_to_display', "Нет ни одного игрового сервер в конфигурации OGP.");
+?>

+ 24 - 20
lang/Spanish/modules/cron.php

@@ -2,7 +2,7 @@
 /*
 /*
  *
  *
  * OGP - Open Game Panel
  * OGP - Open Game Panel
- * Copyright (C) 2008 - 2016 The OGP Development Team
+ * Copyright (C) 2008 - 2017 The OGP Development Team
  *
  *
  * http://www.opengamepanel.org/
  * http://www.opengamepanel.org/
  *
  *
@@ -22,22 +22,26 @@
  *
  *
  */
  */
 
 
-define('minute', "Minuto");
-define('hour', "Hora");
-define('day', "Dia");
-define('month', "Mes");
-define('day_of_the_week', "D/Sem");
-define('action', "Acción");
-define('stop', "Parar");
-define('start', "Iniciar");
-define('restart', "Reiniciar");
-define('command', "Comando");
-define('add', "Añadir");
-define('remove', "Eliminar");
-define('now', "Ahora");
-define('schedule_new_job', "Programar una tarea nueva");
-define('scheduled_jobs', "Tareas programadas");
-define('there_are_no_scheduled_jobs', "No hay tareas programadas");
-define('cron_events', "Eventos de Cron");
-define('refresh_interval', "Intervalo de refresco");
-?>
+define('OGP_LANG_minute', "Minuto");
+define('OGP_LANG_hour', "Hora");
+define('OGP_LANG_day', "Día");
+define('OGP_LANG_month', "Mes");
+define('OGP_LANG_day_of_the_week', "D/Semana");
+define('OGP_LANG_action', "Acción");
+define('OGP_LANG_steam_auto_update', "Steam Auto-Update");
+define('OGP_LANG_stop', "Parar");
+define('OGP_LANG_start', "Iniciar");
+define('OGP_LANG_restart', "Reiniciar");
+define('OGP_LANG_command', "Comando");
+define('OGP_LANG_add', "Añadir");
+define('OGP_LANG_remove', "Eliminar");
+define('OGP_LANG_now', "Ahora");
+define('OGP_LANG_schedule_new_job', "Programar una tarea nueva");
+define('OGP_LANG_scheduled_jobs', "Tareas programadas");
+define('OGP_LANG_there_are_no_scheduled_jobs', "No hay tareas programadas");
+define('OGP_LANG_cron_events', "Eventos de Cron");
+define('OGP_LANG_refresh_interval', "Intervalo de refresco");
+define('OGP_LANG_cron_no_servers_tied_to_account', "No hay servidores de juego directamente asignados a su cuenta.");
+define('OGP_LANG_cron_admin_link_display_text', "Administración de Cron (todos los servidores)");
+define('OGP_LANG_cron_admin_no_ogp_servers_to_display', "No hay ningún servidor de juego actualmente configurado en OGP.");
+?>

+ 47 - 0
lang/Swedish(Sweden)/modules/cron.php

@@ -0,0 +1,47 @@
+<?php
+/*
+ *
+ * OGP - Open Game Panel
+ * Copyright (C) 2008 - 2017 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.
+ *
+ */
+
+define('OGP_LANG_minute', "Minut");
+define('OGP_LANG_hour', "Timma");
+define('OGP_LANG_day', "Dag");
+define('OGP_LANG_month', "Månad");
+define('OGP_LANG_day_of_the_week', "Dag i Veckan");
+define('OGP_LANG_action', "Handling");
+define('OGP_LANG_steam_auto_update', "Steam autouppdatera");
+define('OGP_LANG_stop', "Stop");
+define('OGP_LANG_start', "Start");
+define('OGP_LANG_restart', "Omstart");
+define('OGP_LANG_command', "Kommando");
+define('OGP_LANG_add', "Lägg till");
+define('OGP_LANG_remove', "Ta bort");
+define('OGP_LANG_now', "Nu");
+define('OGP_LANG_schedule_new_job', "Schemalägg ett nytt jobb");
+define('OGP_LANG_scheduled_jobs', "Schemalagda jobb");
+define('OGP_LANG_there_are_no_scheduled_jobs', "Det finns inga schemalagda jobb");
+define('OGP_LANG_cron_events', "Cron händelser");
+define('OGP_LANG_refresh_interval', "Uppdaterinsintervall");
+define('OGP_LANG_cron_no_servers_tied_to_account', "Det finns inga spelservrar direkt tilldelade till ditt konto.");
+define('OGP_LANG_cron_admin_link_display_text', "Cron administration (Alla Servrar)");
+define('OGP_LANG_cron_admin_no_ogp_servers_to_display', "Det finns just nu inga spelservrar konfigurerade i OGP.");
+?>

+ 47 - 0
lang/Turkish/modules/cron.php

@@ -0,0 +1,47 @@
+<?php
+/*
+ *
+ * OGP - Open Game Panel
+ * Copyright (C) 2008 - 2017 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.
+ *
+ */
+
+define('OGP_LANG_minute', "Minute");
+define('OGP_LANG_hour', "Hour");
+define('OGP_LANG_day', "Day");
+define('OGP_LANG_month', "Month");
+define('OGP_LANG_day_of_the_week', "D/Week");
+define('OGP_LANG_action', "Action");
+define('OGP_LANG_steam_auto_update', "Steam Auto Update");
+define('OGP_LANG_stop', "Stop");
+define('OGP_LANG_start', "Start");
+define('OGP_LANG_restart', "Restart");
+define('OGP_LANG_command', "Command");
+define('OGP_LANG_add', "Add");
+define('OGP_LANG_remove', "Remove");
+define('OGP_LANG_now', "Now");
+define('OGP_LANG_schedule_new_job', "Schedule a new job");
+define('OGP_LANG_scheduled_jobs', "Scheduled jobs");
+define('OGP_LANG_there_are_no_scheduled_jobs', "There are no scheduled jobs");
+define('OGP_LANG_cron_events', "Cron Events");
+define('OGP_LANG_refresh_interval', "Refresh Interval");
+define('OGP_LANG_cron_no_servers_tied_to_account', "There are no game servers directly assigned to your account.");
+define('OGP_LANG_cron_admin_link_display_text', "Cron Administration (All Servers)");
+define('OGP_LANG_cron_admin_no_ogp_servers_to_display', "There aren't any game servers currently configured in OGP.");
+?>

+ 65 - 167
modules/cron/cron.php

@@ -1,9 +1,9 @@
-<script type="text/javascript" src="js/jquery/jquery-1.11.0.min.js"></script>
+<script type="text/javascript" src="js/modules/cron.js"></script>
 <?php
 <?php
 /*
 /*
  *
  *
  * OGP - Open Game Panel
  * OGP - Open Game Panel
- * Copyright (C) Copyright (C) 2008 - 2012 The OGP Development Team
+ * Copyright (C) 2008 - 2017 The OGP Development Team
  *
  *
  * http://www.opengamepanel.org/
  * http://www.opengamepanel.org/
  *
  *
@@ -26,123 +26,7 @@ error_reporting(E_ALL);
 require_once('includes/lib_remote.php');
 require_once('includes/lib_remote.php');
 require_once('modules/gamemanager/home_handling_functions.php');
 require_once('modules/gamemanager/home_handling_functions.php');
 require_once('modules/config_games/server_config_parser.php');
 require_once('modules/config_games/server_config_parser.php');
-function reloadJobs($server_homes, $remote_servers)
-{
-	$remote_servers_offline = array();
-	$jobsArray = array();
-	foreach( $remote_servers as $remote_server )
-	{
-		$remote = new OGPRemoteLibrary($remote_server['agent_ip'], $remote_server['agent_port'], $remote_server['encryption_key'], $remote_server['timeout']);
-		$rhost_id = $remote_server['remote_server_id'];
-		if($remote->status_chk() != 1)
-		{
-			$remote_servers_offline[$rhost_id] = $remote_server;
-			continue;
-		}
-		else
-		{
-			$jobs = $remote->scheduler_list_tasks();
-			if($jobs != -1)
-			{
-				foreach($jobs as $jobId => $job)
-				{
-					$parts = explode(" ", $job);
-					$minute = $parts[0];
-					$hour = $parts[1];
-					$dayOfTheMonth = $parts[2];
-					$month = $parts[3];
-					$dayOfTheWeek = $parts[4];
-					unset($parts[0],$parts[1],$parts[2],$parts[3],$parts[4]);
-					$command = implode(" ", $parts);
-					$retval = preg_match_all("/^%ACTION=(start|restart|stop)\|%\|(.*)$/", $command, $job_info );
-					if($retval and !empty($job_info[1][0]))
-					{
-						//print_r($job_info);
-						$action = $job_info[1][0];
-						$server_args = explode("|%|", $job_info[2][0]);
-						switch ($action) {
-							case 'start':
-								list($home_id, $home_path, $server_exe, $run_dir,
-									 $startup_cmd, $port, $ip, $cpu, $nice) = $server_args;
-								break;
-							case 'restart':
-								list($home_id, $ip, $port, $control_protocol, 
-									 $control_password, $control_type, $home_path, 
-									 $server_exe, $run_dir, $startup_cmd, $cpu, $nice) = $server_args;
-								break;
-							case 'stop':
-								list($home_id, $ip, $port, $control_protocol, 
-									 $control_password, $control_type, $home_path) = $server_args;
-								break;
-						}
-						if(!isset($server_homes[$home_id."_".$ip."_".$port])) continue;
-						$jobsArray[$rhost_id][$jobId] = array( 'job' => $job, 
-															   'minute' => $minute, 
-															   'hour' => $hour, 
-															   'dayOfTheMonth' => $dayOfTheMonth, 
-															   'month' => $month, 
-															   'dayOfTheWeek' => $dayOfTheWeek,
-															   'action' => $action,
-															   'home_id' => $home_id,
-															   'ip' => $ip,
-															   'port' => $port);
-					}
-					else
-					{	
-						$jobsArray[$rhost_id][$jobId] = array( 'job' => $job, 
-															   'minute' => $minute, 
-															   'hour' => $hour, 
-															   'dayOfTheMonth' => $dayOfTheMonth, 
-															   'month' => $month, 
-															   'dayOfTheWeek' => $dayOfTheWeek, 
-															   'command' => $command);
-					}
-				}
-			}
-		}
-	}
-	return array($jobsArray, $remote_servers_offline);
-}
-
-function get_action_selector($action = false) {
-	$server_actions = array('restart','stop','start');
-	$select_action = '<select  style="width: 100px;" name="action">';
-	foreach($server_actions as $server_action)
-	{
-		$selected = ($action and $action == $server_action) ? 'selected="selected"' : '';
-		$select_action .= '<option value="'.$server_action.'" '.$selected.'>'.get_lang($server_action).'</option>';
-	}
-	return $select_action .= '</select>';
-}
-
-function get_server_selector($server_homes, $homeid_ip_port = FALSE, $onchange = FALSE) {
-	$onchange_this_form_submit = $onchange ? 'onchange="this.form.submit();"' : '';
-	$select_game = "<select style='text-overflow: ellipsis; width: 100%;' name='homeid_ip_port' $onchange_this_form_submit>\n";
-	if($server_homes != FALSE)
-	{
-		foreach ( $server_homes as $server_home )
-		{
-			$selected = ($homeid_ip_port and $homeid_ip_port == $server_home['home_id']."_".$server_home['ip']."_".$server_home['port']) ? 'selected="selected"' : '';
-			$select_game .= "<option value='". $server_home['home_id'] . "_" . $server_home['ip'] .
-							"_" . $server_home['port'] . "' $selected>" . $server_home['home_name'] . 
-							" - " . $server_home['ip'] . ":" .$server_home['port'] . " ( " . $server_home['remote_server_name'] . " )</option>\n";
-		}
-	}
-	return $select_game .= "</select>\n";
-}
-
-function get_remote_server_selector($r_servers, $remote_servers_offline, $remote_server_id = FALSE, $onchange = FALSE, $first_empty = FALSE ) {
-	$onchange_this_form_submit = $onchange ? 'onchange="this.form.submit();"' : '';
-	$select_rserver = "<select id='r_server_id' style='width: 100px;' name='r_server_id' $onchange_this_form_submit>\n";
-	if($first_empty) $select_rserver .= '<option></option>';
-	foreach ( $r_servers as $r_server )
-	{
-		$selected = ($remote_server_id and $remote_server_id == $r_server['remote_server_id']) ? 'selected="selected"' : '';
-		$offline = isset($remote_servers_offline[$r_server['remote_server_id']]) ? ' (' . offline . ')' : '';
-		$select_rserver .= "<option value='". $r_server['remote_server_id'] . "' $selected>" . $r_server['remote_server_name'] . "$offline</option>\n";
-	}
-	return $select_rserver .= "</select>\n";
-}
+require_once('modules/cron/shared_cron_functions.php');
 
 
 function exec_ogp_module() 
 function exec_ogp_module() 
 {
 {
@@ -151,7 +35,7 @@ function exec_ogp_module()
 	$homes = $db->getIpPorts();
 	$homes = $db->getIpPorts();
 	if(!$homes)
 	if(!$homes)
 	{
 	{
-		print_failure('There are no game servers assigned');
+		print_failure(get_lang('cron_admin_no_ogp_servers_to_display'));
 		return 0;
 		return 0;
 	}
 	}
 	
 	
@@ -199,23 +83,28 @@ function exec_ogp_module()
 															  "mod_name" => $game_home['mod_name'],
 															  "mod_name" => $game_home['mod_name'],
 															  "def_precmd" => $game_home['def_precmd'],
 															  "def_precmd" => $game_home['def_precmd'],
 															  "def_postcmd" => $game_home['def_postcmd']);
 															  "def_postcmd" => $game_home['def_postcmd']);
-			$startup_cmd = get_start_cmd($remote,$server_xml,$game_home,$game_home['mod_id'],$game_home['ip'],$game_home['port'], $remote->what_os());
+			$startup_cmd = get_start_cmd($remote,$server_xml,$game_home,$game_home['mod_id'],$game_home['ip'],$game_home['port'], $db);
 			$cpu = $game_home['cpu_affinity'];
 			$cpu = $game_home['cpu_affinity'];
 			$nice = $game_home['nice'];
 			$nice = $game_home['nice'];
 			
 			
+			$panelURL = getOGPSiteURL();
+			if($panelURL === false){
+				print_failure('Failed to retrieve panel URL.');
+				return 0;
+			}
+			
 			switch ($_POST['action']) {
 			switch ($_POST['action']) {
 				case "stop":
 				case "stop":
-					$command = "%ACTION=stop|%|$home_id|%|$ip|%|$port|%|".
-							   "$control_protocol|%|$control_password|%|$control_type|%|$home_path";
+					$command = "wget -qO- \"" . $panelURL . "/ogp_api.php?action=stopServer&homeid=" . $home_id . "&controlpass=" . $control_password . "\" --no-check-certificate > /dev/null 2>&1";
 					break;
 					break;
 				case "start":
 				case "start":
-					$command = "%ACTION=start|%|$home_id|%|$home_path|%|$server_exe|%|$run_dir|%|".
-							   "$startup_cmd|%|$port|%|$ip|%|$cpu|%|$nice";
+					$command = "wget -qO- \"" . $panelURL . "/ogp_api.php?action=startServer&homeid=" . $home_id . "&controlpass=" . $control_password . "\" --no-check-certificate > /dev/null 2>&1";
 					break;
 					break;
 				case "restart":
 				case "restart":
-					$command = "%ACTION=restart|%|$home_id|%|$ip|%|$port|%|$control_protocol|%|".
-							   "$control_password|%|$control_type|%|$home_path|%|$server_exe|%|$run_dir|%|".
-							   "$startup_cmd|%|$cpu|%|$nice";
+					$command = "wget -qO- \"" . $panelURL . "/ogp_api.php?action=restartServer&homeid=" . $home_id . "&controlpass=" . $control_password . "\" --no-check-certificate > /dev/null 2>&1";
+					break;
+				case "steam_auto_update":
+					$command = "wget -qO- \"" . $panelURL . "/ogp_api.php?action=autoUpdateSteamHome&homeid=" . $home_id . "&controlpass=" . $control_password . "\" --no-check-certificate > /dev/null 2>&1";
 					break;
 					break;
 			}
 			}
 		}
 		}
@@ -252,7 +141,7 @@ function exec_ogp_module()
 		list($jobsArray, $remote_servers_offline) = reloadJobs($server_homes, $remote_servers);
 		list($jobsArray, $remote_servers_offline) = reloadJobs($server_homes, $remote_servers);
 	}	
 	}	
 	
 	
-	echo "<h2>" . schedule_new_job . "</h2>";
+	echo "<h2>" . get_lang("schedule_new_job") . "</h2>";
 	require_once("includes/refreshed.php");
 	require_once("includes/refreshed.php");
 	$refresh = new refreshed();
 	$refresh = new refreshed();
 	if( isset($_POST['r_server_id']) )
 	if( isset($_POST['r_server_id']) )
@@ -272,34 +161,34 @@ function exec_ogp_module()
 	$r_server_id = $homeid_ip_port == 0 ? $_POST['r_server_id'] : $server_homes[$homeid_ip_port]['remote_server_id'];
 	$r_server_id = $homeid_ip_port == 0 ? $_POST['r_server_id'] : $server_homes[$homeid_ip_port]['remote_server_id'];
 	$homeid_ip_port = $homeid_ip_port == 0 ? key($server_homes) : $homeid_ip_port;
 	$homeid_ip_port = $homeid_ip_port == 0 ? key($server_homes) : $homeid_ip_port;
 	$curtime = $refresh->add( "home.php?m=cron&p=thetime&r_server_id=$r_server_id&type=cleared" );
 	$curtime = $refresh->add( "home.php?m=cron&p=thetime&r_server_id=$r_server_id&type=cleared" );
-	echo "<pre class='log' ><table><tr><td>" . now . 
-		 "&nbsp;</td><td><form action='' method='POST' >" . get_server_selector($server_homes, $homeid_ip_port, TRUE) . 
+	echo "<pre class='log' ><table><tr><td>" . get_lang("now") . 
+		 "&nbsp;</td><td><form action='' method='POST' >" . get_server_selector($server_homes, $homeid_ip_port, TRUE, true) . 
 		 "</form></td><td><form action='' method='POST' >" .
 		 "</form></td><td><form action='' method='POST' >" .
 		 get_remote_server_selector($remote_servers, $remote_servers_offline, $r_server_id, TRUE) .
 		 get_remote_server_selector($remote_servers, $remote_servers_offline, $r_server_id, TRUE) .
 		 "</form></td></tr></table> <b style='font-size:1.4em;'>" . $refresh->getdiv($curtime) . "</b></pre>";
 		 "</form></td></tr></table> <b style='font-size:1.4em;'>" . $refresh->getdiv($curtime) . "</b></pre>";
 ?>
 ?>
-<table class="center">
+<table class="center hundred">
 	<tr>
 	<tr>
 		<th>
 		<th>
-		<?php echo minute; ?>
+		<?php echo get_lang("minute"); ?>
 		</th>
 		</th>
 		<th>
 		<th>
-		<?php echo hour; ?>
+		<?php echo get_lang("hour"); ?>
 		</th>
 		</th>
 		<th>
 		<th>
-		<?php echo day; ?>
+		<?php echo get_lang("day"); ?>
 		</th>
 		</th>
 		<th>
 		<th>
-		<?php echo month; ?>
+		<?php echo get_lang("month"); ?>
 		</th>
 		</th>
 		<th>
 		<th>
-		<?php echo day_of_the_week; ?>
+		<?php echo get_lang("day_of_the_week"); ?>
 		</th>
 		</th>
 		<th>
 		<th>
-		<?php echo action; ?>
+		<?php echo get_lang("action"); ?>
 		</th>
 		</th>
 		<th>
 		<th>
-		<?php echo user_games; ?>
+		<?php echo get_lang("user_games"); ?>
 		</th>
 		</th>
 	</tr>
 	</tr>
 	<tr>
 	<tr>
@@ -323,34 +212,34 @@ function exec_ogp_module()
 			<?php echo get_action_selector();?>
 			<?php echo get_action_selector();?>
 		</td>
 		</td>
 		<td>
 		<td>
-			<?php echo get_server_selector($server_homes, $homeid_ip_port);?>
+			<?php echo get_server_selector($server_homes, $homeid_ip_port, FALSE, true);?>
 		</td>
 		</td>
 		<td>
 		<td>
-			<input style="width:60px;" type="submit" name="addJob" value="<?php echo add; ?>" />
+			<input style="" type="submit" name="addJob" value="<?php echo get_lang("add"); ?>" />
 			</form>
 			</form>
 		</td>
 		</td>
 	</tr>
 	</tr>
 	<tr>
 	<tr>
 		<th>
 		<th>
-		<?php echo minute; ?>
+		<?php echo get_lang("minute"); ?>
 		</th>
 		</th>
 		<th>
 		<th>
-		<?php echo hour; ?>
+		<?php echo get_lang("hour"); ?>
 		</th>
 		</th>
 		<th>
 		<th>
-		<?php echo day; ?>
+		<?php echo get_lang("day"); ?>
 		</th>
 		</th>
 		<th>
 		<th>
-		<?php echo month; ?>
+		<?php echo get_lang("month"); ?>
 		</th>
 		</th>
 		<th>
 		<th>
-		<?php echo day_of_the_week; ?>
+		<?php echo get_lang("day_of_the_week"); ?>
 		</th>
 		</th>
 		<th>
 		<th>
-		<?php echo server; ?>
+		<?php echo get_lang("server"); ?>
 		</th>
 		</th>
 		<th>
 		<th>
-		<?php echo command; ?>
+		<?php echo get_lang("command"); ?>
 		</th>
 		</th>
 	</tr>
 	</tr>
 	<tr>
 	<tr>
@@ -374,16 +263,16 @@ function exec_ogp_module()
 			<?php echo get_remote_server_selector($remote_servers, $remote_servers_offline);?>
 			<?php echo get_remote_server_selector($remote_servers, $remote_servers_offline);?>
 		</td>
 		</td>
 		<td>
 		<td>
-			<input style="width: 490px;" type="text" name="command" />
+			<input style="width: 100%; box-sizing: border-box;" type="text" name="command" />
 		</td>
 		</td>
 		<td>
 		<td>
-			<input style="width:60px;" type="submit" name="addJob" value="<?php echo add; ?>" />
+			<input style="" type="submit" name="addJob" value="<?php echo get_lang("add"); ?>" />
 			</form>
 			</form>
 		</td>
 		</td>
 	</tr>
 	</tr>
 </table>
 </table>
 <br>
 <br>
-<h2><?php echo scheduled_jobs;?></h2>
+<h2><?php echo get_lang("scheduled_jobs");?></h2>
 <?php
 <?php
 	if ( !empty($remote_servers_offline) )
 	if ( !empty($remote_servers_offline) )
 	{
 	{
@@ -397,38 +286,38 @@ function exec_ogp_module()
 	if ( !empty($jobsArray) )
 	if ( !empty($jobsArray) )
 	{
 	{
 ?>
 ?>
-<table class="center">
+<table class="center hundred">
 	<tr>
 	<tr>
 		<td colspan='6' style="text-align:left;" >
 		<td colspan='6' style="text-align:left;" >
 			<form  action='' method='GET'>
 			<form  action='' method='GET'>
 				<input type="hidden" name="m" value="cron" />
 				<input type="hidden" name="m" value="cron" />
 				<input type="hidden" name="p" value="events" />
 				<input type="hidden" name="p" value="events" />
-				<label for="r_server_id" ><?php echo cron_events;?></label>
+				<label for="r_server_id" ><?php echo get_lang("cron_events");?></label>
 				<?php echo get_remote_server_selector($remote_servers, $remote_servers_offline, FALSE, TRUE, TRUE); ?>
 				<?php echo get_remote_server_selector($remote_servers, $remote_servers_offline, FALSE, TRUE, TRUE); ?>
 			</form>
 			</form>
 		</td>
 		</td>
 	</tr>
 	</tr>
 	<tr>
 	<tr>
 		<th>
 		<th>
-		<?php echo minute; ?>
+		<?php echo get_lang("minute"); ?>
 		</th>
 		</th>
 		<th>
 		<th>
-		<?php echo hour; ?>
+		<?php echo get_lang("hour"); ?>
 		</th>
 		</th>
 		<th>
 		<th>
-		<?php echo day; ?>
+		<?php echo get_lang("day"); ?>
 		</th>
 		</th>
 		<th>
 		<th>
-		<?php echo month; ?>
+		<?php echo get_lang("month"); ?>
 		</th>
 		</th>
 		<th>
 		<th>
-		<?php echo day_of_the_week; ?>
+		<?php echo get_lang("day_of_the_week"); ?>
 		</th>
 		</th>
 		<th>
 		<th>
-		<?php echo action . " / " . server; ?>
+		<?php echo get_lang("action") . " / " . get_lang("server"); ?>
 		</th>
 		</th>
 		<th>
 		<th>
-		<?php echo user_games . " / " . command; ?>
+		<?php echo get_lang("user_games") . " / " . get_lang("command"); ?>
 		</th>
 		</th>
 	</tr>
 	</tr>
 <?php
 <?php
@@ -437,12 +326,21 @@ function exec_ogp_module()
 		{
 		{
 			foreach($jobs as $jobId => $job)
 			foreach($jobs as $jobId => $job)
 			{
 			{
-				if(isset($job['action']))				
+				if(isset($job['action'])){	
+					if(array_key_exists('home_id', $job) && array_key_exists('ip', $job) && array_key_exists('port', $job) && hasValue($job['home_id']) && hasValue($job['ip']) && hasValue($job['port'])){
+						$idStr = $job['home_id']."_".$job['ip']."_".$job['port'];				
+					}else if(hasValue($job['home_id'])){
+						$idStr = $job['home_id'];
+					}else{
+						$idStr = false;
+					}
+								
 					$task = get_action_selector($job['action'])."</td><td>".
 					$task = get_action_selector($job['action'])."</td><td>".
-							get_server_selector($server_homes, $job['home_id']."_".$job['ip']."_".$job['port']);
+							get_server_selector($server_homes, $idStr, FALSE, TRUE);
+				}
 				else
 				else
 					$task = get_remote_server_selector($remote_servers, $remote_servers_offline, $remote_server_id).
 					$task = get_remote_server_selector($remote_servers, $remote_servers_offline, $remote_server_id).
-							'</td><td><input style="width: 490px;" type="text" name="command" value="'.str_replace("\"","&quot;",$job['command']).'" />';
+							'</td><td><input style="width: 100%; box-sizing: border-box;" type="text" name="command" value="'.str_replace("\"","&quot;",$job['command']).'" />';
 				
 				
 				$user_jobs .=  '<tr>
 				$user_jobs .=  '<tr>
 									<td style="width: 35px;" >
 									<td style="width: 35px;" >
@@ -467,8 +365,8 @@ function exec_ogp_module()
 									<td style="width: 132px;">
 									<td style="width: 132px;">
 										<input type="hidden" name="job_id" value=\''.$jobId.'\' />
 										<input type="hidden" name="job_id" value=\''.$jobId.'\' />
 										<input type="hidden" name="r_server_id" value=\''.$remote_server_id.'\' />
 										<input type="hidden" name="r_server_id" value=\''.$remote_server_id.'\' />
-										<input style="width:60px;" type="submit" name="editJob" value="'. edit .'" />
-										<input style="width:60px;" type="submit" name="removeJob" value="'. remove .'" />
+										<input style="" type="submit" name="editJob" value="'. get_lang("edit") .'" />
+										<input style="" type="submit" name="removeJob" value="'. get_lang("remove") .'" />
 										</form>
 										</form>
 									</td>
 									</td>
 								</tr>';
 								</tr>';
@@ -481,10 +379,10 @@ function exec_ogp_module()
 	}
 	}
 	else
 	else
 	{
 	{
-		echo "<h3>". there_are_no_scheduled_jobs ."</h3>";
+		echo "<h3>". get_lang("there_are_no_scheduled_jobs") ."</h3>";
 	}
 	}
 ?>
 ?>
-<table class='center' ><tr><td><a href='?m=administration&p=main' > << <?php echo back ?></a></td></tr></table>
+<table class='center hundred' ><tr><td><a href='javascript:history.go(-1)' > << <?php echo get_lang("back") ?></a></td></tr></table>
 <script type="text/javascript">
 <script type="text/javascript">
 $(document).ready(function() 
 $(document).ready(function() 
 	{
 	{

+ 3 - 2
modules/cron/events.php

@@ -3,7 +3,7 @@
 /*
 /*
  *
  *
  * OGP - Open Game Panel
  * OGP - Open Game Panel
- * Copyright (C) Copyright (C) 2008 - 2012 The OGP Development Team
+ * Copyright (C) 2008 - 2017 The OGP Development Team
  *
  *
  * http://www.opengamepanel.org/
  * http://www.opengamepanel.org/
  *
  *
@@ -22,6 +22,7 @@
  * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.
  * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.
  *
  *
  */
  */
+
 error_reporting(E_ALL);
 error_reporting(E_ALL);
 
 
 function exec_ogp_module() 
 function exec_ogp_module() 
@@ -36,7 +37,7 @@ function exec_ogp_module()
 		$remote = new OGPRemoteLibrary($remote_server['agent_ip'], $remote_server['agent_port'], $remote_server['encryption_key'], $remote_server['timeout'] );
 		$remote = new OGPRemoteLibrary($remote_server['agent_ip'], $remote_server['agent_port'], $remote_server['encryption_key'], $remote_server['timeout'] );
 		if($remote->status_chk() != 1)
 		if($remote->status_chk() != 1)
 		{
 		{
-			print_failure(agent_offline);
+			print_failure(get_lang("agent_offline"));
 			return;
 			return;
 		}
 		}
 		$remote->remote_readfile('scheduler.log', $events);
 		$remote->remote_readfile('scheduler.log', $events);

+ 1 - 1
modules/cron/module.php

@@ -2,7 +2,7 @@
 /*
 /*
  *
  *
  * OGP - Open Game Panel
  * OGP - Open Game Panel
- * Copyright (C) Copyright (C) 2008 - 2012 The OGP Development Team
+ * Copyright (C) 2008 - 2017 The OGP Development Team
  *
  *
  * http://www.opengamepanel.org/
  * http://www.opengamepanel.org/
  *
  *

+ 252 - 0
modules/cron/shared_cron_functions.php

@@ -0,0 +1,252 @@
+<?php
+/*
+ *
+ * OGP - Open Game Panel
+ * Copyright (C) 2008 - 2017 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.
+ *
+ */
+function reloadJobs($server_homes, $remote_servers)
+{
+	$remote_servers_offline = array();
+	$jobsArray = array();
+	foreach( $remote_servers as $remote_server )
+	{
+		$remote = new OGPRemoteLibrary($remote_server['agent_ip'], $remote_server['agent_port'], $remote_server['encryption_key'], $remote_server['timeout']);
+		$rhost_id = $remote_server['remote_server_id'];
+		if($remote->status_chk() != 1)
+		{
+			$remote_servers_offline[$rhost_id] = $remote_server;
+			continue;
+		}
+		else
+		{
+			$jobs = $remote->scheduler_list_tasks();
+			if($jobs != -1)
+			{
+				foreach($jobs as $jobId => $job)
+				{
+					$parts = explode(" ", $job);
+					$minute = $parts[0];
+					$hour = $parts[1];
+					$dayOfTheMonth = $parts[2];
+					$month = $parts[3];
+					$dayOfTheWeek = $parts[4];
+					unset($parts[0],$parts[1],$parts[2],$parts[3],$parts[4]);
+					$command = implode(" ", $parts);
+					$retval = preg_match_all("/^%ACTION=(start|restart|stop)\|%\|(.*)$/", $command, $job_info );
+					if($retval and !empty($job_info[1][0]))
+					{
+						//print_r($job_info);
+						$action = $job_info[1][0];
+						$server_args = explode("|%|", $job_info[2][0]);
+						switch ($action) {
+							case 'start':
+								list($home_id, $home_path, $server_exe, $run_dir,
+									 $startup_cmd, $port, $ip, $cpu, $nice) = $server_args;
+								break;
+							case 'restart':
+								list($home_id, $ip, $port, $control_protocol, 
+									 $control_password, $control_type, $home_path, 
+									 $server_exe, $run_dir, $startup_cmd, $cpu, $nice) = $server_args;
+								break;
+							case 'stop':
+								list($home_id, $ip, $port, $control_protocol, 
+									 $control_password, $control_type, $home_path) = $server_args;
+								break;
+						}
+						if(!isset($server_homes[$home_id."_".$ip."_".$port])) continue;
+						$jobsArray[$rhost_id][$jobId] = array( 'job' => $job, 
+															   'minute' => $minute, 
+															   'hour' => $hour, 
+															   'dayOfTheMonth' => $dayOfTheMonth, 
+															   'month' => $month, 
+															   'dayOfTheWeek' => $dayOfTheWeek,
+															   'action' => $action,
+															   'home_id' => $home_id,
+															   'ip' => $ip,
+															   'port' => $port);
+					}
+					else if(getURLParam("homeid=", $command) !== false){
+						$homeId = getURLParam("homeid=", $command);
+						
+						$action = getURLParam("action=", $command);
+						if($action == "autoUpdateSteamHome"){
+							$action = "steam_auto_update";
+						}else if($action == "stopServer"){
+							$action = "stop";
+						}else if($action == "startServer"){
+							$action = "start";
+						}else if($action == "restartServer"){
+							$action = "restart";
+						}
+						
+						$jobsArray[$rhost_id][$jobId] = array( 'job' => $job, 
+															   'minute' => $minute, 
+															   'hour' => $hour, 
+															   'dayOfTheMonth' => $dayOfTheMonth, 
+															   'month' => $month, 
+															   'dayOfTheWeek' => $dayOfTheWeek,
+															   'command' => $command,
+															   'action' => $action,
+															   'home_id' => $homeId);
+					}
+					else
+					{	
+						$jobsArray[$rhost_id][$jobId] = array( 'job' => $job, 
+															   'minute' => $minute, 
+															   'hour' => $hour, 
+															   'dayOfTheMonth' => $dayOfTheMonth, 
+															   'month' => $month, 
+															   'dayOfTheWeek' => $dayOfTheWeek, 
+															   'command' => $command);
+					}
+				}
+			}
+		}
+	}
+	return array($jobsArray, $remote_servers_offline);
+}
+
+function updateCronJobPasswords($db, $remote, $changedHomeId){
+	$homes = $db->getIpPorts();
+
+	foreach( $homes as $home )
+	{
+		$id = $home['home_id']."_".$home['ip']."_".$home['port'];
+		$server_homes[$id] = $home;
+		$server_id = $home['remote_server_id'];
+		$remote_servers[$server_id] = array("remote_server_id" => $home['remote_server_id'],
+											"remote_server_name" => $home['remote_server_name'],
+											"ogp_user" => $home['ogp_user'],
+											"agent_ip" => $home['agent_ip'],
+											"agent_port" => $home['agent_port'],
+											"ftp_port" => $home['ftp_port'],
+											"encryption_key" => $home['encryption_key'],
+											"timeout" => $home['timeout'],
+											"use_nat" => $home['use_nat'],
+											"ftp_ip" => $home['ftp_ip']);
+	}
+
+	list($jobsArray, $remote_servers_offline) = reloadJobs($server_homes, $remote_servers);
+
+	$homes = customShift($homes, "home_id", $changedHomeId);
+	$homeIdStr = "homeid=";
+	$actionStr = "action=";
+	$cPassStr = "controlpass=";
+
+	if(count($homes) > 0){
+		$home = $homes[0];
+		if($home["home_id"] == $changedHomeId){ 
+			$control_password = $home['control_password'];
+			
+			foreach( $jobsArray as $remote_server_id => $jobs )
+			{
+				if($home['remote_server_id'] == $remote_server_id){
+					foreach($jobs as $jobId => $job)
+					{
+						$command = $job['command'];
+						$homeId = getURLParam($homeIdStr, $command);
+						$action = getURLParam($actionStr, $command);
+						if($homeId !== false && $action !== false){
+							if($homeId == $changedHomeId){
+								$curPass = getURLParam($cPassStr, $command);
+								if(stripos($curPass, '" --no-check-certificate') !== false){
+									$curPass = substr($curPass, 0, stripos($curPass, '" --no-check-certificate'));
+								}else if(strrpos($curPass, '"') !== false){
+									$curPass = substr($curPass, 0, strrpos($curPass, '"'));
+								}								
+								if($curPass != $control_password){
+									$command = str_replace($cPassStr . $curPass, $cPassStr . $control_password, $command);
+									$minute = $job['minute'];
+									$hour = $job['hour'];
+									$dayOfTheMonth = $job['dayOfTheMonth'];
+									$month = $job['month'];
+									$dayOfTheWeek = $job['dayOfTheWeek'];
+									
+									$job = $minute." ".
+										$hour ." ".
+										$dayOfTheMonth." ".
+										$month." ".
+										$dayOfTheWeek." ".
+										$command;
+										
+									$remote->scheduler_edit_task($jobId, $job);						
+								}
+							}
+						}
+					}
+				}
+			}
+		}
+	}
+}
+
+function get_action_selector($action = false) {
+	$server_actions = array('restart','stop','start','steam_auto_update');
+	$select_action = '<select name="action" style="width: 100%;">';
+	foreach($server_actions as $server_action)
+	{
+		$selected = ($action and $action == $server_action) ? 'selected="selected"' : '';
+		$select_action .= '<option value="'.$server_action.'" '.$selected.'>'.get_lang($server_action).'</option>';
+	}
+	return $select_action .= '</select>';
+}
+
+function get_server_selector($server_homes, $homeid_ip_port = FALSE, $onchange = FALSE, $includeRemoteName = false) {
+	$onchange_this_form_submit = $onchange ? 'onchange="this.form.submit();"' : '';
+	$select_game = "<select style='text-overflow: ellipsis; width: 100%;' name='homeid_ip_port' $onchange_this_form_submit>\n";
+	if($server_homes != FALSE)
+	{
+		
+		foreach ( $server_homes as $server_home )
+		{
+			// Find out if it's a steamcmd server
+			$additionalMarkup = "";
+			$server_xml = read_server_config(SERVER_CONFIG_LOCATION."/".$server_home['home_cfg_file']);
+			if( $server_xml->installer == "steamcmd" ){
+				$additionalMarkup = 'steam="1"';
+			}			
+			
+			$selected = ($homeid_ip_port and ($homeid_ip_port == $server_home['home_id']."_".$server_home['ip']."_".$server_home['port'] || trim($homeid_ip_port) == trim($server_home['home_id']))) ? 'selected="selected"' : '';
+			$select_game .= "<option value='". $server_home['home_id'] . "_" . $server_home['ip'] .
+							"_" . $server_home['port'] . "' $selected " . $additionalMarkup . ">" . $server_home['home_name'] . 
+							" - " . checkDisplayPublicIP($server_home['display_public_ip'],$server_home['ip']) . ":" .$server_home['port'];
+			if($includeRemoteName){
+				$select_game .= " ( " . $server_home['remote_server_name'] . " )";
+			}
+			
+			$select_game .= "</option>\n";
+		}
+	}
+	return $select_game .= "</select>\n";
+}
+
+function get_remote_server_selector($r_servers, $remote_servers_offline, $remote_server_id = FALSE, $onchange = FALSE, $first_empty = FALSE ) {
+	$onchange_this_form_submit = $onchange ? 'onchange="this.form.submit();"' : '';
+	$select_rserver = "<select id='r_server_id' style='width: 100%;' name='r_server_id' $onchange_this_form_submit>\n";
+	if($first_empty) $select_rserver .= '<option></option>';
+	foreach ( $r_servers as $r_server )
+	{
+		$selected = ($remote_server_id and $remote_server_id == $r_server['remote_server_id']) ? 'selected="selected"' : '';
+		$offline = isset($remote_servers_offline[$r_server['remote_server_id']]) ? ' (' . offline . ')' : '';
+		$select_rserver .= "<option value='". $r_server['remote_server_id'] . "' $selected>" . $r_server['remote_server_name'] . "$offline</option>\n";
+	}
+	return $select_rserver .= "</select>\n";
+}
+?>

+ 3 - 3
modules/cron/thetime.php

@@ -2,7 +2,7 @@
 /*
 /*
  *
  *
  * OGP - Open Game Panel
  * OGP - Open Game Panel
- * Copyright (C) Copyright (C) 2008 - 2012 The OGP Development Team
+ * Copyright (C) 2008 - 2017 The OGP Development Team
  *
  *
  * http://www.opengamepanel.org/
  * http://www.opengamepanel.org/
  *
  *
@@ -43,6 +43,6 @@ function exec_ogp_module()
 			 '</td></tr></table>';
 			 '</td></tr></table>';
 	}
 	}
 	else
 	else
-		echo agent_offline;
+		echo get_lang("agent_offline");
 }
 }
-?>
+?>

+ 59 - 144
modules/cron/user_cron.php

@@ -1,9 +1,9 @@
-<script type="text/javascript" src="js/jquery/jquery-1.11.0.min.js"></script>
+<script type="text/javascript" src="js/modules/cron.js"></script>
 <?php
 <?php
 /*
 /*
  *
  *
  * OGP - Open Game Panel
  * OGP - Open Game Panel
- * Copyright (C) Copyright (C) 2008 - 2012 The OGP Development Team
+ * Copyright (C) 2008 - 2017 The OGP Development Team
  *
  *
  * http://www.opengamepanel.org/
  * http://www.opengamepanel.org/
  *
  *
@@ -26,120 +26,22 @@ error_reporting(E_ALL);
 require_once('includes/lib_remote.php');
 require_once('includes/lib_remote.php');
 require_once('modules/gamemanager/home_handling_functions.php');
 require_once('modules/gamemanager/home_handling_functions.php');
 require_once('modules/config_games/server_config_parser.php');
 require_once('modules/config_games/server_config_parser.php');
-function reloadJobs($server_homes, $remote_servers)
-{
-	$remote_servers_offline = array();
-	$jobsArray = array();
-	foreach( $remote_servers as $remote_server )
-	{
-		$remote = new OGPRemoteLibrary($remote_server['agent_ip'], $remote_server['agent_port'], $remote_server['encryption_key'], $remote_server['timeout']);
-		$rhost_id = $remote_server['remote_server_id'];
-		if($remote->status_chk() != 1)
-		{
-			$remote_servers_offline[$rhost_id] = $remote_server;
-			continue;
-		}
-		else
-		{
-			$jobs = $remote->scheduler_list_tasks();
-			if($jobs != -1)
-			{
-				foreach($jobs as $jobId => $job)
-				{
-					$parts = explode(" ", $job);
-					$minute = $parts[0];
-					$hour = $parts[1];
-					$dayOfTheMonth = $parts[2];
-					$month = $parts[3];
-					$dayOfTheWeek = $parts[4];
-					unset($parts[0],$parts[1],$parts[2],$parts[3],$parts[4]);
-					$command = implode(" ", $parts);
-					$retval = preg_match_all("/^%ACTION=(start|restart|stop)\|%\|(.*)$/", $command, $job_info );
-					if($retval and !empty($job_info[1][0]))
-					{
-						//print_r($job_info);
-						$action = $job_info[1][0];
-						$server_args = explode("|%|", $job_info[2][0]);
-						switch ($action) {
-							case 'start':
-								list($home_id, $home_path, $server_exe, $run_dir,
-									 $startup_cmd, $port, $ip, $cpu, $nice) = $server_args;
-								break;
-							case 'restart':
-								list($home_id, $ip, $port, $control_protocol, 
-									 $control_password, $control_type, $home_path, 
-									 $server_exe, $run_dir, $startup_cmd, $cpu, $nice) = $server_args;
-								break;
-							case 'stop':
-								list($home_id, $ip, $port, $control_protocol, 
-									 $control_password, $control_type, $home_path) = $server_args;
-								break;
-						}
-						if(!isset($server_homes[$home_id."_".$ip."_".$port])) continue;
-						$jobsArray[$rhost_id][$jobId] = array( 'job' => $job, 
-															   'minute' => $minute, 
-															   'hour' => $hour, 
-															   'dayOfTheMonth' => $dayOfTheMonth, 
-															   'month' => $month, 
-															   'dayOfTheWeek' => $dayOfTheWeek,
-															   'action' => $action,
-															   'home_id' => $home_id,
-															   'ip' => $ip,
-															   'port' => $port);
-					}
-				}
-			}
-		}
-	}
-	return array($jobsArray, $remote_servers_offline);
-}
-
-function get_action_selector($action = false) {
-	$server_actions = array('restart','stop','start');
-	$select_action = '<select  style="width: 100px;" name="action">';
-	foreach($server_actions as $server_action)
-	{
-		$selected = ($action and $action == $server_action) ? 'selected="selected"' : '';
-		$select_action .= '<option value="'.$server_action.'" '.$selected.'>'.get_lang($server_action).'</option>';
-	}
-	return $select_action .= '</select>';
-}
-
-function get_server_selector($server_homes, $homeid_ip_port = FALSE, $onchange = FALSE) {
-	$onchange_this_form_submit = $onchange ? 'onchange="this.form.submit();"' : '';
-	$select_game = "<select style='text-overflow: ellipsis; width: 100%;' name='homeid_ip_port' $onchange_this_form_submit>\n";
-	if($server_homes != FALSE)
-	{
-		foreach ( $server_homes as $server_home )
-		{
-			$selected = ($homeid_ip_port and $homeid_ip_port == $server_home['home_id']."_".$server_home['ip']."_".$server_home['port']) ? 'selected="selected"' : '';
-			$select_game .= "<option value='". $server_home['home_id'] . "_" . $server_home['ip'] .
-							"_" . $server_home['port'] . "' $selected>" . $server_home['home_name'] . 
-							" - " . $server_home['ip'] . ":" .$server_home['port'] . "</option>\n";
-		}
-	}
-	return $select_game .= "</select>\n";
-}
-
-function get_remote_server_selector($r_servers, $remote_servers_offline, $remote_server_id = FALSE, $onchange = FALSE) {
-	$onchange_this_form_submit = $onchange ? 'onchange="this.form.submit();"' : '';
-	$select_rserver = "<select  style='width: 100px;' name='r_server_id' $onchange_this_form_submit>\n";
-	foreach ( $r_servers as $r_server )
-	{
-		$selected = ($remote_server_id and $remote_server_id == $r_server['remote_server_id']) ? 'selected="selected"' : '';
-		$offline = isset($remote_servers_offline[$r_server['remote_server_id']]) ? ' (' . offline . ')' : '';
-		$select_rserver .= "<option value='". $r_server['remote_server_id'] . "' $selected>" . $r_server['remote_server_name'] . "$offline</option>\n";
-	}
-	return $select_rserver .= "</select>\n";
-}
+require_once('modules/cron/shared_cron_functions.php');
 
 
 function exec_ogp_module() 
 function exec_ogp_module() 
 {
 {
 	global $db;
 	global $db;
+	$isAdmin = $db->isAdmin($_SESSION['user_id']);
+	$boolShowedAdminLink = false;
+
 	$homes = $db->getIpPortsForUser($_SESSION['user_id']);
 	$homes = $db->getIpPortsForUser($_SESSION['user_id']);
 	if(!$homes)
 	if(!$homes)
 	{
 	{
-		print_failure('There are no game servers assigned');
+		print_failure(get_lang('cron_no_servers_tied_to_account'));
+		if($isAdmin){
+			$boolShowedAdminLink = true;
+			echo '<a href="home.php?m=cron&p=cron">' . get_lang('cron_admin_link_display_text') . '</a>';
+		}
 		return 0;
 		return 0;
 	}
 	}
 	
 	
@@ -193,23 +95,28 @@ function exec_ogp_module()
 															  "mod_name" => $game_home['mod_name'],
 															  "mod_name" => $game_home['mod_name'],
 															  "def_precmd" => $game_home['def_precmd'],
 															  "def_precmd" => $game_home['def_precmd'],
 															  "def_postcmd" => $game_home['def_postcmd']);
 															  "def_postcmd" => $game_home['def_postcmd']);
-			$startup_cmd = get_start_cmd($remote,$server_xml,$game_home,$game_home['mod_id'],$game_home['ip'],$game_home['port'], $remote->what_os());
+			$startup_cmd = get_start_cmd($remote,$server_xml,$game_home,$game_home['mod_id'],$game_home['ip'],$game_home['port'], $db);
 			$cpu = $game_home['cpu_affinity'];
 			$cpu = $game_home['cpu_affinity'];
 			$nice = $game_home['nice'];
 			$nice = $game_home['nice'];
 			
 			
+			$panelURL = getOGPSiteURL();
+			if($panelURL === false){
+				print_failure('Failed to retrieve panel URL.');
+				return 0;
+			}
+			
 			switch ($_POST['action']) {
 			switch ($_POST['action']) {
 				case "stop":
 				case "stop":
-					$command = "%ACTION=stop|%|$home_id|%|$ip|%|$port|%|".
-							   "$control_protocol|%|$control_password|%|$control_type|%|$home_path";
+					$command = "wget -qO- \"" . $panelURL . "/ogp_api.php?action=stopServer&homeid=" . $home_id . "&controlpass=" . $control_password . "\" --no-check-certificate > /dev/null 2>&1";
 					break;
 					break;
 				case "start":
 				case "start":
-					$command = "%ACTION=start|%|$home_id|%|$home_path|%|$server_exe|%|$run_dir|%|".
-							   "$startup_cmd|%|$port|%|$ip|%|$cpu|%|$nice";
+					$command = "wget -qO- \"" . $panelURL . "/ogp_api.php?action=startServer&homeid=" . $home_id . "&controlpass=" . $control_password . "\" --no-check-certificate > /dev/null 2>&1";
 					break;
 					break;
 				case "restart":
 				case "restart":
-					$command = "%ACTION=restart|%|$home_id|%|$ip|%|$port|%|$control_protocol|%|".
-							   "$control_password|%|$control_type|%|$home_path|%|$server_exe|%|$run_dir|%|".
-							   "$startup_cmd|%|$cpu|%|$nice";
+					$command = "wget -qO- \"" . $panelURL . "/ogp_api.php?action=restartServer&homeid=" . $home_id . "&controlpass=" . $control_password . "\" --no-check-certificate > /dev/null 2>&1";
+					break;
+				case "steam_auto_update":
+					$command = "wget -qO- \"" . $panelURL . "/ogp_api.php?action=autoUpdateSteamHome&homeid=" . $home_id . "&controlpass=" . $control_password . "\" --no-check-certificate > /dev/null 2>&1";
 					break;
 					break;
 			}
 			}
 			$job = $_POST['minute']." ".
 			$job = $_POST['minute']." ".
@@ -236,39 +143,39 @@ function exec_ogp_module()
 		list($jobsArray, $remote_servers_offline) = reloadJobs($server_homes, $remote_servers);
 		list($jobsArray, $remote_servers_offline) = reloadJobs($server_homes, $remote_servers);
 	}	
 	}	
 
 
-	echo "<h2>" . schedule_new_job . "</h2>";
+	echo "<h2>" . get_lang("schedule_new_job") . "</h2>";
 	require_once("includes/refreshed.php");
 	require_once("includes/refreshed.php");
 	$refresh = new refreshed();
 	$refresh = new refreshed();
 	$homeid_ip_port = isset($_POST['homeid_ip_port']) ? $_POST['homeid_ip_port'] : key($server_homes);
 	$homeid_ip_port = isset($_POST['homeid_ip_port']) ? $_POST['homeid_ip_port'] : key($server_homes);
 	$r_server_id = $server_homes[$homeid_ip_port]['remote_server_id'];
 	$r_server_id = $server_homes[$homeid_ip_port]['remote_server_id'];
 	$curtime = $refresh->add( "home.php?m=cron&p=thetime&r_server_id=$r_server_id&type=cleared" );
 	$curtime = $refresh->add( "home.php?m=cron&p=thetime&r_server_id=$r_server_id&type=cleared" );
-	echo "<pre class='log' ><table><tr><td>" . now . 
+	echo "<pre class='log' ><table><tr><td>" . get_lang("now") . 
 		"&nbsp;</td><td><form action='' method='POST' >" . get_server_selector($server_homes, $homeid_ip_port, TRUE) . 
 		"&nbsp;</td><td><form action='' method='POST' >" . get_server_selector($server_homes, $homeid_ip_port, TRUE) . 
 		"</form></td></tr></table> <b style='font-size:1.4em;'>" . $refresh->getdiv($curtime) . "</b></pre>";
 		"</form></td></tr></table> <b style='font-size:1.4em;'>" . $refresh->getdiv($curtime) . "</b></pre>";
  ?>
  ?>
 <form method="POST" >	
 <form method="POST" >	
-<table class="center">
+<table class="center hundred">
 	<tr>
 	<tr>
 		<th>
 		<th>
-		<?php echo minute; ?>
+		<?php echo get_lang("minute"); ?>
 		</th>
 		</th>
 		<th>
 		<th>
-		<?php echo hour; ?>
+		<?php echo get_lang("hour"); ?>
 		</th>
 		</th>
 		<th>
 		<th>
-		<?php echo day; ?>
+		<?php echo get_lang("day"); ?>
 		</th>
 		</th>
 		<th>
 		<th>
-		<?php echo month; ?>
+		<?php echo get_lang("month"); ?>
 		</th>
 		</th>
 		<th>
 		<th>
-		<?php echo day_of_the_week; ?>
+		<?php echo get_lang("day_of_the_week"); ?>
 		</th>
 		</th>
 		<th>
 		<th>
-		<?php echo action; ?>
+		<?php echo get_lang("action"); ?>
 		</th>
 		</th>
 		<th>
 		<th>
-		<?php echo user_games; ?>
+		<?php echo get_lang("user_games"); ?>
 		</th>
 		</th>
 	</tr>
 	</tr>
 	<tr>
 	<tr>
@@ -293,41 +200,41 @@ function exec_ogp_module()
 		<td>
 		<td>
 			<?php echo get_server_selector($server_homes, $homeid_ip_port);?>
 			<?php echo get_server_selector($server_homes, $homeid_ip_port);?>
 		</td>
 		</td>
-		<td>
-			<input style="width:60px;" type="submit" name="addJob" value="<?php echo add; ?>" />
+		<td style="width: 132px;">
+			<input style="" type="submit" name="addJob" value="<?php echo get_lang("add"); ?>" />
 		</td>
 		</td>
 	</tr>
 	</tr>
 </table>
 </table>
 </form>
 </form>
 <br>
 <br>
-<h2><?php echo scheduled_jobs;?></h2>
+<h2><?php echo get_lang("scheduled_jobs");?></h2>
 <?php
 <?php
 	if ( !empty($jobsArray) )
 	if ( !empty($jobsArray) )
 	{
 	{
 ?>
 ?>
-<table class="center">
+<table class="center hundred">
 	</tr>
 	</tr>
 	<tr>
 	<tr>
 		<th>
 		<th>
-		<?php echo minute; ?>
+		<?php echo get_lang("minute"); ?>
 		</th>
 		</th>
 		<th>
 		<th>
-		<?php echo hour; ?>
+		<?php echo get_lang("hour"); ?>
 		</th>
 		</th>
 		<th>
 		<th>
-		<?php echo day; ?>
+		<?php echo get_lang("day"); ?>
 		</th>
 		</th>
 		<th>
 		<th>
-		<?php echo month; ?>
+		<?php echo get_lang("month"); ?>
 		</th>
 		</th>
 		<th>
 		<th>
-		<?php echo day_of_the_week; ?>
+		<?php echo get_lang("day_of_the_week"); ?>
 		</th>
 		</th>
 		<th>
 		<th>
-		<?php echo action; ?>
+		<?php echo get_lang("action"); ?>
 		</th>
 		</th>
 		<th>
 		<th>
-		<?php echo user_games; ?>
+		<?php echo get_lang("user_games"); ?>
 		</th>
 		</th>
 	</tr>
 	</tr>
 <?php
 <?php
@@ -338,7 +245,14 @@ function exec_ogp_module()
 			{				
 			{				
 				if(isset($job['action']))
 				if(isset($job['action']))
 				{
 				{
-					$user_jobs .=  '<tr>
+					if(array_key_exists('home_id', $job) && array_key_exists('ip', $job) && array_key_exists('port', $job) && hasValue($job['home_id']) && hasValue($job['ip']) && hasValue($job['port'])){
+						$uniqueStr = $job['home_id']."_".$job['ip']."_".$job['port'];
+					}else if(hasValue($job['home_id'])){
+						$uniqueStr = $job['home_id'];
+					}
+					
+					if(hasValue(@$uniqueStr)){
+						$user_jobs .=  '<tr>
 										<td style="width: 35px;" >
 										<td style="width: 35px;" >
 											<form method="POST" >
 											<form method="POST" >
 											<input style="width: 30px;" type="text" name="minute" value="'.$job['minute'].'" />
 											<input style="width: 30px;" type="text" name="minute" value="'.$job['minute'].'" />
@@ -357,16 +271,17 @@ function exec_ogp_module()
 										</td>
 										</td>
 										<td>
 										<td>
 											'.get_action_selector($job['action'])."</td><td>".
 											'.get_action_selector($job['action'])."</td><td>".
-											  get_server_selector($server_homes, $job['home_id']."_".$job['ip']."_".$job['port']).'
+											  get_server_selector($server_homes, $uniqueStr).'
 										</td>
 										</td>
 										<td style="width: 132px;">
 										<td style="width: 132px;">
 											<input type="hidden" name="job_id" value=\''.$jobId.'\' />
 											<input type="hidden" name="job_id" value=\''.$jobId.'\' />
 											<input type="hidden" name="r_server_id" value=\''.$remote_server_id.'\' />
 											<input type="hidden" name="r_server_id" value=\''.$remote_server_id.'\' />
-											<input style="width:60px;" type="submit" name="editJob" value="'. edit .'" />
-											<input style="width:60px;" type="submit" name="removeJob" value="'. remove .'" />
+											<input style="" type="submit" name="editJob" value="'. get_lang("edit") .'" />
+											<input style="" type="submit" name="removeJob" value="'. get_lang("remove") .'" />
 											</form>
 											</form>
 										</td>
 										</td>
 									</tr>';
 									</tr>';
+					}
 				}
 				}
 			}
 			}
 		}
 		}
@@ -376,9 +291,9 @@ function exec_ogp_module()
 <?php
 <?php
 	}
 	}
 	else
 	else
-		echo "<h3>". there_are_no_scheduled_jobs ."</h3>";
+		echo "<h3>". get_lang("there_are_no_scheduled_jobs") ."</h3>";
 ?>
 ?>
-<table class='center' ><tr><td><a href='?m=administration&p=main' > << <?php echo back ?></a></td></tr></table>
+<table class='center hundred' ><tr><td><a href='javascript:history.go(-1)' > << <?php echo get_lang("back") ?></a><?php if(!$boolShowedAdminLink && $isAdmin){ echo '&nbsp; &nbsp; | &nbsp; &nbsp; ' . '<a href="home.php?m=cron&p=cron">' . get_lang('cron_admin_link_display_text') . '</a>'; }?></td></tr></table>
 <script type="text/javascript">
 <script type="text/javascript">
 $(document).ready(function() 
 $(document).ready(function() 
 	{
 	{