 				<tfoot>
 					<tr>
 						<td>
-							<input type="submit" class="bs button submit" name="mainAction" value="#stText.services.update.exeRun#">
+							<input type="submit" class="button submit" name="mainAction" value="#stText.services.update.exeRun#">
 						</td>
 					</tr>
 				</tfoot>

---->
<cfset needNewJars=false>

<cfscript>
stText.services.update.serverNotReachable="Could not reach server {url}.";
stText.services.update.serverFailed="server {url} failed to return a valid response.";

	struct function getAvailableVersion() localmode="true"{
		try{
			
			admin 
				action="getAPIKey"
				type="#request.adminType#"
				password="#session["password"&request.adminType]#"
				returnVariable="apiKey";

			http 
			url="#update.location##restBasePath#info/#server.lucee.version#" 
			method="get" resolveurl="no" result="local.http" {
				httpparam type="header" name="ioid" value="#apikey#";

			}
			// i have a response
			if(isJson(http.filecontent)) {
				rsp=deserializeJson(http.filecontent);
			}
			// service not available
			else if(http.status_code==404) {
				rsp={"type":"warning","message":replace(stText.services.update.serverNotReachable,'{url}',update.location)};
			}
			// server failed
			else {
				rsp={"type":"warning","message":replace(stText.services.update.serverFailed,'{url}',update.location)&" "&http.filecontent};
			}
		}
		catch(e){
			rsp={"type":"warning","message":replace(stText.services.update.serverFailed,'{url}',update.location)&" "&e.message};
		}
		return rsp;
	}

// get info for the update location
admin 
	action="getUpdate"
	type="#request.adminType#"
	password="#session["password"&request.adminType]#"
	returnvariable="update";


curr=server.lucee.version;
updateData=getAvailableVersion();
hasAccess=1;
hasUpdate=structKeyExists(updateData,"available");

</cfscript>



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

							<ul class="radiolist" id="updatelocations">
								<li>
									<label>
										<input type="radio" class="radio" name="location" value="http://www.getlucee.org"<cfif update.location EQ 'http://www.getlucee.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.getlucee.org"<cfif update.location EQ 'http://preview.getlucee.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.getlucee.org"<cfif update.location EQ 'http://dev.getlucee.org'> <cfset isCustom=false>checked="checked"</cfif> />
										<b>#stText.services.update.location_dev#</b>
									</label>
									<div class="comment">#stText.services.update.location_devdesc#</div>
