1
0

publicshareauth.php 3.5 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182
  1. <?php
  2. /** @var array $_ */
  3. /** @var \OCP\IL10N $l */
  4. \OCP\Util::addStyle('core', 'guest');
  5. \OCP\Util::addStyle('core', 'publicshareauth');
  6. \OCP\Util::addScript('core', 'publicshareauth');
  7. ?>
  8. <div class="guest-box">
  9. <!-- password prompt form. It should be hidden when we show the email prompt form -->
  10. <?php if (!isset($_['identityOk'])): ?>
  11. <form method="post" id="password-input-form">
  12. <?php else: ?>
  13. <form method="post" id="password-input-form" style="display:none;">
  14. <?php endif; ?>
  15. <fieldset class="warning">
  16. <?php if (!isset($_['wrongpw'])): ?>
  17. <div class="warning-info"><?php p($l->t('This share is password-protected')); ?></div>
  18. <?php endif; ?>
  19. <?php if (isset($_['wrongpw'])): ?>
  20. <div class="warning wrongPasswordMsg"><?php p($l->t('The password is wrong or expired. Please try again or request a new one.')); ?></div>
  21. <?php endif; ?>
  22. <p>
  23. <label for="password" class="infield"><?php p($l->t('Password')); ?></label>
  24. <input type="hidden" name="requesttoken" value="<?php p($_['requesttoken']) ?>" />
  25. <input type="password" name="password" id="password"
  26. placeholder="<?php p($l->t('Password')); ?>" value=""
  27. autocomplete="new-password" autocapitalize="off" spellcheck="false"
  28. autofocus />
  29. <input type="hidden" name="sharingToken" value="<?php p($_['share']->getToken()) ?>" id="sharingToken">
  30. <input type="hidden" name="sharingType" value="<?php p($_['share']->getShareType()) ?>" id="sharingType">
  31. <input type="submit" id="password-submit"
  32. class="svg icon-confirm input-button-inline" value="" disabled="disabled" />
  33. </p>
  34. </fieldset>
  35. </form>
  36. <!-- email prompt form. It should initially be hidden -->
  37. <?php if (isset($_['identityOk'])): ?>
  38. <form method="post" id="email-input-form">
  39. <?php else: ?>
  40. <form method="post" id="email-input-form" style="display:none;">
  41. <?php endif; ?>
  42. <fieldset class="warning">
  43. <div class="warning-info" id="email-prompt"><?php p($l->t('Please type in your email address to request a temporary password')); ?></div>
  44. <p>
  45. <input type="email" id="email" name="identityToken" placeholder="<?php p($l->t('Email address')); ?>" />
  46. <input type="submit" id="password-request" name="passwordRequest" class="svg icon-confirm input-button-inline" value="" disabled="disabled"/>
  47. <input type="hidden" name="requesttoken" value="<?php p($_['requesttoken']) ?>" />
  48. <input type="hidden" name="sharingToken" value="<?php p($_['share']->getToken()) ?>" id="sharingToken">
  49. <input type="hidden" name="sharingType" value="<?php p($_['share']->getShareType()) ?>" id="sharingType">
  50. </p>
  51. <?php if (isset($_['identityOk'])): ?>
  52. <?php if ($_['identityOk']): ?>
  53. <div class="warning-info" id="identification-success"><?php p($l->t('Password sent!')); ?></div>
  54. <?php else: ?>
  55. <div class="warning" id="identification-failure"><?php p($l->t('You are not authorized to request a password for this share')); ?></div>
  56. <?php endif; ?>
  57. <?php endif; ?>
  58. </fieldset>
  59. </form>
  60. <!-- request password button -->
  61. <?php if (!isset($_['identityOk']) && $_['share']->getShareType() === $_['share']::TYPE_EMAIL && !$_['share']->getSendPasswordByTalk()): ?>
  62. <a id="request-password-button-not-talk"><?php p($l->t('Forgot password?')); ?></a>
  63. <?php endif; ?>
  64. <!-- back to showShare button -->
  65. <form method="get">
  66. <fieldset>
  67. <a
  68. href=""
  69. id="request-password-back-button"
  70. <?php if (isset($_['identityOk'])): ?>
  71. style="display:block;">
  72. <?php else: ?>
  73. style="display:none;">
  74. <?php endif; ?>
  75. <?php p($l->t('Back')); ?></a>
  76. </fieldset>
  77. </form>
  78. </div>