<?php
// форма редактирования конфига
if(!defined('ANTIBOT')) die('access denied');

$title = abTranslate('Edit Config');

if ($ab_config['timezone'] == '' AND date_default_timezone_get() != '') {
$ab_config['timezone'] = date_default_timezone_get();
}

include(__DIR__.'/../data/conf.php');
//@include(__DIR__.'/data/subsalt.php');
//$ab_config['salt'] = $ab_config['subsalt'].$ab_config['salt'];

$content .= '
<form action="?'.$abw.$abp.'=confsave" method="post">
  <div class="form-group row">
    <label for="disable" class="col-sm-2 col-form-label">'.abTranslate('Antibot is working now').'</label>
    <div class="col-sm-10">
  <div class="form-check">
  <input class="form-check-input" type="radio" name="disable" id="disable1" value="1" '.(($ab_config['disable'] == '1') ? 'checked' : '').'>
  <label class="form-check-label" for="disable1"><span class="text-danger">'.abTranslate('Disable').'</span> <small class="text-muted">('.abTranslate('If you need to temporarily disable without deleting the connection code').').</small></label>
</div>
<div class="form-check">
  <input class="form-check-input" type="radio" name="disable" id="disable0" value="0" '.(($ab_config['disable'] == '0') ? 'checked' : '').'>
  <label class="form-check-label" for="disable0"><span class="text-success">'.abTranslate('Enable').'</span></label>
</div>
    </div>
  </div>

<hr />

  <div class="form-group row">
    <label for="disable" class="col-sm-2 col-form-label">'.abTranslate('PHP errors').'</label>
    <div class="col-sm-10">
<div class="form-check">
  <input class="form-check-input" type="radio" name="phperror" id="phperror2" value="2" '.(($ab_config['phperror'] == '2') ? 'checked' : '').'>
  <label class="form-check-label" for="phperror2">'.abTranslate('Enable display in the browser, write to the log').' <small class="text-muted">('.abTranslate('For debugging').').</small></label>
</div>
<div class="form-check">
  <input class="form-check-input" type="radio" name="phperror" id="phperror1" value="1" '.(($ab_config['phperror'] == '1') ? 'checked' : '').'>
  <label class="form-check-label" for="phperror1">'.abTranslate('Disable display in the browser, write to the log').' <small class="text-muted">('.abTranslate('Recommended').').</small></label>
</div>
<div class="form-check">
  <input class="form-check-input" type="radio" name="phperror" id="phperror0" value="0" '.(($ab_config['phperror'] == '0') ? 'checked' : '').'>
  <label class="form-check-label" for="phperror0">'.abTranslate('Disable display in the browser, disable error log').'.</label>
</div>
    </div>
  </div>

<hr />
   
  <div class="form-group row">
    <label for="webdir" class="col-sm-2 col-form-label">'.abTranslate('Web directory').'</label>
    <div class="col-sm-10">
      <input name="webdir" type="text" class="form-control" id="webdir" value="'.$ab_config['webdir'].'">
      <small class="form-text text-muted">'.abTranslate('Antibot web directory, path from website root or with protocol and domain. Example: /antibot8/ or https://yoursite.com/antibot8/').'</small>
    </div>
  </div>

<hr />
   
  <div class="form-group row">
    <label for="timezone" class="col-sm-2 col-form-label">'.abTranslate('Timezone').'</label>
    <div class="col-sm-10">
      <input name="timezone" type="text" class="form-control" id="timezone" value="'.$ab_config['timezone'].'">
      <small class="form-text text-muted"><a href="https://www.php.net/manual/'.$lang_code.'/timezones.php" target="_blank" rel="noopener">'.abTranslate('List of Supported Timezones').'</a></small>
    </div>
  </div>

