summaryrefslogtreecommitdiff
path: root/change_password.php
diff options
context:
space:
mode:
authorLester Caine <lester@lsces.co.uk>2007-07-24 08:02:57 +0000
committerLester Caine <lester@lsces.co.uk>2007-07-24 08:02:57 +0000
commit01effaac5deab125d4c31c78ccf2721f3b558299 (patch)
tree4ccd05dac8689d2867fe9a7cd65a95878aee368a /change_password.php
parent117002ef86a8373ee6c56d4627fb0e42194ad884 (diff)
downloadusers-01effaac5deab125d4c31c78ccf2721f3b558299.tar.gz
users-01effaac5deab125d4c31c78ccf2721f3b558299.tar.bz2
users-01effaac5deab125d4c31c78ccf2721f3b558299.zip
Send welcome message after changing provpass
Diffstat (limited to 'change_password.php')
-rw-r--r--change_password.php16
1 files changed, 12 insertions, 4 deletions
diff --git a/change_password.php b/change_password.php
index 1f981bd..b8a4f20 100644
--- a/change_password.php
+++ b/change_password.php
@@ -1,6 +1,6 @@
<?php
/**
- * $Header: /cvsroot/bitweaver/_bit_users/change_password.php,v 1.8 2007/04/23 09:36:32 squareing Exp $
+ * $Header: /cvsroot/bitweaver/_bit_users/change_password.php,v 1.9 2007/07/24 08:02:57 lsces Exp $
*
* Copyright (c) 2004 bitweaver.org
* Copyright (c) 2003 tikwiki.org
@@ -8,7 +8,7 @@
* All Rights Reserved. See copyright.txt for details and a complete list of authors.
* Licensed under the GNU LESSER GENERAL PUBLIC LICENSE. See license.txt for details
*
- * $Id: change_password.php,v 1.8 2007/04/23 09:36:32 squareing Exp $
+ * $Id: change_password.php,v 1.9 2007/07/24 08:02:57 lsces Exp $
* @package users
* @subpackage functions
*/
@@ -41,8 +41,16 @@ if (isset($_REQUEST["change"])) {
$validated = FALSE;
if( !empty( $_REQUEST["provpass"] ) ) {
- if( !($validated = $gBitUser->confirmRegistration( $userInfo['user_id'], $_REQUEST["provpass"] )) ) {
- $gBitSystem->fatalError( tra("Password reset request is invalid or has expired") );
+ if( $validated = $gBitUser->confirmRegistration( $userInfo['user_id'], $_REQUEST["provpass"] ) ) {
+ if( $gBitSystem->isFeatureActive( 'send_welcome_email' ) ) {
+ // Send the welcome mail
+ $gBitSmarty->assign( 'mailPassword',$_REQUEST['pass'] );
+ $gBitSmarty->assign( 'mailEmail',$validated['email'] );
+ $mail_data = $gBitSmarty->fetch('bitpackage:users/welcome_mail.tpl');
+ mail($validated["email"], tra( 'Welcome to' ).' '.$gBitSystem->getConfig('site_title', $_SERVER['HTTP_HOST'] ),$mail_data,"From: ".$gBitSystem->getConfig('site_sender_email')."\r\nContent-type: text/plain;charset=utf-8\r\n");
+ } else {
+ $gBitSystem->fatalError( tra("Password reset request is invalid or has expired") );
+ }
}
} elseif( $gBitUser->isRegistered() ) {
if( !( $validated = $gBitUser->validate( $userInfo['login'], $_REQUEST["oldpass"], '', '' )) ) {