<!--%%INCLUDE "i_defaulthead.incl"-->
   <title>PolluStop Web Administration</title>
   <!--%%IF NOT(requestsecure)--><script type="text/javascript" src="/rsa.js"></script><!--%%ENDIF-->

   <script type="text/javascript">
      <!--%%IF NOT(requestsecure)-->
      window.setTimeout("window.location.replace('')", 250 * 1000);

      function encString(in_Key, in_Data, in_Field)
      {
         if ((in_Field.value == "********") || (!in_Field.value.length))
         {
            in_Field.value = "";
         }
         else
         {
            in_Field.maxLength = 255;
            in_Field.value = encryptedString(in_Key, in_Data + ' ' + in_Field.value);
         }
      }

      function doSubmit()
      {
         var l_Form = document.forms[0];
         setMaxDigits(19);
         var l_Key = new RSAKeyPair('%%pk_key%%', '', '%%pk_mod%%');
         var l_Data = '%%pk_data%%';

         l_Form.verifypassword.value = '';

         var l_El;
         for (var i = 0; (l_El = l_Form.elements[i]); ++i)
         {
            if (l_El.type == "password")
            {
               encString(l_Key, l_Data, l_El);
            }
         }

         l_Form.submit();
      }
      <!--%%ENDIF-->

      function preSubmit()
      {
         var l_Form = document.forms[0];

         if (l_Form.newpassword.value != "********")
         {
            if (l_Form.oldpassword.length < 6)
            {
               alert("%%JAVASCRIPT:DICTIONARY("errors")."CurrentPass"%%");
               l_Form.oldpassword.focus();
               return false;
            }
            if (l_Form.username.length < 5)
            {
               alert("%%JAVASCRIPT:DICTIONARY("errors")."Username5"%%");
               l_Form.username.focus();
               return false;
            }
            if (l_Form.newpassword.length < 6)
            {
               alert("%%JAVASCRIPT:DICTIONARY("errors")."Password6"%%");
               l_Form.newpassword.value = l_Form.verifypassword.value = "";
               l_Form.newpassword.focus();
               return false;
            }
            else if (l_Form.newpassword.value != l_Form.verifypassword.value)
            {
               alert("%%JAVASCRIPT:DICTIONARY("errors")."PassNotMatch"%%");
               l_Form.newpassword.value = l_Form.verifypassword.value = "";
               l_Form.newpassword.focus();
               return false;
            }
         }
         if (l_Form.view_password.value != "********")
         {
            if (l_Form.view_password.length < 6)
            {
               alert("%%JAVASCRIPT:DICTIONARY("errors")."Password6"%%");
               l_Form.view_password.value = "";
               l_Form.view_password.focus();
               return false;
            }
         }

         <!--%%IF requestsecure-->
         return true;
         <!--%%ELSE-->
         for (var i = 0; (l_El = l_Form.elements[i]); ++i)
         {
            if ((l_El.type == "password") || (l_El.type == "text") || (l_El.type == "select-one"))
            {
               l_El.readOnly = true;
            }
         }

         l_Form.apply_button.disabled = true;
         l_Form.elements["reset"].disabled = true;
         l_Form.temp.name = "apply";
         document.getElementById('encrypt').style.display='';
         window.setTimeout(doSubmit, 50);
         return false;
         <!--%%ENDIF-->
      }

   </script>
