diff --git a/app/controllers/artifacts_controller.rb b/app/controllers/artifacts_controller.rb new file mode 100644 index 000000000..6efa9d1c6 --- /dev/null +++ b/app/controllers/artifacts_controller.rb @@ -0,0 +1,36 @@ +class ArtifactsController < ApplicationController + + def versioncheck + + # the reported client version + client_version = params[:ver] + + # the name of the client + product = params[:product] + + # the os (Win32/MacOSX/Unix) + os = params[:os] + + product = "#{product}/#{os}" + + unless ArtifactUpdate::PRODUCTS.include? product + render :text => "Unknown product type" + return + end + + @artifact = ArtifactUpdate.find_by_product_and_environment(product, ArtifactUpdate::DEFAULT_ENVIRONMENT) + + if @artifact.nil? + @log.error "no product was found for #{product} and environment: #{ArtifactUpdate::DEFAULT_ENVIRONMENT}" + render :text => "No product available" + return + elsif @artifact.version == client_version + render :text => "You have the latest version." + return + else + render :layout => false + end + + end + +end diff --git a/app/views/artifacts/versioncheck.html.erb b/app/views/artifacts/versioncheck.html.erb new file mode 100644 index 000000000..dc5be95b3 --- /dev/null +++ b/app/views/artifacts/versioncheck.html.erb @@ -0,0 +1,10 @@ + + + + + + +
<%= image_tag "logo.png" %>

New version available

+ +

Version <%= @artifact.version %> is now released on Jamkazam.com
+ Please download directly from here.

\ No newline at end of file