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.9KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899
  1. <?php /** @var $l \OCP\IL10N */ ?>
  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. </p>
  55. <?php if (!empty($_['invalidpassword']) && !empty($_['canResetPassword'])) { ?>
  56. <a id="lost-password" class="warning" href="<?php p($_['resetPasswordLink']); ?>">
  57. <?php p($l->t('Wrong password. Reset it?')); ?>
  58. </a>
  59. <?php } else if (!empty($_['invalidpassword'])) { ?>
  60. <p class="warning">
  61. <?php p($l->t('Wrong password.')); ?>
  62. </p>
  63. <?php } ?>
  64. <input type="submit" id="submit" class="login primary icon-confirm-white" title="" value="<?php p($l->t('Log in')); ?>" disabled="disabled" />
  65. <div class="login-additional">
  66. <?php if ($_['rememberLoginAllowed'] === true) : ?>
  67. <div class="remember-login-container">
  68. <?php if ($_['rememberLoginState'] === 0) { ?>
  69. <input type="checkbox" name="remember_login" value="1" id="remember_login" class="checkbox checkbox--white">
  70. <?php } else { ?>
  71. <input type="checkbox" name="remember_login" value="1" id="remember_login" class="checkbox checkbox--white" checked="checked">
  72. <?php } ?>
  73. <label for="remember_login"><?php p($l->t('Stay logged in')); ?></label>
  74. </div>
  75. <?php endif; ?>
  76. </div>
  77. <input type="hidden" name="timezone_offset" id="timezone_offset"/>
  78. <input type="hidden" name="timezone" id="timezone"/>
  79. <input type="hidden" name="requesttoken" value="<?php p($_['requesttoken']) ?>">
  80. </fieldset>
  81. </form>
  82. <?php if (!empty($_['alt_login'])) { ?>
  83. <form id="alternative-logins">
  84. <fieldset>
  85. <legend><?php p($l->t('Alternative Logins')) ?></legend>
  86. <ul>
  87. <?php foreach($_['alt_login'] as $login): ?>
  88. <li><a class="button" href="<?php print_unescaped($login['href']); ?>" ><?php p($login['name']); ?></a></li>
  89. <?php endforeach; ?>
  90. </ul>
  91. </fieldset>
  92. </form>
  93. <?php }