<hr />
  
  <div class="form-group row">
    <label for="email" class="col-sm-2 col-form-label">'.abTranslate('Email (Login)').'</label>
    <div class="col-sm-10">
      <input name="email" type="text" class="form-control" id="email" value="'.$ab_config['email'].'">
      <small class="form-text text-muted">'.abTranslate('Email registered on the website:').' <a href="https://antibot.cloud/" target="_blank" rel="noopener noreferrer">AntiBot.Cloud.</a></small>
    </div>
  </div>
  
  <div class="form-group row">
    <label for="pass" class="col-sm-2 col-form-label">'.abTranslate('Password').'</label>
    <div class="col-sm-10">
      <input name="pass" type="text" class="form-control" id="pass" value="'.$ab_config['pass'].'">
      <small class="form-text text-muted">'.abTranslate('The password is also from the AntiBot.Cloud website.').'</small>
    </div>
  </div>
<a name="secondpass"></a>
  <div class="form-group row">
    <label for="secondpass" class="col-sm-2 col-form-label">'.abTranslate('Second Password').'</label>
    <div class="col-sm-10">
      <input name="secondpass" type="text" class="form-control" id="secondpass" value="'.(($ab_config['secondpass'] != '') ? '**********' : '').'">
      <small class="form-text text-muted">'.abTranslate('Additional password for accessing the AntiBot admin panel. If you forget it, you can log in via FTP and clear the <code>secondpass</code> variable in the <code>data/conf.php</code> configuration file.').'</small>
    </div>
  </div>
  
<hr />

  <div class="form-group row">
    <label class="col-sm-2 col-form-label">'.abTranslate('Salt and cookies').'</label>
    <div class="col-sm-10">
      <div class="form-check">
        <input name="newsalt" class="form-check-input" type="checkbox" id="newsalt">
        <label class="form-check-label" for="newsalt">'.abTranslate('Generate new salt').' <small class="text-muted">'.abTranslate('To reset cookies for all visitors, they will have to pass the Antibot check again.').'</small></label>
      </div>
<div class="form-check form-check-inline">
  <input class="form-check-input" type="radio" name="timesalt" id="timesalt_Y" value="Y" '.(($ab_config['timesalt'] == 'Y') ? 'checked' : '').'>
  <label class="form-check-label" for="timesalt_Y">'.abTranslate('without resetting cookies').'</label>
</div>
<div class="form-check form-check-inline">
  <input class="form-check-input" type="radio" name="timesalt" id="timesalt_Yz" value="Yz" '.(($ab_config['timesalt'] == 'Yz') ? 'checked' : '').'>
  <label class="form-check-label" for="timesalt_Yz">'.abTranslate('every new day').'</label>
</div>
<div class="form-check form-check-inline">
  <input class="form-check-input" type="radio" name="timesalt" id="timesalt_YW" value="YW" '.(($ab_config['timesalt'] == 'YW') ? 'checked' : '').'>
  <label class="form-check-label" for="timesalt_YW">'.abTranslate('every new week').'</label>
</div>
<small class="form-text text-muted">'.abTranslate('No reset - cookies live for 10 days if the visitor\'s IP and User-Agent do not change.').'</small>
    </div>
  </div>

<hr />

  <div class="form-group row">
    <label for="check_url" class="col-sm-2 col-form-label">'.abTranslate('Check URL').'</label>
    <div class="col-sm-10">
      <input name="check_url" type="text" class="form-control" id="check_url" value="'.$ab_config['check_url'].'">
      <small class="form-text text-muted">'.abTranslate('Leave the field blank for cloud Antibot check or specify your local check URL, for example the path to:"').' '.$ab_config['webdir'].'ab.php</small>
    </div>
  </div>

<hr />

  <div class="form-group row">
    <label for="is_bitrix" class="col-sm-2 col-form-label">'.abTranslate('Is it Bitrix CMS?').'</label>
    <div class="col-sm-10">
  <div class="form-check">
  <input class="form-check-input" type="radio" name="is_bitrix" id="is_bitrix1" value="1" '.(($ab_config['is_bitrix'] == '1') ? 'checked' : '').'>
  <label class="form-check-label" for="is_bitrix1">'.abTranslate('Website on Bitrix CMS and a looped redirect appears on the check page').'</label>
