{capture name="title"} - {l}User Management{/l}{/capture}
{capture assign="in_page_title"}{l}User Management{/l}{/capture}

{include file="header.tpl"}
{include file="top_bar.tpl"}

{include file="validation.tpl" form_id="submit_form" validators=$validators}

{literal}
<script type="text/javascript">
jQuery(function($) {
	$(document).ready(function(){

		var thumb = $('img#thumb');	

		new AjaxUpload('IMG', {
			action: $('form#submit_form').attr('action'),
			name: 'image',
			onSubmit: function(file, extension) {
				$('div.preview').addClass('loading');
			},
			onComplete: function(file, response) {
				thumb.load(function(){
					$('div.preview').removeClass('loading');
					thumb.unbind();
				});
				thumb.attr('src', response);
			}
		});
	});
	});
</script>

{/literal}

{strip}
{if $thank_you}
<h3>{l}Information{/l}</h3>
<table border="0" class="formPage" align="center">
   <tr>
      <td>
         {l}Thank you for registering. Your account has been created. You may now log in and submit links.{/l}
      </td>
   </tr>
</table>
{elseif $confirmed}
<h3>{l}Information{/l}</h3>
<table border="0" class="formPage" align="center">
   <tr>
      <td>
         {l}Thank you for confirming your email. Your account has been activated. You may now log in with your username and password.{/l}
      </td>
   </tr>
</table>
{elseif $user_logged}
<h3>{l}User Area{/l}</h3>


   {if $profileUpdate}
   <p>{l}Profile updated{/l}</p>
   
   {/if}

   
      <p>   <a href="{$smarty.const.DOC_ROOT}/index.php?uid={$regular_user_details.ID}" title="{l}Browse personal links{/l}">{l}My Submissions{/l}</a></p>
      
       <p>  <a href="{$smarty.const.DOC_ROOT}/profile.php?mode=edit" title="{l}Edit Profile{/l}">{l}Edit Profile{/l}</a>
  </p>
{elseif $agreement_terms}
<h3>{l}Registration Agreement Terms{/l}</h3>
<table border="0" class="formPage" align="center">
   <tr>
      <td>
         While the administrators and editors of this link directory will attempt to remove or edit any generally objectionable material as quickly as possible, it is impossible to review every link. Therefore you acknowledge that all links submitted to this link directory express the views and opinions of the submitter and not the administrators, editors or webmaster (except for posts by these people) and hence will not be held liable.
<br /><br />
         You agree not to post any abusive, obscene, vulgar, slanderous, hateful, threatening, sexually-oriented or any other links and/or material that may violate any applicable laws. Doing so may lead to you being immediately and permanently banned (and your service provider being informed). The IP address of all submitted links is recorded to aid in enforcing these conditions. You agree that the webmaster, administrator and editors of this link directory have the right to remove, edit or move any link at any time should they see fit. As a user you agree to any information you have entered above being stored in a database. While this information will not be disclosed to any third party without your consent the webmaster, administrator and editors cannot be held responsible for any cracking attempt that may lead to the data being compromised.
<br /><br />
         This link directory uses sessions to store information. These do not contain any of the information you have entered above; they serve only to improve your viewing and submit pleasure. The e-mail address is used only for confirming your registration details and password (and for sending new passwords should you forget your current one).
<br /><br />
         By clicking Register below you agree to be bound by these conditions.
      </td>
   </tr>
   <tr>
      <td>
         <a href="{$smarty.const.DOC_ROOT}/profile.php?mode=register&amp;agreed=true" title="{l}I Agree to these terms{/l}">{l}I Agree to these terms{/l}</a>
      </td>
   </tr>
   <tr>
      <td>
         <a href="{$smarty.const.DOC_ROOT}/profile.php?mode=register&amp;agreed=false" title="{l}I Do Not Agree to these terms{/l}">{l}I Do Not Agree to these terms{/l}</a>
      </td>
   </tr>
