This repository was archived by the owner on Sep 19, 2022. It is now read-only.
File tree Expand file tree Collapse file tree 3 files changed +68
-0
lines changed
Expand file tree Collapse file tree 3 files changed +68
-0
lines changed Original file line number Diff line number Diff line change 1+ <?php
2+
3+ /**
4+ * Class sspmod_perun_Auth_Process_WarningTestSP
5+ *
6+ * Warns user that he/she is accessing to the testing SP
7+ */
8+ class sspmod_perun_Auth_Process_WarningTestSP extends SimpleSAML_Auth_ProcessingFilter
9+ {
10+
11+ public function __construct ($ config , $ reserved )
12+ {
13+ parent ::__construct ($ config , $ reserved );
14+ }
15+ public function process (&$ request )
16+ {
17+ if ($ request ["SPMetadata " ]["test.sp " ] === true ) {
18+ $ id = SimpleSAML_Auth_State::saveState ($ request , 'perun:warningTestSP ' );
19+ $ url = SimpleSAML_Module::getModuleURL ('perun/warning_test_sp_page.php ' );
20+ \SimpleSAML \Utils \HTTP ::redirectTrustedURL ($ url , array ('StateId ' => $ id ));
21+ }
22+ }
23+
24+ }
25+
Original file line number Diff line number Diff line change 1+ <?php
2+
3+ /**
4+ * Template for warn user that he/she is accessing test SP
5+ *
6+ * Allow type hinting in IDE
7+ * @var SimpleSAML_XHTML_Template $this
8+ */
9+
10+ $ this ->data ['header ' ] = '' ;
11+
12+ $ this ->includeAtTemplateBase ('includes/header.php ' );
13+
14+ ?>
15+
16+
17+ <form method="post" action="<?php echo SimpleSAML_Module::getModuleURL ('perun/warning_test_sp_continue.php ' ); ?> " >
18+
19+ <input type="hidden" name="StateId" value="<?php echo $ _REQUEST ['StateId ' ] ?> " >
20+ <h3>You are about to access service, which is in testing environment.</h3>
21+ </hr>
22+ </br>
23+
24+ <div class="form-group">
25+ <input type="submit" value="Continue" class="btn btn-lg btn-primary btn-block">
26+ </div>
27+ </form>
28+
29+
30+
31+ <?php
32+
33+ $ this ->includeAtTemplateBase ('includes/footer.php ' );
Original file line number Diff line number Diff line change 1+ <?php
2+
3+ $ id = $ _REQUEST ['StateId ' ];
4+ $ state = SimpleSAML_Auth_State::loadState ($ id , 'perun:warningTestSP ' );
5+
6+ $ config = SimpleSAML_Configuration::getInstance ();
7+
8+ $ t = new SimpleSAML_XHTML_Template ($ config , 'perun:warning-test-sp-tpl.php ' );
9+ $ t ->show ();
10+
You can’t perform that action at this time.
0 commit comments