PasswordResetEmail   A
last analyzed

Complexity

Total Complexity 5

Size/Duplication

Total Lines 45
Duplicated Lines 0 %

Coupling/Cohesion

Components 1
Dependencies 2

Importance

Changes 0
Metric Value
dl 0
loc 45
rs 10
c 0
b 0
f 0
wmc 5
lcom 1
cbo 2

5 Methods

Rating   Name   Duplication   Size   Complexity  
A __construct() 0 6 1
A getSubject() 0 4 1
A getResetLink() 0 6 1
A getHTMLBody() 0 10 1
A getTextBody() 0 10 1
1
<?php
2
require_once('class.FlipsideProfileEmail.php');
3
4
class PasswordResetEmail extends FlipsideProfileEmail
5
{
6
    private $hash;
7
8
    public function __construct($user)
9
    {
10
        parent::__construct($user);
11
        $this->addToAddress($user->mail, $user->displayName);
12
        $this->hash = $this->user->getPasswordResetHash();
13
    }
14
15
    public function getSubject()
16
    {
17
        return 'Burning Flipside Password Reset';
18
    }
19
20
    protected function getResetLink()
21
    {
22
        $settings = \Settings::getInstance();
23
        $profilesUrl = $settings->getGlobalSetting('profiles_url', 'https://profiles.burningflipside.com');
24
        return $profilesUrl.'/change.php?hash='.$this->hash;
25
    }
26
27
    public function getHTMLBody()
28
    {
29
        return 'Someone (quite possibly you) has requested a password reset of your Flipside account.<br/>
30
                To reset your password click on the link below.<br/>
31
                <a href="'.$this->getResetLink().'">Reset Password</a><br/>
32
                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/>
33
                If you receive many of these requests, you can notify the technology team ([email protected]).<br/>
34
                Thank you,<br/>
35
                Burning Flipside Technology Team';
36
    }
37
38
    public function getTextBody()
39
    {
40
        return 'Someone (quite possibly you) has requested a password reset of your Flipside account.
41
                To reset your password copy the following URL into your browser.
42
                '.$this->getResetLink().'
43
                If you did not request this reset, don\'t worry. This email was sent only to you and your password has not been changed.
44
                If you receive many of these requests, you can notify the technology team ([email protected]).
45
                Thank you,
46
                Burning Flipside Technology Team';
47
    }
48
}
49
/* vim: set tabstop=4 shiftwidth=4 expandtab: */
50