File: consentadmin.php

package info (click to toggle)
simplesamlphp 1.19.0-1
  • links: PTS, VCS
  • area: main
  • in suites: bullseye
  • size: 43,240 kB
  • sloc: php: 200,806; javascript: 15,025; xml: 3,336; sh: 265; perl: 82; makefile: 70; python: 5
file content (90 lines) | stat: -rw-r--r-- 4,122 bytes parent folder | download | duplicates (3)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
<?php
    $this->data['head'] = '<link rel="stylesheet" type="text/css" href="'.
        SimpleSAML\Module::getModuleURL("consentAdmin/assets/css/consentAdmin.css").'" />'."\n";
    $this->data['head'] .= '<script type="text/javascript" src="'.
        SimpleSAML\Module::getModuleURL("consentAdmin/assets/js/consentAdmin.js").'"></script>';
    // default theme
    $this->includeAtTemplateBase('includes/header.php');
?>
        <h2><?php echo $this->t('{consentAdmin:consentadmin:consentadmin_header}') ?></h2>
        <p>
        <?php echo $this->t('{consentAdmin:consentadmin:consentadmin_description1}') ?> </p>


            <table>
            <tr>
                <th width="80%"><?php echo $this->t('{consentAdmin:consentadmin:service_provider_header}') ?></th>
                <th><?php echo $this->t('{consentAdmin:consentadmin:status_header}') ?></th>
            </tr>
            <?php
            $spList = $this->data['spList'];
            $show_spid = 0;
            $show_text = $this->t('{consentAdmin:consentadmin:show}');
            $hide_text = $this->t('{consentAdmin:consentadmin:hide}');
            $attributes_text = $this->t('{consentAdmin:consentadmin:attributes_text}');
            foreach ($spList as $spName => $spValues) {
                if (!is_null($spValues['serviceurl'])) {
                    $htmlSpName = '<a class="serviceUrl" href="'.$spValues['serviceurl'].'">'.
                        htmlspecialchars($spValues['name']).'</a>';
                } else {
                    $htmlSpName = htmlspecialchars($spValues['name']);
                }
                $spDescription = htmlspecialchars($spValues['description']);
                $checkedAttr = $spValues['consentStatus'] == 'ok' ? 'checked="checked"' : '';
                $consentValue = $spValues['consentValue'];
                $consentText = $spValues['consentStatus'] == 'changed' ? "attributes has changed" : "";
                $row_class = ($show_spid % 2) ? "row0" : "row1";
                echo <<<TRSTART
<tr class="$row_class">
<td>
    <table>
      <tr class="$row_class">
          <td><span class='caSPName'><span title='$spDescription'>$htmlSpName</span>&emsp;
          <span class="show_hide" id="show_hide_$show_spid"><span id='showing_$show_spid'>$show_text</span>
          <span id='hiding_$show_spid'>$hide_text</span> $attributes_text</span></span></td></tr>
      <tr><td colspan="2" class="caAttributes"><div id="attributes_$show_spid">
TRSTART;
                $attributes = $spValues['attributes_by_sp'];
                if ($this->data['showDescription']) {
                    echo '<p>'.$this->t('{consentAdmin:consentadmin:consentadmin_purpose}').' '.$spDescription.'</p>';
                }
                echo "\n<ul>\n";
                foreach ($attributes as $name => $value) {
                    if (sizeof($value) > 1) {
                        echo "<li>".htmlspecialchars($name).":\n<ul>\n";
                        foreach ($value as $v) {
                            echo '<li>'.htmlspecialchars($v)."</li>\n";
                        }
                        echo "</ul>\n</li>\n";
                    } else {
                        echo "<li>".htmlspecialchars($name).": ".htmlspecialchars($value[0])."</li>\n";
                    }
                }
                echo "</ul>";
                echo <<<TRSTART
      </div></td></tr>
  </table>
</td>

<td class='caAllowed'>
    <input id="checkbox_$show_spid" class="checkbox" value='$consentValue' type='checkbox' $checkedAttr />
    <span id="consentText_$show_spid">$consentText</span></td>
TRSTART;
                echo "</tr>\n";
                $show_spid++;
            }
            ?>
            </table>

            <p>
        <?php echo $this->t('{consentAdmin:consentadmin:consentadmin_description2}') ?> </p>

        <h2>Logout</h2>
        <p>
            <a href="
            <?php
                echo \SimpleSAML\Module::getModuleURL('consentAdmin/consentAdmin.php', ['logout' => 1]);
            ?>">Logout</a>
        </p>

<?php $this->includeAtTemplateBase('includes/footer.php');