Exemple #1
0
 public function postSendEmail($p, $z)
 {
     $person = new Person($p[1]);
     $token = $person->generateToken('resetPassword');
     $message = new GuiMessage();
     $message->setFrom('*****@*****.**', 'The System');
     $message->addTo($person->getEmail(), $person->getName());
     $message->setSubject('password reset');
     $message->assign('token', $token);
     $message->send('messages/setPassword.tpl');
     die;
 }
Exemple #2
0
 public function postResetPassword($p, $z)
 {
     Form::set('Person', function ($person) {
         $person->password = Person::hashPassword($person->password);
     });
     $objects = Form::save();
     $person = current($objects);
     assert($person instanceof Person);
     $person->login();
     $message = new GuiMessage();
     $message->setFrom('*****@*****.**', 'The System');
     $message->addTo($person->username);
     $message->setSubject("{$person->firstname}, your password has been reset");
     $message->assign('person', $person);
     $message->send('messages/confirmPasswordReset.tpl');
     BaseRedirect('install/list');
 }