</div>
<div class="form-check">
  <input class="form-check-input" type="radio" name="is_bitrix" id="is_bitrix0" value="0" '.(($ab_config['is_bitrix'] == '0') ? 'checked' : '').'>
  <label class="form-check-label" for="is_bitrix0">'.abTranslate('There is no specified problem or it is not Bitrix CMS').'</label>
</div>
    </div>
  </div>

<hr />

  <div class="form-group row">
    <label for="timer" class="col-sm-2 col-form-label">'.abTranslate('Timer (sec)').'</label>
    <div class="col-sm-10">
      <input name="timer" type="text" class="form-control" id="timer" value="'.$ab_config['timer'].'">
      <small class="form-text text-muted">'.abTranslate('If cloud check does not respond in time, the login buttons will appear after a certain number of seconds (if they are allowed).').'</small>
    </div>
  </div>

<hr />

  <div class="form-group row">
    <label for="hits_per_user" class="col-sm-2 col-form-label">'.abTranslate('Views').'</label>
    <div class="col-sm-10">
      <input name="hits_per_user" type="text" class="form-control" id="hits_per_user" value="'.$ab_config['hits_per_user'].'">
      <small class="form-text text-muted">'.abTranslate('The number of page views by a visitor on the website after which to re-issue the Antibot check.').'</small>
    </div>
  </div>

<hr />

  <div class="form-group row">
    <label for="input_button" class="col-sm-2 col-form-label">'.abTranslate('Login button').'</label>
    <div class="col-sm-10">
  <div class="form-check">
  <input class="form-check-input" type="radio" name="input_button" id="input_button1" value="1" '.(($ab_config['input_button'] == '1') ? 'checked' : '').'>
  <label class="form-check-label" for="input_button1">'.abTranslate('Disable buttons').' <small class="text-muted">('.abTranslate('If the visitor does not pass the automatic check, he will not get to the website at all.').').</small></label>
</div>
<div class="form-check">
  <input class="form-check-input" type="radio" name="input_button" id="input_button0" value="0" '.(($ab_config['input_button'] == '0') ? 'checked' : '').'>
  <label class="form-check-label" for="input_button0">'.abTranslate('Do not disable buttons').'</label>
</div>
    </div>
  </div>

  <div class="form-group row">
    <label for="buttons" class="col-sm-2 col-form-label">'.abTranslate('Login button type').'</label>
    <div class="col-sm-10">
<div class="form-check">
  <input class="form-check-input" type="radio" name="buttons" id="buttons2" value="2" '.(($ab_config['buttons'] == '2') ? 'checked' : '').'>
  <label class="form-check-label" for="buttons2">'.abTranslate('Multiple buttons with similar IMAGE selection').'</label>
</div>
<div class="form-check">
  <input class="form-check-input" type="radio" name="buttons" id="buttons1" value="1" '.(($ab_config['buttons'] == '1') ? 'checked' : '').'>
  <label class="form-check-label" for="buttons1">'.abTranslate('Multiple buttons with similar COLOR selection').'</label>
</div>
<div class="form-check">
  <input class="form-check-input" type="radio" name="buttons" id="buttons0" value="0" '.(($ab_config['buttons'] == '0') ? 'checked' : '').'>
  <label class="form-check-label" for="buttons0">'.abTranslate('One big button "I\'m not a robot"').'</label>
</div>
    </div>
  </div>

  <div class="form-group row">
    <label for="time_ban" class="col-sm-2 col-form-label">'.abTranslate('Blocking period').'</label>
    <div class="col-sm-10">
      <input name="time_ban" type="text" class="form-control" id="time_ban" value="'.$ab_config['time_ban'].'">
      <small class="form-text text-muted">'.abTranslate('The number of hours and minutes for which to block the IP of those visitors who clicked on the wrong button, if 0 then do not block. Format: hours.minutes (example: 12 - 12 hours, 0.10 - 10 minutes, 1.1 - 1 hour and 1 minute)').'</small>
    </div>
  </div>

