@@ -162,8 +162,8 @@ discard block |
||
162 | 162 | common\Entity::intoThePotatoes(); |
163 | 163 | $mail = \core\common\OutsideComm::mailHandle(); |
164 | 164 | // who to whom? |
165 | - $mail->FromName = \config\Main::APPEARANCE['productname'] . " Notification System"; |
|
166 | - $mail->addReplyTo(\config\Main::APPEARANCE['support-contact']['developer-mail'], \config\Main::APPEARANCE['productname'] . " " . _("Feedback")); |
|
165 | + $mail->FromName = \config\Main::APPEARANCE['productname']." Notification System"; |
|
166 | + $mail->addReplyTo(\config\Main::APPEARANCE['support-contact']['developer-mail'], \config\Main::APPEARANCE['productname']." "._("Feedback")); |
|
167 | 167 | $mail->addAddress($mailaddr[0]["value"]); |
168 | 168 | // what do we want to say? |
169 | 169 | $mail->Subject = $subject; |
@@ -228,7 +228,7 @@ discard block |
||
228 | 228 | } |
229 | 229 | $lookFor .= "$name"; |
230 | 230 | } |
231 | - $finding = preg_match("/^(" . $lookFor . "):(.*)/", $oneRow->user_id, $matches); |
|
231 | + $finding = preg_match("/^(".$lookFor."):(.*)/", $oneRow->user_id, $matches); |
|
232 | 232 | if ($finding === 0 || $finding === FALSE) { |
233 | 233 | return FALSE; |
234 | 234 | } |
@@ -246,7 +246,7 @@ discard block |
||
246 | 246 | $matchedProviders[] = $idp; |
247 | 247 | $name = $idp; |
248 | 248 | if ($skipCurl == 0) { |
249 | - $url = \config\Diagnostics::EDUGAINRESOLVER['url'] . "?action=get_entity_name&type=idp&e_id=$idp&lang=$lang"; |
|
249 | + $url = \config\Diagnostics::EDUGAINRESOLVER['url']."?action=get_entity_name&type=idp&e_id=$idp&lang=$lang"; |
|
250 | 250 | $ch = curl_init($url); |
251 | 251 | if ($ch === FALSE) { |
252 | 252 | $loggerInstance->debug(2, "Unable ask eduGAIN about IdP - CURL init failed!"); |
@@ -262,7 +262,7 @@ discard block |
||
262 | 262 | } |
263 | 263 | curl_close($ch); |
264 | 264 | } |
265 | - $listOfProviders[] = User::PROVIDER_STRINGS[$providerStrings[0]] . " - IdP: " . $name; |
|
265 | + $listOfProviders[] = User::PROVIDER_STRINGS[$providerStrings[0]]." - IdP: ".$name; |
|
266 | 266 | } |
267 | 267 | break; |
268 | 268 | case $providerStrings[1]: |
@@ -154,17 +154,17 @@ discard block |
||
154 | 154 | foreach (array_keys($this->typeDb) as $name) { |
155 | 155 | if ($className === 0) { |
156 | 156 | $tempArray[] = $name; |
157 | - } elseif (preg_match('/^' . $className . ':/', $name) > 0) { |
|
157 | + } elseif (preg_match('/^'.$className.':/', $name) > 0) { |
|
158 | 158 | $tempArray[] = $name; |
159 | 159 | } |
160 | 160 | } |
161 | 161 | $returnArray = $tempArray; |
162 | 162 | // remove silverbullet-specific options if this deployment is not SB |
163 | 163 | foreach ($tempArray as $key => $val) { |
164 | - if (( \config\Main::FUNCTIONALITY_LOCATIONS['CONFASSISTANT_SILVERBULLET'] != 'LOCAL') && (preg_match('/^fed:silverbullet/', $val) > 0)) { |
|
164 | + if ((\config\Main::FUNCTIONALITY_LOCATIONS['CONFASSISTANT_SILVERBULLET'] != 'LOCAL') && (preg_match('/^fed:silverbullet/', $val) > 0)) { |
|
165 | 165 | unset($returnArray[$key]); |
166 | 166 | } |
167 | - if (( \config\Main::FUNCTIONALITY_LOCATIONS['CONFASSISTANT_RADIUS'] != 'LOCAL') && (preg_match('/^fed:minted_ca_file/', $val) > 0)) { |
|
167 | + if ((\config\Main::FUNCTIONALITY_LOCATIONS['CONFASSISTANT_RADIUS'] != 'LOCAL') && (preg_match('/^fed:minted_ca_file/', $val) > 0)) { |
|
168 | 168 | unset($returnArray[$key]); |
169 | 169 | } |
170 | 170 | } |
@@ -185,7 +185,7 @@ discard block |
||
185 | 185 | if (isset($this->typeDb[$optionname])) { |
186 | 186 | return $this->typeDb[$optionname]; |
187 | 187 | } |
188 | - throw new Exception("Metadata about an option was requested, but the option name does not exist in the system: " . htmlentities($optionname)); |
|
188 | + throw new Exception("Metadata about an option was requested, but the option name does not exist in the system: ".htmlentities($optionname)); |
|
189 | 189 | } |
190 | 190 | |
191 | 191 | /** |
@@ -254,7 +254,7 @@ discard block |
||
254 | 254 | $serverCandidates[IdPlist::geoDistance($adminLocation, ['lat' => $iterator->location_lat, 'lon' => $iterator->location_lon])] = $iterator->server_id; |
255 | 255 | } |
256 | 256 | if ($clients > $maxSupportedClients * 0.9) { |
257 | - $this->loggerInstance->debug(1, "A RADIUS server for Managed SP (" . $iterator->server_id . ") is serving at more than 90% capacity!"); |
|
257 | + $this->loggerInstance->debug(1, "A RADIUS server for Managed SP (".$iterator->server_id.") is serving at more than 90% capacity!"); |
|
258 | 258 | } |
259 | 259 | } |
260 | 260 | if (count($serverCandidates) == 0 && $federation != "DEFAULT") { |
@@ -263,7 +263,7 @@ discard block |
||
263 | 263 | return $this->findGoodServerLocation($adminLocation, "DEFAULT", $blacklistedServers); |
264 | 264 | } |
265 | 265 | if (count($serverCandidates) == 0) { |
266 | - throw new Exception("No available server found for new SP! $federation " . print_r($serverCandidates, true)); |
|
266 | + throw new Exception("No available server found for new SP! $federation ".print_r($serverCandidates, true)); |
|
267 | 267 | } |
268 | 268 | // put the nearest server on top of the list |
269 | 269 | ksort($serverCandidates); |
@@ -291,7 +291,7 @@ discard block |
||
291 | 291 | $foundFreePort1 = 0; |
292 | 292 | while ($foundFreePort1 == 0) { |
293 | 293 | $portCandidate = random_int(1200, 65535); |
294 | - $check = $this->databaseHandle->exec("SELECT port_instance_1 FROM deployment WHERE radius_instance_1 = '" . $ourserver . "' AND port_instance_1 = $portCandidate"); |
|
294 | + $check = $this->databaseHandle->exec("SELECT port_instance_1 FROM deployment WHERE radius_instance_1 = '".$ourserver."' AND port_instance_1 = $portCandidate"); |
|
295 | 295 | if (mysqli_num_rows(/** @scrutinizer ignore-type */ $check) == 0) { |
296 | 296 | $foundFreePort1 = $portCandidate; |
297 | 297 | } |
@@ -300,14 +300,14 @@ discard block |
||
300 | 300 | $foundFreePort2 = 0; |
301 | 301 | while ($foundFreePort2 == 0) { |
302 | 302 | $portCandidate = random_int(1200, 65535); |
303 | - $check = $this->databaseHandle->exec("SELECT port_instance_2 FROM deployment WHERE radius_instance_2 = '" . $ourSecondServer . "' AND port_instance_2 = $portCandidate"); |
|
303 | + $check = $this->databaseHandle->exec("SELECT port_instance_2 FROM deployment WHERE radius_instance_2 = '".$ourSecondServer."' AND port_instance_2 = $portCandidate"); |
|
304 | 304 | if (mysqli_num_rows(/** @scrutinizer ignore-type */ $check) == 0) { |
305 | 305 | $foundFreePort2 = $portCandidate; |
306 | 306 | } |
307 | 307 | } |
308 | 308 | // and make up a shared secret that is halfways readable |
309 | 309 | $futureSecret = $this->randomString(16, "0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ"); |
310 | - $this->databaseHandle->exec("UPDATE deployment SET radius_instance_1 = '" . $ourserver . "', radius_instance_2 = '" . $ourSecondServer . "', port_instance_1 = $foundFreePort1, port_instance_2 = $foundFreePort2, secret = '$futureSecret' WHERE deployment_id = $this->identifier"); |
|
310 | + $this->databaseHandle->exec("UPDATE deployment SET radius_instance_1 = '".$ourserver."', radius_instance_2 = '".$ourSecondServer."', port_instance_1 = $foundFreePort1, port_instance_2 = $foundFreePort2, secret = '$futureSecret' WHERE deployment_id = $this->identifier"); |
|
311 | 311 | return ["port_instance_1" => $foundFreePort1, "port_instance_2" => $foundFreePort2, "secret" => $futureSecret, "radius_instance_1" => $ourserver, "radius_instance_2" => $ourserver]; |
312 | 312 | } |
313 | 313 | |
@@ -354,7 +354,7 @@ discard block |
||
354 | 354 | */ |
355 | 355 | public function deactivate() |
356 | 356 | { |
357 | - $this->databaseHandle->exec("UPDATE deployment SET status = " . DeploymentManaged::INACTIVE . " WHERE deployment_id = $this->identifier"); |
|
357 | + $this->databaseHandle->exec("UPDATE deployment SET status = ".DeploymentManaged::INACTIVE." WHERE deployment_id = $this->identifier"); |
|
358 | 358 | } |
359 | 359 | |
360 | 360 | /** |
@@ -365,7 +365,7 @@ discard block |
||
365 | 365 | */ |
366 | 366 | public function activate() |
367 | 367 | { |
368 | - $this->databaseHandle->exec("UPDATE deployment SET status = " . DeploymentManaged::ACTIVE . " WHERE deployment_id = $this->identifier"); |
|
368 | + $this->databaseHandle->exec("UPDATE deployment SET status = ".DeploymentManaged::ACTIVE." WHERE deployment_id = $this->identifier"); |
|
369 | 369 | } |
370 | 370 | |
371 | 371 | /** |
@@ -377,7 +377,7 @@ discard block |
||
377 | 377 | { |
378 | 378 | $customAttrib = $this->getAttributes("managedsp:operatorname"); |
379 | 379 | if (count($customAttrib) == 0) { |
380 | - return "1sp." . $this->identifier . "-" . $this->institution . \config\ConfAssistant::SILVERBULLET['realm_suffix']; |
|
380 | + return "1sp.".$this->identifier."-".$this->institution.\config\ConfAssistant::SILVERBULLET['realm_suffix']; |
|
381 | 381 | } |
382 | 382 | return $customAttrib[0]["value"]; |
383 | 383 | } |
@@ -393,13 +393,13 @@ discard block |
||
393 | 393 | { |
394 | 394 | |
395 | 395 | $hostname = "radius_hostname_$idx"; |
396 | - $ch = curl_init("http://" . $this->$hostname); |
|
396 | + $ch = curl_init("http://".$this->$hostname); |
|
397 | 397 | if ($ch === FALSE) { |
398 | 398 | $res = 'FAILURE'; |
399 | 399 | } else { |
400 | 400 | curl_setopt($ch, CURLOPT_POST, 1); |
401 | 401 | curl_setopt($ch, CURLOPT_POSTFIELDS, $post); |
402 | - $this->loggerInstance->debug(1, "Posting to http://" . $this->$hostname . ": $post\n"); |
|
402 | + $this->loggerInstance->debug(1, "Posting to http://".$this->$hostname.": $post\n"); |
|
403 | 403 | curl_setopt($ch, CURLOPT_FOLLOWLOCATION, 1); |
404 | 404 | curl_setopt($ch, CURLOPT_HEADER, 0); |
405 | 405 | curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1); |
@@ -408,13 +408,13 @@ discard block |
||
408 | 408 | $this->loggerInstance->debug(1, "curl_exec failure"); |
409 | 409 | $res = 'FAILURE'; |
410 | 410 | } else { |
411 | - $res = (string)$exec; // it is always a string due to RETURNTRANSFER but let's make Scrutinizer which thinks this could be TRUE as well |
|
411 | + $res = (string) $exec; // it is always a string due to RETURNTRANSFER but let's make Scrutinizer which thinks this could be TRUE as well |
|
412 | 412 | } |
413 | 413 | $this->loggerInstance->debug(1, "Response from FR configurator: $res\n"); |
414 | 414 | $this->loggerInstance->debug(1, $this); |
415 | 415 | } |
416 | 416 | $this->loggerInstance->debug(1, "Database update"); |
417 | - $this->databaseHandle->exec("UPDATE deployment SET radius_status_$idx = " . ($res == 'OK' ? \core\AbstractDeployment::RADIUS_OK : \core\AbstractDeployment::RADIUS_FAILURE) . " WHERE deployment_id = $this->identifier"); |
|
417 | + $this->databaseHandle->exec("UPDATE deployment SET radius_status_$idx = ".($res == 'OK' ? \core\AbstractDeployment::RADIUS_OK : \core\AbstractDeployment::RADIUS_FAILURE)." WHERE deployment_id = $this->identifier"); |
|
418 | 418 | return $res; |
419 | 419 | } |
420 | 420 | |
@@ -435,19 +435,19 @@ discard block |
||
435 | 435 | } else { |
436 | 436 | $txt = $remove ? _('Profile dectivation failed') : _('Profile activation/modification failed'); |
437 | 437 | } |
438 | - $txt = $txt . ' '; |
|
438 | + $txt = $txt.' '; |
|
439 | 439 | if (array_count_values($response)[$status] == 2) { |
440 | - $txt = $txt . _('on both RADIUS servers: primary and backup') . '.'; |
|
440 | + $txt = $txt._('on both RADIUS servers: primary and backup').'.'; |
|
441 | 441 | } else { |
442 | 442 | if ($response['res[1]'] == $status) { |
443 | - $txt = $txt . _('on primary RADIUS server') . '.'; |
|
443 | + $txt = $txt._('on primary RADIUS server').'.'; |
|
444 | 444 | } else { |
445 | - $txt = $txt . _('on backup RADIUS server') . '.'; |
|
445 | + $txt = $txt._('on backup RADIUS server').'.'; |
|
446 | 446 | } |
447 | 447 | } |
448 | 448 | $mail = \core\common\OutsideComm::mailHandle(); |
449 | 449 | $email = $this->getAttributes("support:email")[0]['value']; |
450 | - $mail->FromName = \config\Main::APPEARANCE['productname'] . " Notification System"; |
|
450 | + $mail->FromName = \config\Main::APPEARANCE['productname']." Notification System"; |
|
451 | 451 | $mail->addAddress($email); |
452 | 452 | if ($status == 'OK') { |
453 | 453 | $mail->Subject = _('RADIUS profile update problem fixed'); |
@@ -481,7 +481,7 @@ discard block |
||
481 | 481 | return NULL; |
482 | 482 | } |
483 | 483 | $timeout = 10; |
484 | - curl_setopt($ch, CURLOPT_URL, 'http://' . $host); |
|
484 | + curl_setopt($ch, CURLOPT_URL, 'http://'.$host); |
|
485 | 485 | curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1); |
486 | 486 | curl_setopt($ch, CURLOPT_TIMEOUT, $timeout); |
487 | 487 | curl_exec($ch); |
@@ -572,32 +572,32 @@ discard block |
||
572 | 572 | { |
573 | 573 | $remove = ($this->status == \core\AbstractDeployment::INACTIVE) ? 0 : 1; |
574 | 574 | $toPost = ($onlyone ? array($onlyone => '') : array(1 => '', 2 => '')); |
575 | - $toPostTemplate = 'instid=' . $this->institution . '&deploymentid=' . $this->identifier . '&secret=' . $this->secret . '&country=' . $this->getAttributes("internal:country")[0]['value'] . '&'; |
|
575 | + $toPostTemplate = 'instid='.$this->institution.'&deploymentid='.$this->identifier.'&secret='.$this->secret.'&country='.$this->getAttributes("internal:country")[0]['value'].'&'; |
|
576 | 576 | if ($remove) { |
577 | - $toPostTemplate = $toPostTemplate . 'remove=1&'; |
|
577 | + $toPostTemplate = $toPostTemplate.'remove=1&'; |
|
578 | 578 | } else { |
579 | 579 | if ($this->getAttributes("managedsp:operatorname")[0]['value'] ?? NULL) { |
580 | - $toPostTemplate = $toPostTemplate . 'operatorname=' . $this->getAttributes("managedsp:operatorname")[0]['value'] . '&'; |
|
580 | + $toPostTemplate = $toPostTemplate.'operatorname='.$this->getAttributes("managedsp:operatorname")[0]['value'].'&'; |
|
581 | 581 | } |
582 | 582 | if ($this->getAttributes("managedsp:vlan")[0]['value'] ?? NULL) { |
583 | 583 | $allRealms = $this->getAllRealms(); |
584 | 584 | if (!empty($allRealms)) { |
585 | - $toPostTemplate = $toPostTemplate . 'vlan=' . $this->getAttributes("managedsp:vlan")[0]['value'] . '&'; |
|
586 | - $toPostTemplate = $toPostTemplate . 'realmforvlan[]=' . implode('&realmforvlan[]=', $allRealms) . '&'; |
|
585 | + $toPostTemplate = $toPostTemplate.'vlan='.$this->getAttributes("managedsp:vlan")[0]['value'].'&'; |
|
586 | + $toPostTemplate = $toPostTemplate.'realmforvlan[]='.implode('&realmforvlan[]=', $allRealms).'&'; |
|
587 | 587 | } |
588 | 588 | } |
589 | 589 | } |
590 | 590 | foreach (array_keys($toPost) as $key) { |
591 | - $elem = 'port' . $key; |
|
592 | - $toPost[$key] = $toPostTemplate . 'port=' . $this->$elem; |
|
591 | + $elem = 'port'.$key; |
|
592 | + $toPost[$key] = $toPostTemplate.'port='.$this->$elem; |
|
593 | 593 | } |
594 | 594 | $response = array(); |
595 | 595 | foreach ($toPost as $key => $value) { |
596 | - $this->loggerInstance->debug(1, 'toPost ' . $toPost[$key] . "\n"); |
|
597 | - $response['res[' . $key . ']'] = $this->sendToRADIUS($key, $toPost[$key]); |
|
596 | + $this->loggerInstance->debug(1, 'toPost '.$toPost[$key]."\n"); |
|
597 | + $response['res['.$key.']'] = $this->sendToRADIUS($key, $toPost[$key]); |
|
598 | 598 | } |
599 | 599 | if ($onlyone) { |
600 | - $response['res[' . ($onlyone == 1) ? 2 : 1 . ']'] = \core\AbstractDeployment::RADIUS_OK; |
|
600 | + $response['res['.($onlyone == 1) ? 2 : 1.']'] = \core\AbstractDeployment::RADIUS_OK; |
|
601 | 601 | } |
602 | 602 | foreach (array('OK', 'FAILURE') as $status) { |
603 | 603 | if ((($status == 'OK' && $notify) || ($status == 'FAILURE')) && in_array($status, $response)) { |
@@ -82,7 +82,7 @@ discard block |
||
82 | 82 | $mail->WordWrap = 72; |
83 | 83 | $mail->isHTML(FALSE); |
84 | 84 | $mail->CharSet = 'UTF-8'; |
85 | - $configuredFrom = \config\Main::APPEARANCE['from-mail'] . ""; |
|
85 | + $configuredFrom = \config\Main::APPEARANCE['from-mail'].""; |
|
86 | 86 | $mail->From = $configuredFrom; |
87 | 87 | // are we fancy? i.e. S/MIME signing? |
88 | 88 | if (isset(\config\Main::MAILSETTINGS['certfilename'], \config\Main::MAILSETTINGS['keyfilename'], \config\Main::MAILSETTINGS['keypass'])) { |
@@ -123,7 +123,7 @@ discard block |
||
123 | 123 | $loggerInstance->debug(4, "OutsideComm::mailAddressValidSecure: no MX."); |
124 | 124 | return OutsideComm::MAILDOMAIN_NO_MX; |
125 | 125 | } |
126 | - $loggerInstance->debug(5, "Domain: $domain MX: " . print_r($mx, TRUE)); |
|
126 | + $loggerInstance->debug(5, "Domain: $domain MX: ".print_r($mx, TRUE)); |
|
127 | 127 | // create a pool of A and AAAA records for all the MXes |
128 | 128 | $ipAddrs = []; |
129 | 129 | foreach ($mx as $onemx) { |
@@ -133,14 +133,14 @@ discard block |
||
133 | 133 | $ipAddrs[] = $oneipv4['ip']; |
134 | 134 | } |
135 | 135 | foreach ($v6list as $oneipv6) { |
136 | - $ipAddrs[] = "[" . $oneipv6['ipv6'] . "]"; |
|
136 | + $ipAddrs[] = "[".$oneipv6['ipv6']."]"; |
|
137 | 137 | } |
138 | 138 | } |
139 | 139 | if (count($ipAddrs) == 0) { |
140 | 140 | $loggerInstance->debug(4, "OutsideComm::mailAddressValidSecure: no mailserver hosts."); |
141 | 141 | return OutsideComm::MAILDOMAIN_NO_HOST; |
142 | 142 | } |
143 | - $loggerInstance->debug(5, "Domain: $domain Addrs: " . print_r($ipAddrs, TRUE)); |
|
143 | + $loggerInstance->debug(5, "Domain: $domain Addrs: ".print_r($ipAddrs, TRUE)); |
|
144 | 144 | // connect to all hosts. If all can't connect, return MAILDOMAIN_NO_CONNECT. |
145 | 145 | // If at least one does not support STARTTLS or one of the hosts doesn't connect |
146 | 146 | // , return MAILDOMAIN_NO_STARTTLS (one which we can't connect to we also |
@@ -193,7 +193,7 @@ discard block |
||
193 | 193 | switch (\config\ConfAssistant::SMSSETTINGS['provider']) { |
194 | 194 | case 'Nexmo': |
195 | 195 | // taken from https://docs.nexmo.com/messaging/sms-api |
196 | - $url = 'https://rest.nexmo.com/sms/json?' . http_build_query( |
|
196 | + $url = 'https://rest.nexmo.com/sms/json?'.http_build_query( |
|
197 | 197 | [ |
198 | 198 | 'api_key' => \config\ConfAssistant::SMSSETTINGS['username'], |
199 | 199 | 'api_secret' => \config\ConfAssistant::SMSSETTINGS['password'], |
@@ -219,14 +219,14 @@ discard block |
||
219 | 219 | $loggerInstance->debug(2, 'Problem with SMS invitation: no message was sent!'); |
220 | 220 | return OutsideComm::SMS_NOTSENT; |
221 | 221 | } |
222 | - $loggerInstance->debug(2, 'Total of ' . $messageCount . ' messages were attempted to send.'); |
|
222 | + $loggerInstance->debug(2, 'Total of '.$messageCount.' messages were attempted to send.'); |
|
223 | 223 | |
224 | 224 | $totalFailures = 0; |
225 | 225 | foreach ($decoded_response['messages'] as $message) { |
226 | 226 | if ($message['status'] == 0) { |
227 | - $loggerInstance->debug(2, $message['message-id'] . ": Success"); |
|
227 | + $loggerInstance->debug(2, $message['message-id'].": Success"); |
|
228 | 228 | } else { |
229 | - $loggerInstance->debug(2, $message['message-id'] . ": Failed (failure code = " . $message['status'] . ")"); |
|
229 | + $loggerInstance->debug(2, $message['message-id'].": Failed (failure code = ".$message['status'].")"); |
|
230 | 230 | $totalFailures++; |
231 | 231 | } |
232 | 232 | } |
@@ -295,7 +295,7 @@ discard block |
||
295 | 295 | $proto = "https://"; |
296 | 296 | } |
297 | 297 | // then, send out the mail |
298 | - $message = _("Hello,") . "\n\n" . wordwrap($introTexts[$introtext] . " " . $validity, 72) . "\n\n"; |
|
298 | + $message = _("Hello,")."\n\n".wordwrap($introTexts[$introtext]." ".$validity, 72)."\n\n"; |
|
299 | 299 | // default means we don't have a Reply-To. |
300 | 300 | $replyToMessage = wordwrap(_("manually. Please do not reply to this mail; this is a send-only address.")); |
301 | 301 | |
@@ -303,8 +303,8 @@ discard block |
||
303 | 303 | // see if we are supposed to add a custom message |
304 | 304 | $customtext = $federation->getAttributes('fed:custominvite'); |
305 | 305 | if (count($customtext) > 0) { |
306 | - $message .= wordwrap(sprintf(_("Additional message from your %s administrator:"), Entity::$nomenclature_fed), 72) . "\n---------------------------------" . |
|
307 | - wordwrap($customtext[0]['value'], 72) . "\n---------------------------------\n\n"; |
|
306 | + $message .= wordwrap(sprintf(_("Additional message from your %s administrator:"), Entity::$nomenclature_fed), 72)."\n---------------------------------". |
|
307 | + wordwrap($customtext[0]['value'], 72)."\n---------------------------------\n\n"; |
|
308 | 308 | } |
309 | 309 | // and add Reply-To already now |
310 | 310 | foreach ($federation->listFederationAdmins() as $fedadmin_id) { |
@@ -320,19 +320,19 @@ discard block |
||
320 | 320 | } |
321 | 321 | $productname = \config\Main::APPEARANCE['productname']; |
322 | 322 | $consortium = \config\ConfAssistant::CONSORTIUM['display_name']; |
323 | - $message .= wordwrap(sprintf(_("To enlist as an administrator for that %s, please click on the following link:"), Entity::$nomenclature_participant), 72) . "\n\n" . |
|
324 | - $proto . $_SERVER['SERVER_NAME'] . \config\Main::PATHS['cat_base_url'] . "admin/action_enrollment.php?token=$newtoken\n\n" . |
|
325 | - wordwrap(sprintf(_("If clicking the link doesn't work, you can also go to the %s Administrator Interface at"), $productname), 72) . "\n\n" . |
|
326 | - $proto . $_SERVER['SERVER_NAME'] . \config\Main::PATHS['cat_base_url'] . "admin/\n\n" . |
|
327 | - _("and enter the invitation token") . "\n\n" . |
|
328 | - $newtoken . "\n\n$replyToMessage\n\n" . |
|
329 | - 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" . |
|
330 | - wordwrap(sprintf(_("We wish you a lot of fun with the %s."), $productname), 72) . "\n\n" . |
|
323 | + $message .= wordwrap(sprintf(_("To enlist as an administrator for that %s, please click on the following link:"), Entity::$nomenclature_participant), 72)."\n\n". |
|
324 | + $proto.$_SERVER['SERVER_NAME'].\config\Main::PATHS['cat_base_url']."admin/action_enrollment.php?token=$newtoken\n\n". |
|
325 | + wordwrap(sprintf(_("If clicking the link doesn't work, you can also go to the %s Administrator Interface at"), $productname), 72)."\n\n". |
|
326 | + $proto.$_SERVER['SERVER_NAME'].\config\Main::PATHS['cat_base_url']."admin/\n\n". |
|
327 | + _("and enter the invitation token")."\n\n". |
|
328 | + $newtoken."\n\n$replyToMessage\n\n". |
|
329 | + 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". |
|
330 | + wordwrap(sprintf(_("We wish you a lot of fun with the %s."), $productname), 72)."\n\n". |
|
331 | 331 | sprintf(_("Sincerely,\n\nYour friendly folks from %s Operations"), $consortium); |
332 | 332 | |
333 | 333 | |
334 | 334 | // who to whom? |
335 | - $mail->FromName = \config\Main::APPEARANCE['productname'] . " Invitation System"; |
|
335 | + $mail->FromName = \config\Main::APPEARANCE['productname']." Invitation System"; |
|
336 | 336 | |
337 | 337 | if (isset(\config\Main::APPEARANCE['invitation-bcc-mail']) && \config\Main::APPEARANCE['invitation-bcc-mail'] !== NULL) { |
338 | 338 | $mail->addBCC(\config\Main::APPEARANCE['invitation-bcc-mail']); |
@@ -75,9 +75,9 @@ discard block |
||
75 | 75 | $loggerInstance = new \core\common\Logging(); |
76 | 76 | $olddomain = textdomain(NULL); |
77 | 77 | $loggerInstance->debug(4, "set_locale($domain)\n"); |
78 | - $loggerInstance->debug(4, ROOT . "\n"); |
|
78 | + $loggerInstance->debug(4, ROOT."\n"); |
|
79 | 79 | textdomain($domain); |
80 | - bindtextdomain($domain, ROOT . "/translation/"); |
|
80 | + bindtextdomain($domain, ROOT."/translation/"); |
|
81 | 81 | return $olddomain; |
82 | 82 | } |
83 | 83 | |
@@ -128,7 +128,7 @@ discard block |
||
128 | 128 | |
129 | 129 | // check if this language is supported by the CAT config |
130 | 130 | foreach (\config\Main::LANGUAGES as $language => $value) { |
131 | - if (preg_match("/^" . $language . ".*/", $tryLang)) { |
|
131 | + if (preg_match("/^".$language.".*/", $tryLang)) { |
|
132 | 132 | $localeTmp = $value['locale']; |
133 | 133 | $langIndex = $language; // ??? |
134 | 134 | break; |
@@ -143,7 +143,7 @@ discard block |
||
143 | 143 | } |
144 | 144 | } |
145 | 145 | } |
146 | - putenv("LC_ALL=" . $theLocale); |
|
146 | + putenv("LC_ALL=".$theLocale); |
|
147 | 147 | $_SESSION['language'] = $langIndex; |
148 | 148 | $loggerInstance = new \core\common\Logging(); |
149 | 149 | $loggerInstance->debug(4, "selected lang:$langIndex:$theLocale\n"); |
@@ -49,7 +49,7 @@ discard block |
||
49 | 49 | */ |
50 | 50 | private function writeToFile($filename, $message) |
51 | 51 | { |
52 | - file_put_contents(\config\Main::PATHS['logdir'] . "/$filename", sprintf("%-015s", microtime(TRUE)) . $message, FILE_APPEND); |
|
52 | + file_put_contents(\config\Main::PATHS['logdir']."/$filename", sprintf("%-015s", microtime(TRUE)).$message, FILE_APPEND); |
|
53 | 53 | } |
54 | 54 | |
55 | 55 | /** |
@@ -81,7 +81,7 @@ discard block |
||
81 | 81 | } else { |
82 | 82 | $output .= var_export($stuff, TRUE); |
83 | 83 | } |
84 | - $output = $prefix . $output . $suffix; |
|
84 | + $output = $prefix.$output.$suffix; |
|
85 | 85 | $this->writeToFile("debug.log", $output); |
86 | 86 | |
87 | 87 | return; |
@@ -129,6 +129,6 @@ discard block |
||
129 | 129 | $logTextStep1 = preg_replace("/[\n\r]/", "", $query); |
130 | 130 | $logTextStep2 = preg_replace("/ +/", " ", $logTextStep1); |
131 | 131 | $logTextStep3 = iconv("UTF-8", "UTF-8//IGNORE", $logTextStep2); |
132 | - $this->writeToFile("audit-SQL.log", " " . $logTextStep3 . "\n"); |
|
132 | + $this->writeToFile("audit-SQL.log", " ".$logTextStep3."\n"); |
|
133 | 133 | } |
134 | 134 | } |
135 | 135 | \ No newline at end of file |
@@ -23,16 +23,16 @@ discard block |
||
23 | 23 | namespace config; |
24 | 24 | |
25 | 25 | require_once "autoloader.php"; |
26 | -require_once __DIR__ . "/../packageRoot.php"; |
|
26 | +require_once __DIR__."/../packageRoot.php"; |
|
27 | 27 | |
28 | 28 | // enable Composer autoloader, if exists |
29 | -if (file_exists(__DIR__ . "/../vendor/autoload.php") !== FALSE) { |
|
30 | - include_once __DIR__ . "/../vendor/autoload.php"; |
|
29 | +if (file_exists(__DIR__."/../vendor/autoload.php") !== FALSE) { |
|
30 | + include_once __DIR__."/../vendor/autoload.php"; |
|
31 | 31 | } |
32 | 32 | |
33 | -if (!file_exists(ROOT . "/config/Main.php")) { |
|
33 | +if (!file_exists(ROOT."/config/Main.php")) { |
|
34 | 34 | // Keep old configurations working |
35 | - if (file_exists(ROOT . "/config/Master.php")) { |
|
35 | + if (file_exists(ROOT."/config/Master.php")) { |
|
36 | 36 | // Autoloader loads Master and we define Main inline |
37 | 37 | class Main extends Master {} |
38 | 38 | } else { |
@@ -44,14 +44,14 @@ discard block |
||
44 | 44 | /* load sub-configs if we are dealing with those in this installation */ |
45 | 45 | |
46 | 46 | if (Main::FUNCTIONALITY_LOCATIONS['CONFASSISTANT_SILVERBULLET'] == 'LOCAL' || Main::FUNCTIONALITY_LOCATIONS['CONFASSISTANT_RADIUS'] == 'LOCAL') { |
47 | - if (!file_exists(ROOT . "/config/ConfAssistant.php")) { |
|
47 | + if (!file_exists(ROOT."/config/ConfAssistant.php")) { |
|
48 | 48 | echo "ConfAssistant configuration file not found. You need to configure the product!"; |
49 | 49 | throw new \Exception("ConfAssistant config file not found!"); |
50 | 50 | } |
51 | 51 | } |
52 | 52 | |
53 | 53 | if (Main::FUNCTIONALITY_LOCATIONS['DIAGNOSTICS'] == 'LOCAL') { |
54 | - if (!file_exists(ROOT . "/config/Diagnostics.php")) { |
|
54 | + if (!file_exists(ROOT."/config/Diagnostics.php")) { |
|
55 | 55 | echo "Diagnostics configuration file not found. You need to configure the product!"; |
56 | 56 | throw new \Exception("Diagnostics config file not found!"); |
57 | 57 | } |