</table>

{elseif $confirm eq 1}
   {if $password_recovered eq 1}
	<h3>{l}Information{/l}</h3>
   <table border="0" class="formPage" align="center">
      <tr>
         <td>
            {l}You can now login with your new password.{/l}
         </td>
      </tr>
   </table>

   {elseif $password_recovered eq 0}
   <h3>{l}Information{/l}</h3>
   <table border="0" class="formPage" align="center">
      <tr>
         <td class="err">
            {l}An error occured while saving your new password.{/l}
         </td>
      </tr>
   </table>
   {/if}

{elseif $send_password eq 1}
   {if $email_status eq 1 or $wrong_user_details eq 1}
   	  <h3>{l}Information{/l}</h3>
      <table border="0" class="formPage" align="center">
      <tr>
         <td class="{if $email_sent eq 'sent'}msg{else}err{/if}">
            {if $email_sent eq 'sent'}
               {l}Please check your email to confirm your new password request.{/l}
            {elseif $email_sent eq 'error'}
               {l}An error occurred while sending the email.{/l}
               {if $email_error_msg}<br />{$email_error_msg}{/if}
            {elseif $wrong_user_details}
               {l}The details you supplied do not match any registered user.{/l}
            {else}
               {l}Unknown error.{/l}
            {/if}
         </td>
      </tr>
   </table>
   {else}
   <form method="post" action="" id="submit_form">
   <h3>{l}Recover Password{/l}</h3>
   <table border="0" class="formPage" align="center" width="auto">
      <tr>
         <td class="label"><span class='req'>*</span>{l}Login{/l}:</td>
         <td class="smallDesc">
            <input type="text" name="LOGIN" value="{$LOGIN}" size="20" maxlength="{$smarty.const.USER_LOGIN_MAX_LENGTH}" class="text" />
         </td>
      </tr>
      <tr>
         <td class="label"><span class='req'>*</span>{l}Email{/l}:</td>
         <td class="smallDesc">
            <input type="text" name="EMAIL" value="{$EMAIL}" size="20" maxlength="255" class="text" />
         </td>
      </tr>
         {if $smarty.const.VISUAL_CONFIRM eq 2}
<tr>
		<td class="label"<span class='req'>*</span>{l}DO THE MATH{/l}:</td>
		<td class="field">
			<span style="color: red;">
				{foreach name=errorList from=$error_list key=errorKey item=errorItem}
					{if $errorKey == 'DO_MATH'}
						{if is_array($errorItem)}
							{$errorItem.remote}<br/>
						{else}
							{$errorItem}<br/>
						{/if}
					{/if}
				{/foreach}
			</span>
			<font style="font-weight: bold; font-size: 14pt; color: red; margin-right: 10px;">{$DO_MATH_N1} + {$DO_MATH_N2} = </font><input type="text" id="DO_MATH" name="DO_MATH" value='{$DO_MATH}' class="text" style="width: 60px;"/>
		<br/>
		<br/>
		</td>
	</tr>
	{/if}
      {if $smarty.const.VISUAL_CONFIRM eq 1}
      <tr>
         <td class="label">
            <span class='req'>*</span>{l}Confirmation code{/l}
            <p class="small">{l}This helps prevent automated registrations.{/l}</p>
         </td>
         <td class="smallDesc">
            <input id="IMAGEHASH" name="IMAGEHASH" type="hidden" value="{$imagehash}" />
            <input id="CAPTCHA" name="CAPTCHA" type="text" value="" size="{$smarty.const.CAPTCHA_PHRASE_LENGTH}" maxlength="{$smarty.const.CAPTCHA_PHRASE_LENGTH}" class="text" />
            <img src="{$smarty.const.DOC_ROOT}/captcha.php?imagehash={$imagehash}" class="captcha" alt="{l}Visual Confirmation Security Code{/l}" title="{l}Visual Confirmation Security Code{/l}" />
         </td>
      </tr>
      {/if}
      <tr>
         <td>&nbsp;</td>
         <td><input type="submit" name="send" value="Submit" class="btn" /></td>
      </tr>
   </table>
   <input type="hidden" name="formSubmitted" value="1" />
   </form>
   {/if}

