\core\commonOutsideComm

This class contains a number of functions for talking to the outside world

Summary

Methods
Properties
Constants
downloadFile()
mailHandle()
mailAddressValidSecure()
sendSMS()
adminInvitationMail()
postJson()
No public properties found
MAILDOMAIN_INVALID
MAILDOMAIN_NO_MX
MAILDOMAIN_NO_HOST
MAILDOMAIN_NO_CONNECT
MAILDOMAIN_NO_STARTTLS
MAILDOMAIN_STARTTLS
SMS_SENT
SMS_NOTSENT
SMS_FRAGEMENTSLOST
INVITE_CONTEXTS
No protected methods found
No protected properties found
N/A
No private methods found
No private properties found
N/A

Constants

MAILDOMAIN_INVALID

MAILDOMAIN_INVALID = -1000

MAILDOMAIN_NO_MX

MAILDOMAIN_NO_MX = -1001

MAILDOMAIN_NO_HOST

MAILDOMAIN_NO_HOST = -1002

MAILDOMAIN_NO_CONNECT

MAILDOMAIN_NO_CONNECT = -1003

MAILDOMAIN_NO_STARTTLS

MAILDOMAIN_NO_STARTTLS = 1

MAILDOMAIN_STARTTLS

MAILDOMAIN_STARTTLS = 2

SMS_SENT

SMS_SENT = 100

SMS_NOTSENT

SMS_NOTSENT = 101

SMS_FRAGEMENTSLOST

SMS_FRAGEMENTSLOST = 102

INVITE_CONTEXTS

INVITE_CONTEXTS = [0 => CO-ADMIN, 1 => NEW-FED, 2 => EXISTING-FED]

Methods

downloadFile()

downloadFile(  url) : string|bool

downloads a file from the internet

Parameters

url

Returns

string|bool —

the data we got back, or FALSE on failure

mailHandle()

mailHandle() : \PHPMailer\PHPMailer\PHPMailer

create an email handle from PHPMailer for later customisation and sending

Returns

\PHPMailer\PHPMailer\PHPMailer —

mailAddressValidSecure()

mailAddressValidSecure(  address) : 

verifies whether a mail address is in an existing and STARTTLS enabled mail domain

Parameters

address

Returns

status of the mail domain

sendSMS()

sendSMS(  number,   content) : 

Send SMS invitations to end users

Parameters

number

the number to send to: with country prefix, but without the + sign ("352123456" for a Luxembourg example)

content

the text to send

Throws

\core\common\Exception

Returns

status of the sending process

adminInvitationMail()

adminInvitationMail(  targets,   introtext,   newtoken,  idpPrettyName, \core\Federation  federation) : mixed|string|int

Parameters

targets

one or more mail addresses, comma-separated

introtext

introductory sentence (varies by situation)

newtoken

the token to send

idpPrettyName
\core\Federation federation

if not NULL, indicates that invitation comes from authorised fed admin of that federation

Returns

mixed|string|int —

postJson()

postJson( url,  dataArray) : 

Parameters

url
dataArray

Returns