{include file="mheader.tpl"}
<div class="header-title-breadcrumb element-box-shadow">
              <div class="container">
                  <div class="row">
                      <div class="col-md-7 col-sm-6 col-xs-12 text-left">
                        <h3>Security</h3>
                      </div>
                      <div class="col-md-5 col-sm-6 col-xs-12 hide-on-tablet">
                          <ol class="breadcrumb text-right">
                            <li><a href="?a=account">Home</a></li> 
                            <li class="active">Security</li>
                          </ol>                    
                      </div>
                  </div>
              </div>
            </div>
            <div class="spacer_80"></div>
            <div class="col-md-10">

<form method=post>
<input type=hidden name=a value="security">
<input type=hidden name=action value="save">


    <div class="row">
<h4>Detect IP Address Change Sensitivity</h4>
<div class="col-sm-4">
  <div class="radio">                 
<input type=radio name=ip value=disabled {if $security.detect_ip == 'disabled'}checked{/if}>Disabled
</div>
</div>
<div class="col-sm-4">
<div class="radio">
<input type=radio name=ip value=medium {if $security.detect_ip == 'medium'}checked{/if}>Medium
</div>
</div>

<div class="col-sm-4">
<div class="radio">
<input type=radio name=ip value=high {if $security.detect_ip == 'high'}checked{/if}>High
</div>
</div>
<div class="col-sm-4">
<div class="radio">
<input type=radio name=ip value=always {if $security.detect_ip == 'always'}checked{/if}>Paranoic
</div>
</div>
</div>
<div class="row">
<h4>Detect Browser Change</h4>

<div class="col-sm-4">
<div class="radio">
<input type=radio name=browser value=disabled {if $security.detect_browser == 'disabled'}checked{/if}>Disabled
</div>
</div>
<div class="col-sm-4">
<div class="radio">
<input type=radio name=browser value=enabled {if $security.detect_browser == 'enabled'}checked{/if}>Enabled
</div>
</div>
<input type=submit value="Set" class="btn btn-success next-step text-bold">
</div>
</form>

</div>
{if $settings.use_tfa}
<div class="col-md-10">
<h3>Two Factor Authentication</h3>
<form method=post name=mainform>
<input type=hidden name=a value="security">
<input type=hidden name=action value="tfa_save">
<input type=hidden name=time>
{if $errors.invalid_tfa_code}
<b style=color:red>Invalid code.</b><br>
{/if}
{if $errors.invalid_tfa_secret}
<b style=color:red>Invalid Secret.</b><br>
{/if}

{if $tfa_enabled}
<input type="checkbox" name="tfa_on_login" value=1 {if $tfa_settings.login}checked{/if}> on Login<br>
<input type="checkbox" name="tfa_on_edit_account" value=1 {if $tfa_settings.edit_account}checked{/if}> on Edit Account<br>
<input type="checkbox" name="tfa_on_withdraw" value=1 {if $tfa_settings.withdraw}checked{/if}> on Withdraw<br>
<input type="checkbox" name="tfa_disable" value=1> <b style=color:red>Disable Two Factor Authentication (not recommended)</b><br>
<br>
Confirm by typing code: <input type=text name="code" class=inpts> <input type=submit value="Update" class=sbmt>
{else}
1. Install <a href="http://m.google.com/authenticator" targe=_blank>Google Authenticator</a> on your mobile device.<br>
2. Your Secret Code is: <b>{$tfa_secret}</b> <input type=hidden name="tfa_secret" value="{$tfa_secret}"><br>
<img src="{$tfa_secret_url}"><br>
3. Please enter two factor token from Google Authenticator to verify correct setup:<br> 
<input type=text name="code" class=inpts> <input type=submit value="Enable" class=sbmt>
{/if}
</form>
</div>

{literal}
<script language=javascript>
document.mainform.time.value = (new Date()).getTime();

function checkform() {
  if (!document.mainform.code.value.match(/^[0-9]{6}$/)) {
    alert("Please type code!");
    document.mainform.code.focus();
    return false;
  }
  return true;
}
</script>
{/literal}
{/if} {* use_tfa *}
<a href="#" class="scrollToTop"><i class="fa fa-chevron-up text-white" aria-hidden="true"></i></a>
</div>
{include file="mfooter.tpl"}
