@@ -49,15 +49,15 @@ |
||
49 | 49 | } |
50 | 50 | |
51 | 51 | switch ($_GET['token']) { |
52 | - case "SELF-REGISTER": |
|
53 | - $token = "SELF-REGISTER"; |
|
54 | - $checkval = \core\UserManagement::TOKENSTATUS_OK_NEW; |
|
55 | - $federation = \config\ConfAssistant::CONSORTIUM['selfservice_registration']; |
|
56 | - break; |
|
57 | - default: |
|
58 | - $tokenUnfiltered = $validator->token(filter_input(INPUT_GET,'token')); |
|
59 | - $token = htmlspecialchars(strip_tags($tokenUnfiltered)); |
|
60 | - $checkval = $usermgmt->checkTokenValidity($token); |
|
52 | + case "SELF-REGISTER": |
|
53 | + $token = "SELF-REGISTER"; |
|
54 | + $checkval = \core\UserManagement::TOKENSTATUS_OK_NEW; |
|
55 | + $federation = \config\ConfAssistant::CONSORTIUM['selfservice_registration']; |
|
56 | + break; |
|
57 | + default: |
|
58 | + $tokenUnfiltered = $validator->token(filter_input(INPUT_GET,'token')); |
|
59 | + $token = htmlspecialchars(strip_tags($tokenUnfiltered)); |
|
60 | + $checkval = $usermgmt->checkTokenValidity($token); |
|
61 | 61 | } |
62 | 62 | |
63 | 63 | if ($checkval < 0) { |
@@ -30,7 +30,7 @@ discard block |
||
30 | 30 | ?> |
31 | 31 | <?php |
32 | 32 | |
33 | -require_once dirname(dirname(dirname(__FILE__))) . "/config/_config.php"; |
|
33 | +require_once dirname(dirname(dirname(__FILE__)))."/config/_config.php"; |
|
34 | 34 | |
35 | 35 | $auth = new \web\lib\admin\Authentication(); |
36 | 36 | $deco = new \web\lib\admin\PageDecoration(); |
@@ -41,11 +41,11 @@ discard block |
||
41 | 41 | $auth->authenticate(); |
42 | 42 | |
43 | 43 | if (!isset($_GET['token'])) { |
44 | - $elements->errorPage(_("Error creating new IdP binding!"),_("This page needs to be called with a valid invitation token!")); |
|
44 | + $elements->errorPage(_("Error creating new IdP binding!"), _("This page needs to be called with a valid invitation token!")); |
|
45 | 45 | } |
46 | 46 | |
47 | 47 | if (\config\ConfAssistant::CONSORTIUM['selfservice_registration'] === NULL && $_GET['token'] == "SELF-REGISTER") { |
48 | - $elements->errorPage(_("Error creating new IdP binding!"),_("You tried to register in self-service, but this deployment does not allow self-service!")); |
|
48 | + $elements->errorPage(_("Error creating new IdP binding!"), _("You tried to register in self-service, but this deployment does not allow self-service!")); |
|
49 | 49 | } |
50 | 50 | |
51 | 51 | switch ($_GET['token']) { |
@@ -55,23 +55,23 @@ discard block |
||
55 | 55 | $federation = \config\ConfAssistant::CONSORTIUM['selfservice_registration']; |
56 | 56 | break; |
57 | 57 | default: |
58 | - $tokenUnfiltered = $validator->token(filter_input(INPUT_GET,'token')); |
|
58 | + $tokenUnfiltered = $validator->token(filter_input(INPUT_GET, 'token')); |
|
59 | 59 | $token = htmlspecialchars(strip_tags($tokenUnfiltered)); |
60 | 60 | $checkval = $usermgmt->checkTokenValidity($token); |
61 | 61 | } |
62 | 62 | |
63 | 63 | if ($checkval < 0) { |
64 | 64 | echo $deco->pageheader(_("Error creating new IdP binding!"), "ADMIN-IDP"); |
65 | - echo "<h1>" . _("Error creating new IdP binding!") . "</h1>"; |
|
65 | + echo "<h1>"._("Error creating new IdP binding!")."</h1>"; |
|
66 | 66 | switch ($checkval) { |
67 | 67 | case \core\UserManagement::TOKENSTATUS_FAIL_ALREADYCONSUMED: |
68 | - echo "<p>" . sprintf(_("Sorry... this token has already been used. The %s is already created. If you got the invitation from a mailing list, probably someone else used it before you."), $elements->nomenclatureParticipant) . "</p>"; |
|
68 | + echo "<p>".sprintf(_("Sorry... this token has already been used. The %s is already created. If you got the invitation from a mailing list, probably someone else used it before you."), $elements->nomenclatureParticipant)."</p>"; |
|
69 | 69 | break; |
70 | 70 | case \core\UserManagement::TOKENSTATUS_FAIL_EXPIRED: |
71 | - echo "<p>" . sprintf(_("Sorry... this token has expired. Invitation tokens are valid for 24 hours. The %s administrator can create a new one for you."), $elements->nomenclatureFed) . "</p>"; |
|
71 | + echo "<p>".sprintf(_("Sorry... this token has expired. Invitation tokens are valid for 24 hours. The %s administrator can create a new one for you."), $elements->nomenclatureFed)."</p>"; |
|
72 | 72 | break; |
73 | 73 | default: |
74 | - echo "<p>" . _("Sorry... you have come to the enrollment page without a valid token. Are you a nasty person? If not, you should go to <a href='overview_user.php'>your profile page</a> instead.") . "</p>"; |
|
74 | + echo "<p>"._("Sorry... you have come to the enrollment page without a valid token. Are you a nasty person? If not, you should go to <a href='overview_user.php'>your profile page</a> instead.")."</p>"; |
|
75 | 75 | } |
76 | 76 | echo $deco->footer(); |
77 | 77 | throw new Exception("Terminating because something is wrong with the token we received."); |
@@ -86,12 +86,12 @@ discard block |
||
86 | 86 | case "SELF-REGISTER": |
87 | 87 | $fed = new \core\Federation($federation); |
88 | 88 | $newidp = new \core\IdP($fed->newIdP(core\IdP::TYPE_IDPSP, $user, "FED", "SELFSERVICE")); |
89 | - $loggerInstance->writeAudit($user, "MOD", "IdP " . $newidp->identifier . " - selfservice registration"); |
|
89 | + $loggerInstance->writeAudit($user, "MOD", "IdP ".$newidp->identifier." - selfservice registration"); |
|
90 | 90 | break; |
91 | 91 | default: |
92 | 92 | $newidp = $usermgmt->createIdPFromToken($token, $user); |
93 | 93 | $usermgmt->invalidateToken($token); |
94 | - $loggerInstance->writeAudit($user, "MOD", "IdP " . $newidp->identifier . " - Token used and invalidated"); |
|
94 | + $loggerInstance->writeAudit($user, "MOD", "IdP ".$newidp->identifier." - Token used and invalidated"); |
|
95 | 95 | break; |
96 | 96 | } |
97 | 97 |