Exemplo n.º 1
0
    public function reset(UserInterface $user)
    {
        $scheme = $this->isHTTPS() ? 'https' : 'http';
        $message = '
        <html>
            <head>
               <title>Camagru reset request</title>
            </head>
            <body>
                <p>
                    Hello ' . $user->getUsername() . ' !<br /><br />

                    Your requested to change your password, to proceed, click on the following link:<br />
                    <a href="' . $scheme . '://' . $_SERVER['HTTP_HOST'] . '/reset?key=' . $user->getHash() . '">
                        ' . $scheme . '://' . $_SERVER['HTTP_HOST'] . '/reset?key=' . $user->getHash() . '</a>
                    <br /><br />

                    If you did not request to change your password on Camagru, ignore this email.<br /><br />

                    Camagru webmaster.
                </p>
            </body>
        </html>
        ';
        $this->send($message, 'reset password', $user);
    }
Exemplo n.º 2
0
 public function update(UserInterface $user)
 {
     $req = $this->db->prepare('
         UPDATE `camagru_user` SET
             username = :username,
             email = :email,
             password = :password,
             hash = :hash,
             active = :active
         WHERE id = :id
     ');
     $req->execute(['id' => $user->getId(), 'username' => $user->getUsername(), 'email' => $user->getEmail(), 'password' => $user->getPassword(), 'hash' => $user->getHash(), 'active' => $user->getActive()]);
 }