diff --git a/e107_admin/cron.php b/e107_admin/cron.php
index 44b71bbcd..0af31cbbe 100644
--- a/e107_admin/cron.php
+++ b/e107_admin/cron.php
@@ -155,6 +155,20 @@ class cron_admin_ui extends e_admin_ui
'description' => LAN_CRON_05_2 .' '.e_SYSTEM.'backups/'
// 'available' => e107::getPref('ban_retrigger')
),
+ 5 => array(
+ 'name' => LAN_CRON_06_1,
+ 'category' => 'user',
+ 'function' => 'procBanRetrigger',
+ 'description' => LAN_CRON_06_2 ."
". LAN_CRON_06_3,
+ // 'available' => e107::getPref('ban_retrigger')
+ ),
+ 6 => array(
+ 'name' => LAN_CRON_20_1,
+ 'category' => '',
+ 'function' => 'checkCoreUpdate',
+ 'description' => LAN_CRON_20_2 ."
". LAN_CRON_20_3,
+ // 'available' => e107::getPref('ban_retrigger')
+ ),
);
if(!vartrue($_GET['action']) || $_GET['action'] == 'refresh')
diff --git a/e107_handlers/cron_class.php b/e107_handlers/cron_class.php
index a80e6dac3..6834b7ebb 100644
--- a/e107_handlers/cron_class.php
+++ b/e107_handlers/cron_class.php
@@ -30,6 +30,89 @@ class _system_cron
// Whatever code you wish.
}
+ /**
+ * Burnsy - This is just a test
+ *
+ */
+ function checkCoreUpdate () // Check if there is an e107 Core update and email Site Admin if so
+ {
+ // Check if there's a core e107 update available
+
+ // Get site version
+ if (is_readable(e_ADMIN."ver.php"))
+ {
+ include (e_ADMIN."ver.php"); // $e107info['e107_version'];
+ }
+ else
+ {
+ // Find alternate way to get local site version or throw an error
+ }
+
+ // Check for updates for currently installed version
+ $localVersion = (int) $e107info['e107_version'];
+
+ switch ($localVersion) {
+ case 0:
+ // Local version is <= 0.7
+ // Run update routine for 0.x
+ break;
+ case 1:
+ // Local version is == 1.x
+ // Run update routine for 1.x
+ break;
+ case 2:
+ // Local version is == 2.x
+ // Run update routine for 2.x
+
+ // Get newest available release version
+ $xml = e107::getXml();
+ $file = "http://e107.org/releases.php?mode=2";
+ $xdata = $xml->loadXMLfile($file,true,false);
+
+ // Check for update
+ if ($e107info['e107_version'] < $xdata['core']['@attributes']['version'])
+ {
+ // If there is a new version of e107 available, notify Site Admin by email, make a log entry, and notify Admin in Admin Area, $versionTest = false
+
+ $pref = e107::getPref();
+ require_once(e_HANDLER.'mail.php');
+ $message = "There is a new version of e107 available. Please visit http://www.e107.org for further details.";
+ sendemail($pref['siteadminemail'], "e107 - Update(s) Available For " . $pref['sitename'], $message, $pref['siteadmin'],$pref['siteadminemail'], $pref['siteadmin']);
+
+ // Add entry to the log
+ e107::getAdminLog()->add("Update(s) Available", "There is a new version of e107 available. Please visit http://www.e107.org for further details.", 3);
+
+ $versionTest = $xdata['core']['@attributes']['version'];
+
+ }
+ else
+ {
+ // If there is not a new version of e107 available, $versionTest = false
+ $versionTest = false;
+ }
+
+ break;
+ }
+
+ //$versionTest = "{CHECK THE VERSION}"; // If out of date, return some text, if up-to-date , return false;
+
+ $che = e107::getCache();
+ $che->setMD5(e_LANGUAGE);
+
+ if($versionTest)
+ {
+ $che->set("releasecheck",$versionTest, TRUE);
+ return $versionTest;
+ // e107::getMessage()=>addInfo($versionTest);
+ }
+ else
+ {
+ $che->set("releasecheck", 'false', TRUE);
+ return false;
+ }
+
+ }
+
function sendEmail() // Test Email.
{
diff --git a/e107_languages/English/admin/lan_cron.php b/e107_languages/English/admin/lan_cron.php
index 65938ef36..d020431f4 100644
--- a/e107_languages/English/admin/lan_cron.php
+++ b/e107_languages/English/admin/lan_cron.php
@@ -56,6 +56,11 @@ define("LAN_CRON_16", "Using your server control panel (eg. cPanel, DirectAdmin,
// leave some room for additions/changes
+// Info for checkCoreUpdate cron
+define("LAN_CRON_20_1", "Check for e107 Update");
+define("LAN_CRON_20_2", "Check e107.org for Core updates"); // [eml] is automatically replaced by head admin e-mail address.
+define("LAN_CRON_20_3", "Recommended to keep system up to date.");
+
define("LAN_CRON_30", "Every Minute");
define("LAN_CRON_31", "Every Other Minute");
define("LAN_CRON_32", "Every 5 Minutes");