summaryrefslogtreecommitdiff
path: root/app
diff options
context:
space:
mode:
Diffstat (limited to 'app')
-rw-r--r--app/Helper/Text.php19
-rw-r--r--app/Template/user/last.php10
-rw-r--r--app/Template/user/sessions.php12
3 files changed, 11 insertions, 30 deletions
diff --git a/app/Helper/Text.php b/app/Helper/Text.php
index 790fc411..4b8e99bd 100644
--- a/app/Helper/Text.php
+++ b/app/Helper/Text.php
@@ -42,25 +42,6 @@ class Text extends \Core\Base
}
/**
- * Truncate a long text
- *
- * @param string $value Text
- * @param integer $max_length Max Length
- * @param string $end Text end
- * @return string
- */
- public function truncate($value, $max_length = 85, $end = '[...]')
- {
- $length = mb_strlen($value);
-
- if ($length > $max_length) {
- return mb_substr($value, 0, $max_length).' '.$end;
- }
-
- return $value;
- }
-
- /**
* Return true if needle is contained in the haystack
*
* @param string $haystack Haystack
diff --git a/app/Template/user/last.php b/app/Template/user/last.php
index ab25f79b..8097d6f1 100644
--- a/app/Template/user/last.php
+++ b/app/Template/user/last.php
@@ -5,11 +5,11 @@
<?php if (empty($last_logins)): ?>
<p class="alert"><?= t('Never connected.') ?></p>
<?php else: ?>
- <table class="table-small">
+ <table class="table-small table-fixed">
<tr>
- <th><?= t('Login date') ?></th>
- <th><?= t('Authentication method') ?></th>
- <th><?= t('IP address') ?></th>
+ <th class="column-20"><?= t('Login date') ?></th>
+ <th class="column-15"><?= t('Authentication method') ?></th>
+ <th class="column-15"><?= t('IP address') ?></th>
<th><?= t('User agent') ?></th>
</tr>
<?php foreach($last_logins as $login): ?>
@@ -17,7 +17,7 @@
<td><?= dt('%B %e, %Y at %k:%M %p', $login['date_creation']) ?></td>
<td><?= $this->e($login['auth_type']) ?></td>
<td><?= $this->e($login['ip']) ?></td>
- <td><?= $this->e($this->text->truncate($login['user_agent'])) ?></td>
+ <td><?= $this->e($login['user_agent']) ?></td>
</tr>
<?php endforeach ?>
</table>
diff --git a/app/Template/user/sessions.php b/app/Template/user/sessions.php
index a7504a7a..67b2c8cd 100644
--- a/app/Template/user/sessions.php
+++ b/app/Template/user/sessions.php
@@ -5,20 +5,20 @@
<?php if (empty($sessions)): ?>
<p class="alert"><?= t('No session.') ?></p>
<?php else: ?>
- <table class="table-small">
+ <table class="table-small table-fixed">
<tr>
- <th><?= t('Creation date') ?></th>
- <th><?= t('Expiration date') ?></th>
- <th><?= t('IP address') ?></th>
+ <th class="column-20"><?= t('Creation date') ?></th>
+ <th class="column-20"><?= t('Expiration date') ?></th>
+ <th class="column-15"><?= t('IP address') ?></th>
<th><?= t('User agent') ?></th>
- <th><?= t('Action') ?></th>
+ <th class="column-10"><?= t('Action') ?></th>
</tr>
<?php foreach($sessions as $session): ?>
<tr>
<td><?= dt('%B %e, %Y at %k:%M %p', $session['date_creation']) ?></td>
<td><?= dt('%B %e, %Y at %k:%M %p', $session['expiration']) ?></td>
<td><?= $this->e($session['ip']) ?></td>
- <td><?= $this->e($this->text->truncate($session['user_agent'])) ?></td>
+ <td><?= $this->e($session['user_agent']) ?></td>
<td><?= $this->url->link(t('Remove'), 'user', 'removeSession', array('user_id' => $user['id'], 'id' => $session['id']), true) ?></td>
</tr>
<?php endforeach ?>