Fix commands
This commit is contained in:
@@ -87,10 +87,10 @@ class MigrateUsersExecute extends Command
|
||||
->leftJoin('usermeta as m2', fn( $j ) => $j->on('users.ID', '=', 'm2.user_id')->where('m2.meta_key', '=', 'wp_capabilities') )
|
||||
->leftJoin('usermeta as m3', fn( $j ) => $j->on('users.ID', '=', 'm3.user_id')->where('m3.meta_key', '=', 'simple_local_avatar') )
|
||||
->where('users.ID', '=', $plan->wp_user_id )
|
||||
->select('m1.meta_value as description', 'm2.meta_value as capabilities', 'm3.meta_value as avatar_meta', 'users.user_url as website', 'users.user_pass as password', 'users.user_registred' )
|
||||
->select('m1.meta_value as description', 'm2.meta_value as capabilities', 'm3.meta_value as avatar_meta', 'users.user_url as website', 'users.user_pass as password', 'users.user_registered' )
|
||||
->first();
|
||||
|
||||
$infos['register_date'] = $wp->user_registred ? strtotime($wp->user_registred) : null;
|
||||
$infos['register_date'] = $wp->user_registered ? strtotime($wp->user_registered) : null;
|
||||
$infos['profile']['about'] = $wp->description;
|
||||
$infos['profile']['website'] = $wp->website;
|
||||
$role = $this->extractWpRole($wp->capabilities);
|
||||
|
||||
@@ -29,8 +29,10 @@ class XenforoApiService {
|
||||
'XF-Api-User' => $customUserId ?? $this->superUserId,
|
||||
])->get("{$this->apiUrl}/{$endpoint}");
|
||||
|
||||
if( !$response->ok() )
|
||||
if( !$response->ok() ) {
|
||||
\Illuminate\Support\Facades\Log::error("XF API error [{$response->status()}] on {$endpoint}: " . $response->body());
|
||||
return null;
|
||||
}
|
||||
|
||||
return $response->json();
|
||||
}
|
||||
@@ -42,8 +44,10 @@ class XenforoApiService {
|
||||
'XF-Api-User' => $customUserId ?? $this->superUserId,
|
||||
])->post("{$this->apiUrl}/{$endpoint}", $data);
|
||||
|
||||
if( !$response->ok() )
|
||||
if( !$response->ok() ) {
|
||||
\Illuminate\Support\Facades\Log::error("XF API error [{$response->status()}] on {$endpoint}: " . $response->body());
|
||||
return null;
|
||||
}
|
||||
|
||||
return $response->json();
|
||||
}
|
||||
@@ -55,8 +59,10 @@ class XenforoApiService {
|
||||
'XF-Api-User' => $customUserId ?? $this->superUserId,
|
||||
])->delete("{$this->apiUrl}/{$endpoint}", $data);
|
||||
|
||||
if( !$response->ok() )
|
||||
if( !$response->ok() ) {
|
||||
\Illuminate\Support\Facades\Log::error("XF API error [{$response->status()}] on {$endpoint}: " . $response->body());
|
||||
return null;
|
||||
}
|
||||
|
||||
return $response->json();
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user