change the registration process to email a random password due to recent abuse
This commit is contained in:
committed by
Chris Morgan
parent
7619dc2122
commit
7b26438a58
20
account.php
20
account.php
@@ -96,16 +96,6 @@ function cmd_do_new()
|
|||||||
retry("new", "Invalid email address");
|
retry("new", "Invalid email address");
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
if(strlen($aClean['sUserPassword']) < 5)
|
|
||||||
{
|
|
||||||
retry("new", "Password must be at least 5 characters");
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
if($aClean['sUserPassword'] != $aClean['sUserPassword2'])
|
|
||||||
{
|
|
||||||
retry("new", "Passwords don't match");
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
if(empty($aClean['sUserRealname']))
|
if(empty($aClean['sUserRealname']))
|
||||||
{
|
{
|
||||||
retry("new", "You don't have a Real name?");
|
retry("new", "You don't have a Real name?");
|
||||||
@@ -113,16 +103,14 @@ function cmd_do_new()
|
|||||||
}
|
}
|
||||||
|
|
||||||
$oUser = new User();
|
$oUser = new User();
|
||||||
|
$sPassword = substr(base_convert(rand(0, PHP_INT_MAX),10, 36), 0, 9);
|
||||||
$iResult = $oUser->create($aClean['sUserEmail'], $aClean['sUserPassword'],
|
$iResult = $oUser->create($aClean['sUserEmail'], $sPassword,
|
||||||
$aClean['sUserRealname'], $aClean['sWineRelease'] );
|
$aClean['sUserRealname'], $aClean['sWineRelease'] );
|
||||||
|
|
||||||
if($iResult == SUCCESS)
|
if($iResult == SUCCESS)
|
||||||
{
|
{
|
||||||
/* if we can log the user in, log them in automatically */
|
mail_appdb($oUser->sEmail, "New account", "Your password is ".$sPassword);
|
||||||
$oUser->login($aClean['sUserEmail'], $aClean['sUserPassword']);
|
addmsg("Account created! Check your email for your password. (".$aClean['sUserEmail'].")", "green");
|
||||||
|
|
||||||
addmsg("Account created! (".$aClean['sUserEmail'].")", "green");
|
|
||||||
util_redirect_and_exit(apidb_fullurl());
|
util_redirect_and_exit(apidb_fullurl());
|
||||||
}
|
}
|
||||||
else if($iResult == USER_CREATE_EXISTS)
|
else if($iResult == USER_CREATE_EXISTS)
|
||||||
|
|||||||
@@ -16,14 +16,6 @@ echo html_frame_start("Create New Application DB Account","400","",0)
|
|||||||
<td class=color1> E-mail </td>
|
<td class=color1> E-mail </td>
|
||||||
<td class=color0> <input type="text" name="sUserEmail" value='<?php if(!empty($aClean['sUserEmail'])) echo $aClean['sUserEmail']?>'> </td>
|
<td class=color0> <input type="text" name="sUserEmail" value='<?php if(!empty($aClean['sUserEmail'])) echo $aClean['sUserEmail']?>'> </td>
|
||||||
</tr>
|
</tr>
|
||||||
<tr>
|
|
||||||
<td class=color1> Password </td>
|
|
||||||
<td class=color0> <input type="password" name="sUserPassword"> </td>
|
|
||||||
</tr>
|
|
||||||
<tr>
|
|
||||||
<td class=color1> Password (again) </td>
|
|
||||||
<td class=color0> <input type="password" name="sUserPassword2"> </td>
|
|
||||||
</tr>
|
|
||||||
<tr>
|
<tr>
|
||||||
<td class=color1> Real Name </td>
|
<td class=color1> Real Name </td>
|
||||||
<td class=color0> <input type="text" name="sUserRealname" value='<?php if(!empty($aClean['sUserRealname'])) echo $aClean['sUserRealname']?>'> </td>
|
<td class=color0> <input type="text" name="sUserRealname" value='<?php if(!empty($aClean['sUserRealname'])) echo $aClean['sUserRealname']?>'> </td>
|
||||||
|
|||||||
@@ -173,6 +173,7 @@ class User {
|
|||||||
$retval = $this->login($sEmail, $sPassword);
|
$retval = $this->login($sEmail, $sPassword);
|
||||||
if($retval == SUCCESS)
|
if($retval == SUCCESS)
|
||||||
$this->setPref("comments:mode", "threaded"); /* set the users default comments:mode to threaded */
|
$this->setPref("comments:mode", "threaded"); /* set the users default comments:mode to threaded */
|
||||||
|
$this->logout();
|
||||||
|
|
||||||
return $retval;
|
return $retval;
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user