{*
  Template for the user management screen
  $Id: users.tpl,v 1.7 2005/05/24 12:59:02 chinamann Exp $
*}

<!-- {$smarty.template} -->

{if $message}
	<div id="actions">
		<p class="center">{$message}</p>
	</div>
	<!-- /actions -->
{else}
	<div id="topspacer"></div>
{/if}


<div id="content">

<div id="users">
{literal}
<script type="text/javascript">
function valider(){
frm=document.forms['frmSaisie'];
  
  if(frm.elements['newuser'].value.length < 5) {
{/literal}
    alert("{$lang.msg_invalidnickname}");
{literal}
    return false;
  }  
  if (!/^\w+([\.-]?\w+)*@\w+([\.-]?\w+)*(\.\w{2,3})+$/.test(frm.elements['email'].value) || frm.elements['email'].value.length < 4) {
{/literal}
    alert("{$lang.msg_invalidemail}");
{literal}
    return false;
  }
  if(frm.elements['email'].value != frm.elements['email2'].value) {
{/literal}
  	alert("{$lang.msg_repeatemail}");
{literal}
    return false;
  }
  if(frm.elements['password'].value.length < 6) {
{/literal}
    alert("{$lang.msg_invalidpassword}");
{literal}
    return false;
  }
  if(frm.elements['password'].value != frm.elements['password2'].value) {
{/literal}
  	alert("{$lang.msg_repeatpassword}");
{literal}
    return false;
  }
  if(frm.elements['code'].value.length != 6) {
{/literal}
    alert("{$lang.msg_invalidcode}");
{literal}
    return false;
  }
  return true;
}
</script>
{/literal}
	<table width="100%" cellspacing="1" cellpadding="5" border=="0">
		<tr>
			<td colspan="4" class="title-classement">{$lang.registerat} {$sitename}</td>
		</tr>
		<form action="register.php" method="post" onsubmit="return valider()" name="frmSaisie">
		<input type=hidden name="sid" value="{$session}">
		<input type="hidden" name="save" value="1"/>
		<tr class="odd">
			<td class="td-opt">{$lang.nickname} :</td>
			<td class="td-value"><input type="text" name="newuser" /></td>
			<td colspan="2" class="td-opt">&nbsp;</td>
		</tr>
		<tr>
			<td class="td-opt">{$lang.email} :</td><td class="td-value"><input type="text" name="email" /></td>
			<td class="td-opt">{$lang.confirmation} {$lang.email} :</td><td class="td-value"><input type="text" name="email2" /></td>
		</tr>
		<tr>
			<td class="td-opt">{$lang.password} :</td><td class="td-value"><input type="password" name="password"/></td>
			<td class="td-opt">{$lang.confirmation} {$lang.password} :</td><td class="td-value"><input type="password" name="password2"/></td>
		</tr>
		<tr>
			<td class="td-opt">{$lang.copycode} :</td><td class="td-value"><input type="text" name="code"/></td>
  			<td colspan="2" align="center" class="td-opt">
  			<span class="img-shadow">{html_image file=$numero max_width="100"}</span>
  			</td>
  		</tr>  
		<tr>
			<td class="center" colspan="4">
				<input type="submit" class="button" style="width:100%;" value="{$lang.register}" accesskey="s" />
			</td>
		</tr>
		
		</form>
	</table>

</div>
<!-- /users -->

</div>
<!-- /content -->
