@@ -79,7 +79,7 @@ discard block |
||
| 79 | 79 | $mail->WordWrap = 72; |
| 80 | 80 | $mail->isHTML(FALSE); |
| 81 | 81 | $mail->CharSet = 'UTF-8'; |
| 82 | - $configuredFrom = \config\Master::APPEARANCE['from-mail'] . ""; |
|
| 82 | + $configuredFrom = \config\Master::APPEARANCE['from-mail'].""; |
|
| 83 | 83 | $mail->From = $configuredFrom; |
| 84 | 84 | // are we fancy? i.e. S/MIME signing? |
| 85 | 85 | if (isset(\config\Master::MAILSETTINGS['certfilename'], \config\Master::MAILSETTINGS['keyfilename'], \config\Master::MAILSETTINGS['keypass'])) { |
@@ -119,7 +119,7 @@ discard block |
||
| 119 | 119 | $loggerInstance->debug(4, "OutsideComm::mailAddressValidSecure: no MX."); |
| 120 | 120 | return OutsideComm::MAILDOMAIN_NO_MX; |
| 121 | 121 | } |
| 122 | - $loggerInstance->debug(5, "Domain: $domain MX: " . print_r($mx, TRUE)); |
|
| 122 | + $loggerInstance->debug(5, "Domain: $domain MX: ".print_r($mx, TRUE)); |
|
| 123 | 123 | // create a pool of A and AAAA records for all the MXes |
| 124 | 124 | $ipAddrs = []; |
| 125 | 125 | foreach ($mx as $onemx) { |
@@ -129,14 +129,14 @@ discard block |
||
| 129 | 129 | $ipAddrs[] = $oneipv4['ip']; |
| 130 | 130 | } |
| 131 | 131 | foreach ($v6list as $oneipv6) { |
| 132 | - $ipAddrs[] = "[" . $oneipv6['ipv6'] . "]"; |
|
| 132 | + $ipAddrs[] = "[".$oneipv6['ipv6']."]"; |
|
| 133 | 133 | } |
| 134 | 134 | } |
| 135 | 135 | if (count($ipAddrs) == 0) { |
| 136 | 136 | $loggerInstance->debug(4, "OutsideComm::mailAddressValidSecure: no mailserver hosts."); |
| 137 | 137 | return OutsideComm::MAILDOMAIN_NO_HOST; |
| 138 | 138 | } |
| 139 | - $loggerInstance->debug(5, "Domain: $domain Addrs: " . print_r($ipAddrs, TRUE)); |
|
| 139 | + $loggerInstance->debug(5, "Domain: $domain Addrs: ".print_r($ipAddrs, TRUE)); |
|
| 140 | 140 | // connect to all hosts. If all can't connect, return MAILDOMAIN_NO_CONNECT. |
| 141 | 141 | // If at least one does not support STARTTLS or one of the hosts doesn't connect |
| 142 | 142 | // , return MAILDOMAIN_NO_STARTTLS (one which we can't connect to we also |
@@ -188,7 +188,7 @@ discard block |
||
| 188 | 188 | switch (\config\ConfAssistant::SMSSETTINGS['provider']) { |
| 189 | 189 | case 'Nexmo': |
| 190 | 190 | // taken from https://docs.nexmo.com/messaging/sms-api |
| 191 | - $url = 'https://rest.nexmo.com/sms/json?' . http_build_query( |
|
| 191 | + $url = 'https://rest.nexmo.com/sms/json?'.http_build_query( |
|
| 192 | 192 | [ |
| 193 | 193 | 'api_key' => \config\ConfAssistant::SMSSETTINGS['username'], |
| 194 | 194 | 'api_secret' => \config\ConfAssistant::SMSSETTINGS['password'], |
@@ -214,14 +214,14 @@ discard block |
||
| 214 | 214 | $loggerInstance->debug(2, 'Problem with SMS invitation: no message was sent!'); |
| 215 | 215 | return OutsideComm::SMS_NOTSENT; |
| 216 | 216 | } |
| 217 | - $loggerInstance->debug(2, 'Total of ' . $messageCount . ' messages were attempted to send.'); |
|
| 217 | + $loggerInstance->debug(2, 'Total of '.$messageCount.' messages were attempted to send.'); |
|
| 218 | 218 | |
| 219 | 219 | $totalFailures = 0; |
| 220 | 220 | foreach ($decoded_response['messages'] as $message) { |
| 221 | 221 | if ($message['status'] == 0) { |
| 222 | - $loggerInstance->debug(2, $message['message-id'] . ": Success"); |
|
| 222 | + $loggerInstance->debug(2, $message['message-id'].": Success"); |
|
| 223 | 223 | } else { |
| 224 | - $loggerInstance->debug(2, $message['message-id'] . ": Failed (failure code = " . $message['status'] . ")"); |
|
| 224 | + $loggerInstance->debug(2, $message['message-id'].": Failed (failure code = ".$message['status'].")"); |
|
| 225 | 225 | $totalFailures++; |
| 226 | 226 | } |
| 227 | 227 | } |
@@ -289,7 +289,7 @@ discard block |
||
| 289 | 289 | $proto = "https://"; |
| 290 | 290 | } |
| 291 | 291 | // then, send out the mail |
| 292 | - $message = _("Hello,") . "\n\n" . wordwrap($introTexts[$introtext] . " " . $validity, 72) . "\n\n"; |
|
| 292 | + $message = _("Hello,")."\n\n".wordwrap($introTexts[$introtext]." ".$validity, 72)."\n\n"; |
|
| 293 | 293 | // default means we don't have a Reply-To. |
| 294 | 294 | $replyToMessage = wordwrap(_("manually. Please do not reply to this mail; this is a send-only address.")); |
| 295 | 295 | |
@@ -297,8 +297,8 @@ discard block |
||
| 297 | 297 | // see if we are supposed to add a custom message |
| 298 | 298 | $customtext = $federation->getAttributes('fed:custominvite'); |
| 299 | 299 | if (count($customtext) > 0) { |
| 300 | - $message .= wordwrap(sprintf(_("Additional message from your %s administrator:"), Entity::$nomenclature_fed), 72) . "\n---------------------------------" . |
|
| 301 | - wordwrap($customtext[0]['value'], 72) . "\n---------------------------------\n\n"; |
|
| 300 | + $message .= wordwrap(sprintf(_("Additional message from your %s administrator:"), Entity::$nomenclature_fed), 72)."\n---------------------------------". |
|
| 301 | + wordwrap($customtext[0]['value'], 72)."\n---------------------------------\n\n"; |
|
| 302 | 302 | } |
| 303 | 303 | // and add Reply-To already now |
| 304 | 304 | foreach ($federation->listFederationAdmins() as $fedadmin_id) { |
@@ -314,19 +314,19 @@ discard block |
||
| 314 | 314 | } |
| 315 | 315 | $productname = \config\Master::APPEARANCE['productname']; |
| 316 | 316 | $consortium = \config\ConfAssistant::CONSORTIUM['display_name']; |
| 317 | - $message .= wordwrap(sprintf(_("To enlist as an administrator for that %s, please click on the following link:"), Entity::$nomenclature_participant), 72) . "\n\n" . |
|
| 318 | - $proto . $_SERVER['SERVER_NAME'] . \config\Master::PATHS['cat_base_url'] . "admin/action_enrollment.php?token=$newtoken\n\n" . |
|
| 319 | - wordwrap(sprintf(_("If clicking the link doesn't work, you can also go to the %s Administrator Interface at"), $productname), 72) . "\n\n" . |
|
| 320 | - $proto . $_SERVER['SERVER_NAME'] . \config\Master::PATHS['cat_base_url'] . "admin/\n\n" . |
|
| 321 | - _("and enter the invitation token") . "\n\n" . |
|
| 322 | - $newtoken . "\n\n$replyToMessage\n\n" . |
|
| 323 | - 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" . |
|
| 324 | - wordwrap(sprintf(_("We wish you a lot of fun with the %s."), $productname), 72) . "\n\n" . |
|
| 317 | + $message .= wordwrap(sprintf(_("To enlist as an administrator for that %s, please click on the following link:"), Entity::$nomenclature_participant), 72)."\n\n". |
|
| 318 | + $proto.$_SERVER['SERVER_NAME'].\config\Master::PATHS['cat_base_url']."admin/action_enrollment.php?token=$newtoken\n\n". |
|
| 319 | + wordwrap(sprintf(_("If clicking the link doesn't work, you can also go to the %s Administrator Interface at"), $productname), 72)."\n\n". |
|
| 320 | + $proto.$_SERVER['SERVER_NAME'].\config\Master::PATHS['cat_base_url']."admin/\n\n". |
|
| 321 | + _("and enter the invitation token")."\n\n". |
|
| 322 | + $newtoken."\n\n$replyToMessage\n\n". |
|
| 323 | + 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". |
|
| 324 | + wordwrap(sprintf(_("We wish you a lot of fun with the %s."), $productname), 72)."\n\n". |
|
| 325 | 325 | sprintf(_("Sincerely,\n\nYour friendly folks from %s Operations"), $consortium); |
| 326 | 326 | |
| 327 | 327 | |
| 328 | 328 | // who to whom? |
| 329 | - $mail->FromName = \config\Master::APPEARANCE['productname'] . " Invitation System"; |
|
| 329 | + $mail->FromName = \config\Master::APPEARANCE['productname']." Invitation System"; |
|
| 330 | 330 | |
| 331 | 331 | if (isset(\config\Master::APPEARANCE['invitation-bcc-mail']) && \config\Master::APPEARANCE['invitation-bcc-mail'] !== NULL) { |
| 332 | 332 | $mail->addBCC(\config\Master::APPEARANCE['invitation-bcc-mail']); |
@@ -93,7 +93,7 @@ discard block |
||
| 93 | 93 | |
| 94 | 94 | // realm is automatically calculated, then stored in DB |
| 95 | 95 | |
| 96 | - $this->realm = "opaquehash@$myInst->identifier-$this->identifier." . strtolower($myInst->federation) . \config\ConfAssistant::SILVERBULLET['realm_suffix']; |
|
| 96 | + $this->realm = "opaquehash@$myInst->identifier-$this->identifier.".strtolower($myInst->federation).\config\ConfAssistant::SILVERBULLET['realm_suffix']; |
|
| 97 | 97 | $localValueIfAny = ""; |
| 98 | 98 | |
| 99 | 99 | // but there's some common internal attributes populated directly |
@@ -110,10 +110,10 @@ discard block |
||
| 110 | 110 | |
| 111 | 111 | // and we need to populate eap:server_name and eap:ca_file with the NRO-specific EAP information |
| 112 | 112 | $silverbulletAttributes = [ |
| 113 | - "eap:server_name" => "auth." . strtolower($myFed->tld) . \config\ConfAssistant::SILVERBULLET['server_suffix'], |
|
| 113 | + "eap:server_name" => "auth.".strtolower($myFed->tld).\config\ConfAssistant::SILVERBULLET['server_suffix'], |
|
| 114 | 114 | ]; |
| 115 | 115 | $x509 = new \core\common\X509(); |
| 116 | - $caHandle = fopen(dirname(__FILE__) . "/../config/SilverbulletServerCerts/" . strtoupper($myFed->tld) . "/root.pem", "r"); |
|
| 116 | + $caHandle = fopen(dirname(__FILE__)."/../config/SilverbulletServerCerts/".strtoupper($myFed->tld)."/root.pem", "r"); |
|
| 117 | 117 | if ($caHandle !== FALSE) { |
| 118 | 118 | $cAFile = fread($caHandle, 16000000); |
| 119 | 119 | $silverbulletAttributes["eap:ca_file"] = $x509->der2pem(($x509->pem2der($cAFile))); |