Completed
Pull Request — master (#11)
by
unknown
04:05 queued 01:41
created

PasswordResetEmail::getTextBody()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 10
Code Lines 3

Duplication

Lines 10
Ratio 100 %

Importance

Changes 0
Metric Value
cc 1
eloc 3
nc 1
nop 0
dl 10
loc 10
rs 9.4285
c 0
b 0
f 0
1
<?php
2
require_once('class.FlipsideProfileEmail.php');
3
4
class PasswordResetEmail extends FlipsideProfileEmail
5
{
6
    /** An instance of the Settings class */
7
    protected $settings;
8
    /** The prfiles app URL */
9
    protected $profilesUrl
10
11
12
    public function __construct($user)
0 ignored issues
show
Bug introduced by
This code did not parse for me. Apparently, there is an error somewhere around this line:

Syntax error, unexpected T_PUBLIC, expecting ',' or ';'
Loading history...
13
    {
14
        parent::__construct($user);
15
        $this->addToAddress($user->mail, $user->displayName);
16
        $this->settings = \Settings::getInstance();
17
        $this->profilesUrl = $this->settings->getGlobalSetting('profiles_url', 'https://profiles.burningflipside.com/');
18
    }
19
20
    public function getSubject()
21
    {
22
        return 'Burning Flipside Password Reset';
23
    }
24
25
    public function getHTMLBody()
26
    {
27
        return 'Someone (quite possibly you) has requested a password reset of your Flipside account.<br/>
28
                To reset your password click on the link below.<br/>
29
                <a href="'.$this->profilesUrl.'/change.php?hash='.$this->user->getPasswordResetHash().'">Reset Password</a><br/>
30
                If you did not request this reset, don\'t worry. This email was sent only to you and your password has not been changed.<br/>
31
                If you receive many of these requests, you can notify the technology team ([email protected]).<br/>
32
                Thank you,<br/>
33
                Burning Flipside Technology Team';
34
    }
35
36
    public function getTextBody()
37
    {
38
        return 'Someone (quite possibly you) has requested a password reset of your Flipside account.
39
                To reset your password copy the following URL into your browser.
40
                '.$this->profilesUrl.'/change.php?hash='.$this->user->getPasswordResetHash().'
41
                If you did not request this reset, don\'t worry. This email was sent only to you and your password has not been changed.
42
                If you receive many of these requests, you can notify the technology team ([email protected]).
43
                Thank you,
44
                Burning Flipside Technology Team';
45
    }
46
}
47
?>
0 ignored issues
show
Best Practice introduced by
It is not recommended to use PHP's closing tag ?> in files other than templates.

Using a closing tag in PHP files that only contain PHP code is not recommended as you might accidentally add whitespace after the closing tag which would then be output by PHP. This can cause severe problems, for example headers cannot be sent anymore.

A simple precaution is to leave off the closing tag as it is not required, and it also has no negative effects whatsoever.

Loading history...
48