]> git.mxchange.org Git - mailer.git/blobdiff - inc/modules/admin/what-updates.php
Renamed ifSqlHasZeroNums() to ifSqlHasZeroNumRows() and improved some queries.
[mailer.git] / inc / modules / admin / what-updates.php
index b0b07ae95fac8eab2eff08c03a36ad771920ef8a..f1ad0cc563fc5490f152fb77a783c2cda3f81431 100644 (file)
@@ -16,8 +16,8 @@
  * $Author::                                                          $ *
  * -------------------------------------------------------------------- *
  * Copyright (c) 2003 - 2009 by Roland Haeder                           *
- * Copyright (c) 2009 - 2011 by Mailer Developer Team                   *
- * For more information visit: http://www.mxchange.org                  *
+ * Copyright (c) 2009 - 2015 by Mailer Developer Team                   *
+ * For more information visit: http://mxchange.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 *
@@ -47,7 +47,7 @@ addYouAreHereLink('admin', __FILE__);
 $ONLINE['code'] = '???';
 
 // Get response from our server in an array
-$response = sendGetRequest('check-updates3.php');
+$response = sendHttpGetRequest('check-updates3.php');
 
 if (empty($response[0]) && empty($response[1]) && empty($response[2]) && empty($response[3])) {
        // Error!
@@ -60,9 +60,8 @@ if (empty($response[0]) && empty($response[1]) && empty($response[2]) && empty($
 
                // Which is the latest version on server?
                $ONLINE = array(
-                       'version'  => trim(str_replace("\n", '', $response[0])),
-                       'changed'  => trim(str_replace("\n", '', $response[1])),
-                       'revision' => trim(str_replace("\n", '', $response[2])),
+                       'version'  => trim(str_replace(PHP_EOL, '', $response[0])),
+                       'changed'  => trim(str_replace(PHP_EOL, '', $response[1])),
                        'code'     => '200 OK'
                );
        } else {
@@ -74,16 +73,13 @@ if (empty($response[0]) && empty($response[1]) && empty($response[2]) && empty($
 // Is a newer version available?
 if (empty($ONLINE['version'])) {
        // Disconnected?
-       loadTemplate('admin_settings_unsaved', false, '{--ADMIN_CANNOT_CHECK_VERSION--} (' . $ONLINE['code'] . ')');
-} elseif (($ONLINE['version'] != getFullVersion()) || ($ONLINE['revision'] > getCurrentRepositoryRevision())) {
+       displayErrorMessage('{--ADMIN_CANNOT_CHECK_VERSION--} (' . $ONLINE['code'] . ')');
+} elseif ($ONLINE['version'] != getFullVersion()) {
        // New full-version available (all previous released patches are included in this version!)
        $ONLINE['changed'] = generateDateTime($ONLINE['changed'], 2);
 
        // Load template
-       loadTemplate('admin_update_download', false, $ONLINE);
-} elseif ($ONLINE['revision'] < getCurrentRepositoryRevision()) {
-       // Installed revision is newer than on server
-       displayMessage('{--ADMIN_LOCAL_REVISION_IS_NEWER_THAN_UPDATE--}');
+       loadTemplate('admin_update_download', FALSE, $ONLINE);
 } else {
        // You have the latest version!
        displayMessage('{--ADMIN_NO_UPDATES_AVAILABLE--}');