Cmscout1.00rc2 > Forgot.php

Questions? Need Help? Want to share? » PHP Forum
Script Name:
Cmscout1.00rc2

Download:
cmscout1.00rc2.zip

Category:
Content Management

Archive Content:

Content:

Admin

Content:

Avatars

Cache

Calendar

Calendar > Lang

Content:

Docs

Content:

Downloads

Content:

Forums

Content:

Images

Includes

Includes > Internals

Includes > Plugins

Includes

Content:

Install

Install > Templates C

Install

Content:

Photos

Pm

Content:

Sidebox

Content:

Templates > Admin

Templates > Admin > Images

Templates > Admin

Templates > CMScout

Templates > CMScout > Images

Templates > CMScout

Templates

Templates C

Content:

Tiny Mce

Tiny Mce > Langs

Tiny Mce > Plugins > Advhr

Tiny Mce > Plugins > Advhr > Images

Tiny Mce > Plugins > Advhr > Jscripts

Tiny Mce > Plugins > Advhr > Langs

Tiny Mce > Plugins > Advhr

Tiny Mce > Plugins > Advimage > Css

Tiny Mce > Plugins > Advimage

Tiny Mce > Plugins > Advimage > Images

Tiny Mce > Plugins > Advimage > Jscripts

Tiny Mce > Plugins > Advimage > Langs

Tiny Mce > Plugins > Advlink > Css

Tiny Mce > Plugins > Advlink

Tiny Mce > Plugins > Advlink > Jscripts

Tiny Mce > Plugins > Advlink > Langs

Tiny Mce > Plugins > Advlink

Tiny Mce > Plugins > Autosave

Tiny Mce > Plugins > Autosave > Langs

Tiny Mce > Plugins > Contextmenu > Css

Tiny Mce > Plugins > Contextmenu

Tiny Mce > Plugins > Contextmenu > Images

Tiny Mce > Plugins > Directionality

Tiny Mce > Plugins > Directionality > Images

Tiny Mce > Plugins > Directionality > Langs

Tiny Mce > Plugins > Emotions

Tiny Mce > Plugins > Emotions > Images

Tiny Mce > Plugins > Emotions > Jscripts

Tiny Mce > Plugins > Emotions > Langs

Tiny Mce > Plugins > Fullscreen

Tiny Mce > Plugins > Fullscreen > Images

Tiny Mce > Plugins > Fullscreen > Langs

Tiny Mce > Plugins > Ibrowser > Config

Tiny Mce > Plugins > Ibrowser > Css

Tiny Mce > Plugins > Ibrowser

Tiny Mce > Plugins > Ibrowser > Images

Tiny Mce > Plugins > Ibrowser

Tiny Mce > Plugins > Ibrowser > Interface

Tiny Mce > Plugins > Ibrowser > Interface > Images > TinyMCE

Tiny Mce > Plugins > Ibrowser > Interface

Tiny Mce > Plugins > Ibrowser > Langs

Tiny Mce > Plugins > Ibrowser > Scripts

Tiny Mce > Plugins > Ibrowser > Scripts > PhpThumb > Cache

Tiny Mce > Plugins > Ibrowser > Scripts > PhpThumb > Cache > Source

Tiny Mce > Plugins > Ibrowser > Scripts > PhpThumb > Demo

Tiny Mce > Plugins > Ibrowser > Scripts > PhpThumb > Docs

Tiny Mce > Plugins > Ibrowser > Scripts > PhpThumb > Fonts

Tiny Mce > Plugins > Ibrowser > Scripts > PhpThumb

Tiny Mce > Plugins > Ibrowser > Scripts

Tiny Mce > Plugins > Ibrowser > Temp

Tiny Mce > Plugins

Tiny Mce > Plugins > Inlinepopups > Css

Tiny Mce > Plugins > Inlinepopups

Tiny Mce > Plugins > Inlinepopups > Images

Tiny Mce > Plugins > Inlinepopups > Jscripts

Tiny Mce > Plugins > Insertdatetime

Tiny Mce > Plugins > Insertdatetime > Images

Tiny Mce > Plugins > Insertdatetime > Langs

Tiny Mce > Plugins > Paste

Tiny Mce > Plugins > Paste > Css

Tiny Mce > Plugins > Paste

Tiny Mce > Plugins > Paste > Images

Tiny Mce > Plugins > Paste > Jscripts

Tiny Mce > Plugins > Paste > Langs

Tiny Mce > Plugins > Paste

Tiny Mce > Plugins > Preview

Tiny Mce > Plugins > Preview > Images

Tiny Mce > Plugins > Preview > Langs

Tiny Mce > Plugins > Print

Tiny Mce > Plugins > Print > Images

Tiny Mce > Plugins > Print > Langs

Tiny Mce > Plugins > Searchreplace

Tiny Mce > Plugins > Searchreplace > Images

