users
[ class tree: users ] [ index: users ] [ all elements ]

Source for file remind_password.php

Documentation is available at remind_password.php

  1. <?php
  2. /**
  3.  * $Header: /cvsroot/bitweaver/_bit_users/remind_password.php,v 1.21 2007/02/09 15:28:53 phoenixandy Exp $
  4.  *
  5.  * Copyright (c) 2004 bitweaver.org
  6.  * Copyright (c) 2003 tikwiki.org
  7.  * Copyright (c) 2002-2003, Luis Argerich, Garland Foster, Eduardo Polidor, et. al.
  8.  * All Rights Reserved. See copyright.txt for details and a complete list of authors.
  9.  * Licensed under the GNU LESSER GENERAL PUBLIC LICENSE. See license.txt for details
  10.  *
  11.  * $Id: remind_password.php,v 1.21 2007/02/09 15:28:53 phoenixandy Exp $
  12.  * @package users
  13.  * @subpackage functions
  14.  */
  15.  
  16. /**
  17.  * required setup
  18.  */
  19. require_once'../bit_setup_inc.php' );
  20.  
  21. $gBitSystem->verifyFeature'users_forgot_pass' );
  22.  
  23. if$gBitUser->isRegistered() ) {
  24.     header'Location: '.BIT_ROOT_URL );
  25.     die;
  26. elseif (isset($_REQUEST["remind"])) {
  27.     $userInfo '';
  28.     $pLogin trim$_REQUEST["username");
  29.     if strlen $pLogin ) ) {
  30.         $loginCol strpos$pLogin'@' 'email' 'login';
  31.         $userInfo $gBitUser->getUserInfoarray$loginCol => $pLogin ) );
  32.     }
  33.     if$userInfo {
  34.         if $gBitSystem->isFeatureActive'users_clear_passwords' && !empty($userInfo['user_password']) ) {
  35.             $gBitSmarty->assign'userPass'$userInfo['user_password');
  36.             $tmp['success'tra("A password reminder email has been sent ");
  37.             $pass $userInfo['user_password'];
  38.         else {
  39.             $pass $gBitUser->genPass();
  40.             list($pass,$provpass$gBitUser->createTempPassword$_REQUEST["username"]$pass );
  41.             $gBitSmarty->assign'mailProvPass'$provpass );
  42.             $gBitSmarty->assign'mailUserId'$userInfo['user_id');
  43.             $tmp['success'tra("Information to reset your password has been sent ");
  44.         }
  45.         $tmp['success'.= tra("to the registered email address for")." " $_REQUEST["username"".";
  46.  
  47.         $gBitSmarty->assign('mail_user'$userInfo[$loginCol]);
  48.         $gBitSmarty->assign('mail_same'$gBitSystem->isFeatureActive'users_clear_passwords' ));
  49.         $gBitSmarty->assign('mail_pass'$pass);
  50.         $mail_data $gBitSmarty->fetch('bitpackage:users/password_reminder.tpl');
  51.         $subject tra"Your password for" ).": ".$gBitSystem->getConfig'site_title'$_SERVER['HTTP_HOST');
  52.         mail$userInfo['email']$subject$mail_data"From: ".$gBitSystem->getConfig'site_sender_email' )."\r\nContent-type: text/plain;charset=utf-8\r\n");
  53.         // Just show "success" message and no form
  54.     else {
  55.         // Show error message (and leave form visible so user can fix problem)
  56.         $gBitSmarty->assign('showmsg''e');
  57.         $tmp['error'tra("Invalid or unknown username").": ".$_REQUEST["username"];
  58.     }
  59.     $gBitSmarty->assign('msg'$tmp);
  60. }
  61. // Display the template
  62. $gBitSystem->display'bitpackage:users/remind_password.tpl''Request New Password' );
  63. ?>

Documentation generated on Thu, 15 Feb 2007 20:48:12 +0000 by phpDocumentor 1.3.0