diff options
| author | bitweaver.org <bitweaver@users.sourceforge.net> | 2005-06-19 05:12:24 +0000 |
|---|---|---|
| committer | bitweaver.org <bitweaver@users.sourceforge.net> | 2005-06-19 05:12:24 +0000 |
| commit | 657b3b2cb4d1ecb68c78320bdc03151590a9e6cd (patch) | |
| tree | c88e26bedb5f01d457e28d07d6b7aa08ed13cdd1 /remind_password.php | |
| download | users-657b3b2cb4d1ecb68c78320bdc03151590a9e6cd.tar.gz users-657b3b2cb4d1ecb68c78320bdc03151590a9e6cd.tar.bz2 users-657b3b2cb4d1ecb68c78320bdc03151590a9e6cd.zip | |
IMPORT TikiPro CLYDE FINAL
Diffstat (limited to 'remind_password.php')
| -rw-r--r-- | remind_password.php | 41 |
1 files changed, 41 insertions, 0 deletions
diff --git a/remind_password.php b/remind_password.php new file mode 100644 index 0000000..bcbed4d --- /dev/null +++ b/remind_password.php @@ -0,0 +1,41 @@ +<?php +// $Header: /cvsroot/bitweaver/_bit_users/remind_password.php,v 1.1 2005/06/19 05:12:22 bitweaver Exp $ +// Copyright (c) 2002-2003, Luis Argerich, Garland Foster, Eduardo Polidor, et. al. +// 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. +// Initialization +require_once( '../bit_setup_inc.php' ); +if ($forgotPass != 'y') { + $smarty->assign('msg', tra("This feature is disabled").": forgotPass"); + $gBitSystem->display( 'error.tpl' ); + die; +} +if (isset($_REQUEST["remind"])) { + if( $userInfo = $gBitUser->getUserInfo( array( 'login' => $_REQUEST["username"] ) ) ) { + if ( $gBitSystem->isFeatureActive( 'feature_clear_passwords' ) && !empty($userInfo['password']) ) { + $pass = $userInfo['password']; + $tmp['success'] = tra("A password reminder email has been sent "); + } else { + $pass = $gBitUser->renew_user_password($_REQUEST["username"]); + $tmp['success'] = tra("A new password has been sent "); + } + $tmp['success'] .= tra("to the registered email address for")." " . $_REQUEST["username"] . "."; + + $smarty->assign('mail_site', $_SERVER["SERVER_NAME"]); + $smarty->assign('mail_user', $_REQUEST["username"]); + $smarty->assign('mail_same', $gBitSystem->isFeatureActive( 'feature_clear_passwords' )); + $smarty->assign('mail_pass', $pass); + $mail_data = $smarty->fetch('bitpackage:users/password_reminder.tpl'); + $subject = "Your password for ".$gBitSystem->getPreference( 'siteTitle', $_SERVER['HTTP_HOST'] ); + mail( $userInfo['email'], $subject, $mail_data, "From: ".$gBitSystem->getPreference( 'sender_email' )."\r\nContent-type: text/plain;charset=utf-8\r\n"); + // Just show "success" message and no form + } else { + // Show error message (and leave form visible so user can fix problem) + $smarty->assign('showmsg', 'e'); + $tmp['error'] = tra("Invalid or unknown username").": ".$_REQUEST["username"]; + } + $smarty->assign('msg', $tmp); +} +// Display the template +$gBitSystem->display( 'bitpackage:users/remind_password.tpl'); +?> |
