From 2f27b7dfb7187ce252379ac4c9bfa2efd55bb6ae Mon Sep 17 00:00:00 2001 From: Vladimir H Date: Thu, 18 Dec 2008 06:25:25 -0600 Subject: [PATCH] Ajustado mailer.php de acuerdo a las necesidades del proyecto. --- include/constants.php | 118 +++++++++++--------------------------------------- include/mailer.php | 107 ++++++++++++++++----------------------------- 2 files changed, 64 insertions(+), 161 deletions(-) rewrite include/constants.php (75%) rewrite include/mailer.php (79%) diff --git a/include/constants.php b/include/constants.php dissimilarity index 75% index 7d56b18..850b78d 100644 --- a/include/constants.php +++ b/include/constants.php @@ -1,92 +1,26 @@ - - */ -define("COOKIE_EXPIRE", 60*60*24*100); //100 days by default -define("COOKIE_PATH", "/"); //Avaible in whole domain - -/** - * Email Constants - these specify what goes in - * the from field in the emails that the script - * sends to users, and whether to send a - * welcome email to newly registered users. - */ -define("EMAIL_FROM_NAME", "Ajelandro"); -define("EMAIL_FROM_ADDR", "buho.uca@todosv.com"); -define("EMAIL_WELCOME", true); - -/** - * This constant forces all users to have - * lowercase usernames, capital letters are - * converted automatically. - */ -define("ALL_LOWERCASE", false); -?> + diff --git a/include/mailer.php b/include/mailer.php dissimilarity index 79% index 3ca9536..09c3904 100644 --- a/include/mailer.php +++ b/include/mailer.php @@ -1,69 +1,38 @@ - - * - * Written by: Jpmaster77 a.k.a. The Grandmaster of C++ (GMC) - * Last Updated: August 19, 2004 - */ - -class Mailer -{ - /** - * sendWelcome - Sends a welcome message to the newly - * registered user, also supplying the username and - * password. - */ - function sendWelcome($user, $email, $pass){ - $from = "From: ".EMAIL_FROM_NAME." <".EMAIL_FROM_ADDR.">"; - $subject = "Jpmaster77's Site - Welcome!"; - $body = $user.",\n\n" - ."Welcome! You've just registered at Jpmaster77's Site " - ."with the following information:\n\n" - ."Username: ".$user."\n" - ."Password: ".$pass."\n\n" - ."If you ever lose or forget your password, a new " - ."password will be generated for you and sent to this " - ."email address, if you would like to change your " - ."email address you can do so by going to the " - ."My Account page after signing in.\n\n" - ."- Jpmaster77's Site"; - - return mail($email,$subject,$body,$from); - } - - /** - * sendNewPass - Sends the newly generated password - * to the user's email address that was specified at - * sign-up. - */ - function sendNewPass($user, $email, $pass){ - $from = "From: ".EMAIL_FROM_NAME." <".EMAIL_FROM_ADDR.">"; - $subject = "Jpmaster77's Site - Your new password"; - $body = $user.",\n\n" - ."We've generated a new password for you at your " - ."request, you can use this new password with your " - ."username to log in to Jpmaster77's Site.\n\n" - ."Username: ".$user."\n" - ."New Password: ".$pass."\n\n" - ."It is recommended that you change your password " - ."to something that is easier to remember, which " - ."can be done by going to the My Account page " - ."after signing in.\n\n" - ."- Jpmaster77's Site"; - - return mail($email,$subject,$body,$from); - } -}; - -/* Initialize mailer object */ -$mailer = new Mailer; - -?> +"; + $subject = "¡Bienvenido al Sistema de Horarios!"; + $body = $user.",\n\n" + ."¡Bienvenido! acabas de se registrado como instructor en el Sistema de Horarios" + ." con la siguiente información:\n\n" + ."Usuario: ".$user."\n" + ."Clave: ".$pass."\n\n" + ."Si tu clave esta en blanco significa que no necesitas de ella para ingresar al sistema\n" + ."De lo contrario será necesario que la ingreses para poder acceder a tu cuenta"; + + return mail($email,$subject,$body,$from); + } + + function sendNewPass($user, $email, $pass){ + $from = "From: ".EMAIL_FROM_NAME." <".EMAIL_FROM_ADDR.">"; + $subject = "Sistema de Horarios - Nueva contraseña"; + $body = $user.",\n\n" + ."Hemos generado una nueva contraseña a tu petición " + ."para que puedas reingresar al sistema con ella. " + ."username to log in to Jpmaster77's Site.\n\n" + ."Usuario: ".$user."\n" + ."Clave: ".$pass."\n\n" + ."Si tu clave esta en blanco significa que no necesitas de ella para ingresar al sistema\n" + ."De lo contrario será necesario que la ingreses para poder acceder a tu cuenta\n" + ."Se recomienda solicitar un cambio de contraseña una vez ingrese al sistema"; + + return mail($email,$subject,$body,$from); + } +}; + +$mailer = new Mailer; + +?> -- 2.11.4.GIT