<hr />
   
  <div class="form-group row">
    <label for="tpl_lang" class="col-sm-2 col-form-label">'.abTranslate('Check page lang').'</label>
    <div class="col-sm-10">
      <input name="tpl_lang" type="text" class="form-control" id="tpl_lang" value="'.$ab_config['tpl_lang'].'">
      <small class="form-text text-muted">'.abTranslate('The language of the check page (e.g. ru). If not specified, the language of the text is determined by the browser language. Languages from the directory lang/tpl/').'</small>
    </div>
  </div>

<hr />

  <div class="form-group row">
    <label for="re_check" class="col-sm-2 col-form-label">ReCAPTCHA v3</label>
    <div class="col-sm-10">
  <div class="form-check">
  <input class="form-check-input" type="radio" name="re_check" id="re_check1" value="1" '.(($ab_config['re_check'] == '1') ? 'checked' : '').'>
  <label class="form-check-label" for="re_check1">'.abTranslate('Enable').' <small class="text-muted">('.abTranslate('Invisible collection of RE score visitor rating, this is not the selection of "boats"').').</small></label>
</div>
<div class="form-check">
  <input class="form-check-input" type="radio" name="re_check" id="re_check0" value="0" '.(($ab_config['re_check'] == '0') ? 'checked' : '').'>
  <label class="form-check-label" for="re_check0">'.abTranslate('Disable').'</label>
</div>
    </div>
  </div>

  <div class="form-group row">
    <label for="recaptcha_key" class="col-sm-2 col-form-label">'.abTranslate('Public key').'</label>
    <div class="col-sm-10">
      <input name="recaptcha_key" type="text" class="form-control" id="recaptcha_key" value="'.$ab_config['recaptcha_key'].'">
      <small class="form-text text-muted">'.abTranslate('Public reCAPTCHA v3 website key.').' <a href="https://www.google.com/recaptcha/admin/create" target="_blank" rel="noopener">'.abTranslate('Create keys for free.').'</a></small>
    </div>
  </div>

  <div class="form-group row">
    <label for="recaptcha_secret" class="col-sm-2 col-form-label">'.abTranslate('Private key').'</label>
    <div class="col-sm-10">
      <input name="recaptcha_secret" type="text" class="form-control" id="recaptcha_secret" value="'.$ab_config['recaptcha_secret'].'">
      <small class="form-text text-muted">'.abTranslate('Private reCAPTCHA v3 website key.').'</small>
    </div>
  </div>

<hr />

  <div class="form-group row">
    <label for="utm_referrer" class="col-sm-2 col-form-label">UTM Referrer</label>
    <div class="col-sm-10">
  <div class="form-check">
  <input class="form-check-input" type="radio" name="utm_referrer" id="utm_referrer1" value="1" '.(($ab_config['utm_referrer'] == '1') ? 'checked' : '').'>
  <label class="form-check-label" for="utm_referrer1">'.abTranslate('Enable').' <small class="text-muted">('.abTranslate('To pass the referrer to Yandex.Metrica through substitution in the URL of an additional GET variable').').</small></label>
</div>
<div class="form-check">
  <input class="form-check-input" type="radio" name="utm_referrer" id="utm_referrer0" value="0" '.(($ab_config['utm_referrer'] == '0') ? 'checked' : '').'>
  <label class="form-check-label" for="utm_referrer0">'.abTranslate('Disable').'</label>
</div>
    </div>
  </div>

  <div class="form-group row">
    <label for="utm_noindex" class="col-sm-2 col-form-label">'.abTranslate('UTM indexing').'</label>
    <div class="col-sm-10">
  <div class="form-check">
  <input class="form-check-input" type="radio" name="utm_noindex" id="utm_noindex1" value="1" '.(($ab_config['utm_noindex'] == '1') ? 'checked' : '').'>
  <label class="form-check-label" for="utm_noindex1">'.abTranslate('Disable indexing').' <small class="text-muted">('.abTranslate('URLs with added utm_referrer will be prohibited from being indexed by search engines').').</small></label>
</div>
<div class="form-check">
  <input class="form-check-input" type="radio" name="utm_noindex" id="utm_noindex0" value="0" '.(($ab_config['utm_noindex'] == '0') ? 'checked' : '').'>
  <label class="form-check-label" for="utm_noindex0">'.abTranslate('Do not prohibit').' <small class="text-muted">('.abTranslate('If the website has a rel="canonical" meta tag, then it will solve the problem of duplicates').').</small></label>