{elseif $user_registration eq 1 or $user_edit eq 1}
<form method="post" action="" enctype="multipart/form-data" name="profile_form" id="submit_form">
<h3>{l}Registration Information{/l}</h3>
<table border="0" class="formPage" align="center" width="auto">
   {if $profileUpdate}
   <tr>
      <td colspan="2"><h3>{l}Profile updated{/l}</h3></td>
   </tr>
   {/if}
   {if $user_registration eq 1}
   <tr>
      <td class="label"><span class='req'>*</span>{l}Login{/l}:</td>
      <td class="smallDesc">
         <input type="text" name="LOGIN" value="{$LOGIN}" size="20" maxlength="{$smarty.const.USER_LOGIN_MAX_LENGTH}" class="text" />
      </td>
   </tr>
   {/if}
   <tr>
      <td class="label"><span class='req'>*</span>{l}Name{/l}:</td>
      <td class="smallDesc">
         <input type="text" name="NAME" value="{$NAME}" size="20" maxlength="{$smarty.const.USER_NAME_MAX_LENGTH}" class="text" />
      </td>
   </tr>
   <tr>
      <td class="label"><span class='req'>*</span>{l}Password{/l}:</td>
      <td class="smallDesc">
         <input type="password" name="PASSWORD" id="PASSWORD" value="" size="20" maxlength="{$smarty.const.USER_PASSWORD_MAX_LENGTH}" class="text" />
      </td>
   </tr>
   <tr>
      <td class="label"><span class='req'>*</span>{l}Confirm Password{/l}:</td>
      <td class="smallDesc">
         <input type="password" name="PASSWORDC" id="PASSWORDC" value="" size="20" maxlength="{$smarty.const.USER_PASSWORD_MAX_LENGTH}" class="text" />
      </td>
   </tr>
   <tr>
      <td class="label"><span class='req'>*</span>{l}Language{/l}:</td>
      <td class="smallDesc">
         {html_options options=$languages selected=$LANGUAGE name="LANGUAGE"}
      </td>
   </tr>
   <tr>
      <td class="label"><span class='req'>*</span>{l}Email{/l}:</td>
      <td class="smallDesc">
         <input type="text" name="EMAIL" value="{$EMAIL|escape}" size="20" maxlength="255" class="text" />
      </td>
   </tr>
{if $user_registration eq 0 AND $ALLOW_AUTHOR_INFO eq 1}
   <tr>
      <td colspan="2">
         <h3>{l}Optional Info For About Page{/l}</h3>
      </td>
   </tr>
  <!-- author avatar related -->

  {if $ALLOW_AVATARS eq 1}
  <!--
  <tr>
     <td class="label"><label for="IMG">{l}Upload Personal Photo{/l}:</label></td>
     <td class="smallDesc">
            <input type="file" name="IMG" id="IMG" value="{$IMG}" class="text"/><br />
     </td>
  </tr>
  <tr>
     <td class="label"><label for="DESCRIPTION">{l}Preview Photo{/l}:</label></td>
     <td class="smallDesc">
        <div class="preview">
     	     <img id="thumb" width="100px" height="100px" src=""/>
	      </div>
     </td>
   </tr>
  

  <tr>
     <td class="label"><label for="DESCRIPTION">{l}Current Photo{/l}:</label></td>
     <td class="smallDesc">
            {if $AUTH_IMG}
            <img src="{$AUTH_IMG}">{else}None{/if}
     </td>
   </tr>
  -->
   {/if}
    <!-- end -->
    {* if user has links posted*}
    {if $hasLinks > 0}
    <tr>
        <td class="label">
            <input type="checkbox" name="OWNER_NEWSLETTER_ALLOW" {if $OWNER_NEWSLETTER_ALLOW >= 1}checked="checked"{/if} />
        </td>
        <td>
            <p class="small">Allow site administrator to send me newsletters.</p>
        </td>
    </tr>
    {/if}
    <tr>
      <td class="label">
         {l}Post Articles Anonymously{/l}:
         <p class="small">{l}This will keep your name off of the articles page,{/l}<BR>{l}but admins will still know who wrote each article.{/l}</p>
      </td>
      <td class="field">
         {html_options options=$yesno selected=$ANONYMOUS name="ANONYMOUS"}
      </td>
   </tr>
   <tr>
      <td class="label">{l}Info{/l}:</td>
      <td class="field">
         <textarea name="INFO" rows="3" cols="37" class="text" {formtool_count_chars name="INFO" limit="255" alert=true}>{$INFO|escape|trim}</textarea>
         <br />
         {l}Limit{/l}: <input type="text" name="INFO_limit" size="4" class="limit_field" readonly="readonly" value="{$InfoLimit|trim}" />
      </td>
   </tr>
   <tr>
      <td class="label">{l}Website Name{/l}:</td>
      <td class="field">
         <input type="text" name="WEBSITE_NAME" value="{$WEBSITE_NAME|escape|trim}" size="40" maxlength="255" class="text"/>
      </td>
   </tr>
   <tr>
      <td class="label">{l}Website URL{/l}:</td>
      <td class="field">
         <input type="text" name="WEBSITE" value="{if !$WEBSITE}http://{else}{$WEBSITE|escape|trim}{/if}" size="40" maxlength="255" class="text"/>
      </td>
   </tr>
   <tr>
      <td colspan="2">
         <h3></h3>
      </td>
   </tr>
{/if}
         {if $smarty.const.VISUAL_CONFIRM eq 2}
