<!--%%INCLUDE "i_defaulthead.incl" ("Automatic and manual software updates")-->
   <form action="upgrade" method="post" enctype="multipart/form-data">
   <fieldset><legend>Current version</legend>
      <p>PolluStop %%currentversion%% for %%platform%%</p>
   </fieldset>
   <fieldset><legend><select name="usehttpproxy" class="nw"><!--%%BOOLMENU settings.usehttpproxy DEFAULT defaultsettings.usehttpproxy DISPLAY enabledisable--></select> HTTP Proxy</legend>
      <table cellspacing="0">
         <tr><th>Host :</th><td><input size="30" type="text" name="httpproxyhost" value="%%HTML:SETTINGS("httpproxyhost")%%" /></td></tr>
         <tr><th>Port :</th><td><input size="20" type="text" maxlength="5" name="httpproxyport" value="%%HTML:SETTINGS("httpproxyport")%%" /></td></tr>
      </table><br />
      <fieldset><legend><select name="httpproxyauth" class="nw"><!--%%BOOLMENU settings.httpproxyauth DEFAULT defaultsettings.httpproxyauth DISPLAY enabledisable--></select> Authentication</legend>
      <table cellspacing="0">
         <tr><th>Username :</th><td><input size="30" type="text" name="httpproxyusername" value="%%HTML:SETTINGS("httpproxyusername")%%" /></td></tr>
         <tr><th>Password :</th><td><input size="20" maxlength="20" class="pw" type="password" autocomplete="off" name="httpproxypassword" value="********" /></td></tr>
      </table>
      </fieldset>
   </fieldset>

   <fieldset><legend>Regex definition files</legend>
      <p class="explain">Niversoft provides regular expression definitions which are updated to fight new types of spam PolluStop may have problems to deal with. The definitions are available to PolluStop instances for which the maintenance contract is valid. Provided regexes can be viewed on the <a href="regex">Regex</a> page and individual rules can be disabled there.</p>
      <p><select class="ed" name="updateserverregex" onchange="$('#reportfieldset')[this.selectedIndex ? 'show' : 'hide'](); $('#applyandfetch').attr('disabled', !this.selectedIndex);"><!--%%BOOLMENU settings.updateserverregex DEFAULT defaultsettings.updateserverregex DISPLAY enabledisable--></select> automatic download of regex definition files.</p>
      <fieldset id="reportfieldset" <!--%%IF NOT(settings.updateserverregex)-->style="display:none"<!--%%ENDIF-->><legend>Usage data report</legend>
         <p class="explain">To be able to provide the best regex set, usage data has to be gathered for these rules. The data sent is, for each regex, the number of messages matching it, as well as the total number of messages scanned by PolluStop and the percentage of spam. Also, to allow new and better regex to be shared, the same data is gathered about your own regular expressions.</p>
         <p><select style="width:95px" name="reportserverregexusage"><!--%%BOOLMENU settings.reportserverregexusage DEFAULT defaultsettings.reportserverregexusage DISPLAY reportnoreport--></select> anonymous usage data about provided regular expressions.</p>
         <p><select style="width:95px" name="reportuserregexusage"><!--%%BOOLMENU settings.reportuserregexusage DEFAULT defaultsettings.reportuserregexusage DISPLAY reportnoreport--></select> anonymous usage data about custom regular expressions (as well as those custom rules).</p>
      </fieldset>
      <input type="submit" name="apply" value="Save settings" />
      <input type="submit" <!--%%IF NOT(settings.updateserverregex)-->disabled="disabled"<!--%%ENDIF--> name="applyandfetch" id="applyandfetch" value="Save settings and update now" />
   </fieldset>

   <fieldset><legend>Check for new version</legend>
      <p><input type="submit" name="docheck" value="Check for new version" /></p>
      <p class="explain">Note: No information but your IP address is transmitted to Niversoft during this process</p>
      <!--%%IF exists(publishedversion)-->
      <table>
         <tr><td align="right">Installed version: </td><td> %%currentversion%%</td></tr>
         <tr><td align="right">Published version: </td><td> %%publishedversion%%</td></tr>
      </table></p>
      <!--%%IF NOT(hasnewversion)-->
         <p class="explain">You have the latest published version</p>
      <!--%%ELSE-->
         <p class="explain">A new version is available. <a onclick="window.open(this.href); return false;" href="http://www.niversoft.com/products/pollustop/LATEST" style="font-size:x-small; font-weight:bold;">[RELEASE NOTES]</a></p>
         <!--%%IF requiresnewlicence-->
            <p class="errors"><strong>You will need an updated license to run the published version.<br>Please get your new license from <a target="_new" href="http://licenses.niversoft.com">http://licenses.niversoft.com</a> BEFORE upgrading</strong></p>
         <!--%%ELSE-->
            <p class="explain">Your current license is valid to run the published version.</p>
         <!--%%ENDIF-->
      <!--%%ENDIF-->
      <!--%%ENDIF-->
      <!--%%IF EXISTS(versionmessage)-->
         <p class="explain"><strong>MESSAGE:</strong> %%versionmessage%%</p>
      <!--%%ENDIF-->
   </fieldset>

