@@ -25,7 +25,7 @@ discard block |
||
25 | 25 | echo $deco->productheader("FEDERATION"); |
26 | 26 | ?> |
27 | 27 | <h1> |
28 | - <?php echo sprintf(_("%s Overview"),$uiElements->nomenclature_fed); ?> |
|
28 | + <?php echo sprintf(_("%s Overview"), $uiElements->nomenclature_fed); ?> |
|
29 | 29 | </h1> |
30 | 30 | |
31 | 31 | <div class="infobox"> |
@@ -39,7 +39,7 @@ discard block |
||
39 | 39 | <td> |
40 | 40 | </td> |
41 | 41 | <td> |
42 | - <span class='tooltip' style='cursor: pointer;' onclick='alert("<?php echo str_replace('\'','\x27',str_replace('"','\x22', $_SESSION["user"])); ?>")'><?php echo _("click to display"); ?></span> |
|
42 | + <span class='tooltip' style='cursor: pointer;' onclick='alert("<?php echo str_replace('\'', '\x27', str_replace('"', '\x22', $_SESSION["user"])); ?>")'><?php echo _("click to display"); ?></span> |
|
43 | 43 | </td> |
44 | 44 | </tr> |
45 | 45 | </table> |
@@ -49,7 +49,7 @@ discard block |
||
49 | 49 | $mgmt = new \core\UserManagement(); |
50 | 50 | |
51 | 51 | if (!$user->isFederationAdmin()) { |
52 | - echo "<p>" . sprintf(_("You are not a %s manager."),$uiElements->nomenclature_fed) . "</p>"; |
|
52 | + echo "<p>" . sprintf(_("You are not a %s manager."), $uiElements->nomenclature_fed) . "</p>"; |
|
53 | 53 | echo $deco->footer(); |
54 | 54 | exit(0); |
55 | 55 | } |
@@ -198,7 +198,7 @@ discard block |
||
198 | 198 | // deployment status; need to dive into profiles for this |
199 | 199 | // show happy eyeballs if at least one profile is configured/showtime |
200 | 200 | echo "<td>"; |
201 | - echo ($idp_instance->maxProfileStatus() >= \core\IdP::PROFILES_CONFIGURED ? "C" : "" ) . " " . ($idp_instance->maxProfileStatus() >= \core\IdP::PROFILES_SHOWTIME ? "V" : "" ); |
|
201 | + echo ($idp_instance->maxProfileStatus() >= \core\IdP::PROFILES_CONFIGURED ? "C" : "") . " " . ($idp_instance->maxProfileStatus() >= \core\IdP::PROFILES_SHOWTIME ? "V" : ""); |
|
202 | 202 | echo "</td>"; |
203 | 203 | // name |
204 | 204 | echo "<td> |
@@ -237,7 +237,7 @@ discard block |
||
237 | 237 | echo "<tr> |
238 | 238 | <td colspan='2'> |
239 | 239 | <strong>" . |
240 | - sprintf(_("Pending invitations in your %s:"),$uiElements->nomenclature_fed) . " |
|
240 | + sprintf(_("Pending invitations in your %s:"), $uiElements->nomenclature_fed) . " |
|
241 | 241 | </strong> |
242 | 242 | </td> |
243 | 243 | </tr>"; |
@@ -14,6 +14,6 @@ |
||
14 | 14 | $validator = new \web\lib\common\InputValidation(); |
15 | 15 | |
16 | 16 | echo "<pre>"; |
17 | -echo "Testing ".$validator->realm(filter_input(INPUT_GET,'realm', FILTER_SANITIZE_STRING))." in ".$validator->string(filter_input(INPUT_GET, 'visited', FILTER_SANITIZE_STRING)); |
|
17 | +echo "Testing " . $validator->realm(filter_input(INPUT_GET, 'realm', FILTER_SANITIZE_STRING)) . " in " . $validator->string(filter_input(INPUT_GET, 'visited', FILTER_SANITIZE_STRING)); |
|
18 | 18 | print_r($telepath->magic()); |
19 | 19 | echo "</pre>"; |
20 | 20 | \ No newline at end of file |
@@ -53,14 +53,14 @@ |
||
53 | 53 | } |
54 | 54 | |
55 | 55 | switch ($_GET['token']) { |
56 | - case "SELF-REGISTER": |
|
57 | - $token = "SELF-REGISTER"; |
|
58 | - $checkval = \core\UserManagement::TOKENSTATUS_OK_NEW; |
|
59 | - $federation = CONFIG_CONFASSISTANT['CONSORTIUM']['selfservice_registration']; |
|
60 | - break; |
|
61 | - default: |
|
62 | - $token = $validator->token(filter_input(INPUT_GET,'token',FILTER_SANITIZE_STRING)); |
|
63 | - $checkval = $usermgmt->checkTokenValidity($token); |
|
56 | + case "SELF-REGISTER": |
|
57 | + $token = "SELF-REGISTER"; |
|
58 | + $checkval = \core\UserManagement::TOKENSTATUS_OK_NEW; |
|
59 | + $federation = CONFIG_CONFASSISTANT['CONSORTIUM']['selfservice_registration']; |
|
60 | + break; |
|
61 | + default: |
|
62 | + $token = $validator->token(filter_input(INPUT_GET,'token',FILTER_SANITIZE_STRING)); |
|
63 | + $checkval = $usermgmt->checkTokenValidity($token); |
|
64 | 64 | } |
65 | 65 | |
66 | 66 | if ($checkval < 0) { |
@@ -59,7 +59,7 @@ |
||
59 | 59 | $federation = CONFIG_CONFASSISTANT['CONSORTIUM']['selfservice_registration']; |
60 | 60 | break; |
61 | 61 | default: |
62 | - $token = $validator->token(filter_input(INPUT_GET,'token',FILTER_SANITIZE_STRING)); |
|
62 | + $token = $validator->token(filter_input(INPUT_GET, 'token', FILTER_SANITIZE_STRING)); |
|
63 | 63 | $checkval = $usermgmt->checkTokenValidity($token); |
64 | 64 | } |
65 | 65 |
@@ -10,7 +10,7 @@ discard block |
||
10 | 10 | * @author Zilvinas Vaira |
11 | 11 | * |
12 | 12 | */ |
13 | -class ValidateEmailAddress extends AbstractAjaxCommand{ |
|
13 | +class ValidateEmailAddress extends AbstractAjaxCommand { |
|
14 | 14 | |
15 | 15 | const COMMAND = 'validateemailaddress'; |
16 | 16 | const PARAM_ADDRESS = 'address'; |
@@ -20,7 +20,7 @@ discard block |
||
20 | 20 | * @param string $commandToken |
21 | 21 | * @param DefaultContext $context |
22 | 22 | */ |
23 | - public function __construct($commandToken, $context){ |
|
23 | + public function __construct($commandToken, $context) { |
|
24 | 24 | parent::__construct($commandToken, $context); |
25 | 25 | } |
26 | 26 | |
@@ -29,9 +29,9 @@ discard block |
||
29 | 29 | * {@inheritDoc} |
30 | 30 | * @see \web\lib\admin\http\AbstractCommand::execute() |
31 | 31 | */ |
32 | - public function execute(){ |
|
33 | - if(isset($_POST[self::PARAM_ADDRESS])){ |
|
34 | - $address = $this->parseString(filter_input(INPUT_POST,self::PARAM_ADDRESS, FILTER_SANITIZE_STRING)); |
|
32 | + public function execute() { |
|
33 | + if (isset($_POST[self::PARAM_ADDRESS])) { |
|
34 | + $address = $this->parseString(filter_input(INPUT_POST, self::PARAM_ADDRESS, FILTER_SANITIZE_STRING)); |
|
35 | 35 | $result = OutsideComm::mailAddressValidSecure($address); |
36 | 36 | $message = $this->chooseMessage($result, $address); |
37 | 37 | $tokenTag = new Tag('email'); |
@@ -50,7 +50,7 @@ discard block |
||
50 | 50 | * @param string $address |
51 | 51 | * @return string |
52 | 52 | */ |
53 | - private function chooseMessage($result, $address){ |
|
53 | + private function chooseMessage($result, $address) { |
|
54 | 54 | $errorMessage = sprintf(_("Email address '%s' validation failed. Sending is not possible!"), $address); |
55 | 55 | $warningMessage = sprintf(_("The invitation token is possibly going over the internet without transport encryption and can be intercepted by random third parties for email '%s'! Please consider sending the invitation token via a more secure transport!"), $address); |
56 | 56 | switch ($result) { |
@@ -84,14 +84,14 @@ |
||
84 | 84 | $langConverted[] = $hardSetLang; |
85 | 85 | } |
86 | 86 | if (!empty($_REQUEST['lang'])) { |
87 | - $recoverLang = filter_input(INPUT_GET,'lang', FILTER_SANITIZE_STRING) ?? filter_input(INPUT_POST, 'lang', FILTER_SANITIZE_STRING); |
|
87 | + $recoverLang = filter_input(INPUT_GET, 'lang', FILTER_SANITIZE_STRING) ?? filter_input(INPUT_POST, 'lang', FILTER_SANITIZE_STRING); |
|
88 | 88 | $langConverted[] = $recoverLang; |
89 | 89 | } |
90 | 90 | if (!empty($_SESSION['language'])) { |
91 | 91 | $langConverted[] = $_SESSION['language']; |
92 | 92 | } |
93 | 93 | if (!empty($_SERVER['HTTP_ACCEPT_LANGUAGE'])) { |
94 | - $langs = explode(",", filter_input(INPUT_SERVER,"HTTP_ACCEPT_LANGUAGE", FILTER_SANITIZE_STRING)); |
|
94 | + $langs = explode(",", filter_input(INPUT_SERVER, "HTTP_ACCEPT_LANGUAGE", FILTER_SANITIZE_STRING)); |
|
95 | 95 | foreach ($langs as $lang) { |
96 | 96 | $result = []; |
97 | 97 | preg_match("/(.*);+.*/", $lang, $result); |
@@ -21,7 +21,7 @@ discard block |
||
21 | 21 | |
22 | 22 | $cleanToken = FALSE; |
23 | 23 | $tokenStatus = ["status" => \core\ProfileSilverbullet::SB_TOKENSTATUS_INVALID, |
24 | - "cert_status" => [],]; |
|
24 | + "cert_status" => [], ]; |
|
25 | 25 | $profile = NULL; |
26 | 26 | $idp = NULL; |
27 | 27 | $fed = NULL; |
@@ -38,7 +38,7 @@ discard block |
||
38 | 38 | // it can be VALID (exists and not redeemed, EXPIRED, REDEEMED or INVALID (non existent) |
39 | 39 | $tokenStatus = \core\ProfileSilverbullet::tokenStatus($cleanToken); |
40 | 40 | } |
41 | -} elseif (isset($_SERVER['SSL_CLIENT_SAN_Email']) || isset($_SERVER['SSL_CLIENT_SAN_Email_0']) ) { |
|
41 | +} elseif (isset($_SERVER['SSL_CLIENT_SAN_Email']) || isset($_SERVER['SSL_CLIENT_SAN_Email_0'])) { |
|
42 | 42 | // maybe the user authenticated with his client cert? Then pick any of his |
43 | 43 | // tokens to go on |
44 | 44 | $certname = $_SERVER['SSL_CLIENT_SAN_Email'] ?? $_SERVER['SSL_CLIENT_SAN_Email_0']; |
@@ -63,7 +63,7 @@ discard block |
||
63 | 63 | $this->entityOptionTable = "institution_option"; |
64 | 64 | $this->entityIdColumn = "institution_id"; |
65 | 65 | if (!is_numeric($instId)) { |
66 | - throw new Exception("An ".CONFIG_CONFASSISTANT['CONSORTIUM']['nomenclature_inst']." is identified by an integer index!"); |
|
66 | + throw new Exception("An " . CONFIG_CONFASSISTANT['CONSORTIUM']['nomenclature_inst'] . " is identified by an integer index!"); |
|
67 | 67 | } |
68 | 68 | $this->identifier = (int) $instId; |
69 | 69 | |
@@ -317,7 +317,7 @@ discard block |
||
317 | 317 | $alreadyUsed = $this->databaseHandle->exec("SELECT DISTINCT external_db_id FROM institution WHERE external_db_id = ? AND external_db_syncstate = ?", "si", $identifier, $syncState); |
318 | 318 | |
319 | 319 | if (mysqli_num_rows($alreadyUsed) == 0) { |
320 | - $this->databaseHandle->exec("UPDATE institution SET external_db_id = ?, external_db_syncstate = ? WHERE inst_id = ?", "sii", $identifier, $syncState, $this->identifier ); |
|
320 | + $this->databaseHandle->exec("UPDATE institution SET external_db_id = ?, external_db_syncstate = ? WHERE inst_id = ?", "sii", $identifier, $syncState, $this->identifier); |
|
321 | 321 | } |
322 | 322 | } |
323 | 323 | } |
@@ -94,7 +94,7 @@ discard block |
||
94 | 94 | } |
95 | 95 | $prepResult = $statementObject->prepare($querystring); |
96 | 96 | if ($prepResult === FALSE) { |
97 | - throw new Exception("DB: Unable to prepare statement! Statement was --> $querystring <--, error was --> ". $statementObject->error ." <--."); |
|
97 | + throw new Exception("DB: Unable to prepare statement! Statement was --> $querystring <--, error was --> " . $statementObject->error . " <--."); |
|
98 | 98 | } |
99 | 99 | |
100 | 100 | // we have a variable number of arguments packed into the ... array |
@@ -106,11 +106,11 @@ discard block |
||
106 | 106 | array_unshift($localArray, $types); |
107 | 107 | $retval = call_user_func_array([$statementObject, "bind_param"], $localArray); |
108 | 108 | if ($retval === FALSE) { |
109 | - throw new Exception("DB: Unuable to bind parameters to prepared statement! Argument array was --> ". var_export($localArray, TRUE) ." <--. Error was --> ". $statementObject->error ." <--"); |
|
109 | + throw new Exception("DB: Unuable to bind parameters to prepared statement! Argument array was --> " . var_export($localArray, TRUE) . " <--. Error was --> " . $statementObject->error . " <--"); |
|
110 | 110 | } |
111 | 111 | $result = $statementObject->execute(); |
112 | 112 | if ($result === FALSE) { |
113 | - throw new Exception("DB: Unuable to execute prepared statement! Error was --> ". $statementObject->error ." <--"); |
|
113 | + throw new Exception("DB: Unuable to execute prepared statement! Error was --> " . $statementObject->error . " <--"); |
|
114 | 114 | } |
115 | 115 | $selectResult = $statementObject->get_result(); |
116 | 116 | if ($selectResult !== FALSE) { |
@@ -5,7 +5,7 @@ discard block |
||
5 | 5 | use web\lib\admin\http\DefaultContext; |
6 | 6 | use web\lib\admin\http\ValidateEmailAddress; |
7 | 7 | |
8 | -class ValidateEmailAddressTest extends PHPUnit_Framework_TestCase{ |
|
8 | +class ValidateEmailAddressTest extends PHPUnit_Framework_TestCase { |
|
9 | 9 | |
10 | 10 | /** |
11 | 11 | * |
@@ -24,7 +24,7 @@ discard block |
||
24 | 24 | $this->command = new ValidateEmailAddress(ValidateEmailAddress::COMMAND, new DefaultContext($this->page)); |
25 | 25 | } |
26 | 26 | |
27 | - public function testExecute(){ |
|
27 | + public function testExecute() { |
|
28 | 28 | |
29 | 29 | $this->command->execute(); |
30 | 30 | $response = $this->page->getResponse(); |
@@ -36,7 +36,7 @@ discard block |
||
36 | 36 | |
37 | 37 | $this->command->execute(); |
38 | 38 | $renderedResponse = $response->__toString(); |
39 | - $this->assertTrue(strpos($renderedResponse, '<email')!==false); |
|
39 | + $this->assertTrue(strpos($renderedResponse, '<email') !== false); |
|
40 | 40 | // Is not going to work since the $_POST variables can't be modified at runtime for filter_input function |
41 | 41 | //$this->assertTrue(strpos($renderedResponse, 'address="'.$_POST[ValidateEmailAddress::PARAM_ADDRESS].'"')!==false); |
42 | 42 | $this->assertFalse(strpos($renderedResponse, 'isValid="true"')); |