login.php 4.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114
  1. <?php /** @var $l \OCP\IL10N */ ?>
  2. <?php
  3. vendor_script('jsTimezoneDetect/jstz');
  4. script('core', 'merged-login');
  5. use OC\Core\Controller\LoginController;
  6. ?>
  7. <!--[if IE 8]><style>input[type="checkbox"]{padding:0;}</style><![endif]-->
  8. <form method="post" name="login">
  9. <fieldset>
  10. <?php if (!empty($_['redirect_url'])) {
  11. print_unescaped('<input type="hidden" name="redirect_url" value="' . \OCP\Util::sanitizeHTML($_['redirect_url']) . '">');
  12. } ?>
  13. <?php if (isset($_['apacheauthfailed']) && $_['apacheauthfailed']): ?>
  14. <div class="warning">
  15. <?php p($l->t('Server side authentication failed!')); ?><br>
  16. <small><?php p($l->t('Please contact your administrator.')); ?></small>
  17. </div>
  18. <?php endif; ?>
  19. <?php foreach($_['messages'] as $message): ?>
  20. <div class="warning">
  21. <?php p($message); ?><br>
  22. </div>
  23. <?php endforeach; ?>
  24. <?php if (isset($_['internalexception']) && $_['internalexception']): ?>
  25. <div class="warning">
  26. <?php p($l->t('An internal error occurred.')); ?><br>
  27. <small><?php p($l->t('Please try again or contact your administrator.')); ?></small>
  28. </div>
  29. <?php endif; ?>
  30. <div id="message" class="hidden">
  31. <img class="float-spinner" alt=""
  32. src="<?php p(image_path('core', 'loading-dark.gif'));?>">
  33. <span id="messageText"></span>
  34. <!-- the following div ensures that the spinner is always inside the #message div -->
  35. <div style="clear: both;"></div>
  36. </div>
  37. <p class="grouptop<?php if (!empty($_[LoginController::LOGIN_MSG_INVALIDPASSWORD])) { ?> shake<?php } ?>">
  38. <input type="text" name="user" id="user"
  39. placeholder="<?php p($l->t('Username or email')); ?>"
  40. aria-label="<?php p($l->t('Username or email')); ?>"
  41. value="<?php p($_['loginName']); ?>"
  42. <?php p($_['user_autofocus'] ? 'autofocus' : ''); ?>
  43. autocomplete="<?php p($_['login_form_autocomplete']); ?>" autocapitalize="none" autocorrect="off" required>
  44. <label for="user" class="infield"><?php p($l->t('Username or email')); ?></label>
  45. </p>
  46. <p class="groupbottom<?php if (!empty($_[LoginController::LOGIN_MSG_INVALIDPASSWORD])) { ?> shake<?php } ?>">
  47. <input type="password" name="password" id="password" value=""
  48. placeholder="<?php p($l->t('Password')); ?>"
  49. aria-label="<?php p($l->t('Password')); ?>"
  50. <?php p($_['user_autofocus'] ? '' : 'autofocus'); ?>
  51. autocomplete="<?php p($_['login_form_autocomplete']); ?>" autocapitalize="none" autocorrect="off" required>
  52. <label for="password" class="infield"><?php p($l->t('Password')); ?></label>
  53. </p>
  54. <div id="submit-wrapper">
  55. <input type="submit" id="submit" class="login primary" title="" value="<?php p($l->t('Log in')); ?>" disabled="disabled" />
  56. <div class="submit-icon icon-confirm-white"></div>
  57. </div>
  58. <?php if (!empty($_[LoginController::LOGIN_MSG_INVALIDPASSWORD])) { ?>
  59. <p class="warning wrongPasswordMsg">
  60. <?php p($l->t('Wrong password.')); ?>
  61. </p>
  62. <?php } else if (!empty($_[LoginController::LOGIN_MSG_USERDISABLED])) { ?>
  63. <p class="warning userDisabledMsg">
  64. <?php p(\OC::$server->getL10N('lib')->t('User disabled')); ?>
  65. </p>
  66. <?php } ?>
  67. <?php if ($_['throttle_delay'] > 5000) { ?>
  68. <p class="warning throttledMsg">
  69. <?php p($l->t('We have detected multiple invalid login attempts from your IP. Therefore your next login is throttled up to 30 seconds.')); ?>
  70. </p>
  71. <?php } ?>
  72. <?php if (!empty($_['canResetPassword'])) { ?>
  73. <div id="reset-password-wrapper" style="display: none;">
  74. <input type="submit" id="reset-password-submit" class="login primary" title="" value="<?php p($l->t('Reset password')); ?>" disabled="disabled" />
  75. <div class="submit-icon icon-confirm-white"></div>
  76. </div>
  77. <?php } ?>
  78. <div class="login-additional">
  79. <?php if (!empty($_['canResetPassword'])) { ?>
  80. <div class="lost-password-container">
  81. <a id="lost-password" href="<?php p($_['resetPasswordLink']); ?>">
  82. <?php p($l->t('Forgot password?')); ?>
  83. </a>
  84. <a id="lost-password-back" href="" style="display:none;">
  85. <?php p($l->t('Back to login')); ?>
  86. </a>
  87. </div>
  88. <?php } ?>
  89. </div>
  90. <input type="hidden" name="timezone_offset" id="timezone_offset"/>
  91. <input type="hidden" name="timezone" id="timezone"/>
  92. <input type="hidden" name="requesttoken" value="<?php p($_['requesttoken']) ?>">
  93. </fieldset>
  94. </form>
  95. <?php if (!empty($_['alt_login'])) { ?>
  96. <form id="alternative-logins">
  97. <fieldset>
  98. <ul>
  99. <?php foreach($_['alt_login'] as $login): ?>
  100. <li><a class="button" href="<?php print_unescaped($login['href']); ?>" ><?php p($login['name']); ?></a></li>
  101. <?php endforeach; ?>
  102. </ul>
  103. </fieldset>
  104. </form>
  105. <?php }