PageRenderTime 44ms CodeModel.GetById 22ms RepoModel.GetById 1ms app.codeStats 0ms

/themes/default/cplog/login.php

https://github.com/chokoleytdesignoper/fluxcp_choko
PHP | 83 lines | 82 code | 1 blank | 0 comment | 20 complexity | 7e4f1f4292e1450ff70860b2e7e92185 MD5 | raw file
Possible License(s): LGPL-2.1, LGPL-3.0, BSD-3-Clause
  1. <?php if (!defined('FLUX_ROOT')) exit; ?>
  2. <h2>Logins</h2>
  3. <p class="toggler"><a href="javascript:toggleSearchForm()">Search...</a></p>
  4. <form action="<?php echo $this->url ?>" method="get" class="search-form">
  5. <?php echo $this->moduleActionFormInputs($params->get('module'), $params->get('action')) ?>
  6. <p>
  7. <label for="use_login_after">Login Date Between:</label>
  8. <input type="checkbox" name="use_login_after" id="use_login_after"<?php if ($params->get('use_login_after')) echo ' checked="checked"' ?> />
  9. <?php echo $this->dateField('login_after') ?>
  10. <label for="use_login_before">&mdash;</label>
  11. <input type="checkbox" name="use_login_before" id="use_login_before"<?php if ($params->get('use_login_before')) echo ' checked="checked"' ?> />
  12. <?php echo $this->dateField('login_before') ?>
  13. <?php if ($auth->allowedToSearchCpLoginLogPw): ?>
  14. ...
  15. <label for="password">Password:</label>
  16. <input type="text" name="password" id="password" value="<?php echo htmlspecialchars($params->get('password')) ?>" />
  17. <?php endif ?>
  18. </p>
  19. <p>
  20. <label for="account_id">Account ID:</label>
  21. <input type="text" name="account_id" id="account_id" value="<?php echo htmlspecialchars($params->get('account_id')) ?>" />
  22. ...
  23. <label for="username">Username:</label>
  24. <input type="text" name="username" id="username" value="<?php echo htmlspecialchars($params->get('username')) ?>" />
  25. ...
  26. <label for="ip">IP Address:</label>
  27. <input type="text" name="ip" id="ip" value="<?php echo htmlspecialchars($params->get('ip')) ?>" />
  28. ...
  29. <label for="error_code">Error Code:</label>
  30. <select name="error_code" id="error_code">
  31. <option value="all"<?php if (is_null($params->get('error_code')) || strtolower($params->get('error_code') == 'all')) echo ' selected="selected"' ?>>All</option>
  32. <option value="none"<?php if (strtolower($params->get('error_code')) == 'none') echo ' selected="selected"' ?>>None</option>
  33. <?php foreach ($loginErrors->toArray() as $errorCode => $errorType): ?>
  34. <option value="<?php echo $errorCode ?>"<?php if (ctype_digit($params->get('error_code')) && $params->get('error_code') == $errorCode) echo ' selected="selected"' ?>><?php echo htmlspecialchars($errorType) ?></option>
  35. <?php endforeach ?>
  36. </select>
  37. <input type="submit" value="Search" />
  38. <input type="button" value="Reset" onclick="reload()" />
  39. </p>
  40. </form>
  41. <?php if ($logins): ?>
  42. <?php echo $paginator->infoText() ?>
  43. <table class="horizontal-table">
  44. <tr>
  45. <th><?php echo $paginator->sortableColumn('account_id', 'Account ID') ?></th>
  46. <th><?php echo $paginator->sortableColumn('username', 'Username') ?></th>
  47. <?php if (($showPassword=Flux::config('CpLoginLogShowPassword')) && ($seePassword=$auth->allowedToSeeCpLoginLogPass)): ?>
  48. <th><?php echo $paginator->sortableColumn('password', 'Password') ?></th>
  49. <?php endif ?>
  50. <th><?php echo $paginator->sortableColumn('ip', 'IP Address') ?></th>
  51. <th><?php echo $paginator->sortableColumn('login_date', 'Login Date') ?></th>
  52. <th><?php echo $paginator->sortableColumn('error_code', 'Error Code') ?></th>
  53. </tr>
  54. <?php foreach ($logins as $login): ?>
  55. <tr>
  56. <td align="right">
  57. <?php if ($auth->actionAllowed('account', 'view') && $auth->allowedToViewAccount): ?>
  58. <?php echo $this->linkToAccount($login->account_id, $login->account_id) ?>
  59. <?php else: ?>
  60. <?php echo $login->account_id ?>
  61. <?php endif ?>
  62. </td>
  63. <td><?php echo htmlspecialchars($login->username) ?></td>
  64. <?php if ($showPassword && $seePassword): ?>
  65. <td><?php echo htmlspecialchars($login->password) ?></td>
  66. <?php endif ?>
  67. <td><?php echo htmlspecialchars($login->ip) ?></td>
  68. <td><?php echo $this->formatDateTime($login->login_date) ?></td>
  69. <td>
  70. <?php if (!is_null($login->error_code)): ?>
  71. <?php echo $login->error_type ?>
  72. <?php else: ?>
  73. <span class="not-applicable">None</span>
  74. <?php endif ?>
  75. </td>
  76. </tr>
  77. <?php endforeach ?>
  78. </table>
  79. <?php echo $paginator->getHTML() ?>
  80. <?php else: ?>
  81. <p>No logs were found. <a href="javascript:history.go(-1)">Go back</a>.</p>
  82. <?php endif ?>