|
5 | 5 | style('core', 'publicshareauth'); |
6 | 6 | script('core', 'publicshareauth'); |
7 | 7 | ?> |
8 | | -<form method="post"> |
| 8 | + |
| 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; ?> |
9 | 15 | <fieldset class="warning"> |
10 | 16 | <?php if (!isset($_['wrongpw'])): ?> |
11 | 17 | <div class="warning-info"><?php p($l->t('This share is password-protected')); ?></div> |
12 | 18 | <?php endif; ?> |
13 | 19 | <?php if (isset($_['wrongpw'])): ?> |
14 | 20 | <div class="warning"><?php p($l->t('The password is wrong. Try again.')); ?></div> |
15 | 21 | <?php endif; ?> |
16 | | - <div class="warning-info" id="email-prompt" style="display:none;"><?php p($l->t('Please type in your email address to request a temporary password')); ?></div> |
17 | | - <p id="password-input"> |
| 22 | + <p> |
18 | 23 | <label for="password" class="infield"><?php p($l->t('Password')); ?></label> |
19 | 24 | <input type="hidden" name="requesttoken" value="<?php p($_['requesttoken']) ?>" /> |
20 | 25 | <input type="password" name="password" id="password" |
|
26 | 31 | <input type="submit" id="password-submit" |
27 | 32 | class="svg icon-confirm input-button-inline" value="" disabled="disabled" /> |
28 | 33 | </p> |
29 | | - <p id="email-input" style="display:none;"> |
| 34 | + </fieldset> |
| 35 | +</form> |
| 36 | + |
| 37 | +<!-- email prompt form. It should initially be hidden --> |
| 38 | +<?php if (isset($_['identityOk'])): ?> |
| 39 | + <form method="post" id="email-input-form"> |
| 40 | +<?php else: ?> |
| 41 | + <form method="post" id="email-input-form" style="display:none;"> |
| 42 | +<?php endif; ?> |
| 43 | + <fieldset class="warning"> |
| 44 | + <div class="warning-info" id="email-prompt"><?php p($l->t('Please type in your email address to request a temporary password')); ?></div> |
| 45 | + <p> |
30 | 46 | <input type="email" id="email" name="identityToken" placeholder="<?php p($l->t('Email address')); ?>" /> |
31 | | - <input type="submit" id="password-request" name="passwordRequest" class="svg icon-confirm input-button-inline" value="" /> |
| 47 | + <input type="submit" id="password-request" name="passwordRequest" class="svg icon-confirm input-button-inline" value="" disabled="disabled"/> |
| 48 | + <input type="hidden" name="requesttoken" value="<?php p($_['requesttoken']) ?>" /> |
| 49 | + <input type="hidden" name="sharingToken" value="<?php p($_['share']->getToken()) ?>" id="sharingToken"> |
| 50 | + <input type="hidden" name="sharingType" value="<?php p($_['share']->getShareType()) ?>" id="sharingType"> |
32 | 51 | </p> |
33 | 52 | <?php if (isset($_['identityOk'])): ?> |
34 | 53 | <?php if ($_['identityOk']): ?> |
35 | 54 | <div class="warning-info" id="identification-success"><?php p($l->t('Password sent!')); ?></div> |
36 | | - <?php endif; ?> |
37 | | - <?php if (!$_['identityOk']): ?> |
38 | | - <div class="warning-info" id="identification-failure"><?php p($l->t('You are not authorized to request a password for this share')); ?></div> |
| 55 | + <?php else: ?> |
| 56 | + <div class="warning" id="identification-failure"><?php p($l->t('You are not authorized to request a password for this share')); ?></div> |
39 | 57 | <?php endif; ?> |
40 | 58 | <?php endif; ?> |
41 | 59 | </fieldset> |
42 | 60 | </form> |
43 | | -<?php if ($_['share']->getShareType()===$_['share']::TYPE_EMAIL && !$_['share']->getSendPasswordByTalk()): ?> |
| 61 | + |
| 62 | +<!-- request password button --> |
| 63 | +<?php if (!isset($_['identityOk']) && $_['share']->getShareType()===$_['share']::TYPE_EMAIL && !$_['share']->getSendPasswordByTalk()): ?> |
44 | 64 | <input type="button" |
45 | 65 | id="request-password-button-not-talk" |
46 | 66 | value="<?php p($l->t('Request password')); ?>" |
47 | 67 | class="primary" /> |
48 | 68 | <?php endif; ?> |
| 69 | + |
| 70 | +<!-- back to showShare button --> |
| 71 | +<form method="get"> |
| 72 | + <fieldset> |
| 73 | + <input type="submit" |
| 74 | + id="request-password-back-button" |
| 75 | + value="<?php p($l->t('Back')); ?>" |
| 76 | + class="primary" |
| 77 | +<?php if (isset($_['identityOk'])): ?> |
| 78 | + style="display:block;" /> |
| 79 | +<?php else: ?> |
| 80 | + style="display:none;" /> |
| 81 | +<?php endif; ?> |
| 82 | + </fieldset> |
| 83 | +</form> |
0 commit comments