|
10 | 10 | *
|
11 | 11 | * @var SimpleSAML\XHTML\Template $this
|
12 | 12 | */
|
13 |
| -$attributes = $this->data['attributes']; |
14 |
| -$attributesGroupConfiguration = $this->data['attributes_group_config']; |
15 | 13 |
|
| 14 | +$attributesGroupConfiguration = $this->data['attributes_group_config']; |
| 15 | +$as = $this->data['as']; |
16 | 16 |
|
17 | 17 | $this->data['header'] = '';
|
18 | 18 | $this->data['head'] = '<link rel="stylesheet" media="screen" type="text/css" href="' .
|
|
25 | 25 |
|
26 | 26 | $this->includeAtTemplateBase('includes/header.php');
|
27 | 27 |
|
28 |
| -foreach ($attributesGroupConfiguration as $group) { |
29 |
| - echo AttributeCheck::handleAttributesGroup($this, $group, $attributes); |
| 28 | +echo "<h1>" . $this->t('{attribute_check:attribute_check:header}') . "</h1>"; |
| 29 | + |
| 30 | +if (!$as->isAuthenticated()){ |
| 31 | + echo "<div class='mt-5'>"; |
| 32 | + echo "<div>" . $this->t('{attribute_check:attribute_check:sign_in_text}') . "</div>"; |
| 33 | + echo sprintf( |
| 34 | + "<a class='btn btn-primary text-light mt-5' href='%s'>%s</a>", |
| 35 | + $as->getLoginURL(), |
| 36 | + $this->t('{attribute_check:attribute_check:sign_in_btn}') |
| 37 | + ); |
| 38 | + echo "</div>"; |
30 | 39 | }
|
31 | 40 |
|
32 |
| -?> |
33 |
| - <div> |
34 |
| - <button class="btn btn-primary btn-show-hide" type="button" data-bs-toggle="collapse" data-bs-target="#all_attributes" aria-expanded="false" aria-controls="all_attributes"> |
35 |
| - <?php |
36 |
| - echo $this->t('{attribute_check:attribute_check:show_hide_btn}'); |
37 |
| - ?> |
38 |
| - </button> |
39 |
| - </div> |
40 |
| -<?php |
| 41 | +if ($as->isAuthenticated()){ |
| 42 | + $attributes = $as->getAttributes(); |
41 | 43 |
|
42 |
| -echo "<div class='collapse attributes_block' id='all_attributes'>"; |
43 |
| -foreach ($attributes as $attributeName => $attributeValue) { |
44 |
| - echo "<div class='row attribute_row'>"; |
45 |
| - echo "<div class='col-md-4 attribute_name'>"; |
46 |
| - echo '<div>' . $attributeName . '</div>'; |
47 |
| - echo '</div>'; |
| 44 | + foreach ($attributesGroupConfiguration as $group) { |
| 45 | + echo AttributeCheck::handleAttributesGroup($this, $group, $attributes); |
| 46 | + } |
| 47 | + |
| 48 | + ?> |
| 49 | + <div> |
| 50 | + <button aria-controls="all_attributes" aria-expanded="false" class="btn btn-primary btn-show-hide" |
| 51 | + data-bs-target="#all_attributes" data-bs-toggle="collapse" type="button"> |
| 52 | + <?php |
| 53 | + echo $this->t('{attribute_check:attribute_check:show_hide_btn}'); |
| 54 | + ?> |
| 55 | + </button> |
| 56 | + </div> |
| 57 | + <?php |
48 | 58 |
|
49 |
| - echo "<div class='col-md-8 attribute_value'>"; |
50 |
| - if (count($attributeValue) > 1) { |
51 |
| - echo '<ul>'; |
52 |
| - foreach ($attributeValue as $value) { |
53 |
| - echo '<li>' . $value . '</li>'; |
| 59 | + echo "<div class='collapse attributes_block' id='all_attributes'>"; |
| 60 | + foreach ($attributes as $attributeName => $attributeValue) { |
| 61 | + echo "<div class='row attribute_row'>"; |
| 62 | + echo "<div class='col-md-4 attribute_name'>"; |
| 63 | + echo '<div>' . $attributeName . '</div>'; |
| 64 | + echo '</div>'; |
| 65 | + |
| 66 | + echo "<div class='col-md-8 attribute_value'>"; |
| 67 | + if (count($attributeValue) > 1) { |
| 68 | + echo '<ul>'; |
| 69 | + foreach ($attributeValue as $value) { |
| 70 | + echo '<li>' . $value . '</li>'; |
| 71 | + } |
| 72 | + echo '</ul>'; |
| 73 | + } elseif (count($attributeValue) === 1) { |
| 74 | + echo '<div>' . $attributeValue[0] . '</div>'; |
| 75 | + } else { |
| 76 | + echo '<div></div>'; |
54 | 77 | }
|
55 |
| - echo '</ul>'; |
56 |
| - } elseif (count($attributeValue) === 1) { |
57 |
| - echo '<div>' . $attributeValue[0] . '</div>'; |
58 |
| - } else { |
59 |
| - echo '<div></div>'; |
60 |
| - } |
61 | 78 |
|
| 79 | + echo '</div>'; |
| 80 | + echo '</div>'; |
| 81 | + } |
62 | 82 | echo '</div>';
|
63 |
| - echo '</div>'; |
64 | 83 | }
|
65 |
| -echo '</div>'; |
| 84 | + |
| 85 | +if ($as->isAuthenticated()){ |
| 86 | + echo sprintf( |
| 87 | + "<a class='btn btn-light text-dark' href='%s'>%s</a>", |
| 88 | + $as->getLogoutURL(), |
| 89 | + $this->t('{attribute_check:attribute_check:log_out_btn}') |
| 90 | + ); |
| 91 | +} |
66 | 92 |
|
67 | 93 | $this->includeAtTemplateBase('includes/footer.php');
|
0 commit comments