invite.php

Summary
invite.php
InviteSend an invitation to join the instance to an email address given.
InviteActionAction class to display invite send form and a received invite
showNoticeFormDummy function because we don’t use this in this Action
isReadOnlyFunction to indicate this class both reads and writes
handleDisplay the invite form or send an invite as appropriate
sendInvitationsMeat of the system, constructs and sends an invitation email.
showScriptsLoads the scripts neccesary for the invite page
titleReturns the title of the invitation page
showContentConstructs the HTML of the invite form or for a message the invites were sent, as appropriate.
showInvitationSuccessSubfunction for the code to show the invitation was successful.
showPageNoticeSubfunction to display errors, or the instructions for invites
showFormSwitches the invite system into invite form display mode
showInviteFormDisplays the actual invite form
sendInvitationSubfunction to construct and send a single invitation

Invite

Send an invitation to join the instance to an email address given.

postActiv

the micro-blogging software

Copyright

Copyright © 2016-2017, Maiyannah Bishop

Derived from code copyright various sources

  • GNU Social © 2013-2016, Free Software Foundation, Inc
  • StatusNet © 2008-2012, StatusNet, Inc

License

This program is free software: you can redistribute it and/or modify it under the terms of the GNU Affero General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version.

This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU Affero General Public License for more details.

You should have received a copy of the GNU Affero General Public License along with this program.  If not, see http://www.gnu.org/licenses/.

https://www.gnu.org/licenses/agpl.html

About

Send an invitation to join the instance to an email address given.

PHP version

Tested with PHP 7.0

File Authors

Web

InviteAction

Action class to display invite send form and a received invite

Variables

  • mode - current mode
  • error - last error if any
  • already - if an invite was already sent to this address
  • subbed - if the invited user was subbed to inviter
  • sent - if the invite was sent
Summary
showNoticeFormDummy function because we don’t use this in this Action
isReadOnlyFunction to indicate this class both reads and writes
handleDisplay the invite form or send an invite as appropriate
sendInvitationsMeat of the system, constructs and sends an invitation email.
showScriptsLoads the scripts neccesary for the invite page
titleReturns the title of the invitation page
showContentConstructs the HTML of the invite form or for a message the invites were sent, as appropriate.
showInvitationSuccessSubfunction for the code to show the invitation was successful.
showPageNoticeSubfunction to display errors, or the instructions for invites
showFormSwitches the invite system into invite form display mode
showInviteFormDisplays the actual invite form
sendInvitationSubfunction to construct and send a single invitation

showNoticeForm

function showNoticeForm()

Dummy function because we don’t use this in this Action

Returns

  • void

isReadOnly

function isReadOnly($args)

Function to indicate this class both reads and writes

Returns

  • boolean False

handle

function handle()

Display the invite form or send an invite as appropriate

Returns

  • void

Error states

If invites are disabled or you are not logged in, throws a clientError

sendInvitations

function sendInvitations()

Meat of the system, constructs and sends an invitation email.

Returns

  • void

showScripts

function showScripts()

Loads the scripts neccesary for the invite page

Returns

  • void

title

function title()

Returns the title of the invitation page

showContent

function showContent()

Constructs the HTML of the invite form or for a message the invites were sent, as appropriate.

Returns

  • void

showInvitationSuccess

function showInvitationSuccess()

Subfunction for the code to show the invitation was successful.

Returns

  • void

showPageNotice

function showPageNotice()

Subfunction to display errors, or the instructions for invites

Returns

  • void

showForm

function showForm($error = null)

Switches the invite system into invite form display mode

Returns

  • void

showInviteForm

function showInviteForm()

Displays the actual invite form

Returns

  • void

sendInvitation

function sendInvitation($email,
$user,
$personal)

Subfunction to construct and send a single invitation

Returns

  • void

Error States

  • if it couldn’t insert the invitation record into the DB, it logs this and returns false
function showNoticeForm()
Dummy function because we don’t use this in this Action
function isReadOnly($args)
Function to indicate this class both reads and writes
function handle()
Display the invite form or send an invite as appropriate
function sendInvitations()
Meat of the system, constructs and sends an invitation email.
function showScripts()
Loads the scripts neccesary for the invite page
function title()
Returns the title of the invitation page
function showContent()
Constructs the HTML of the invite form or for a message the invites were sent, as appropriate.
function showInvitationSuccess()
Subfunction for the code to show the invitation was successful.
function showPageNotice()
Subfunction to display errors, or the instructions for invites
function showForm($error = null)
Switches the invite system into invite form display mode
function showInviteForm()
Displays the actual invite form
function sendInvitation($email,
$user,
$personal)
Subfunction to construct and send a single invitation