Changeset View
Changeset View
Standalone View
Standalone View
src/app/Http/Controllers/API/V4/UsersController.php
Show First 20 Lines • Show All 615 Lines • ▼ Show 20 Lines | ): ?string { | ||||
$attribute = $is_alias ? 'alias' : 'email'; | $attribute = $is_alias ? 'alias' : 'email'; | ||||
if (strpos($email, '@') === false) { | if (strpos($email, '@') === false) { | ||||
return \trans('validation.entryinvalid', ['attribute' => $attribute]); | return \trans('validation.entryinvalid', ['attribute' => $attribute]); | ||||
} | } | ||||
list($login, $domain) = explode('@', $email); | list($login, $domain) = explode('@', $email); | ||||
if (strlen($login) === 0 || strlen($domain) === 0) { | |||||
return \trans('validation.entryinvalid', ['attribute' => $attribute]); | |||||
} | |||||
// Check if domain exists | // Check if domain exists | ||||
$domain = Domain::where('namespace', Str::lower($domain))->first(); | $domain = Domain::where('namespace', Str::lower($domain))->first(); | ||||
if (empty($domain)) { | if (empty($domain)) { | ||||
return \trans('validation.domaininvalid'); | return \trans('validation.domaininvalid'); | ||||
} | } | ||||
// Validate login part alone | // Validate login part alone | ||||
Show All 40 Lines |