@@ -128,7 +128,7 @@ discard block |
||
128 | 128 | $find = array_keys($displayNames, $input, TRUE); |
129 | 129 | |
130 | 130 | if (count($find) == 0) { // this is an error! throw an Exception |
131 | - throw new \Exception("The translation of an option name was requested, but the option is not known to the system: " . htmlentities($input)); |
|
131 | + throw new \Exception("The translation of an option name was requested, but the option is not known to the system: ".htmlentities($input)); |
|
132 | 132 | } |
133 | 133 | \core\common\Entity::outOfThePotatoes(); |
134 | 134 | return $find[0]; |
@@ -149,7 +149,7 @@ discard block |
||
149 | 149 | |
150 | 150 | foreach ($optionlist as $option) { |
151 | 151 | $type = $optioninfo->optionType($option['name']); |
152 | - if (preg_match('/^' . $class . '/', $option['name']) && $option['level'] == "$level") { |
|
152 | + if (preg_match('/^'.$class.'/', $option['name']) && $option['level'] == "$level") { |
|
153 | 153 | // all non-multilang attribs get this assignment ... |
154 | 154 | $language = ""; |
155 | 155 | $content = $option['value']; |
@@ -167,19 +167,19 @@ discard block |
||
167 | 167 | $locationMarkers[] = $coords; |
168 | 168 | break; |
169 | 169 | case "file": |
170 | - $retval .= "<tr><td>" . $this->displayName($option['name']) . "</td><td>$language</td><td>"; |
|
170 | + $retval .= "<tr><td>".$this->displayName($option['name'])."</td><td>$language</td><td>"; |
|
171 | 171 | switch ($option['name']) { |
172 | 172 | case "general:logo_file": |
173 | 173 | case "fed:logo_file": |
174 | - $retval .= $this->previewImageinHTML('ROWID-' . $option['level'] . '-' . $option['row']); |
|
174 | + $retval .= $this->previewImageinHTML('ROWID-'.$option['level'].'-'.$option['row']); |
|
175 | 175 | break; |
176 | 176 | case "eap:ca_file": |
177 | 177 | // fall-through intended: display both the same way |
178 | 178 | case "fed:minted_ca_file": |
179 | - $retval .= $this->previewCAinHTML('ROWID-' . $option['level'] . '-' . $option['row']); |
|
179 | + $retval .= $this->previewCAinHTML('ROWID-'.$option['level'].'-'.$option['row']); |
|
180 | 180 | break; |
181 | 181 | case "support:info_file": |
182 | - $retval .= $this->previewInfoFileinHTML('ROWID-' . $option['level'] . '-' . $option['row']); |
|
182 | + $retval .= $this->previewInfoFileinHTML('ROWID-'.$option['level'].'-'.$option['row']); |
|
183 | 183 | break; |
184 | 184 | default: |
185 | 185 | } |
@@ -189,10 +189,10 @@ discard block |
||
189 | 189 | // do not display the option at all; it gets auto-set by the ProfileSilverbullet constructor and doesn't have to be seen |
190 | 190 | break; |
191 | 191 | } |
192 | - $retval .= "<tr><td>" . $this->displayName($option['name']) . "</td><td>$language</td><td><strong>" . ($content == "on" ? _("on") : _("off") ) . "</strong></td></tr>"; |
|
192 | + $retval .= "<tr><td>".$this->displayName($option['name'])."</td><td>$language</td><td><strong>".($content == "on" ? _("on") : _("off"))."</strong></td></tr>"; |
|
193 | 193 | break; |
194 | 194 | default: |
195 | - $retval .= "<tr><td>" . $this->displayName($option['name']) . "</td><td>$language</td><td><strong>$content</strong></td></tr>"; |
|
195 | + $retval .= "<tr><td>".$this->displayName($option['name'])."</td><td>$language</td><td><strong>$content</strong></td></tr>"; |
|
196 | 196 | } |
197 | 197 | } |
198 | 198 | } |
@@ -201,11 +201,11 @@ discard block |
||
201 | 201 | $locationCount = 0; |
202 | 202 | foreach ($locationMarkers as $g) { |
203 | 203 | $locationCount++; |
204 | - $marker .= '<marker name="' . $locationCount . '" lat="' . $g['lat'] . '" lng="' . $g['lon'] . '" />'; |
|
204 | + $marker .= '<marker name="'.$locationCount.'" lat="'.$g['lat'].'" lng="'.$g['lon'].'" />'; |
|
205 | 205 | } |
206 | 206 | $marker .= '<\/markers>'; // some validator says this should be escaped |
207 | 207 | $jMarker = json_encode($locationMarkers); |
208 | - $retval .= '<tr><td><script>markers=\'' . $marker . '\'; jmarkers = \'' . $jMarker . '\';</script></td><td></td><td></td></tr>'; |
|
208 | + $retval .= '<tr><td><script>markers=\''.$marker.'\'; jmarkers = \''.$jMarker.'\';</script></td><td></td><td></td></tr>'; |
|
209 | 209 | } |
210 | 210 | \core\common\Entity::outOfThePotatoes(); |
211 | 211 | return $retval; |
@@ -221,11 +221,11 @@ discard block |
||
221 | 221 | \core\common\Entity::intoThePotatoes(); |
222 | 222 | $idpoptions = $myInst->getAttributes(); |
223 | 223 | $retval = "<div class='infobox'> |
224 | - <h2>" . sprintf(_("General %s details"), $this->nomenclatureInst) . "</h2> |
|
224 | + <h2>" . sprintf(_("General %s details"), $this->nomenclatureInst)."</h2> |
|
225 | 225 | <table> |
226 | 226 | <tr> |
227 | 227 | <td> |
228 | - " . _("Country:") . " |
|
228 | + " . _("Country:")." |
|
229 | 229 | </td> |
230 | 230 | <td> |
231 | 231 | </td> |
@@ -235,16 +235,16 @@ discard block |
||
235 | 235 | $retval .= $myFed->name; |
236 | 236 | $retval .= "</strong> |
237 | 237 | </td> |
238 | - </tr>" . $this->infoblock($idpoptions, "general", "IdP") . " |
|
238 | + </tr>" . $this->infoblock($idpoptions, "general", "IdP")." |
|
239 | 239 | </table> |
240 | 240 | </div>"; |
241 | 241 | |
242 | 242 | $blocks = [["support", _("Global Helpdesk Details")], ["media", _("Media Properties")]]; |
243 | 243 | foreach ($blocks as $block) { |
244 | 244 | $retval .= "<div class='infobox'> |
245 | - <h2>" . $block[1] . "</h2> |
|
245 | + <h2>" . $block[1]."</h2> |
|
246 | 246 | <table>" . |
247 | - $this->infoblock($idpoptions, $block[0], "IdP") . |
|
247 | + $this->infoblock($idpoptions, $block[0], "IdP"). |
|
248 | 248 | "</table> |
249 | 249 | </div>"; |
250 | 250 | } |
@@ -259,12 +259,12 @@ discard block |
||
259 | 259 | */ |
260 | 260 | private function displaySize(int $number) { |
261 | 261 | if ($number > 1024 * 1024) { |
262 | - return round($number / 1024 / 1024, 2) . " MiB"; |
|
262 | + return round($number / 1024 / 1024, 2)." MiB"; |
|
263 | 263 | } |
264 | 264 | if ($number > 1024) { |
265 | - return round($number / 1024, 2) . " KiB"; |
|
265 | + return round($number / 1024, 2)." KiB"; |
|
266 | 266 | } |
267 | - return $number . " B"; |
|
267 | + return $number." B"; |
|
268 | 268 | } |
269 | 269 | |
270 | 270 | /** |
@@ -336,7 +336,7 @@ discard block |
||
336 | 336 | $this->checkROWIDpresence($cAReference); |
337 | 337 | $rawResult = UIElements::getBlobFromDB($cAReference, FALSE); |
338 | 338 | if (is_bool($rawResult)) { // we didn't actually get a CA! |
339 | - $retval = "<div class='ca-summary'>" . _("There was an error while retrieving the certificate from the database!") . "</div>"; |
|
339 | + $retval = "<div class='ca-summary'>"._("There was an error while retrieving the certificate from the database!")."</div>"; |
|
340 | 340 | \core\common\Entity::outOfThePotatoes(); |
341 | 341 | return $retval; |
342 | 342 | } |
@@ -352,13 +352,13 @@ discard block |
||
352 | 352 | |
353 | 353 | $details['name'] = preg_replace('/(.)\/(.)/', "$1<br/>$2", $details['name']); |
354 | 354 | $details['name'] = preg_replace('/\//', "", $details['name']); |
355 | - $certstatus = ( $details['root'] == 1 ? "R" : "I"); |
|
355 | + $certstatus = ($details['root'] == 1 ? "R" : "I"); |
|
356 | 356 | if ($details['ca'] == 0 && $details['root'] != 1) { |
357 | - $retval = "<div class='ca-summary' style='background-color:red'><div style='position:absolute; right: 0px; width:20px; height:20px; background-color:maroon; border-radius:10px; text-align: center;'><div style='padding-top:3px; font-weight:bold; color:#ffffff;'>S</div></div>" . _("This is a <strong>SERVER</strong> certificate!") . "<br/>" . $details['name'] . "</div>"; |
|
357 | + $retval = "<div class='ca-summary' style='background-color:red'><div style='position:absolute; right: 0px; width:20px; height:20px; background-color:maroon; border-radius:10px; text-align: center;'><div style='padding-top:3px; font-weight:bold; color:#ffffff;'>S</div></div>"._("This is a <strong>SERVER</strong> certificate!")."<br/>".$details['name']."</div>"; |
|
358 | 358 | \core\common\Entity::outOfThePotatoes(); |
359 | 359 | return $retval; |
360 | 360 | } |
361 | - $retval = "<div class='ca-summary' ><div style='position:absolute; right: 0px; width:20px; height:20px; background-color:#0000ff; border-radius:10px; text-align: center;'><div style='padding-top:3px; font-weight:bold; color:#ffffff;'>$certstatus</div></div>" . $details['name'] . "</div>"; |
|
361 | + $retval = "<div class='ca-summary' ><div style='position:absolute; right: 0px; width:20px; height:20px; background-color:#0000ff; border-radius:10px; text-align: center;'><div style='padding-top:3px; font-weight:bold; color:#ffffff;'>$certstatus</div></div>".$details['name']."</div>"; |
|
362 | 362 | \core\common\Entity::outOfThePotatoes(); |
363 | 363 | return $retval; |
364 | 364 | } |
@@ -372,7 +372,7 @@ discard block |
||
372 | 372 | public function previewImageinHTML($imageReference) { |
373 | 373 | \core\common\Entity::intoThePotatoes(); |
374 | 374 | $this->checkROWIDpresence($imageReference); |
375 | - $retval = "<img style='max-width:150px' src='inc/filepreview.php?id=" . $imageReference . "' alt='" . _("Preview of logo file") . "'/>"; |
|
375 | + $retval = "<img style='max-width:150px' src='inc/filepreview.php?id=".$imageReference."' alt='"._("Preview of logo file")."'/>"; |
|
376 | 376 | \core\common\Entity::outOfThePotatoes(); |
377 | 377 | return $retval; |
378 | 378 | } |
@@ -388,13 +388,13 @@ discard block |
||
388 | 388 | $this->checkROWIDpresence($fileReference); |
389 | 389 | $fileBlob = UIElements::getBlobFromDB($fileReference, FALSE); |
390 | 390 | if (is_bool($fileBlob)) { // we didn't actually get a file! |
391 | - $retval = "<div class='ca-summary'>" . _("There was an error while retrieving the file from the database!") . "</div>"; |
|
391 | + $retval = "<div class='ca-summary'>"._("There was an error while retrieving the file from the database!")."</div>"; |
|
392 | 392 | \core\common\Entity::outOfThePotatoes(); |
393 | 393 | return $retval; |
394 | 394 | } |
395 | 395 | $decodedFileBlob = base64_decode($fileBlob); |
396 | 396 | $fileinfo = new \finfo(); |
397 | - $retval = "<div class='ca-summary'>" . _("File exists") . " (" . $fileinfo->buffer($decodedFileBlob, FILEINFO_MIME_TYPE) . ", " . $this->displaySize(strlen($decodedFileBlob)) . ")<br/><a href='inc/filepreview.php?id=$fileReference'>" . _("Preview") . "</a></div>"; |
|
397 | + $retval = "<div class='ca-summary'>"._("File exists")." (".$fileinfo->buffer($decodedFileBlob, FILEINFO_MIME_TYPE).", ".$this->displaySize(strlen($decodedFileBlob)).")<br/><a href='inc/filepreview.php?id=$fileReference'>"._("Preview")."</a></div>"; |
|
398 | 398 | \core\common\Entity::outOfThePotatoes(); |
399 | 399 | return $retval; |
400 | 400 | } |
@@ -422,7 +422,7 @@ discard block |
||
422 | 422 | $retval .= "<tr><td>"; |
423 | 423 | } |
424 | 424 | $finalCaption = ($caption !== NULL ? $caption : $uiMessages[$level]['text']); |
425 | - $retval .= "<img class='icon' src='" . $uiMessages[$level]['icon'] . "' alt='" . $finalCaption . "' title='" . $finalCaption . "'/>"; |
|
425 | + $retval .= "<img class='icon' src='".$uiMessages[$level]['icon']."' alt='".$finalCaption."' title='".$finalCaption."'/>"; |
|
426 | 426 | if (!$omittabletags) { |
427 | 427 | $retval .= "</td><td>"; |
428 | 428 | } |
@@ -502,8 +502,8 @@ discard block |
||
502 | 502 | return ""; |
503 | 503 | } |
504 | 504 | |
505 | - $loggerInstance->debug(4, "Consortium logo is at: " . ROOT . "/web/resources/images/consortium_logo_large.png"); |
|
506 | - $logogd = imagecreatefrompng(ROOT . "/web/resources/images/consortium_logo_large.png"); |
|
505 | + $loggerInstance->debug(4, "Consortium logo is at: ".ROOT."/web/resources/images/consortium_logo_large.png"); |
|
506 | + $logogd = imagecreatefrompng(ROOT."/web/resources/images/consortium_logo_large.png"); |
|
507 | 507 | |
508 | 508 | $sizeinput = [imagesx($inputgd), imagesy($inputgd)]; |
509 | 509 | $sizelogo = [imagesx($logogd), imagesy($logogd)]; |
@@ -516,8 +516,8 @@ discard block |
||
516 | 516 | $scale = sqrt($maxoccupy / $totallogopixels); |
517 | 517 | $loggerInstance->debug(4, "Scaling info: $scale, $maxoccupy, $totallogopixels\n"); |
518 | 518 | // determine final pixel size - round to multitude of $symbolsize to match exact symbol boundary |
519 | - $targetwidth = (int)($symbolsize * round($sizelogo[0] * $scale / $symbolsize)); |
|
520 | - $targetheight = (int)($symbolsize * round($sizelogo[1] * $scale / $symbolsize)); |
|
519 | + $targetwidth = (int) ($symbolsize * round($sizelogo[0] * $scale / $symbolsize)); |
|
520 | + $targetheight = (int) ($symbolsize * round($sizelogo[1] * $scale / $symbolsize)); |
|
521 | 521 | // paint white below the logo, in case it has transparencies (looks bad) |
522 | 522 | // have one symbol in each direction extra white space |
523 | 523 | $whiteimage = imagecreate($targetwidth + 2 * $symbolsize, $targetheight + 2 * $symbolsize); |
@@ -526,8 +526,8 @@ discard block |
||
526 | 526 | } |
527 | 527 | imagecolorallocate($whiteimage, 255, 255, 255); |
528 | 528 | // also make sure the initial placement is a multitude of 12; otherwise "two half" symbols might be affected |
529 | - $targetplacementx = (int)($symbolsize * round(($sizeinput[0] / 2 - ($targetwidth - $symbolsize) / 2) / $symbolsize)); |
|
530 | - $targetplacementy = (int)($symbolsize * round(($sizeinput[1] / 2 - ($targetheight - $symbolsize) / 2) / $symbolsize)); |
|
529 | + $targetplacementx = (int) ($symbolsize * round(($sizeinput[0] / 2 - ($targetwidth - $symbolsize) / 2) / $symbolsize)); |
|
530 | + $targetplacementy = (int) ($symbolsize * round(($sizeinput[1] / 2 - ($targetheight - $symbolsize) / 2) / $symbolsize)); |
|
531 | 531 | imagecopyresized($inputgd, $whiteimage, $targetplacementx - $symbolsize, $targetplacementy - $symbolsize, 0, 0, $targetwidth + 2 * $symbolsize, $targetheight + 2 * $symbolsize, $targetwidth + 2 * $symbolsize, $targetheight + 2 * $symbolsize); |
532 | 532 | imagecopyresized($inputgd, $logogd, $targetplacementx, $targetplacementy, 0, 0, $targetwidth, $targetheight, $sizelogo[0], $sizelogo[1]); |
533 | 533 | ob_start(); |
@@ -19,7 +19,7 @@ discard block |
||
19 | 19 | * <base_url>/copyright.php after deploying the software |
20 | 20 | */ |
21 | 21 | |
22 | -require_once dirname(dirname(dirname(__FILE__))) . "/config/_config.php"; |
|
22 | +require_once dirname(dirname(dirname(__FILE__)))."/config/_config.php"; |
|
23 | 23 | |
24 | 24 | $auth = new \web\lib\admin\Authentication(); |
25 | 25 | $loggerInstance = new \core\common\Logging(); |
@@ -34,7 +34,7 @@ discard block |
||
34 | 34 | $instId = $my_inst->identifier; |
35 | 35 | // delete the IdP and send user to enrollment |
36 | 36 | $my_inst->destroy(); |
37 | - $loggerInstance->writeAudit($_SESSION['user'], "DEL", "IdP " . $instId); |
|
37 | + $loggerInstance->writeAudit($_SESSION['user'], "DEL", "IdP ".$instId); |
|
38 | 38 | header("Location: overview_user.php"); |
39 | 39 | exit; |
40 | 40 | } |
@@ -50,7 +50,7 @@ discard block |
||
50 | 50 | } |
51 | 51 | // flush all IdP attributes and send user to creation wizard |
52 | 52 | $my_inst->flushAttributes(); |
53 | - $loggerInstance->writeAudit($_SESSION['user'], "DEL", "IdP starting over" . $instId); |
|
53 | + $loggerInstance->writeAudit($_SESSION['user'], "DEL", "IdP starting over".$instId); |
|
54 | 54 | header("Location: edit_idp.php?inst_id=$instId&wizard=true"); |
55 | 55 | exit; |
56 | 56 | } |
@@ -72,21 +72,21 @@ discard block |
||
72 | 72 | } |
73 | 73 | |
74 | 74 | $inst_name = $my_inst->name; |
75 | -echo "<h1>" . sprintf(_("Submitted attributes for IdP '%s'"), $inst_name) . "</h1>"; |
|
75 | +echo "<h1>".sprintf(_("Submitted attributes for IdP '%s'"), $inst_name)."</h1>"; |
|
76 | 76 | echo "<table>"; |
77 | 77 | echo $optionParser->processSubmittedFields($my_inst, $_POST, $_FILES); |
78 | 78 | echo "</table>"; |
79 | 79 | |
80 | 80 | // delete cached logo, if present |
81 | -$dir = ROOT . '/web/downloads/logos/'; |
|
82 | -$globResult = glob($dir . $my_inst->identifier . "_*.png"); |
|
81 | +$dir = ROOT.'/web/downloads/logos/'; |
|
82 | +$globResult = glob($dir.$my_inst->identifier."_*.png"); |
|
83 | 83 | if ($globResult === FALSE) { // we should catch the improbable error condition |
84 | 84 | $globResult = []; |
85 | 85 | } |
86 | 86 | array_map('unlink', $globResult); |
87 | 87 | $loggerInstance->debug(4, "UNLINK from $dir\n"); |
88 | 88 | |
89 | -$loggerInstance->writeAudit($_SESSION['user'], "MOD", "IdP " . $my_inst->identifier . " - attributes changed"); |
|
89 | +$loggerInstance->writeAudit($_SESSION['user'], "MOD", "IdP ".$my_inst->identifier." - attributes changed"); |
|
90 | 90 | |
91 | 91 | // re-instantiate ourselves... profiles need fresh data |
92 | 92 | |
@@ -98,15 +98,15 @@ discard block |
||
98 | 98 | |
99 | 99 | if (isset(CONFIG_CONFASSISTANT['CONSORTIUM']['ssid']) && count(CONFIG_CONFASSISTANT['CONSORTIUM']['ssid']) > 0) { |
100 | 100 | foreach (CONFIG_CONFASSISTANT['CONSORTIUM']['ssid'] as $ssidname) { |
101 | - $ssids[] = $ssidname . " " . (isset(CONFIG_CONFASSISTANT['CONSORTIUM']['tkipsupport']) && CONFIG_CONFASSISTANT['CONSORTIUM']['tkipsupport'] === TRUE ? _("(WPA2/AES and WPA/TKIP)") : _("(WPA2/AES)") ); |
|
101 | + $ssids[] = $ssidname." ".(isset(CONFIG_CONFASSISTANT['CONSORTIUM']['tkipsupport']) && CONFIG_CONFASSISTANT['CONSORTIUM']['tkipsupport'] === TRUE ? _("(WPA2/AES and WPA/TKIP)") : _("(WPA2/AES)")); |
|
102 | 102 | } |
103 | 103 | } |
104 | 104 | |
105 | 105 | foreach ($my_inst->getAttributes("media:SSID_with_legacy") as $ssidname) { |
106 | - $ssids[] = $ssidname['value'] . " " . _("(WPA2/AES and WPA/TKIP)"); |
|
106 | + $ssids[] = $ssidname['value']." "._("(WPA2/AES and WPA/TKIP)"); |
|
107 | 107 | } |
108 | 108 | foreach ($my_inst->getAttributes("media:SSID") as $ssidname) { |
109 | - $ssids[] = $ssidname['value'] . " " . _("(WPA2/AES)"); |
|
109 | + $ssids[] = $ssidname['value']." "._("(WPA2/AES)"); |
|
110 | 110 | } |
111 | 111 | |
112 | 112 | echo "<table>"; |
@@ -114,7 +114,7 @@ discard block |
||
114 | 114 | if (count($ssids) > 0) { |
115 | 115 | $printedlist = ""; |
116 | 116 | foreach ($ssids as $names) { |
117 | - $printedlist = $printedlist . "$names "; |
|
117 | + $printedlist = $printedlist."$names "; |
|
118 | 118 | } |
119 | 119 | echo $uiElements->boxOkay(sprintf(_("Your installers will configure the following SSIDs: <strong>%s</strong>"), $printedlist), _("SSIDs configured")); |
120 | 120 | } |
@@ -142,7 +142,7 @@ discard block |
||
142 | 142 | // did we get an email address? then, show the silverbullet jumpstart button |
143 | 143 | // otherwise, issue a smartass comment |
144 | 144 | if (count($my_inst->getAttributes("support:email")) > 0) { |
145 | - echo "<form method='post' action='edit_silverbullet.php?inst_id=$my_inst->identifier' accept-charset='UTF-8'><button type='submit'>" . sprintf(_("Continue to %s properties"), \core\ProfileSilverbullet::PRODUCTNAME) . "</button></form>"; |
|
145 | + echo "<form method='post' action='edit_silverbullet.php?inst_id=$my_inst->identifier' accept-charset='UTF-8'><button type='submit'>".sprintf(_("Continue to %s properties"), \core\ProfileSilverbullet::PRODUCTNAME)."</button></form>"; |
|
146 | 146 | } else { |
147 | 147 | echo "<table>"; |
148 | 148 | echo $uiElements->boxError(sprintf(_("You did not submit an e-mail address. This is required for %s. Please go to the %s dashboard and edit your helpdesk settings to include a helpdesk e-mail address."), core\ProfileSilverbullet::PRODUCTNAME, $ui->nomenclatureInst), _("No support e-mail!")); |
@@ -150,9 +150,9 @@ discard block |
||
150 | 150 | } |
151 | 151 | } |
152 | 152 | if (CONFIG['FUNCTIONALITY_LOCATIONS']['CONFASSISTANT_RADIUS'] == "LOCAL") { |
153 | - echo "<br/><form method='post' action='edit_profile.php?inst_id=$my_inst->identifier' accept-charset='UTF-8'><button type='submit'>" . _("Continue to RADIUS/EAP profile definition") . "</button></form>"; |
|
153 | + echo "<br/><form method='post' action='edit_profile.php?inst_id=$my_inst->identifier' accept-charset='UTF-8'><button type='submit'>"._("Continue to RADIUS/EAP profile definition")."</button></form>"; |
|
154 | 154 | } |
155 | 155 | } |
156 | -echo "<br/><form method='post' action='overview_idp.php?inst_id=$my_inst->identifier' accept-charset='UTF-8'><button type='submit'>" . _("Continue to dashboard") . "</button></form>"; |
|
156 | +echo "<br/><form method='post' action='overview_idp.php?inst_id=$my_inst->identifier' accept-charset='UTF-8'><button type='submit'>"._("Continue to dashboard")."</button></form>"; |
|
157 | 157 | |
158 | 158 | echo $deco->footer(); |
@@ -154,8 +154,8 @@ discard block |
||
154 | 154 | common\Entity::intoThePotatoes(); |
155 | 155 | $mail = \core\common\OutsideComm::mailHandle(); |
156 | 156 | // who to whom? |
157 | - $mail->FromName = CONFIG['APPEARANCE']['productname'] . " Notification System"; |
|
158 | - $mail->addReplyTo(CONFIG['APPEARANCE']['support-contact']['developer-mail'], CONFIG['APPEARANCE']['productname'] . " " . _("Feedback")); |
|
157 | + $mail->FromName = CONFIG['APPEARANCE']['productname']." Notification System"; |
|
158 | + $mail->addReplyTo(CONFIG['APPEARANCE']['support-contact']['developer-mail'], CONFIG['APPEARANCE']['productname']." "._("Feedback")); |
|
159 | 159 | $mail->addAddress($mailaddr[0]["value"]); |
160 | 160 | // what do we want to say? |
161 | 161 | $mail->Subject = $subject; |
@@ -217,7 +217,7 @@ discard block |
||
217 | 217 | } |
218 | 218 | $lookFor .= "$name"; |
219 | 219 | } |
220 | - $finding = preg_match("/^(" . $lookFor . "):(.*)/", $oneRow->user_id, $matches); |
|
220 | + $finding = preg_match("/^(".$lookFor."):(.*)/", $oneRow->user_id, $matches); |
|
221 | 221 | if ($finding === 0 || $finding === FALSE) { |
222 | 222 | return FALSE; |
223 | 223 | } |
@@ -235,7 +235,7 @@ discard block |
||
235 | 235 | $matchedProviders[] = $idp; |
236 | 236 | $name = $idp; |
237 | 237 | if ($skipCurl == 0) { |
238 | - $url = CONFIG_DIAGNOSTICS['eduGainResolver']['url'] . "?action=get_entity_name&type=idp&e_id=$idp&lang=$lang"; |
|
238 | + $url = CONFIG_DIAGNOSTICS['eduGainResolver']['url']."?action=get_entity_name&type=idp&e_id=$idp&lang=$lang"; |
|
239 | 239 | $ch = curl_init($url); |
240 | 240 | if ($ch === FALSE) { |
241 | 241 | $this->loggerInstance->debug(2, "Unable ask eduGAIN about IdP - CURL init failed!"); |
@@ -251,7 +251,7 @@ discard block |
||
251 | 251 | } |
252 | 252 | curl_close($ch); |
253 | 253 | } |
254 | - $listOfProviders[] = User::PROVIDER_STRINGS[$providerStrings[0]] . " - IdP: " . $name; |
|
254 | + $listOfProviders[] = User::PROVIDER_STRINGS[$providerStrings[0]]." - IdP: ".$name; |
|
255 | 255 | } |
256 | 256 | break; |
257 | 257 | case $providerStrings[1]: |
@@ -117,7 +117,7 @@ discard block |
||
117 | 117 | $loggerInstance->debug(4, "OutsideComm::mailAddressValidSecure: no MX."); |
118 | 118 | return OutsideComm::MAILDOMAIN_NO_MX; |
119 | 119 | } |
120 | - $loggerInstance->debug(5, "Domain: $domain MX: " . print_r($mx, TRUE)); |
|
120 | + $loggerInstance->debug(5, "Domain: $domain MX: ".print_r($mx, TRUE)); |
|
121 | 121 | // create a pool of A and AAAA records for all the MXes |
122 | 122 | $ipAddrs = []; |
123 | 123 | foreach ($mx as $onemx) { |
@@ -127,14 +127,14 @@ discard block |
||
127 | 127 | $ipAddrs[] = $oneipv4['ip']; |
128 | 128 | } |
129 | 129 | foreach ($v6list as $oneipv6) { |
130 | - $ipAddrs[] = "[" . $oneipv6['ipv6'] . "]"; |
|
130 | + $ipAddrs[] = "[".$oneipv6['ipv6']."]"; |
|
131 | 131 | } |
132 | 132 | } |
133 | 133 | if (count($ipAddrs) == 0) { |
134 | 134 | $loggerInstance->debug(4, "OutsideComm::mailAddressValidSecure: no mailserver hosts."); |
135 | 135 | return OutsideComm::MAILDOMAIN_NO_HOST; |
136 | 136 | } |
137 | - $loggerInstance->debug(5, "Domain: $domain Addrs: " . print_r($ipAddrs, TRUE)); |
|
137 | + $loggerInstance->debug(5, "Domain: $domain Addrs: ".print_r($ipAddrs, TRUE)); |
|
138 | 138 | // connect to all hosts. If all can't connect, return MAILDOMAIN_NO_CONNECT. |
139 | 139 | // If at least one does not support STARTTLS or one of the hosts doesn't connect |
140 | 140 | // , return MAILDOMAIN_NO_STARTTLS (one which we can't connect to we also |
@@ -186,7 +186,7 @@ discard block |
||
186 | 186 | switch (CONFIG_CONFASSISTANT['SMSSETTINGS']['provider']) { |
187 | 187 | case 'Nexmo': |
188 | 188 | // taken from https://docs.nexmo.com/messaging/sms-api |
189 | - $url = 'https://rest.nexmo.com/sms/json?' . http_build_query( |
|
189 | + $url = 'https://rest.nexmo.com/sms/json?'.http_build_query( |
|
190 | 190 | [ |
191 | 191 | 'api_key' => CONFIG_CONFASSISTANT['SMSSETTINGS']['username'], |
192 | 192 | 'api_secret' => CONFIG_CONFASSISTANT['SMSSETTINGS']['password'], |
@@ -211,14 +211,14 @@ discard block |
||
211 | 211 | $loggerInstance->debug(2, 'Problem with SMS invitation: no message was sent!'); |
212 | 212 | return OutsideComm::SMS_NOTSENT; |
213 | 213 | } |
214 | - $loggerInstance->debug(2, 'Total of ' . $messageCount . ' messages were attempted to send.'); |
|
214 | + $loggerInstance->debug(2, 'Total of '.$messageCount.' messages were attempted to send.'); |
|
215 | 215 | |
216 | 216 | $totalFailures = 0; |
217 | 217 | foreach ($decoded_response['messages'] as $message) { |
218 | 218 | if ($message['status'] == 0) { |
219 | - $loggerInstance->debug(2, $message['message-id'] . ": Success"); |
|
219 | + $loggerInstance->debug(2, $message['message-id'].": Success"); |
|
220 | 220 | } else { |
221 | - $loggerInstance->debug(2, $message['message-id'] . ": Failed (failure code = " . $message['status'] . ")"); |
|
221 | + $loggerInstance->debug(2, $message['message-id'].": Failed (failure code = ".$message['status'].")"); |
|
222 | 222 | $totalFailures++; |
223 | 223 | } |
224 | 224 | } |
@@ -270,7 +270,7 @@ discard block |
||
270 | 270 | $proto = "https://"; |
271 | 271 | } |
272 | 272 | // then, send out the mail |
273 | - $message = _("Hello,") . "\n\n" . wordwrap($introTexts[$introtext] . " " . $validity, 72) . "\n\n"; |
|
273 | + $message = _("Hello,")."\n\n".wordwrap($introTexts[$introtext]." ".$validity, 72)."\n\n"; |
|
274 | 274 | // default means we don't have a Reply-To. |
275 | 275 | $replyToMessage = wordwrap(_("manually. Please do not reply to this mail; this is a send-only address.")); |
276 | 276 | |
@@ -278,8 +278,8 @@ discard block |
||
278 | 278 | // see if we are supposed to add a custom message |
279 | 279 | $customtext = $federation->getAttributes('fed:custominvite'); |
280 | 280 | if (count($customtext) > 0) { |
281 | - $message .= wordwrap(sprintf(_("Additional message from your %s administrator:"), Entity::$nomenclature_fed), 72) . "\n---------------------------------" . |
|
282 | - wordwrap($customtext[0]['value'], 72) . "\n---------------------------------\n\n"; |
|
281 | + $message .= wordwrap(sprintf(_("Additional message from your %s administrator:"), Entity::$nomenclature_fed), 72)."\n---------------------------------". |
|
282 | + wordwrap($customtext[0]['value'], 72)."\n---------------------------------\n\n"; |
|
283 | 283 | } |
284 | 284 | // and add Reply-To already now |
285 | 285 | foreach ($federation->listFederationAdmins() as $fedadmin_id) { |
@@ -294,19 +294,19 @@ discard block |
||
294 | 294 | } |
295 | 295 | } |
296 | 296 | |
297 | - $message .= wordwrap(sprintf(_("To enlist as an administrator for that %s, please click on the following link:"), Entity::$nomenclature_inst), 72) . "\n\n" . |
|
298 | - $proto . $_SERVER['SERVER_NAME'] . CONFIG['PATHS']['cat_base_url'] . "admin/action_enrollment.php?token=$newtoken\n\n" . |
|
299 | - wordwrap(sprintf(_("If clicking the link doesn't work, you can also go to the %s Administrator Interface at"), CONFIG['APPEARANCE']['productname']), 72) . "\n\n" . |
|
300 | - $proto . $_SERVER['SERVER_NAME'] . CONFIG['PATHS']['cat_base_url'] . "admin/\n\n" . |
|
301 | - _("and enter the invitation token") . "\n\n" . |
|
302 | - $newtoken . "\n\n$replyToMessage\n\n" . |
|
303 | - wordwrap(_("Do NOT forward the mail before the token has expired - or the recipients may be able to consume the token on your behalf!"), 72) . "\n\n" . |
|
304 | - wordwrap(sprintf(_("We wish you a lot of fun with the %s."), CONFIG['APPEARANCE']['productname']), 72) . "\n\n" . |
|
297 | + $message .= wordwrap(sprintf(_("To enlist as an administrator for that %s, please click on the following link:"), Entity::$nomenclature_inst), 72)."\n\n". |
|
298 | + $proto.$_SERVER['SERVER_NAME'].CONFIG['PATHS']['cat_base_url']."admin/action_enrollment.php?token=$newtoken\n\n". |
|
299 | + wordwrap(sprintf(_("If clicking the link doesn't work, you can also go to the %s Administrator Interface at"), CONFIG['APPEARANCE']['productname']), 72)."\n\n". |
|
300 | + $proto.$_SERVER['SERVER_NAME'].CONFIG['PATHS']['cat_base_url']."admin/\n\n". |
|
301 | + _("and enter the invitation token")."\n\n". |
|
302 | + $newtoken."\n\n$replyToMessage\n\n". |
|
303 | + wordwrap(_("Do NOT forward the mail before the token has expired - or the recipients may be able to consume the token on your behalf!"), 72)."\n\n". |
|
304 | + wordwrap(sprintf(_("We wish you a lot of fun with the %s."), CONFIG['APPEARANCE']['productname']), 72)."\n\n". |
|
305 | 305 | sprintf(_("Sincerely,\n\nYour friendly folks from %s Operations"), CONFIG_CONFASSISTANT['CONSORTIUM']['display_name']); |
306 | 306 | |
307 | 307 | |
308 | 308 | // who to whom? |
309 | - $mail->FromName = CONFIG['APPEARANCE']['productname'] . " Invitation System"; |
|
309 | + $mail->FromName = CONFIG['APPEARANCE']['productname']." Invitation System"; |
|
310 | 310 | |
311 | 311 | if (isset(CONFIG['APPEARANCE']['invitation-bcc-mail']) && CONFIG['APPEARANCE']['invitation-bcc-mail'] !== NULL) { |
312 | 312 | $mail->addBCC(CONFIG['APPEARANCE']['invitation-bcc-mail']); |
@@ -355,7 +355,7 @@ discard block |
||
355 | 355 | public static function postJson($url, $dataArray) { |
356 | 356 | $ch = \curl_init($url); |
357 | 357 | if ($ch === FALSE) { |
358 | - $this->loggerInstance->debug(2,"Unable to POST JSON request: CURL init failed!"); |
|
358 | + $this->loggerInstance->debug(2, "Unable to POST JSON request: CURL init failed!"); |
|
359 | 359 | return json_decode(json_encode(FALSE), TRUE); |
360 | 360 | } |
361 | 361 | \curl_setopt_array($ch, array( |