</head>
<body>
   <h1>PolluStop Web Administration<br />
   <span class="h2">%%domainname%%</span></h1>
   <!--%%INCLUDE "i_statuscodes.incl"-->
   <form action="password" autocomplete="off" method="post" onsubmit="return preSubmit();" autocomplete=off><!--%%IF NOT(requestsecure)-->
      <input type="hidden" name="temp" value="">
      <input type="hidden" name="pk_time" value="%%pk_time%%" /><!--%%ENDIF-->
      <!--%%IF EQUALS(settings.password AND "pollustop")-->
      <div class="bolderrors">The system is configured with the default password,<br />
      you must modify it before performing any other action.<br />
      It's also recommended to change the Username.</div>
      <!--%%ENDIF-->
      <fieldset><legend>Web administration password</legend>
         <table cellspacing="0">
            <tr><th>Username</th><td><input size="30" type="text" name="username" value="%%SETTINGS("username")%%" /></td></tr>
            <tr><th>CURRENT Password</th><td><input autocomplete="off" size="20" maxlength="20" class="pw" type="password" name="oldpassword" value="" /></td></tr>
            <tr><th>NEW Password</th><td><input autocomplete="off" size="20" maxlength="20" class="pw" type="password" name="newpassword" value="********" /></td></tr>
            <tr><th>NEW Password (again)</th><td><input autocomplete="off" size="20" maxlength="20" class="pw" type="password" name="verifypassword" value="" /></td></tr>
         </table><br /><!--%%IF NOT(requestsecure)-->
         <p class="explain">Your password is secured. The passwords are sent encrypted using client-side RSA encryption.</p><!--%%ENDIF-->
      </fieldset>

      <fieldset><legend><select class="ed" name="view_enable"><!--%%BOOLMENU settings.view_enable DEFAULT defaultsettings.view_enable DISPLAY enabledisable--></select> View-Only password</legend>
            <p>This account will be allowed to view most pages of the webadmin interface, but not to modify the settings</p>
         <table cellspacing="0">
            <tr><th>Username</th><td><input size="30" type="text" name="view_username" value="%%SETTINGS("view_username")%%" /></td></tr>
            <tr><th>Password</th><td><input size="20" maxlength="20" class="pw" type="password" autocomplete="off" name="view_password" value="********" /></td></tr>
         </table><br />
         <p><select name="view_canchangewblist"><!--%%BOOLMENU settings.view_canchangewblist DEFAULT defaultsettings.view_canchangewblist DISPLAY yesno--></select> User can modify whitelist and blacklist.</p>
      </fieldset>

      <fieldset><legend>
      <select name="usecli"><!--%%BOOLMENU settings.usecli DEFAULT defaultsettings.usecli DISPLAY yesno--></select> Allow PolluStop to use CLI</legend>
      <p class="explain">PolluStop requires a Communigate Pro account with admin rights (Can Modify and Monitor Everything). This account must be in the Main Domain - secondary domain accounts can't get full admin rights. This account is used to access certain CGPro settings via the CLI (Command-Line Interface), and to automate the initial setup of PolluStop via the Wizard.</p>
      <p class="explain">If you stop PolluStop from using the CLI, the initial setup wizard will be disabled, as well as some of the scanning features of PolluStop.</p>
      <p class="explain">Your entries will be verified before being saved (PolluStop will attempt a CLI connection).</p>
      <table cellspacing="0">
         <tr><th>Full account name</th><td><input size="30" type="text" name="cgaccount" value="%%SETTINGS("cgaccount")%%" /></td></tr>
         <tr><th>Password</th><td><input size="20" maxlength="128" class="pw" type="password" autocomplete="off" name="cgpassword" value="********" /></td></tr>
         <tr><th>CLI IP</th><td><input size="15" maxlength="15" class="pw" type="text" name="cliip" value="%%SETTINGS("cliip")%%" /> (usually 127.0.0.1)</td></tr>
         <tr><th>CLI port</th><td><input size="5" maxlength="5" class="pw" type="text" name="cliport" value="%%SETTINGS("cliport")%%" /> (usually 106, 8106 on OSX)</td></tr>
         <tr><th>Use APOP</th><td><select name="useapop"><!--%%BOOLMENU settings.useapop DEFAULT defaultsettings.useapop DISPLAY yesno--></select></td></tr>
      </table></fieldset>

      <fieldset><legend>IMAP username / password</legend>
         <p class="explain">IMAP is used by the <a href="drop">Drop mailboxes</a> processing. The IMAP account can be the same used for CLI access or you can specify a different account, for instance if you want that account to be in a secondary or shared domain.</p>
         <p class="explain"><select class="ud"  onchange="document.getElementById('imap_info').style.display=!this.selectedIndex ? 'none' : ''" name="separateimap"><!--%%BOOLMENU settings.separateimap DEFAULT defaultsettings.separateimap DISPLAY usenouse--></select> separate account information for IMAP access</p>
         <table cellspacing="0" id="imap_info"<!--%%IF NOT(settings.separateimap)--> style="display:none"<!--%%ENDIF-->>
            <tr><th>Full account name</th><td><input size="30" type="text" name="imapaccount" value="<!--%%IF NOT(settings.separateimap)-->%%SETTINGS("cgaccount")%%<!--%%ELSE-->%%SETTINGS("imapaccount")%%<!--%%ENDIF-->" /></td></tr>
            <tr><th>Password</th><td><input size="20" maxlength="128" class="pw" type="password" autocomplete="off" name="imappassword" value="********" /></td></tr>
         </table>
      </fieldset>

      <p><input type="submit" class="btn" name="apply<!--%%IF NOT(requestsecure)-->_button<!--%%ENDIF-->" value="Save Settings" /><input type="reset" class="btn" name="reset" value="Reset" /> <span id="encrypt" style="display:none; font-size:x-small; color:#808080; font-style:italic;">&nbsp;&nbsp;encrypting data...</span></p>
   </form>
<!--%%INCLUDE "i_defaultfoot.incl"-->
