With this mod you can email yourself a new password if you forgot your old one.
Installation:
Please read the readme file.
35f504164d5a963d6a820e71614a4009Fatal error: Cannot redeclare makerandompassword() (previously declared in /home/*****/public_html/*****/control/lostpass.php:89) in /home/*****/public_html/*****/control/plugins/newsletter.php on line 400if(!function_exists('makerandompassword')){
here comes the function
}FI-DD wrote:Find one of the makerandompassword() functions and put this around it:
- Code: Select all
if(!function_exists('makerandompassword')){
here comes the function
}
Parse error: syntax error, unexpected T_IF, expecting T_STRING in /home/solution/public_html/kpaneel/lostpass.php on line 88
[quote][/quote]<?php
/////////////////////////////////////////////////////////////////////
//Lostpass mod based on lostpass.php from CuteHack //
//Modified for CuteNews.RU by FI-DD //
//http://english.cutenews.ru/forum/profile.php?mode=viewprofile&u=2//
/////////////////////////////////////////////////////////////////////
include('./head.php');
require_once("./data/config.php");
require_once("./skins/${config_skin}.skin.php");
$echo = cute_lang('addons/lostpass');
if($action == "dosend"){
if($user == "" or $email == ""){
msg('error', $echo['error'], $echo['empty'], 'javascript:history.back(1)');
}
else{
if(!$query = $sql -> select(array('table' => 'users', 'where' => array("username = $user", "and", "mail = $email")))) {
msg('error', $echo['error'], $echo['notFound'], 'javascript:history.back(1)');
}
else{
foreach($query as $row){
$new_pass = if(!function_exists('makerandompassword')){
here comes the function
};
$sql -> update(array(
'table' => 'users',
'where' => array("id = ".$row['id'].""),
'values' => array('password' => md5x($new_pass))
));
cute_mail("$email", $echo['mailSubject'], sprintf($echo['mailMessage'], $user, $new_pass));
msg("info", $echo['headerSent'], sprintf($echo['passwordSent'], $user, $email, $config_http_script_dir));
}
}
}
}
elseif($action == "showlostpass"){
echoheader("user", $echo['header']);
echo"<form method=post action=\"\"><table border=0 cellpading=0 cellspacing=0 width=\"654\" height=\"59\" >
<td width=\"18\" height=\"11\">
<td width=\"71\" height=\"11\" align=\"left\">
".$echo['username']."<td width=\"203\" height=\"11\" align=\"left\">
<input type=text name=user seize=20>
<td width=\"350\" height=\"26\" align=\"left\" rowspan=\"2\" valign=\"middle\">
".$echo['description']."
<tr>
<td width=\"18\" valign=\"top\" height=\"15\">
<td width=\"71\" height=\"15\" align=\"left\">
".$echo['email']."
<td width=\"203\" height=\"15\" align=\"left\">
<input type=text name=email size=\"20\">
</tr>
<tr>
<td width=\"18\" valign=\"top\" height=\"15\">
<td width=\"628\" height=\"15\" align=\"left\" colspan=\"3\">
</tr>
<tr>
<td width=\"18\" valign=\"top\" height=\"15\">
<td width=\"628\" height=\"15\" align=\"left\" colspan=\"3\">
<input type=submit value=\"".$echo['submit']."\">
</tr>
<input type=hidden name=action value=dosend>
<tr>
<td width=\"18\" height=\"27\">
<td width=\"632\" height=\"27\" colspan=\"3\">
</tr></table></form>";
echofooter();
}
////////////////////////////////////////////////////////
// Function: makeRandomPassword Version: 1.0
// Description: Make a random password
function if(!function_exists('makerandompassword')){
here comes the function
} {
$salt = "abchefghjkmnpqrstuvwxyz0123456789";
$pass = "";
srand((double)microtime()*1000000);
$i = 0;
while ($i <= 7) {
$num = rand() % 33;
$tmp = substr($salt, $num, 1);
$pass = $pass . $tmp;
$i++;
}
return $pass;
}
?>if(!function_exists('makeRandomPassword'){
<table border="0" cellspacing="0" cellpadding="2">
<form name="login" action="cnr/index.php" method="post" onsubmit="return process_form(this)">
<tr>
<td width="55">Username:
<td><input tabindex="1" type="text" name="username" value="<?=$lastusername; ?>" style="width:134">
<tr>
<td>Password:
<td><input type="password" name="password" style="width:134">
<tr>
<td><a href="index.php?do=register">[Register]</a>
<td><a href="<?=$config_http_script_dir; ?>/lostpass.php?action=showlostpass">[Recover pass]</a>
<input accesskey="s" type="submit" style="width:60;" value="Log in">
<tr>
<td align="center" colspan="3"><?=$result; ?></td>
</tr>
<input type="hidden" name="action" value="dologin">
</form>
</table>
FI-DD wrote:Sorry, there was a mistake in the code. It's fixed now. Please download it again.
Return to Additional Downloads
Users browsing this forum: No registered users and 0 guests