</div>
    </div>
  </div>
  
<hr />

  <div class="form-group row">
    <label for="check_get_ref" class="col-sm-2 col-form-label">'.abTranslate('GET referrer').'</label>
    <div class="col-sm-10">
  <div class="form-check">
  <input class="form-check-input" type="radio" name="check_get_ref" id="check_get_ref1" value="1" '.(($ab_config['check_get_ref'] == '1') ? 'checked' : '').'>
  <label class="form-check-label" for="check_get_ref1">'.abTranslate('Check').' <small class="text-muted">('.abTranslate('Check GET variable names in REFERRER URL against stop list').').</small></label>
</div>
<div class="form-check">
  <input class="form-check-input" type="radio" name="check_get_ref" id="check_get_ref0" value="0" '.(($ab_config['check_get_ref'] == '0') ? 'checked' : '').'>
  <label class="form-check-label" for="check_get_ref0">'.abTranslate('Do not check').'</label>
</div>
    </div>
  </div>

<hr />

  <div class="form-group row">
    <label for="noarchive" class="col-sm-2 col-form-label">'.abTranslate('NoArchive Header').'</label>
    <div class="col-sm-10">
  <div class="form-check">
  <input class="form-check-input" type="radio" name="noarchive" id="noarchive1" value="1" '.(($ab_config['noarchive'] == '1') ? 'checked' : '').'>
  <label class="form-check-label" for="noarchive1">'.abTranslate('Enable').' <small class="text-muted">('.abTranslate('Send <strong>X-Robots-Tag: noarchive</strong> header to prevent search engines from saving a "Cached"').').</small></label>
</div>
<div class="form-check">
  <input class="form-check-input" type="radio" name="noarchive" id="noarchive0" value="0" '.(($ab_config['noarchive'] == '0') ? 'checked' : '').'>
  <label class="form-check-label" for="noarchive0">'.abTranslate('Disable').' <small class="text-muted">(<a href="https://antibot.cloud/FAQ.php?page=noarchive&lang='.$lang_code.'" target="_blank" rel="noopener noreferrer">'.abTranslate('What is the X-Robots-Tag: noarchive header for?').'</a>)</small></label>
</div>
    </div>
  </div>

<hr />

  <div class="form-group row">
    <label for="bad_get_ref" class="col-sm-2 col-form-label">'.abTranslate('Stop name list').'</label>
    <div class="col-sm-10">
      <input name="bad_get_ref" type="text" class="form-control" id="bad_get_ref" value="'.$ab_config['bad_get_ref'].'">
      <small class="form-text text-muted">'.abTranslate('If these GET variables (with any content or empty) are present in the referrer, the verification will not allow automatic access, and the visitor will have to click on the buttons. This is to prevent referrer spam with fake search queries. Specify them separated by a space.').'</small>
    </div>
  </div>

<hr />

  <div class="form-group row">
    <label for="secret_allow_get" class="col-sm-2 col-form-label">Secret allow get</label>
    <div class="col-sm-10">
      <input name="secret_allow_get" type="text" class="form-control" id="secret_allow_get" value="'.$ab_config['secret_allow_get'].'">
      <small class="form-text text-muted">'.abTranslate('The name of the secret GET variable. If it is present in the URL, the visitor will be allowed without check (the Antibot will not be activated, and these visits will not be added to the logs). In addition, a cookie with this name will be set, and the Antibot will not be activated if this cookie is present. This is useful in cases where you are testing behavioral algorithms on your website, so as not to interfere with your own bots.').'</small>
    </div>
  </div>

<hr />

  <div class="form-group row">
    <label for="ptrcache_time" class="col-sm-2 col-form-label">PTR cache (days)</label>
    <div class="col-sm-10">
      <input name="ptrcache_time" type="text" class="form-control" id="ptrcache_time" value="'.$ab_config['ptrcache_time'].'">
      <small class="form-text text-muted">'.abTranslate('Expiration time for PTR cache. In days. Should be set to run daily Cron task from "Log storage period".').'</small>
    </div>
  </div>

