public function confirmPassLost() { if (!isset($_POST['email'])) { FoxFWKernel::loadRouter('index'); } //trouver le compte ! $user = FoxFWUsers::existe($_POST['email']); if ($user == NULL) { return $GLOBALS['Twig']->render(FoxFWKernel::getView('users_passlost'), array('msg' => 'Cette Email n\'existe pas !')); } // On définit le corps du message $code = @md5('P8lit' . $user . 'y4Ol'); //ligne 171 //envoi le message de reset du password FoxFWKernel::addVendor('PHPMailer/class.phpmailer.php'); $mail = new PHPMailer(); $mail->charSet = "UTF-8"; //Emetteur $mail->setFrom($GLOBALS['Config']->FoxFW->email, 'Mailer'); //email HTML $mail->isHTML(true); // Définition du sujet/objet $mail->Subject = "Changement de mot de passe !"; //corps du mail $mail->Body = $GLOBALS['Twig']->render(FoxFWKernel::getView('users_pattern_mail_change_mdp'), array('url' => FoxFWKernel::path('user/passlost/' . $code))); // Il reste encore à ajouter au moins un destinataire // (ou plus, par plusieurs appel à cette méthode) $mail->AddAddress($_POST['email'], "Utilisateur"); //Envoyer le message if (!$mail->send()) { echo 'Message could not be sent.'; echo 'Mailer Error: ' . $mail->ErrorInfo; exit; } //jeton secu $_SESSION['CHANGEPASSWORD'] = $user; return $GLOBALS['Twig']->render(FoxFWKernel::getView('users_passlost'), array('msg' => 'Email envoyé !')); }
public static function bundlePath($path = '') { $ret = '#'; if (!isset($_SESSION['_BP' . $path])) { $tab = explode('#', $path); if (empty($tab[1])) { return '#'; } //path avec detection du bundle if ($tab[0] != $GLOBALS['Config']['FoxFW']['HomeBundle']) { $ret = FoxFWKernel::path(_BUNDLE . $tab[0] . '/web/' . $tab[1]); } else { $ret = FoxFWKernel::path(_HOME . 'web/' . $tab[1]); } $_SESSION['_BP' . $path] = $ret; } else { $ret = $_SESSION['_BP' . $path]; } return $ret; }
// // //-------------------------------------------------------------------------------- //twig extension function bundlePath ! $GLOBALS['Twig']->addFunction(new Twig_SimpleFunction('bundlePath', function ($path) { return FoxFWKernel::bundlePath($path); })); //-------------------------------------------------------------------------------- //-------------------------------------------------------------------------------- // // // //-------------------------------------------------------------------------------- //twig extension function path ! $GLOBALS['Twig']->addFunction(new Twig_SimpleFunction('path', function ($url) { return FoxFWKernel::path($url); })); //-------------------------------------------------------------------------------- //-------------------------------------------------------------------------------- // // // //-------------------------------------------------------------------------------- //twig extension function router ! $GLOBALS['Twig']->addFunction(new Twig_SimpleFunction('router', function ($id, $add = '') { return FoxFWKernel::router($id, $add); })); //-------------------------------------------------------------------------------- //-------------------------------------------------------------------------------- // //