{*
  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">
<br>
<div id="toppage"><a href="#">{$lang.registerat} {$sitename}</a></div>
<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 id="tableshow" width="100%" cellspacing="0" cellpadding="5" border="0">
		<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="lineeven"><b>» {$lang.nickname} :</b></td>
			<td class="lineeven" colspan="2"><input type="text" name="newuser" /></td>
		</tr>
		<tr>
			<td class="lineodd"><b>» {$lang.email} :</b></td>
			<td class="lineodd" colspan="2"><input type="text" name="email" /></td>
		</tr>
		<tr>
			<td class="lineeven"><b>» {$lang.confirmation} {$lang.email} :</b></td>
			<td class="lineeven" colspan="2"><input type="text" name="email2" /></td>
		</tr>
		<tr>
			<td class="lineodd"><b>» {$lang.password} :</b></td>
			<td class="lineodd" colspan="2"><input type="password" name="password"/></td>
		</tr>
		<tr>
		    <td class="lineeven"><b>» {$lang.confirmation} {$lang.password} :</b></td>
			<td class="lineeven" colspan="2"><input type="password" name="password2"/></td>
		</tr>
		{if !$desactiveturing}
		<tr>
			<td class="lineodd"><b>» {$lang.copycode} :</b></td>
			<td class="lineodd"><input type="text" name="code" maxlength="6"/></td>
			<td class="lineodd"><span class="img-shadow">{html_image file=$numero max_width="100"}</span></td>
  		</tr>
		{/if}
		<tr>
			<td align="center" colspan="4">
				<span class="onglet-admin">
				<input type="submit" value="{$lang.register}" accesskey="s" />
				</span>
				<span class="onglet-admin">
				<input type="button" style="width:100%;" value="{$lang.back}" onclick="javascript:history.go(-1)"/>
				</span>
			</td>
		</tr>
		
		</form>
	</table>

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

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