login.php 3.1 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980
  1. <?php /** @var $l OC_L10N */ ?>
  2. <?php
  3. vendor_script('jsTimezoneDetect/jstz');
  4. script('core', [
  5. 'visitortimezone',
  6. 'lostpassword'
  7. ]);
  8. ?>
  9. <!--[if IE 8]><style>input[type="checkbox"]{padding:0;}</style><![endif]-->
  10. <form method="post" name="login">
  11. <fieldset>
  12. <?php if (!empty($_['redirect_url'])) {
  13. print_unescaped('<input type="hidden" name="redirect_url" value="' . OC_Util::sanitizeHTML($_['redirect_url']) . '">');
  14. } ?>
  15. <?php if (isset($_['apacheauthfailed']) && ($_['apacheauthfailed'])): ?>
  16. <div class="warning">
  17. <?php p($l->t('Server side authentication failed!')); ?><br>
  18. <small><?php p($l->t('Please contact your administrator.')); ?></small>
  19. </div>
  20. <?php endif; ?>
  21. <?php foreach($_['messages'] as $message): ?>
  22. <div class="warning">
  23. <?php p($message); ?><br>
  24. </div>
  25. <?php endforeach; ?>
  26. <p id="message" class="hidden">
  27. <img class="float-spinner" alt=""
  28. src="<?php p(\OCP\Util::imagePath('core', 'loading-dark.gif'));?>">
  29. <span id="messageText"></span>
  30. <!-- the following div ensures that the spinner is always inside the #message div -->
  31. <div style="clear: both;"></div>
  32. </p>
  33. <p class="grouptop">
  34. <input type="text" name="user" id="user"
  35. placeholder="<?php p($l->t('Username')); ?>"
  36. value="<?php p($_['username']); ?>"
  37. <?php p($_['user_autofocus'] ? 'autofocus' : ''); ?>
  38. autocomplete="on" autocapitalize="off" autocorrect="off" required>
  39. <label for="user" class="infield"><?php p($l->t('Username')); ?></label>
  40. <img class="svg" src="<?php print_unescaped(image_path('', 'actions/user.svg')); ?>" alt=""/>
  41. </p>
  42. <p class="groupbottom">
  43. <input type="password" name="password" id="password" value=""
  44. placeholder="<?php p($l->t('Password')); ?>"
  45. <?php p($_['user_autofocus'] ? '' : 'autofocus'); ?>
  46. autocomplete="on" autocapitalize="off" autocorrect="off" required>
  47. <label for="password" class="infield"><?php p($l->t('Password')); ?></label>
  48. <img class="svg" id="password-icon" src="<?php print_unescaped(image_path('', 'actions/password.svg')); ?>" alt=""/>
  49. </p>
  50. <?php if (isset($_['invalidpassword']) && ($_['invalidpassword'])): ?>
  51. <a id="lost-password" class="warning" href="">
  52. <?php p($l->t('Forgot your password? Reset it!')); ?>
  53. </a>
  54. <?php endif; ?>
  55. <?php if ($_['rememberLoginAllowed'] === true) : ?>
  56. <input type="checkbox" name="remember_login" value="1" id="remember_login">
  57. <label for="remember_login"><?php p($l->t('remember')); ?></label>
  58. <?php endif; ?>
  59. <input type="hidden" name="timezone-offset" id="timezone-offset"/>
  60. <input type="hidden" name="timezone" id="timezone"/>
  61. <input type="hidden" name="requesttoken" value="<?php p($_['requesttoken']) ?>">
  62. <input type="submit" id="submit" class="login primary" value="<?php p($l->t('Log in')); ?>" disabled="disabled"/>
  63. </fieldset>
  64. </form>
  65. <?php if (!empty($_['alt_login'])) { ?>
  66. <form id="alternative-logins">
  67. <fieldset>
  68. <legend><?php p($l->t('Alternative Logins')) ?></legend>
  69. <ul>
  70. <?php foreach($_['alt_login'] as $login): ?>
  71. <li><a class="button" href="<?php print_unescaped($login['href']); ?>" ><?php p($login['name']); ?></a></li>
  72. <?php endforeach; ?>
  73. </ul>
  74. </fieldset>
  75. </form>
  76. <?php }