<hr />


<div class="form-group row">
 <label for="antibot_log_tests" class="col-sm-2 col-form-label">Main Logs</label>
    <div class="col-sm-10">
<div class="form-check">
  <input class="form-check-input" type="radio" name="antibot_log_tests" id="antibot_log_tests1" value="1" '.(($ab_config['antibot_log_tests'] == '1') ? 'checked' : '').'>
  <label class="form-check-label" for="antibot_log_tests1">'.abTranslate('Enable').' <small class="text-muted">('.abTranslate('The main log of visitors who have landed on the check page. The log stores records with statuses:').' STOP, AUTO, CLICK, MISS).</small></label>
</div>
<div class="form-check">
  <input class="form-check-input" type="radio" name="antibot_log_tests" id="antibot_log_tests0" value="0" '.(($ab_config['antibot_log_tests'] == '0') ? 'checked' : '').'>
  <label class="form-check-label" for="antibot_log_tests0">'.abTranslate('Disable').'</label>
</div>
    </div>
</div>

<div class="form-group row">
 <label for="antibot_log_local" class="col-sm-2 col-form-label">LOCAL Log</label>
    <div class="col-sm-10">
<div class="form-check">
  <input class="form-check-input" type="radio" name="antibot_log_local" id="antibot_log_local1" value="1" '.(($ab_config['antibot_log_local'] == '1') ? 'checked' : '').'>
  <label class="form-check-label" for="antibot_log_local1">'.abTranslate('Enable').' <small class="text-muted">('.abTranslate('The log of visitors who have successfully passed the Antibot check and have allowed cookies').').</small></label>
</div>
<div class="form-check">
  <input class="form-check-input" type="radio" name="antibot_log_local" id="antibot_log_local0" value="0" '.(($ab_config['antibot_log_local'] == '0') ? 'checked' : '').'>
  <label class="form-check-label" for="antibot_log_local0">'.abTranslate('Disable').' <small class="text-muted">('.abTranslate('Recommended').').</small></label>
</div>
    </div>
</div>

<div class="form-group row">
 <label for="antibot_log_allow" class="col-sm-2 col-form-label">ALLOW Log</label>
    <div class="col-sm-10">
<div class="form-check">
  <input class="form-check-input" type="radio" name="antibot_log_allow" id="antibot_log_allow1" value="1" '.(($ab_config['antibot_log_allow'] == '1') ? 'checked' : '').'>
  <label class="form-check-label" for="antibot_log_allow1">'.abTranslate('Enable').' <small class="text-muted">('.abTranslate('The log of visitors who have passed without check according to the allowing rules').').</small></label>
</div>
<div class="form-check">
  <input class="form-check-input" type="radio" name="antibot_log_allow" id="antibot_log_allow0" value="0" '.(($ab_config['antibot_log_allow'] == '0') ? 'checked' : '').'>
  <label class="form-check-label" for="antibot_log_allow0">'.abTranslate('Disable').'</label>
</div>
    </div>
</div>

<div class="form-group row">
 <label for="antibot_log_fake" class="col-sm-2 col-form-label">FAKE Log</label>
    <div class="col-sm-10">
<div class="form-check">
  <input class="form-check-input" type="radio" name="antibot_log_fake" id="antibot_log_fake1" value="1" '.(($ab_config['antibot_log_fake'] == '1') ? 'checked' : '').'>
  <label class="form-check-label" for="antibot_log_fake1">'.abTranslate('Enable').' <small class="text-muted">('.abTranslate('The log of visitors who have not passed the IP➜PTR➜IP check. These are mostly fake bots disguised as search engine bots').').</small></label>
</div>
<div class="form-check">
  <input class="form-check-input" type="radio" name="antibot_log_fake" id="antibot_log_fake0" value="0" '.(($ab_config['antibot_log_fake'] == '0') ? 'checked' : '').'>
  <label class="form-check-label" for="antibot_log_fake0">'.abTranslate('Disable').'</label>
