|
@@ -118,7 +118,7 @@ discard block |
|
|
block discarded – undo |
|
118
|
118
|
$loggerInstance->debug(4, "OutsideComm::mailAddressValidSecure: no MX."); |
|
119
|
119
|
return OutsideComm::MAILDOMAIN_NO_MX; |
|
120
|
120
|
} |
|
121
|
|
- $loggerInstance->debug(5, "Domain: $domain MX: " . print_r($mx, TRUE)); |
|
|
121
|
+ $loggerInstance->debug(5, "Domain: $domain MX: ".print_r($mx, TRUE)); |
|
122
|
122
|
// create a pool of A and AAAA records for all the MXes |
|
123
|
123
|
$ipAddrs = []; |
|
124
|
124
|
foreach ($mx as $onemx) { |
|
@@ -128,14 +128,14 @@ discard block |
|
|
block discarded – undo |
|
128
|
128
|
$ipAddrs[] = $oneipv4['ip']; |
|
129
|
129
|
} |
|
130
|
130
|
foreach ($v6list as $oneipv6) { |
|
131
|
|
- $ipAddrs[] = "[" . $oneipv6['ipv6'] . "]"; |
|
|
131
|
+ $ipAddrs[] = "[".$oneipv6['ipv6']."]"; |
|
132
|
132
|
} |
|
133
|
133
|
} |
|
134
|
134
|
if (count($ipAddrs) == 0) { |
|
135
|
135
|
$loggerInstance->debug(4, "OutsideComm::mailAddressValidSecure: no mailserver hosts."); |
|
136
|
136
|
return OutsideComm::MAILDOMAIN_NO_HOST; |
|
137
|
137
|
} |
|
138
|
|
- $loggerInstance->debug(5, "Domain: $domain Addrs: " . print_r($ipAddrs, TRUE)); |
|
|
138
|
+ $loggerInstance->debug(5, "Domain: $domain Addrs: ".print_r($ipAddrs, TRUE)); |
|
139
|
139
|
// connect to all hosts. If all can't connect, return MAILDOMAIN_NO_CONNECT. |
|
140
|
140
|
// If at least one does not support STARTTLS or one of the hosts doesn't connect |
|
141
|
141
|
// , return MAILDOMAIN_NO_STARTTLS (one which we can't connect to we also |
|
@@ -187,7 +187,7 @@ discard block |
|
|
block discarded – undo |
|
187
|
187
|
switch (\config\ConfAssistant::SMSSETTINGS['provider']) { |
|
188
|
188
|
case 'Nexmo': |
|
189
|
189
|
// taken from https://docs.nexmo.com/messaging/sms-api |
|
190
|
|
- $url = 'https://rest.nexmo.com/sms/json?' . http_build_query( |
|
|
190
|
+ $url = 'https://rest.nexmo.com/sms/json?'.http_build_query( |
|
191
|
191
|
[ |
|
192
|
192
|
'api_key' => \config\ConfAssistant::SMSSETTINGS['username'], |
|
193
|
193
|
'api_secret' => \config\ConfAssistant::SMSSETTINGS['password'], |
|
@@ -213,14 +213,14 @@ discard block |
|
|
block discarded – undo |
|
213
|
213
|
$loggerInstance->debug(2, 'Problem with SMS invitation: no message was sent!'); |
|
214
|
214
|
return OutsideComm::SMS_NOTSENT; |
|
215
|
215
|
} |
|
216
|
|
- $loggerInstance->debug(2, 'Total of ' . $messageCount . ' messages were attempted to send.'); |
|
|
216
|
+ $loggerInstance->debug(2, 'Total of '.$messageCount.' messages were attempted to send.'); |
|
217
|
217
|
|
|
218
|
218
|
$totalFailures = 0; |
|
219
|
219
|
foreach ($decoded_response['messages'] as $message) { |
|
220
|
220
|
if ($message['status'] == 0) { |
|
221
|
|
- $loggerInstance->debug(2, $message['message-id'] . ": Success"); |
|
|
221
|
+ $loggerInstance->debug(2, $message['message-id'].": Success"); |
|
222
|
222
|
} else { |
|
223
|
|
- $loggerInstance->debug(2, $message['message-id'] . ": Failed (failure code = " . $message['status'] . ")"); |
|
|
223
|
+ $loggerInstance->debug(2, $message['message-id'].": Failed (failure code = ".$message['status'].")"); |
|
224
|
224
|
$totalFailures++; |
|
225
|
225
|
} |
|
226
|
226
|
} |
|
@@ -288,7 +288,7 @@ discard block |
|
|
block discarded – undo |
|
288
|
288
|
$proto = "https://"; |
|
289
|
289
|
} |
|
290
|
290
|
// then, send out the mail |
|
291
|
|
- $message = _("Hello,") . "\n\n" . wordwrap($introTexts[$introtext] . " " . $validity, 72) . "\n\n"; |
|
|
291
|
+ $message = _("Hello,")."\n\n".wordwrap($introTexts[$introtext]." ".$validity, 72)."\n\n"; |
|
292
|
292
|
// default means we don't have a Reply-To. |
|
293
|
293
|
$replyToMessage = wordwrap(_("manually. Please do not reply to this mail; this is a send-only address.")); |
|
294
|
294
|
|
|
@@ -296,8 +296,8 @@ discard block |
|
|
block discarded – undo |
|
296
|
296
|
// see if we are supposed to add a custom message |
|
297
|
297
|
$customtext = $federation->getAttributes('fed:custominvite'); |
|
298
|
298
|
if (count($customtext) > 0) { |
|
299
|
|
- $message .= wordwrap(sprintf(_("Additional message from your %s administrator:"), Entity::$nomenclature_fed), 72) . "\n---------------------------------" . |
|
300
|
|
- wordwrap($customtext[0]['value'], 72) . "\n---------------------------------\n\n"; |
|
|
299
|
+ $message .= wordwrap(sprintf(_("Additional message from your %s administrator:"), Entity::$nomenclature_fed), 72)."\n---------------------------------". |
|
|
300
|
+ wordwrap($customtext[0]['value'], 72)."\n---------------------------------\n\n"; |
|
301
|
301
|
} |
|
302
|
302
|
// and add Reply-To already now |
|
303
|
303
|
foreach ($federation->listFederationAdmins() as $fedadmin_id) { |
|
@@ -313,19 +313,19 @@ discard block |
|
|
block discarded – undo |
|
313
|
313
|
} |
|
314
|
314
|
$productname = \config\Master::APPEARANCE['productname']; |
|
315
|
315
|
$consortium = \config\ConfAssistant::CONSORTIUM['display_name']; |
|
316
|
|
- $message .= wordwrap(sprintf(_("To enlist as an administrator for that %s, please click on the following link:"), Entity::$nomenclature_participant), 72) . "\n\n" . |
|
317
|
|
- $proto . $_SERVER['SERVER_NAME'] . \config\Master::PATHS['cat_base_url'] . "admin/action_enrollment.php?token=$newtoken\n\n" . |
|
318
|
|
- wordwrap(sprintf(_("If clicking the link doesn't work, you can also go to the %s Administrator Interface at"), $productname), 72) . "\n\n" . |
|
319
|
|
- $proto . $_SERVER['SERVER_NAME'] . \config\Master::PATHS['cat_base_url'] . "admin/\n\n" . |
|
320
|
|
- _("and enter the invitation token") . "\n\n" . |
|
321
|
|
- $newtoken . "\n\n$replyToMessage\n\n" . |
|
322
|
|
- 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" . |
|
323
|
|
- wordwrap(sprintf(_("We wish you a lot of fun with the %s."), $productname), 72) . "\n\n" . |
|
|
316
|
+ $message .= wordwrap(sprintf(_("To enlist as an administrator for that %s, please click on the following link:"), Entity::$nomenclature_participant), 72)."\n\n". |
|
|
317
|
+ $proto.$_SERVER['SERVER_NAME'].\config\Master::PATHS['cat_base_url']."admin/action_enrollment.php?token=$newtoken\n\n". |
|
|
318
|
+ wordwrap(sprintf(_("If clicking the link doesn't work, you can also go to the %s Administrator Interface at"), $productname), 72)."\n\n". |
|
|
319
|
+ $proto.$_SERVER['SERVER_NAME'].\config\Master::PATHS['cat_base_url']."admin/\n\n". |
|
|
320
|
+ _("and enter the invitation token")."\n\n". |
|
|
321
|
+ $newtoken."\n\n$replyToMessage\n\n". |
|
|
322
|
+ 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". |
|
|
323
|
+ wordwrap(sprintf(_("We wish you a lot of fun with the %s."), $productname), 72)."\n\n". |
|
324
|
324
|
sprintf(_("Sincerely,\n\nYour friendly folks from %s Operations"), $consortium); |
|
325
|
325
|
|
|
326
|
326
|
|
|
327
|
327
|
// who to whom? |
|
328
|
|
- $mail->FromName = \config\Master::APPEARANCE['productname'] . " Invitation System"; |
|
|
328
|
+ $mail->FromName = \config\Master::APPEARANCE['productname']." Invitation System"; |
|
329
|
329
|
|
|
330
|
330
|
if (isset(\config\Master::APPEARANCE['invitation-bcc-mail']) && \config\Master::APPEARANCE['invitation-bcc-mail'] !== NULL) { |
|
331
|
331
|
$mail->addBCC(\config\Master::APPEARANCE['invitation-bcc-mail']); |