activity.phtml 2.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475
  1. <?php
  2. /**
  3. * Copyright © Magento, Inc. All rights reserved.
  4. * See COPYING.txt for license details.
  5. */
  6. /**
  7. * Account activity template
  8. *
  9. * @codingStandardsIgnoreFile
  10. * @var $block \Magento\Security\Block\Adminhtml\Session\Activity
  11. */
  12. $sessionInfoCollection = $block->getSessionInfoCollection();
  13. ?>
  14. <header>
  15. <div class="page-title-wrapper">
  16. <h1 class="page-title" align="center"><?= $block->escapeHtml(__('Account Activity')) ?></h1>
  17. <?php
  18. if ($block->areMultipleSessionsActive()) {
  19. echo $block->escapeHtml(__(
  20. 'This administrator account is open in more than one location. '
  21. .'Note that other locations might be different browsers or sessions on the same computer.'
  22. ));
  23. } ?>
  24. </div>
  25. </header>
  26. <div class="page-content">
  27. <?= $block->getLayout()->getMessagesBlock()->getGroupedHtml() ?>
  28. <div>
  29. <div class="information-title"><?= $block->escapeHtml(__('Concurrent session information:')) ?></div>
  30. <table cellspacing="0" border="1" class="information-table">
  31. <thead>
  32. <tr>
  33. <th><?= $block->escapeHtml(__('IP Address')) ?></th>
  34. <th><?= $block->escapeHtml(__('Time of session start')) ?></th>
  35. </tr>
  36. </thead>
  37. <tbody>
  38. <?php
  39. foreach ($sessionInfoCollection as $item): ?>
  40. <tr>
  41. <td><?= $block->escapeHtml($item->getFormattedIp()) ?></td>
  42. <td><?= $block->escapeHtml($block->formatDateTime($item->getCreatedAt())) ?></td>
  43. </tr>
  44. <?php
  45. endforeach;
  46. ?>
  47. </tbody>
  48. </table>
  49. <div class="button-container">
  50. <button type="button"
  51. <?php
  52. if ($block->areMultipleSessionsActive()): ?>
  53. data-mage-init='{"confirmRedirect":{
  54. "message": "<?=
  55. $block->escapeJs(__('Are you sure that you want to log out all other sessions?'))
  56. ?>",
  57. "url":"<?=
  58. $block->escapeJs($block->escapeUrl($block->getUrl('security/session/logoutAll')))
  59. ?>"
  60. }}'
  61. <?php
  62. else: ?>disabled<?php
  63. endif ?>
  64. title="<?= $block->escapeHtmlAttr(__('Log out all other sessions')) ?>">
  65. <?= $block->escapeHtml(__('Log out all other sessions')) ?>
  66. </button>
  67. </div>
  68. <div><?= $block->escapeHtml(__('This computer is using IP address %1.', $block->getRemoteIp())) ?></div>
  69. </div>
  70. </div>