</div>
    </div>
</div>

<div class="form-group row">
 <label for="antibot_log_goodip" class="col-sm-2 col-form-label">GOODIP Log</label>
    <div class="col-sm-10">
<div class="form-check">
  <input class="form-check-input" type="radio" name="antibot_log_goodip" id="antibot_log_goodip1" value="1" '.(($ab_config['antibot_log_goodip'] == '1') ? 'checked' : '').'>
  <label class="form-check-label" for="antibot_log_goodip1">'.abTranslate('Enable').' <small class="text-muted">('.abTranslate('The log of requests with IPs from the allowed list, which includes search engine bots').').</small></label>
</div>
<div class="form-check">
  <input class="form-check-input" type="radio" name="antibot_log_goodip" id="antibot_log_goodip0" value="0" '.(($ab_config['antibot_log_goodip'] == '0') ? 'checked' : '').'>
  <label class="form-check-label" for="antibot_log_goodip0">'.abTranslate('Disable').' <small class="text-muted">('.abTranslate('It is recommended as it may cause increased server load').').</small></label>
</div>
    </div>
</div>

<div class="form-group row">
 <label for="antibot_log_block" class="col-sm-2 col-form-label">BLOCK Log</label>
    <div class="col-sm-10">
<div class="form-check">
  <input class="form-check-input" type="radio" name="antibot_log_block" id="antibot_log_block1" value="1" '.(($ab_config['antibot_log_block'] == '1') ? 'checked' : '').'>
  <label class="form-check-label" for="antibot_log_block1">'.abTranslate('Enable').' <small class="text-muted">('.abTranslate('The log of visitors who have been blocked according to the blocking rules').').</small></label>
</div>
<div class="form-check">
  <input class="form-check-input" type="radio" name="antibot_log_block" id="antibot_log_block0" value="0" '.(($ab_config['antibot_log_block'] == '0') ? 'checked' : '').'>
  <label class="form-check-label" for="antibot_log_block0">'.abTranslate('Disable').'</label>
</div>
    </div>
</div>

<hr />

  <div class="form-group row">
    <label for="header_test_code" class="col-sm-2 col-form-label">Header Check Page</label>
    <div class="col-sm-10">
      <input name="header_test_code" type="text" class="form-control" id="header_test_code" value="'.$ab_config['header_test_code'].'">
      <small class="form-text text-muted">'.abTranslate('Server response code for the check page. Options:').' 200, 400, 401, 403, 404, 410, 451, 500, 502, 503, 504, 511. <a href="https://en.wikipedia.org/wiki/List_of_HTTP_status_codes" target="_blank" rel="noopener">Wiki: List of HTTP status</a>.</small>
    </div>
  </div>

  <div class="form-group row">
    <label for="header_error_code" class="col-sm-2 col-form-label">Header Block Page</label>
    <div class="col-sm-10">
      <input name="header_error_code" type="text" class="form-control" id="header_error_code" value="'.$ab_config['header_error_code'].'">
      <small class="form-text text-muted">'.abTranslate('Server response code for the blocking page. Options:').' 200, 400, 401, 403, 404, 410, 451, 500, 502, 503, 504, 511. <a href="https://en.wikipedia.org/wiki/List_of_HTTP_status_codes" target="_blank" rel="noopener">Wiki: List of HTTP status</a>.</small>
    </div>
  </div>

<hr />

  <div class="form-group row">
    <label class="col-sm-2 col-form-label">'.abTranslate('Log storage period').'</label>
    <div class="col-sm-10">
  <a name="cron"></a>
<div class="form-check form-check-inline">
  <input class="form-check-input" type="radio" name="period_cleaning" id="period_cleaning_lastday" value="lastday" '.(($ab_config['period_cleaning'] == 'lastday') ? 'checked' : '').'>
  <label class="form-check-label" for="period_cleaning_lastday">'.abTranslate('Last Day').'</label>
