<div class="usvn_info">
	<h1><?= T_("Users") ?></h1>
</div>

<table class="sortable" id="users">
	<thead>
		<tr>
			<th><?= T_('Login') ?></th>
			<th><?= T_('Firstname') ?></th>
			<th><?= T_('Lastname') ?></th>
			<th><?= T_('Email') ?></th>
			<th><?= T_('Administrator') ?></th>
			<th class="sorttable_nosort" width="56px"><?= T_('Action') ?></th>
		</tr>
	</thead>
	<tbody>

<? if (!empty($this->users)): ?>
	<? $me = Zend_Auth::getInstance()->getIdentity();
	$me = $me['username'] ?>
	<? $even = true ?>
	<? foreach ($this->users as $user): ?>
	<? $even = !$even ?>
	<? $editurl = $this->url(array('action' => 'edit', 'login' => $user->login)) ?>
	<? $deletetext = T_("Do you really want to delete user %s?") ?>
	<tr class="<?= ($even ? 'even' : 'odd') ?>">
		<td><a href="<?= h_($editurl) ?>"><?= h_($user->login) ?></a></td>
		<td><a href="<?= h_($editurl) ?>"><?= h_($user->firstname) ?></a></td>
		<td><a href="<?= h_($editurl) ?>"><?= h_($user->lastname) ?></a></td>
		<td><a href="mailto:<?= h_($user->email) ?>"><?= h_($user->email) ?></a></td>
		<td><a href="<?= h_($editurl) ?>"><?= T_($user->is_admin ? "yes" : "no") ?></a></td>
		<td class="align-right">
			<?= $this->editLink('login', $user->login) ?>
			<? if ($user->login != $me): ?>
				<?= $this->deleteLink('login', $user->login, $deletetext) ?>
			<? else: ?>
				<?= $this->img('empty.png') ?>
			<? endif ?>
		</td>
	</tr>
<? endforeach ?>
<? endif ?>
	</tbody>
	<tfoot>
		<tr>
			<td colspan="6" class="align-right">
				<div>
					<a href="<?= $this->url(array('action' => 'new')) ?>"><?= T_("Add new user") ?></a>
					<?= $this->addLink() ?>
				</div>
				<div>
					<a href="<?= $this->url(array('action' => 'import')) ?>"><?= T_("Import htpasswd") ?></a>
					<?= $this->addLink() ?>
				</div>
			</td>
		</tr>
	</tfoot>
</table>
<br />
