{include file="$template/pageheader.tpl" title=$LANG.clientareanavsecurity}

{include file="$template/clientareadetailslinks.tpl"}

{if $successful}
	<div class="notice notice-success">
		<div class="inside">
			<p>{$LANG.changessavedsuccessfully}</p>
		</div>
	</div>
{/if}

{if $errormessage}
	<div class="notice notice-error">
		<div class="inside">
			<p>{$errormessage}</p>
		</div>
	</div>
{/if}

{if $twofaavailable}

{if $twofaactivation}

<script>{literal}
function dialogSubmit() {
    $('div#twofaactivation form').attr('method', 'post');
    $('div#twofaactivation form').attr('action', 'clientarea.php');
    $('div#twofaactivation form').attr('onsubmit', '');
    $('div#twofaactivation form').submit();
    return true;
}
{/literal}</script>

<div id="twofaactivation">
    {$twofaactivation}
</div>

{else}

		<div class="bigheader">
			<h2>{$LANG.twofactorauth}</h2>
		</div><!-- .bigheader -->

<p>{$LANG.twofaactivationintro}</p>

<form method="post" action="clientarea.php?action=security">
<input type="hidden" name="2fasetup" value="1" />
<p class="center">
{if $twofastatus}
<input type="submit" value="{$LANG.twofadisableclickhere}" class="button1 color2" />
{else}
<input type="submit" value="{$LANG.twofaenableclickhere}" class="button1 color1" />
{/if}
</p>
</form>

{/if}

{/if}

{if $securityquestionsenabled && !$twofaactivation}

<form class="form-horizontal" method="post" action="{$smarty.server.PHP_SELF}?action=changesq">

  		<div class="feildset">
		
			<div class="col1">
			
			{if !$nocurrent}
				<div>
					<label>
						<span>{$currentquestion}:</span>						
						<input type="password" name="currentsecurityqans" id="currentans" />
					</label>
				</div>	
			{/if}
			
				<div>
					<label>
						<span>{$LANG.clientareasecurityquestion}:</span>						
								    <select name="securityqid" id="securityqid">
            {foreach key=num item=question from=$securityquestions}
            	<option value={$question.id}>{$question.question}</option>
            {/foreach}
            </select>
					</label>
				</div>
				
				
				<div>
					<label>
						<span>{$LANG.clientareasecurityanswer}:</span>						
						<input type="password" name="securityqans" id="securityqans" />
					</label>
				</div>	
				
				
				<div>
					<label>
						<span>{$LANG.clientareasecurityconfanswer}:</span>						
						<input type="password" name="securityqans2" id="securityqans2" />
					</label>
				</div>					
														
			
			</div>
			
			
		</div>	
		
	<p class="center">		
    <input class="button1 color2" type="submit" name="submit" value="{$LANG.clientareasavechanges}" />
    <input class="button1 color1" type="reset" value="{$LANG.cancel}" />			
    </p>		


</form>

{/if}