<tr>
		<td class="label"<span class='req'>*</span>{l}DO THE MATH{/l}:</td>
		<td class="field">
			<span style="color: red;">
				{foreach name=errorList from=$error_list key=errorKey item=errorItem}
					{if $errorKey == 'DO_MATH'}
						{if is_array($errorItem)}
							{$errorItem.remote}<br/>
						{else}
							{$errorItem}<br/>
						{/if}
					{/if}
				{/foreach}
			</span>
			<font style="font-weight: bold; font-size: 14pt; color: red; margin-right: 10px;">{$DO_MATH_N1} + {$DO_MATH_N2} = </font><input type="text" id="DO_MATH" name="DO_MATH" value='{$DO_MATH}' class="text" style="width: 60px;"/>
		<br/>
		<br/>
		</td>
	</tr>
	{/if}
   {if $smarty.const.VISUAL_CONFIRM eq 1}
      <tr>
         <td class="label">
            <span class='req'>*</span>{l}Confirmation code{/l}
            <p class="small">{l}This helps prevent automated registrations.{/l}</p>
         </td>
         <td class="smallDesc">
            <input id="IMAGEHASH" name="IMAGEHASH" type="hidden" value="{$imagehash}" />
            <input id="CAPTCHA" name="CAPTCHA" type="text" value="" size="{$smarty.const.CAPTCHA_PHRASE_LENGTH}" maxlength="{$smarty.const.CAPTCHA_PHRASE_LENGTH}" class="text" />
            <img src="{$smarty.const.DOC_ROOT}/captcha.php?imagehash={$imagehash}" class="captcha" alt="{l}Visual Confirmation Security Code{/l}" title="{l}Visual Confirmation Security Code{/l}" />
         </td>
      </tr>
   {/if}
   <tr>
      <td>&nbsp;</td>
      <td><input type="submit" name="send" value="Submit" class="btn" /></td>
   </tr>
</table>
<input type="hidden" name="formSubmitted" value="1" />
</form>
{/if}

{include file="footer.tpl"}
{/strip}