Navigation Menu

Skip to content

Commit

Permalink
Backport removal of update checker
Browse files Browse the repository at this point in the history
Conflicts:
	applications/dashboard/controllers/class.utilitycontroller.php
  • Loading branch information
linc committed Dec 22, 2013
1 parent cd87fba commit 91904fa
Show file tree
Hide file tree
Showing 2 changed files with 0 additions and 95 deletions.
56 changes: 0 additions & 56 deletions applications/dashboard/controllers/class.utilitycontroller.php
Expand Up @@ -417,62 +417,6 @@ public function Alive() {
$this->Render();
}

/**
* Because you cannot send xmlhttprequests across domains, we need to use
* a proxy to check for updates.
*
* @since 2.0.?
* @access public
*/
public function UpdateProxy() {
$Fields = $_POST;
foreach ($Fields as $Field => $Value) {
if (get_magic_quotes_gpc()) {
if (is_array($Value)) {
$Count = count($Value);
for ($i = 0; $i < $Count; ++$i) {
$Value[$i] = stripslashes($Value[$i]);
}
} else {
$Value = stripslashes($Value);
}
$Fields[$Field] = $Value;
}
}

$UpdateCheckUrl = C('Garden.UpdateCheckUrl', 'http://vanillaforums.org/addons/update');
echo ProxyRequest($UpdateCheckUrl.'?'.http_build_query($FielupdateChecksds));
$Database = Gdn::Database();
$Database->CloseConnection();
}

/**
* What the mothership said about update availability.
*
* @since 2.0.?
* @access public
*/
public function UpdateResponse() {
// Get the message, response, and transientkey
$Response = TrueStripSlashes(GetValue('Response', $_POST));
$TransientKey = GetIncomingValue('TransientKey', '');

// If the key validates
$Session = Gdn::Session();
if ($Session->ValidateTransientKey($TransientKey)) {
// Save some info to the configuration file
$Save = array();

// If the response wasn't empty, save it in the config
if ($Response != '')
$Save['Garden.RequiredUpdates'] = @json_decode($Response);

// Record the current update check time in the config.
$Save['Garden.UpdateCheckDate'] = time();
SaveToConfig($Save);
}
}

