@@ -16,8 +16,11 @@ discard block |
||
16 | 16 | <?php foreach($this->data['FIDO2Tokens'] as $index => $this->data['token']): ?> |
17 | 17 | <?php if($this->data['FIDO2AuthSuccessful'] == false or $this->data['FIDO2AuthSuccessful'] != $this->data['token'][0]): ?> |
18 | 18 | <li class='othertoken'><?php echo htmlspecialchars($this->data['token'][3]); ?></li> |
19 | - <?php else: ?> |
|
20 | - <li class='currenttoken'><?php echo htmlspecialchars($this->data['token'][3]); ?> <?php echo htmlspecialchars($this->t('{webauthn:webauthn:currentToken}')); ?></li> |
|
19 | + <?php else { |
|
20 | + : ?> |
|
21 | + <li class='currenttoken'><?php echo htmlspecialchars($this->data['token'][3]); |
|
22 | +} |
|
23 | +?> <?php echo htmlspecialchars($this->t('{webauthn:webauthn:currentToken}')); ?></li> |
|
21 | 24 | <?php endif; ?> |
22 | 25 | <?php endforeach;?> |
23 | 26 | </ul> |
@@ -69,8 +72,11 @@ discard block |
||
69 | 72 | <label for='credentialChange'> |
70 | 73 | <?php if((isset($this->data['FIDO2Tokens'])?((is_array($this->data['FIDO2Tokens']) || $this->data['FIDO2Tokens'] instanceof Countable)?count($this->data['FIDO2Tokens']):strlen($this->data['FIDO2Tokens'])):0) < 2): ?> |
71 | 74 | <?php echo htmlspecialchars($this->t('{webauthn:webauthn:wantsAdd}')); ?> |
72 | - <?php else: ?> |
|
73 | - <?php echo htmlspecialchars($this->t('{webauthn:webauthn:wantsModification}')); ?> |
|
75 | + <?php else { |
|
76 | + : ?> |
|
77 | + <?php echo htmlspecialchars($this->t('{webauthn:webauthn:wantsModification}')); |
|
78 | +} |
|
79 | +?> |
|
74 | 80 | <?php endif; ?> |
75 | 81 | </label><br/> |
76 | 82 | <button type='button' id='authformSubmit'><?php echo htmlspecialchars($this->t('{webauthn:webauthn:authTokenButton}')); ?></button> |
@@ -29,28 +29,28 @@ |
||
29 | 29 | throw new Exception("Attempt to access the token management page unauthenticated."); |
30 | 30 | } |
31 | 31 | switch ($_POST['submit']) { |
32 | - case "NEVERMIND": |
|
33 | - Auth\ProcessingChain::resumeProcessing($state); |
|
34 | - break; |
|
35 | - case "DELETE": |
|
36 | - if ($state['FIDO2AuthSuccessful'] == $_POST['credId']) { |
|
37 | - throw new Exception("Attempt to delete the currently used credential despite UI preventing this."); |
|
38 | - } |
|
39 | - $store = $state['webauthn:store']; |
|
40 | - $store->deleteTokenData($_POST['credId']); |
|
41 | - if (array_key_exists('Registration', $state)) { |
|
42 | - foreach ($state['FIDO2Tokens'] as $key => $value) { |
|
43 | - if ($state['FIDO2Tokens'][$key][0] == $_POST['credId']) { |
|
44 | - unset($state['FIDO2Tokens'][$key]); |
|
45 | - break; |
|
46 | - } |
|
32 | + case "NEVERMIND": |
|
33 | + Auth\ProcessingChain::resumeProcessing($state); |
|
34 | + break; |
|
35 | + case "DELETE": |
|
36 | + if ($state['FIDO2AuthSuccessful'] == $_POST['credId']) { |
|
37 | + throw new Exception("Attempt to delete the currently used credential despite UI preventing this."); |
|
47 | 38 | } |
39 | + $store = $state['webauthn:store']; |
|
40 | + $store->deleteTokenData($_POST['credId']); |
|
41 | + if (array_key_exists('Registration', $state)) { |
|
42 | + foreach ($state['FIDO2Tokens'] as $key => $value) { |
|
43 | + if ($state['FIDO2Tokens'][$key][0] == $_POST['credId']) { |
|
44 | + unset($state['FIDO2Tokens'][$key]); |
|
45 | + break; |
|
46 | + } |
|
47 | + } |
|
48 | 48 | |
49 | - StaticProcessHelper::saveStateAndRedirect($state); |
|
50 | - } else { |
|
51 | - Auth\ProcessingChain::resumeProcessing($state); |
|
52 | - } |
|
53 | - break; |
|
54 | - default: |
|
55 | - throw new Exception("Unknown submit button state."); |
|
49 | + StaticProcessHelper::saveStateAndRedirect($state); |
|
50 | + } else { |
|
51 | + Auth\ProcessingChain::resumeProcessing($state); |
|
52 | + } |
|
53 | + break; |
|
54 | + default: |
|
55 | + throw new Exception("Unknown submit button state."); |
|
56 | 56 | } |