-<cfif request.admintype EQ "web"><cflocation url="#request.self#" addtoken="no"></cfif>
+<!--- 
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either 
+ * version 2.1 of the License, or (at your option) any later version.
+ * 
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+ * Lesser General Public License for more details.
+ * 
+ * You should have received a copy of the GNU Lesser General Public 
+ * License along with this library.  If not, see <http://www.gnu.org/licenses/>.
+ * 
+ ---><cfif request.admintype EQ "web"><cflocation url="#request.self#" addtoken="no"></cfif>
 
 <cfparam name="url.action2" default="none">
 <cfset error.message="">
 <cfset error.detail="">
-<cfset restBasePath="/rest/update/provider/">
 
 <cftry>
 <cfswitch expression="#url.action2#">

							<ul class="radiolist" id="updatelocations">
								<li>
									<label>
										<input type="radio" class="radio" name="location" value="http://stable.lucee.org"<cfif update.location EQ 'http://stable.lucee.org'> <cfset isCustom=false>checked="checked"</cfif> />
										<b>#stText.services.update.location_www#</b>
									</label>
									<div class="comment">#stText.services.update.location_wwwdesc#</div>
								</li>
								<li>
									<label>
										<input type="radio" class="radio" name="location" value="http://preview.lucee.org"<cfif update.location EQ 'http://preview.lucee.org'> <cfset isCustom=false>checked="checked"</cfif> />
										<b>#stText.services.update.location_preview#</b>
									</label>
									<div class="comment">#stText.services.update.location_previewdesc#</div>
								</li>
								<li>
									<label>
										<input type="radio" class="radio" name="location" value="http://dev.lucee.org"<cfif update.location EQ 'http://dev.lucee.org'> <cfset isCustom=false>checked="checked"</cfif> />
										<b>#stText.services.update.location_dev#</b>
									</label>
									<div class="comment">#stText.services.update.location_devdesc#</div>

---->
<cfset needNewJars=false>


<cffunction name="getAvailableVersion" output="false">
	
	<cftry>
	<cfhttp 
			url="#update.location#/lucee/remote/version/Info.cfc?method=getpatchversionfor&version=#server.lucee.version#" 
		method="get" resolveurl="no" result="local.http">

	<cfwddx action="wddx2cfml" input="#http.fileContent#" output="local.wddx">
	<cfset session.availableVersion=wddx>
	<cfreturn session.availableVersion>
		<cfcatch>
			<cfreturn "">
		</cfcatch>
	</cftry>
</cffunction>

<cffunction name="getAvailableVersionDoc" output="true">
	
	<cftry>
	<cfhttp 
		url="#update.location#/lucee/remote/version/Info.cfc?method=getPatchVersionDocFor&level=#server.ColdFusion.ProductLevel#&version=#server.lucee.version#" 
		method="get" resolveurl="no" result="local.http"><!--- #server.lucee.version# --->
	<cfwddx action="wddx2cfml" input="#http.fileContent#" output="wddx">
		
	<cfreturn wddx>
		<cfcatch>
			<cfreturn "-">
		</cfcatch>
	</cftry>
</cffunction>

<cfadmin 
	action="getUpdate"
	type="#request.adminType#"
	password="#session["password"&request.adminType]#"
	returnvariable="update">

<cfset curr=server.lucee.version>
<cfset avi=getAvailableVersion()>
<cfset hasAccess=1>
<cfset hasUpdate=curr LT avi>

<cfoutput>
	<div class="pageintro">#stText.services.update.desc#</div>