/**
* Set the user's timezone (hour offset).
*
Expand Down
39 changes: 0 additions & 39 deletions applications/dashboard/js/settings.js
Expand Up @@ -23,44 +23,5 @@ jQuery(document).ready(function($) {
lists.addClass('Loading');
loadFeed(newsColumn, 'news', 3, 'extended');
loadFeed(helpColumn, 'help', 3, 'extended');

// Phone-home to the VanillaForums server to check for updates
var updateChecks = gdn.definition('UpdateChecks', '');
if (updateChecks != '') {
var webroot = gdn.definition('WebRoot', '');
var data = 'source='+webroot
+ '&users=' + gdn.definition('CountUsers', 0)
+ '&conversations=' + gdn.definition('CountConversations', 0)
+ '&messages=' + gdn.definition('CountConversationMessages', 0)
+ '&discussions=' + gdn.definition('CountDiscussions', 0)
+ '&comments=' + gdn.definition('CountComments', 0)
+ '&updateChecks=' + updateChecks

$.ajax({
type: "POST",
url: gdn.url('/dashboard/utility/updateproxy'),
data: data,
dataType: 'json',
success: function(json) {
if (json.messages != '' || json.response != '') {
// Save the message
$.ajax({
type: "POST",
url: gdn.url('/dashboard/utility/updateresponse'),
data: 'Messages='+json.messages+'&Response='+json.response+'&TransientKey='+gdn.definition('TransientKey'),
success: function() {
// After the responses have been saved, re-fill the
// #Content with this page's view (in case there are any
// messages to be displayed)
if (json.messages != '')
$('#Content').load(
gdn.url('/dashboard/settings/index'),
'DeliveryType=ASSET&DeliveryMethod=XHTML'
);
}
});
}
}
});
}
});

1 comment on commit 91904fa

@BoRiley24
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Garden / 91904fa
Backport removal of update checker
Conflicts:
applications/dashboard/controllers/class.utilitycontroller.php
Lincoln Russelllincolnwebs authored about 1 month ago
 applications/dashboard/controllers/class.utilitycontroller.php
... ...
@@ -418,62 +418,6 @@ public function Alive() {
418 418
}
419 419

420 420
/**
421

  • * Because you cannot send xmlhttprequests across domains, we need to use
    422
  • * a proxy to check for updates.
    423

424

  • * @SInCE 2.0.?
    425
  • * @access public
    426
  • */
    427
  • public function UpdateProxy() {
    428
  •  $Fields = $_POST;
    
    429
  •  foreach ($Fields as $Field => $Value) {
    
    430
  •     if (get_magic_quotes_gpc()) {
    
    431
  •        if (is_array($Value)) {
    
    432
  •           $Count = count($Value);
    
    433
  •           for ($i = 0; $i < $Count; ++$i) {
    
    434
  •              $Value[$i] = stripslashes($Value[$i]);
    
    435
  •           }
    
    436
  •        } else {
    
    437
  •           $Value = stripslashes($Value);
    
    438
  •        }
    
    439
  •        $Fields[$Field] = $Value;
    
    440
  •     }
    
    441
  •  }
    
    442
  • 443
  •   $UpdateCheckUrl = C('Garden.UpdateCheckUrl', 'http://vanillaforums.org/addons/update');
    
    444
  •  echo ProxyRequest($UpdateCheckUrl.'?'.http_build_query($FielupdateChecksds));
    
    445
  •  $Database = Gdn::Database();
    
    446
  •  $Database->CloseConnection();
    
    447
  • }
    448
  • 449
  • /**
    450
  • * What the mothership said about update availability.
    451

452

  • * @SInCE 2.0.?
    453
  • * @access public
    454
  • */
    455
  • public function UpdateResponse() {
    456
  •  // Get the message, response, and transientkey
    
    457
  •  $Response = TrueStripSlashes(GetValue('Response', $_POST));
    
    458
  •  $TransientKey = GetIncomingValue('TransientKey', '');
    
    459
  • 460
  •  // If the key validates
    
    461
  •  $Session = Gdn::Session();
    
    462
  •  if ($Session->ValidateTransientKey($TransientKey)) {
    
    463
  •     // Save some info to the configuration file
    
    464
  •     $Save = array();
    

    465

    466
  •     // If the response wasn't empty, save it in the config
    
    467
  •     if ($Response != '')
    
    468
  •        $Save['Garden.RequiredUpdates'] = @json_decode($Response);
    
    469
  • 470
  •     // Record the current update check time in the config.
    
    471
  •     $Save['Garden.UpdateCheckDate'] = time();
    
    472
  •     SaveToConfig($Save);
    
    473
  •  }
    
    474
  • }
    475
  • 476
  • /**
    477 421
  • Set the user's timezone (hour offset).
    478 422
    *
    479 423
  • @SInCE 2.0.0
     applications/dashboard/js/settings.js
    ... ...
    @@ -23,44 +23,5 @@ jQuery(document).ready(function($) {
    23 23
    lists.addClass('Loading');
    24 24
    loadFeed(newsColumn, 'news', 3, 'extended');
    25 25
    loadFeed(helpColumn, 'help', 3, 'extended');
    26
  • 27
  • // Phone-home to the VanillaForums server to check for updates
    28
  • var updateChecks = gdn.definition('UpdateChecks', '');
    29
  • if (updateChecks != '') {
    30
  •  var webroot = gdn.definition('WebRoot', '');
    
    31
  •  var data = 'source='+webroot
    
    32
  •     + '&users=' + gdn.definition('CountUsers', 0)
    
    33
  •     + '&conversations=' + gdn.definition('CountConversations', 0)
    
    34
  •     + '&messages=' + gdn.definition('CountConversationMessages', 0)
    
    35
  •     + '&discussions=' + gdn.definition('CountDiscussions', 0)
    
    36
  •     + '&comments=' + gdn.definition('CountComments', 0)
    
    37
  •     + '&updateChecks=' + updateChecks
    
    38 26

39

  •  $.ajax({
    
    40
  •     type: "POST",
    
    41
  •     url: gdn.url('/dashboard/utility/updateproxy'),
    
    42
  •     data: data,
    
    43
  •     dataType: 'json',
    
    44
  •     success: function(json) {
    
    45
  •        if (json.messages != '' || json.response != '') {
    
    46
  •           // Save the message
    
    47
  •           $.ajax({
    
    48
  •              type: "POST",
    
    49
  •              url: gdn.url('/dashboard/utility/updateresponse'),
    
    50
  •              data: 'Messages='+json.messages+'&Response='+json.response+'&TransientKey='+gdn.definition('TransientKey'),
    
    51
  •              success: function() {
    
    52
  •                 // After the responses have been saved, re-fill the
    
    53
  •                 // #Content with this page's view (in case there are any
    
    54
  •                 // messages to be displayed)
    
    55
  •                 if (json.messages != '')
    
    56
  •                    $('#Content').load(
    
    57
  •                       gdn.url('/dashboard/settings/index'),
    
    58
  •                       'DeliveryType=ASSET&DeliveryMethod=XHTML'
    
    59
  •                    );
    
    60
  •              }
    
    61
  •           });
    
    62
  •        }
    
    63
  •     }
    
    64
  •  });
    
    65
  • }
    66 27
    });
    0 notes on commit 91904fa

Comment
Desktop version

Please sign in to comment.