<!--%%IF hasnewversion & NOT(requiresnewlicence)-->
   <fieldset><legend>Automatic update</legend>
         <p class="errors">After applying the upgrade, PolluStop will need to restart itself. To do so, it relies on CGP to auto-restart
            the PolluStop helper. BE SURE YOU SET THE POLLUSTOP HELPER'S AUTO-RESTART SETTING TO A LOW VALUE in CGP webadmin (Settings/General/Helpers).
            Failure to do so will prevent PolluStop from restarting, and your mail will be stuck in the queue until it's manually restarted.</p>
         <p class="explain">PolluStop will attempt to fetch the new package from Niversoft's website, will save it to a temp location, verify its integrity and
         unpack it. It will backup the current files and replace them with the unpacked ones. PolluStop will then stop to let CGP restart the new version.</p>
         <p class="errors">Your browser will hang for several seconds until the package is downloaded and unpacked.</p>
         <input type="submit" name="autoupdate" disabled="disabled" value="Apply update" /> <label><input type="checkbox" onclick="IAmSure(this, 'autoupdate')" name="autosure" value="1" />I am sure</label>
         <p class="explain">If you use the PolluStop-Drop Helper feature, you must restart the helper manually once PolluStop is updated.</p>
   </fieldset>
<!--%%ENDIF-->

   <fieldset><legend>Manual update</legend>
      <p class="explain">&bull; <a href="http://www.niversoft.com/downloads/%%packagefilename%%">Download the package</a></p>
      <p class="explain">&bull; <a href="http://www.niversoft.com/downloads/%%packagefilename%%.md5">Download the md5 signature</a></p>
      <p class="errors">Warning: package integrity and version can not be automatically verified when applying a manually downloaded update. It's under your responsability to verify
         the md5sum of the manually downloaded package against the published signature. You must also verify your current license is valid for the new version.</p>
      <input type="radio" checked="checked" name="whichfile" value="0" id="wf0" />PolluStop package: <input size="40" type="file" onclick="$('#wf0').checked(true)" name="manualdlfile" value="" /><br />
      <input type="radio" name="whichfile" value="1" id="wf1" />Path to the file on the server:  <input size="60" onclick="$('#wf1').checked(true)" type="text" name="manualhdfile" value="" /><br />

      <p class="explain">Your browser will hang for a few seconds while the file is unpacked.</p>
      <input type="submit" name="manualupdate" disabled="disabled" value="Apply update" /> <label><input type="checkbox" onclick="IAmSure(this, 'manualupdate')" name="manualsure" value="1" />I am sure</label>
      <p class="explain">If you use the PolluStop-Drop Helper feature, you must restart the helper manually once PolluStop is updated.</p>
   </fieldset>
   </form>
<!--%%INCLUDE "i_defaultfoot.incl"-->

  <!--%%If upgrading--><script type="text/javascript">checkUpgrade()</script><!--%%ENDIF-->

