autoname calls
implement getRandomName function
This commit is contained in:
parent
0e01568ccd
commit
b99925060a
5 changed files with 6 additions and 5 deletions
|
@ -31,7 +31,7 @@ function lostpass_post(App $a)
|
|||
$a->internalRedirect();
|
||||
}
|
||||
|
||||
$pwdreset_token = autoname(12) . mt_rand(1000, 9999);
|
||||
$pwdreset_token = Strings::getRandomName(12) . mt_rand(1000, 9999);
|
||||
|
||||
$fields = [
|
||||
'pwdreset' => $pwdreset_token,
|
||||
|
|
|
@ -11,6 +11,7 @@ use Friendica\Database\DBA;
|
|||
use Friendica\Database\DBStructure;
|
||||
use Friendica\Object\Image;
|
||||
use Friendica\Util\Network;
|
||||
use Friendica\Util\Strings;
|
||||
|
||||
/**
|
||||
* Contains methods for installation purpose of Friendica
|
||||
|
@ -264,7 +265,7 @@ class Installer
|
|||
}
|
||||
|
||||
if ($passed2) {
|
||||
$str = autoname(8);
|
||||
$str = Strings::getRandomName(8);
|
||||
$cmd = "$phppath util/testargs.php $str";
|
||||
$result = trim(shell_exec($cmd));
|
||||
$passed3 = $result == $str;
|
||||
|
|
|
@ -78,7 +78,7 @@ class Register
|
|||
*/
|
||||
public static function createForInvitation()
|
||||
{
|
||||
$code = autoname(8) . srand(1000, 9999);
|
||||
$code = Strings::getRandomName(8) . srand(1000, 9999);
|
||||
|
||||
$fields = [
|
||||
'hash' => $code,
|
||||
|
|
|
@ -270,7 +270,7 @@ class User
|
|||
*/
|
||||
public static function generateNewPassword()
|
||||
{
|
||||
return autoname(6) . mt_rand(100, 9999);
|
||||
return Strings::getRandomName(6) . mt_rand(100, 9999);
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
|
@ -68,7 +68,7 @@ class Strings
|
|||
*
|
||||
* @return string
|
||||
*/
|
||||
public static function getRandomName($len) // autoname()
|
||||
public static function getRandomName($len)
|
||||
{
|
||||
if ($len <= 0) {
|
||||
return '';
|
||||
|
|
Loading…
Reference in a new issue