</div>
<div class="form-check form-check-inline">
  <input class="form-check-input" type="radio" name="period_cleaning" id="period_cleaning_lastweek" value="lastweek" '.(($ab_config['period_cleaning'] == 'lastweek') ? 'checked' : '').'>
  <label class="form-check-label" for="period_cleaning_lastweek">'.abTranslate('Last Week').'</label>
</div>
<div class="form-check form-check-inline">
  <input class="form-check-input" type="radio" name="period_cleaning" id="period_cleaning_lastmonth" value="lastmonth" '.(($ab_config['period_cleaning'] == 'lastmonth') ? 'checked' : '').'>
  <label class="form-check-label" for="period_cleaning_lastmonth">'.abTranslate('Last Month').'</label>
</div>
<div class="form-check form-check-inline">
  <input class="form-check-input" type="radio" name="period_cleaning" id="period_cleaning_quarter" value="quarter" '.(($ab_config['period_cleaning'] == 'quarter') ? 'checked' : '').'>
  <label class="form-check-label" for="period_cleaning_quarter">'.abTranslate('Last Quarter').'</label>
</div>
<div class="form-check form-check-inline">
  <input class="form-check-input" type="radio" name="period_cleaning" id="period_cleaning_lastyear" value="lastyear" '.(($ab_config['period_cleaning'] == 'lastyear') ? 'checked' : '').'>
  <label class="form-check-label" for="period_cleaning_lastyear">'.abTranslate('Last Year').'</label>
</div>
<div class="form-check form-check-inline">
  <input class="form-check-input" type="radio" name="period_cleaning" id="period_cleaning_all" value="all" '.(($ab_config['period_cleaning'] == 'all') ? 'checked' : '').'>
  <label class="form-check-label" for="period_cleaning_all">'.abTranslate('All time').'</label>
</div>
<small class="form-text text-muted">'.abTranslate('Delete for this period.').' '.abTranslate('Set up a CRON job to automatically delete old records from the log and cache:').'<br />
<code>0 1 * * * /usr/bin/php -q '.dirname(dirname(__FILE__)).'/code/clear_old_hits.php > /dev/null 2>&1</code>
<br />'.abTranslate('Please check with your hosting provider on how to run PHP scripts via Cron.').'
</small>
    </div>
  </div>

<hr />

  <div class="form-group row">
    <label class="col-sm-2 col-form-label">'.abTranslate('Last Rule').'</label>
    <div class="col-sm-10">
<div class="form-check form-check-inline">
  <input class="form-check-input" type="radio" name="last_rule" id="last_rule_allow" value="allow" '.(($ab_config['last_rule'] == 'allow') ? 'checked' : '').'>
  <label class="form-check-label" for="last_rule_allow" style="color:green;">ALLOW</label>
</div>
<div class="form-check form-check-inline">
  <input class="form-check-input" type="radio" name="last_rule" id="last_rule_block" value="block" '.(($ab_config['last_rule'] == 'block') ? 'checked' : '').'>
  <label class="form-check-label" for="last_rule_block" style="color:red;">BLOCK</label>
</div>
<div class="form-check form-check-inline">
  <input class="form-check-input" type="radio" name="last_rule" id="last_rule_dark" value="dark" '.(($ab_config['last_rule'] == 'dark' OR $ab_config['last_rule'] == 'gray') ? 'checked' : '').'>
  <label class="form-check-label" for="last_rule_dark" style="color:black;">DARK</label>
</div>

<div class="form-check form-check-inline">
  <input class="form-check-input" type="radio" name="last_rule" id="last_rule_0" value="" '.(($ab_config['last_rule'] == '') ? 'checked' : '').'>
  <label class="form-check-label" for="last_rule_0">'.abTranslate('Do not use').'</label>
</div>
<small class="form-text text-muted">'.abTranslate('The condition that will be triggered last in the "Rules" section, provided that the visitor did not fall under any of the ALLOW, BLOCK, or DARK rules.').'</small>
    </div>
  </div>
  
<hr />
  <div class="form-group row">
    <div class="col-sm-10">
      <button name="save_conf" type="submit" class="btn btn-primary">'.abTranslate('Save Settings').'</button>
    </div>
  </div>
</form>
';
