[COMPONENT][Group] Check nickname on register
This commit is contained in:
parent
262b14a977
commit
090a087832
@ -27,6 +27,7 @@ use App\Core\ActorLocalRoles;
|
|||||||
use App\Core\Cache;
|
use App\Core\Cache;
|
||||||
use App\Core\DB\DB;
|
use App\Core\DB\DB;
|
||||||
use App\Core\Form;
|
use App\Core\Form;
|
||||||
|
use App\Util\Nickname;
|
||||||
use function App\Core\I18n\_m;
|
use function App\Core\I18n\_m;
|
||||||
use App\Core\Log;
|
use App\Core\Log;
|
||||||
use App\Core\Router\Router;
|
use App\Core\Router\Router;
|
||||||
@ -213,7 +214,12 @@ class Group extends FeedController
|
|||||||
$create_form->handleRequest($request);
|
$create_form->handleRequest($request);
|
||||||
if ($create_form->isSubmitted() && $create_form->isValid()) {
|
if ($create_form->isSubmitted() && $create_form->isValid()) {
|
||||||
$data = $create_form->getData();
|
$data = $create_form->getData();
|
||||||
$nickname = $data['group_nickname'];
|
$nickname = Nickname::normalize(
|
||||||
|
nickname: $data['group_nickname'],
|
||||||
|
check_already_used: true,
|
||||||
|
which: Nickname::CHECK_LOCAL_GROUP,
|
||||||
|
check_is_allowed: true
|
||||||
|
);
|
||||||
|
|
||||||
Log::info(
|
Log::info(
|
||||||
_m(
|
_m(
|
||||||
|
@ -133,7 +133,7 @@ class Security extends Controller
|
|||||||
$data['password'] = $form->get('password')->getData();
|
$data['password'] = $form->get('password')->getData();
|
||||||
|
|
||||||
// Already used is checked below
|
// Already used is checked below
|
||||||
$nickname = Nickname::normalize($data['nickname'], check_already_used: false, which: Nickname::CHECK_LOCAL_USER, check_is_allowed: false);
|
$nickname = Nickname::normalize($data['nickname'], check_already_used: false, which: Nickname::CHECK_LOCAL_USER, check_is_allowed: true);
|
||||||
|
|
||||||
try {
|
try {
|
||||||
$found_user = DB::findOneBy('local_user', ['or' => ['nickname' => $nickname, 'outgoing_email' => $data['email']]]);
|
$found_user = DB::findOneBy('local_user', ['or' => ['nickname' => $nickname, 'outgoing_email' => $data['email']]]);
|
||||||
|
Loading…
Reference in New Issue
Block a user