You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

login.php 3.8KB

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