{include file="header.tpl"}

<h3>Edit Account</h3>
<div class="signup">

{if $frm.display == 'updated'}
<div class="ok">Your account has been successfully updated.</div>
{/if}

{if $errors}
<ul class="error">                                                                      
{if $errors.turing}<li> Invalid turing image provided</li>{/if}
{if $errors.email}<li> Please, enter your email</li>{/if}
{if $errors.email_exists}<li> Email already registered. Please, use password reminder to restore your password.</li>{/if}
{if $errors.invalid_email}<li> Please, enter your valid email</li>{/if}
{if $errors.password2}<li> Please, verify passwords you have entered. Both passwords shoudl be equal</li>{/if}
</ul>
{/if}

<form method="post" action="">
<input type="hidden" name="action" value="update">
<table class="form">
<tr>
 <th>Username</th>
 <td><b>{$userinfo.username|escape:htmlall}</b></td>
</tr>
<tr>
 <th>Email</th>
 <td><input type="text" name="email" value="{$frm.email|default:$userinfo.email|escape:htmlall}"></td>
</tr>
<tr>
 <th>Password</th>
 <td><input type="password" name="password" value="{$frm.password|escape:htmlall}"></td>
</tr>
<tr>
 <th>Confirm Password</th>
 <td><input type="password" name="password2" value="{$frm.password2|escape:htmlall}"></td>
</tr>
{foreach from=$ecs key=id item=data}
<tr>
 <th>{$data.name} <img src="{"`$theme`images/`$data.name`.gif"|encurl}" alt="{$data.name}"></th>
 <td><input type="text" name="account[{$id}]" value="{$frm.account.$id|default:$userinfo.accounts.$id|escape:htmlall}"></td>
</tr>
{/foreach}
{if $settings.use_turing}
<tr>
  <th><img src="{"?a=turing&`$sesname`=`$sesid`&r=`$rand`"|encurl}" alt="turing code"></th>
  <td><input type=text name="turing" maxlength=6 size=6></td>
</tr>
{/if}
<tr>
 <th></th>
 <td><input type="submit" value="Update"></td>
</tr>
</table>
</form>

</div>

{include file="footer.tpl"}