{*<!--

+---------------------------------------------------------------------------+
| Revive Adserver                                                           |
| http://www.revive-adserver.com                                            |
|                                                                           |
| Copyright: See the COPYRIGHT.txt file.                                    |
| License: GPLv2 or later, see the LICENSE.txt file.                        |
+---------------------------------------------------------------------------+

-->

<table border='0' width='100%' cellpadding='0' cellspacing='0'>
*}

  <tr>
    <td width='100%' colspan="3">
<table id="user-access-table" width="100%" cellspacing="0" cellpadding="0" border="0">
  <thead>
    <tr height="25">
    {if $sso}
      <td class="first" style="width: 25%">{t str=EMail}</td>
    {else}
      <td class="first" style="width: 10%">{t str=Username}</td>
      <td style="width: 25%">{t str=EMail}</td>
    {/if}
      <td style="width: 20%">{t str=ContactName}</td>
      <td style="width: 15%">{t str=LastLoggedIn}</td>
      <td style="width: 15%">{t str=DateLinked}</td>
      <td style="width: 25%"></td>
    </tr>

    <tr class="break">
      <td colspan="6" />
    </tr>
  </thead>

  {cycle name=row values="even,odd" assign=rowType}
  {foreach from=$users.aUsers item=user}
    {cycle name=row assign=rowType}
    <tbody class="{$rowType}">
      <tr height="25" {if $user.justModified}class="hl"{/if}>
      {if $sso}
        <td class="first"><a href="{$editPage}?userid={$user.user_id}{if $entityIdName}&amp;{$entityIdName}={$entityIdValue}{/if}">{$user.email_address|escape}</a></td>
      {else}
        <td class="first"><a href="{$editPage}?userid={$user.user_id}{if $entityIdName}&amp;{$entityIdName}={$entityIdValue}{/if}">{$user.username|escape}</a></td>
        <td><a href="{$editPage}?userid={$user.user_id}{if $entityIdName}&amp;{$entityIdName}={$entityIdValue}{/if}">{$user.email_address|escape}</a></td>
      {/if}
        <td>{$user.contact_name|escape}</td>
        <td>{$user.date_last_login|utc_to_local}</td>
        <td>{$user.date_created|utc_to_local}</td>
        <td class="last">
          <a href="{$editPage}?userid={$user.user_id}{if $entityIdName}&amp;{$entityIdName}={$entityIdValue}{/if}" class="permissions" style="padding-right: 10px">{t str=Permissions}</a>
          <a href="{$unlinkPage}?userid={$user.user_id}{if $entityIdName}&amp;{$entityIdName}={$entityIdValue}{/if}&amp;{rv_add_session_token}" class="unlink{if $user.toDelete} unlink-last{else} unlink-normal{/if}">{t str=Remove}</a>
        </td>
      </tr>

      <tr class="break">
        <td colspan="6" />
      </tr>
    </tbody>
  {foreachelse}
    <tbody class="odd">
      <tr height="25" {if $user.justModified}class="hl"{/if}>
        <td class="norows" colspan="5">No users added to this entity{if $linkUrl}, you can <a href="{$linkUrl}">add an existing or a new user here</a>{/if}</td>
      </tr>

      <tr class="break">
        <td colspan="6" />
      </tr>
    </tbody>
  {/foreach}
</table>

{include file=confirmation-dialog.html
         id="unlink-last" linkToConfirmClass="unlink-last"
         title="Removing user from last entity"
         message="Removing user from last entity will cause the user to be deleted. Would you like to remove this user?"
         confirmLabel="Remove &amp; delete user"}

{include file=confirmation-dialog.html
         id="unlink-normal" linkToConfirmClass="unlink-normal"
         title="Removing user"
         message="Are you sure you want to remove this user?"
         confirmLabel="Remove user"}

    </td>
  </tr>
{*
</table>
*}
