@@ -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 |
@@ -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 |
@@ -176,7 +176,7 @@ discard block |
||
176 | 176 | if (isset($deviceProperties['options']['hidden']) && $deviceProperties['options']['hidden'] && $showHidden == 0) { |
177 | 177 | continue; |
178 | 178 | } |
179 | - $count ++; |
|
179 | + $count++; |
|
180 | 180 | |
181 | 181 | $deviceProperties['device'] = $device; |
182 | 182 | |
@@ -563,7 +563,7 @@ discard block |
||
563 | 563 | } |
564 | 564 | |
565 | 565 | |
566 | - public function sendLogo($identifier, $type, $width = 0, $height = 0){ |
|
566 | + public function sendLogo($identifier, $type, $width = 0, $height = 0) { |
|
567 | 567 | if ($type === "federation") { |
568 | 568 | $logo = $this->getFedLogo($identifier, $width, $height); |
569 | 569 | } |
@@ -581,7 +581,7 @@ discard block |
||
581 | 581 | return ['status' => 'error', 'error' => 'Function for GEOIPv1 called, but config says this is not the version to use!']; |
582 | 582 | } |
583 | 583 | //$host = $_SERVER['REMOTE_ADDR']; |
584 | - $host = input_filter(INPUT_SERVER,'REMOTE_ADDR',FILTER_VALIDATE_IP); |
|
584 | + $host = input_filter(INPUT_SERVER, 'REMOTE_ADDR', FILTER_VALIDATE_IP); |
|
585 | 585 | $record = geoip_record_by_name($host); |
586 | 586 | if ($record === FALSE) { |
587 | 587 | return ['status' => 'error', 'error' => 'Problem listing countries']; |
@@ -743,12 +743,12 @@ discard block |
||
743 | 743 | $this->loggerInstance->debug(4, "Browser_id: $dev_id\n"); |
744 | 744 | return(['device' => $dev_id, 'display' => $device['display'], 'group' => $device['group']]); |
745 | 745 | } else { |
746 | - $this->loggerInstance->debug(2, "Unrecognised system: " . filter_input(INPUT_SERVER,'HTTP_USER_AGENT', FILTER_SANITIZE_STRING) . "\n"); |
|
746 | + $this->loggerInstance->debug(2, "Unrecognised system: " . filter_input(INPUT_SERVER, 'HTTP_USER_AGENT', FILTER_SANITIZE_STRING) . "\n"); |
|
747 | 747 | return(false); |
748 | 748 | } |
749 | 749 | } |
750 | 750 | } |
751 | - $this->loggerInstance->debug(2, "Unrecognised system: " . filter_input(INPUT_SERVER,'HTTP_USER_AGENT', FILTER_SANITIZE_STRING) . "\n"); |
|
751 | + $this->loggerInstance->debug(2, "Unrecognised system: " . filter_input(INPUT_SERVER, 'HTTP_USER_AGENT', FILTER_SANITIZE_STRING) . "\n"); |
|
752 | 752 | return(false); |
753 | 753 | } |
754 | 754 |
@@ -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) { |
@@ -23,7 +23,7 @@ discard block |
||
23 | 23 | * @param string $commandToken |
24 | 24 | * @param SilverbulletContext $context |
25 | 25 | */ |
26 | - public function __construct($commandToken, $context){ |
|
26 | + public function __construct($commandToken, $context) { |
|
27 | 27 | parent::__construct($commandToken, $context); |
28 | 28 | $this->context = $context; |
29 | 29 | } |
@@ -33,15 +33,15 @@ discard block |
||
33 | 33 | * {@inheritDoc} |
34 | 34 | * @see \web\lib\admin\http\AbstractCommand::execute() |
35 | 35 | */ |
36 | - public function execute(){ |
|
37 | - if(isset($_POST[self::PARAM_NAME]) && isset($_POST[self::PARAM_EXPIRY])){ |
|
36 | + public function execute() { |
|
37 | + if (isset($_POST[self::PARAM_NAME]) && isset($_POST[self::PARAM_EXPIRY])) { |
|
38 | 38 | $name = $this->parseString(filter_input(INPUT_POST, self::PARAM_NAME, FILTER_SANITIZE_STRING)); |
39 | 39 | $expiry = $this->parseString($_POST[self::PARAM_EXPIRY]); |
40 | 40 | $user = $this->context->createUser($name, $expiry, $this); |
41 | - if(!empty($user->getIdentifier())){ |
|
41 | + if (!empty($user->getIdentifier())) { |
|
42 | 42 | $this->storeInfoMessage(_('User was added successfully!')); |
43 | 43 | } |
44 | - }else{ |
|
44 | + } else { |
|
45 | 45 | $this->storeErrorMessage(_('User name or expiry parameters are missing!')); |
46 | 46 | } |
47 | 47 | } |
@@ -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 | } |
@@ -292,7 +292,7 @@ discard block |
||
292 | 292 | $certificatesResult = $this->databaseHandle->exec("SELECT * FROM `silverbullet_certificate` WHERE `silverbullet_invitation_id`=? ORDER BY `revocation_status`, `expiry` DESC", "i", $invitationId); |
293 | 293 | if (!$certificatesResult || $certificatesResult->num_rows < $invitationRow->quantity) { |
294 | 294 | $invitationProfile = $invitationRow->profile_id; |
295 | - $invitationSbId = $invitationRow->silverbullet_user_id; |
|
295 | + $invitationSbId = $invitationRow->silverbullet_user_id; |
|
296 | 296 | $newCertificateResult = $this->databaseHandle->exec("INSERT INTO `silverbullet_certificate` (`profile_id`, `silverbullet_user_id`, `silverbullet_invitation_id`, `serial_number`, `cn` ,`expiry`) VALUES (?, ?, ?, ?, ?, ?)", "iiisss", $invitationProfile, $invitationSbId, $invitationId, $serial, $username, $realExpiryDate); |
297 | 297 | if ($newCertificateResult === true) { |
298 | 298 | $certificateId = $this->databaseHandle->lastID(); |
@@ -479,7 +479,7 @@ discard block |
||
479 | 479 | if (!$invitationsResult || $invitationsResult->num_rows == 0) { |
480 | 480 | $loggerInstance->debug(2, "Token $tokenvalue not found in database or database query error!\n"); |
481 | 481 | return ["status" => self::SB_TOKENSTATUS_INVALID, |
482 | - "cert_status" => [],]; |
|
482 | + "cert_status" => [], ]; |
|
483 | 483 | } |
484 | 484 | // if not returned, we found the token in the DB |
485 | 485 | $invitationRow = mysqli_fetch_object($invitationsResult); |