Changeset View
Changeset View
Standalone View
Standalone View
src/app/Http/Controllers/API/V4/UsersController.php
Show First 20 Lines • Show All 285 Lines • ▼ Show 20 Lines | public function store(Request $request) | ||||
'message' => __('app.user-create-success'), | 'message' => __('app.user-create-success'), | ||||
]); | ]); | ||||
} | } | ||||
/** | /** | ||||
* Update user data. | * Update user data. | ||||
* | * | ||||
* @param \Illuminate\Http\Request $request The API request. | * @param \Illuminate\Http\Request $request The API request. | ||||
* @params string $id User identifier | * @param string $id User identifier | ||||
* | * | ||||
* @return \Illuminate\Http\JsonResponse The response | * @return \Illuminate\Http\JsonResponse The response | ||||
*/ | */ | ||||
public function update(Request $request, $id) | public function update(Request $request, $id) | ||||
{ | { | ||||
$user = User::find($id); | $user = User::find($id); | ||||
if (empty($user)) { | if (empty($user)) { | ||||
▲ Show 20 Lines • Show All 284 Lines • ▼ Show 20 Lines | public static function execProcessStep(User $user, string $step): bool | ||||
$domain = Domain::where('namespace', $domain)->first(); | $domain = Domain::where('namespace', $domain)->first(); | ||||
return DomainsController::execProcessStep($domain, $step); | return DomainsController::execProcessStep($domain, $step); | ||||
} | } | ||||
switch ($step) { | switch ($step) { | ||||
case 'user-ldap-ready': | case 'user-ldap-ready': | ||||
// User not in LDAP, create it | // User not in LDAP, create it | ||||
$job = new \App\Jobs\UserCreate($user); | $job = new \App\Jobs\User\CreateJob($user->id); | ||||
$job->handle(); | $job->handle(); | ||||
return $user->isLdapReady(); | return $user->isLdapReady(); | ||||
machniak: This will have to call fresh()/refresh() on the $user. | |||||
case 'user-imap-ready': | case 'user-imap-ready': | ||||
// User not in IMAP? Verify again | // User not in IMAP? Verify again | ||||
$job = new \App\Jobs\UserVerify($user); | $job = new \App\Jobs\User\VerifyJob($user->id); | ||||
$job->handle(); | $job->handle(); | ||||
return $user->isImapReady(); | return $user->isImapReady(); | ||||
Done Inline ActionsThis will have to call fresh()/refresh() on the $user. machniak: This will have to call fresh()/refresh() on the $user. | |||||
} | } | ||||
} catch (\Exception $e) { | } catch (\Exception $e) { | ||||
\Log::error($e); | \Log::error($e); | ||||
} | } | ||||
return false; | return false; | ||||
} | } | ||||
▲ Show 20 Lines • Show All 68 Lines • Show Last 20 Lines |
This will have to call fresh()/refresh() on the $user.