mirror of
https://github.com/elyby/accounts.git
synced 2025-05-31 14:11:46 +05:30
Отрефакторены тесты
Удалено тестовое окружение acceptance Удалена часть потенциально ненужных тестов Добавлена логика для формы регистрации Добавлена таблица для хранения ключей активации по E-mail Добавлены тесты для формы регистрации Реорганизован роутинг Добавлен компонент для ReCaptcha2
This commit is contained in:
18
common/components/UserFriendlyRandomKey.php
Normal file
18
common/components/UserFriendlyRandomKey.php
Normal file
@ -0,0 +1,18 @@
|
||||
<?php
|
||||
namespace common\components;
|
||||
|
||||
|
||||
class UserFriendlyRandomKey {
|
||||
|
||||
public static function make ($length = 18) {
|
||||
$chars = 'ABCDEFGHIJKLMNOPQRSTUVWXYZ1234567890';
|
||||
$numChars = strlen($chars);
|
||||
$key = '';
|
||||
for ($i = 0; $i < $length; $i++) {
|
||||
$key .= substr($chars, rand(1, $numChars) - 1, 1);
|
||||
}
|
||||
|
||||
return $key;
|
||||
}
|
||||
|
||||
}
|
Reference in New Issue
Block a user