Tiny Mce > Plugins > Searchreplace > Jscripts

Tiny Mce > Plugins > Searchreplace > Langs

Tiny Mce > Plugins > Searchreplace

Tiny Mce > Plugins > Table

Tiny Mce > Plugins > Table > Css

Tiny Mce > Plugins > Table

Tiny Mce > Plugins > Table > Images

Tiny Mce > Plugins > Table > Jscripts

Tiny Mce > Plugins > Table > Langs

Tiny Mce > Plugins > Table

Tiny Mce > Themes > Advanced

Tiny Mce > Themes > Advanced > Css

Tiny Mce > Themes > Advanced > Docs > En

Tiny Mce > Themes > Advanced > Docs > En > Images

Tiny Mce > Themes > Advanced > Docs > En

Tiny Mce > Themes > Advanced > Docs > Images

Tiny Mce > Themes > Advanced

Tiny Mce > Themes > Advanced > Images

Tiny Mce > Themes > Advanced > Images > Xp

Tiny Mce > Themes > Advanced > Jscripts

Tiny Mce > Themes > Advanced > Langs

Tiny Mce > Themes > Advanced

Tiny Mce

Tiny Mce > Utils

Content:

Forgot.php:


<?php
/**************************************************************************
    FILENAME        :   forgot.php
    PURPOSE OF FILE :   Resets users password and emails user with new password.
    LAST UPDATED    :   08 June 2005
    COPYRIGHT       :   © 2005 CMScout Group
    WWW             :   www.cmscout.za.org
    LICENSE         :   GPL vs2.0
    
    

    This program is free software; you can redistribute it and/or modify
    it under the terms of the GNU General Public License as published by
    the Free Software Foundation; either version 2 of the License,  or
    (at your option) any later version.

    This program is distributed in the hope that it will be useful,
    but WITHOUT ANY WARRANTY; without even the implied warranty of
    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
    GNU General Public License for more details.

    You should have received a copy of the GNU General Public License
    along with this program; if not,  write to the Free Software
    Foundation,  Inc.,  51 Franklin St,  Fifth Floor,  Boston,  MA  02110-1301  USA
**************************************************************************/
?>
<?php
if (!defined('SCOUT_NUKE'))
    die(
"You have accessed this page illegally,  please go use the main menu");

if (
$uname != "Guest" || $uname="")
{
    
error_message("Your logged on,  how could you have forgotten your password?");
}

if (
$_POST['submit'] == "Submit")
{
    
$email $_POST['email'];
    if (
$email != "")
    {
        
$sql $data->select_query("records",  "WHERE email='$email'");
    }
    else
    {
        
show_message("Please enter a email address.");
    }
        
    if (
$data->num_rows($sql) > && $email != "")
    {    
        
$temp $data->fetch_array($sql);
        
$username safesql($temp['uname'],  "text");
        
$password "";
        
srand(time(NULL));
        
$passlen rand()%5+5;
        for(
$i=0;$i<=$passlen;$i++)
        {
            
$password .= chr(rand()%26+97);
        }
        
$password safesql(md5(password),  "text");
        
$data->update_query("authuser",  "passwd=$password",  "uname=$username",  "Forgetten Password",  "User with $email address forgot username/password,  uname=$username");
       
        
/* subject */
        
$subject "[{$config['troopname']} site Admin] Password Reset";
        
        
/* message */
        
$emess "
Hello $username

You are receiving this email because you have (or someone pretending to be you has) requested a new password be sent for your account on {$config['troopname']}. If you did not request this email then please ignore it (But,  your password has been changed),  if you keep receiving it please contact the webmaster.

You will now be able to login using the following information:

--------------------------
Username: $username
Password: $password
--------------------------

You can of course change this password yourself via the profile page. If you have any difficulties please contact the webmaster.

Regards
{$config['troopname']} Webmaster
{$config['sitemail']}"
;
    
       
        
/* additional headers */
        
$headers .= "From: {$config['troopname']} Webmaster <{$config['sitemail']}>\r\n";
        
        
/* and now mail it */
        
$mailsuc mail($email,  $subject,  $emess,  $headers);
        if (!
$mailsucerror_message("Error Sending Mail. Please contact the webmaster");
        else 
show_message("Your username and new password has been emailed to you.");
    }
    elseif (
$data->num_rows($sql) == && $email != "")
    {
        
show_message("That email address does not seem to exist in our database.");
    }
}

$editFormAction $_SERVER['PHP_SELF'];
if (isset(
$_SERVER['QUERY_STRING']))
{
  
$editFormAction .= "?" htmlentities($_SERVER['QUERY_STRING']);
}
$tpl->assign('editFormAction',  $editFormAction);
$dbpage true;
$pagename='forgot';
?>


Other Content Management Scripts:

WebMaster Resources Home

©RingsWorld.com