@@ -13,7 +13,7 @@ discard block |
||
13 | 13 | use SimpleSAML\Logger; |
14 | 14 | use SimpleSAML\Module; |
15 | 15 | use SimpleSAML\Utils; |
16 | -use SimpleSAML\XHTML\Template;; |
|
16 | +use SimpleSAML\XHTML\Template; ; |
|
17 | 17 | |
18 | 18 | $globalConfig = Configuration::getInstance(); |
19 | 19 | |
@@ -58,7 +58,7 @@ discard block |
||
58 | 58 | $frontendData = []; |
59 | 59 | $frontendData['challengeEncoded'] = $challengeEncoded; |
60 | 60 | $frontendData['state'] = []; |
61 | -foreach (['Source','FIDO2Scope','FIDO2Username','FIDO2Displayname','requestTokenModel'] as $stateItem) { |
|
61 | +foreach (['Source', 'FIDO2Scope', 'FIDO2Username', 'FIDO2Displayname', 'requestTokenModel'] as $stateItem) { |
|
62 | 62 | $frontendData['state'][$stateItem] = $state[$stateItem]; |
63 | 63 | } |
64 | 64 | $frontendData['usernameEncoded'] = $usernameEncoded; |
@@ -9,20 +9,20 @@ discard block |
||
9 | 9 | |
10 | 10 | <h1><?php echo htmlspecialchars($this->t('{webauthn:webauthn:heading1}')); ?></h1> |
11 | 11 | <h2><?php echo htmlspecialchars($this->t('{webauthn:webauthn:accountEnabled}')); ?></h2> |
12 | - <?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) > 0): ?> |
|
12 | + <?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) > 0) : ?> |
|
13 | 13 | <div id="currentTokens"><span id='tokencaption'><?php echo htmlspecialchars($this->t('{webauthn:webauthn:tokenList}')); ?></span> |
14 | 14 | <ul> |
15 | - <?php foreach($this->data['FIDO2Tokens'] as $index => $this->data['token']): ?> |
|
16 | - <?php if($this->data['FIDO2AuthSuccessful'] == false or $this->data['FIDO2AuthSuccessful'] != $this->data['token'][0]): ?> |
|
15 | + <?php foreach ($this->data['FIDO2Tokens'] as $index => $this->data['token']): ?> |
|
16 | + <?php if ($this->data['FIDO2AuthSuccessful'] == false or $this->data['FIDO2AuthSuccessful'] != $this->data['token'][0]): ?> |
|
17 | 17 | <li class='othertoken'><?php echo htmlspecialchars($this->data['token'][3]); ?></li> |
18 | 18 | <?php else: ?> |
19 | 19 | <li class='currenttoken'><?php echo htmlspecialchars($this->data['token'][3]); ?> <?php echo htmlspecialchars($this->t('{webauthn:webauthn:currentToken}')); ?></li> |
20 | 20 | <?php endif; ?> |
21 | - <?php endforeach;?> |
|
21 | + <?php endforeach; ?> |
|
22 | 22 | </ul> |
23 | 23 | </div> |
24 | 24 | <?php endif; ?> |
25 | - <?php if((isset($this->data['regURL'])?((is_array($this->data['regURL']) || $this->data['regURL'] instanceof Countable)?count($this->data['regURL']):strlen($this->data['regURL'])):0) > 0): ?> |
|
25 | + <?php if ((isset($this->data['regURL']) ? ((is_array($this->data['regURL']) || $this->data['regURL'] instanceof Countable) ?count($this->data['regURL']) : strlen($this->data['regURL'])) : 0) > 0) : ?> |
|
26 | 26 | <form id='regform' method='POST' action='<?php echo $this->data['regURL']; ?>'> |
27 | 27 | <input type='hidden' id='resp' name='response_id' value='0'/> |
28 | 28 | <input type='hidden' id='data' name='attestation_client_data_json' value='nix'/> |
@@ -38,22 +38,22 @@ discard block |
||
38 | 38 | value='<?php echo htmlspecialchars($this->t('{webauthn:webauthn:newTokenDefaultName}')); ?> <?php echo htmlspecialchars((new DateTime("now", new DateTimeZone("Europe/Luxembourg")))->format('Y-m-d')); ?>' /> |
39 | 39 | </form> |
40 | 40 | <div class='space'></div> |
41 | - <?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) > 0): ?> |
|
42 | - <?php foreach($this->data['FIDO2Tokens'] as $index => $this->data['token']): ?> |
|
43 | - <?php if($this->data['FIDO2AuthSuccessful'] != $this->data['token'][0]): ?> |
|
41 | + <?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) > 0) : ?> |
|
42 | + <?php foreach ($this->data['FIDO2Tokens'] as $index => $this->data['token']): ?> |
|
43 | + <?php if ($this->data['FIDO2AuthSuccessful'] != $this->data['token'][0]): ?> |
|
44 | 44 | <form class='deleteform' id='delete-<?php echo htmlspecialchars($index); ?>' method='POST' action='<?php echo $this->data['delURL']; ?>'> |
45 | 45 | <input type='hidden' id='credId-<?php echo htmlspecialchars($index); ?>' name='credId' value='<?php echo htmlspecialchars($this->data['token'][0]); ?>'/> |
46 | 46 | <button type='submit' id='submit-<?php echo htmlspecialchars($index); ?>' name='submit' value='DELETE'><?php echo htmlspecialchars($this->t('{webauthn:webauthn:removePrefix}')); ?> "<?php echo htmlspecialchars($this->data['token'][3]); ?>"</button> |
47 | 47 | </form> |
48 | 48 | <?php endif; ?> |
49 | - <?php endforeach;?> |
|
49 | + <?php endforeach; ?> |
|
50 | 50 | <div class='space'></div> |
51 | 51 | <form id='nevermind' method='POST' action='<?php echo $this->data['delURL']; ?>'> |
52 | 52 | <button type='submit' id='submit-nevermind' name='submit' value='NEVERMIND'><?php echo htmlspecialchars($this->t('{webauthn:webauthn:noChange}')); ?></button> |
53 | 53 | </form> |
54 | 54 | <?php endif; ?> |
55 | 55 | <?php endif; ?> |
56 | - <?php if((isset($this->data['authURL'])?((is_array($this->data['authURL']) || $this->data['authURL'] instanceof Countable)?count($this->data['authURL']):strlen($this->data['authURL'])):0) > 0): ?> |
|
56 | + <?php if ((isset($this->data['authURL']) ? ((is_array($this->data['authURL']) || $this->data['authURL'] instanceof Countable) ?count($this->data['authURL']) : strlen($this->data['authURL'])) : 0) > 0) : ?> |
|
57 | 57 | <form id='authform' method='POST' action='<?php echo $this->data['authURL']; ?>'> |
58 | 58 | <input type='hidden' id='resp' name='response_id' value='0'/> |
59 | 59 | <input type='hidden' id='data_raw_b64' name='client_data_raw' value='garnix'/> |
@@ -63,7 +63,7 @@ discard block |
||
63 | 63 | <!-- ignoring <input type='hidden' id='userhandle' name='userhandle' value='someuser'/> --> |
64 | 64 | <input type='hidden' id='type' name='type' value='something'/> |
65 | 65 | <input type='hidden' id='operation' name='operation' value='AUTH'/> |
66 | - <input type='checkbox' id='credentialChange' name='credentialChange'><?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): ?> |
|
66 | + <input type='checkbox' id='credentialChange' name='credentialChange'><?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) : ?> |
|
67 | 67 | <?php echo htmlspecialchars($this->t('{webauthn:webauthn:wantsAdd}')); ?> |
68 | 68 | <?php else: ?> |
69 | 69 | <?php echo htmlspecialchars($this->t('{webauthn:webauthn:wantsModification}')); ?> |
@@ -15,8 +15,11 @@ discard block |
||
15 | 15 | <?php foreach($this->data['FIDO2Tokens'] as $index => $this->data['token']): ?> |
16 | 16 | <?php if($this->data['FIDO2AuthSuccessful'] == false or $this->data['FIDO2AuthSuccessful'] != $this->data['token'][0]): ?> |
17 | 17 | <li class='othertoken'><?php echo htmlspecialchars($this->data['token'][3]); ?></li> |
18 | - <?php else: ?> |
|
19 | - <li class='currenttoken'><?php echo htmlspecialchars($this->data['token'][3]); ?> <?php echo htmlspecialchars($this->t('{webauthn:webauthn:currentToken}')); ?></li> |
|
18 | + <?php else { |
|
19 | + : ?> |
|
20 | + <li class='currenttoken'><?php echo htmlspecialchars($this->data['token'][3]); |
|
21 | +} |
|
22 | +?> <?php echo htmlspecialchars($this->t('{webauthn:webauthn:currentToken}')); ?></li> |
|
20 | 23 | <?php endif; ?> |
21 | 24 | <?php endforeach;?> |
22 | 25 | </ul> |
@@ -65,8 +68,11 @@ discard block |
||
65 | 68 | <input type='hidden' id='operation' name='operation' value='AUTH'/> |
66 | 69 | <input type='checkbox' id='credentialChange' name='credentialChange'><?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): ?> |
67 | 70 | <?php echo htmlspecialchars($this->t('{webauthn:webauthn:wantsAdd}')); ?> |
68 | - <?php else: ?> |
|
69 | - <?php echo htmlspecialchars($this->t('{webauthn:webauthn:wantsModification}')); ?> |
|
71 | + <?php else { |
|
72 | + : ?> |
|
73 | + <?php echo htmlspecialchars($this->t('{webauthn:webauthn:wantsModification}')); |
|
74 | +} |
|
75 | +?> |
|
70 | 76 | <?php endif; ?></input><br/> |
71 | 77 | <button type='button' id='authformSubmit'><?php echo htmlspecialchars($this->t('{webauthn:webauthn:authTokenButton}')); ?></button> |
72 | 78 | </form> |