From 9ffd2025d3403b498b739ee0d45680f19edd4e9b Mon Sep 17 00:00:00 2001 From: Aleksey Lim Date: Tue, 30 Jun 2009 01:28:58 +0000 Subject: Sugarize services/update.php --- diff --git a/site/app/webroot/services/update.php b/site/app/webroot/services/update.php index f31ff85..80d8b2a 100644 --- a/site/app/webroot/services/update.php +++ b/site/app/webroot/services/update.php @@ -68,11 +68,7 @@ require_once('./functions.php'); */ // Required variables that we need to run the script. -$required_vars = array('reqVersion', - 'id', - 'version', - 'appID', - 'appVersion'); +$required_vars = array('id'); // Mapping of addontypes to addontype_id. // These are used in the urn, and should not be localized. @@ -162,6 +158,9 @@ if (empty($errors) && !$detect_installed) { foreach ($required_vars as $var) { $sql[$var] = mysql_real_escape_string($_GET[$var]); } + + // we are sugar + $sql['appID'] = '{3ca105e0-2280-4897-99a0-c277d1b733d2}'; /** * Determine whether the add-on is hosted on AMO and if so, if it's public @@ -193,11 +192,6 @@ if (empty($errors) && !$detect_installed) { // If public, we only pull public files $where = 'WHERE files.status = '.STATUS_PUBLIC; } - else { - // Otherwise, we pull the appropriate file and find the same version - // currently in use for updated compatibility information - $where = "WHERE files.status > ".STATUS_NULL." AND versions.version = '{$sql['version']}'"; - } $os_query = ($sql['os_id']) ? " OR files.platform_id = {$sql['os_id']}" : ''; // Set up os_id. @@ -248,7 +242,7 @@ if (empty($errors) && !$detect_installed) { * * If you want to test updates, change your config and set up a web dir with public files in it. */ - $data['uri'] = FILES_HOST . '/' . $data['id'] . '/' . $data['filename']; + $data['uri'] = FILES_HOST.'/downloads/file/'.$data['file_id'].'/'.$data['filename']; } if (!empty($data['type'])) { -- cgit v0.9.1