mirror of
https://github.com/pixelfed/pixelfed.git
synced 2024-11-26 00:03:16 +00:00
Update User artisan commands to match UserDelete
This commit is contained in:
parent
71cc016e0b
commit
52d65538cd
4 changed files with 20 additions and 4 deletions
|
@ -39,7 +39,11 @@ class UserAdmin extends Command
|
||||||
public function handle()
|
public function handle()
|
||||||
{
|
{
|
||||||
$id = $this->argument('id');
|
$id = $this->argument('id');
|
||||||
$user = User::whereUsername($id)->orWhere('id', $id)->first();
|
if(ctype_digit($id) == true) {
|
||||||
|
$user = User::find($id);
|
||||||
|
} else {
|
||||||
|
$user = User::whereUsername($id)->first();
|
||||||
|
}
|
||||||
if(!$user) {
|
if(!$user) {
|
||||||
$this->error('Could not find any user with that username or id.');
|
$this->error('Could not find any user with that username or id.');
|
||||||
exit;
|
exit;
|
||||||
|
|
|
@ -39,7 +39,11 @@ class UserShow extends Command
|
||||||
public function handle()
|
public function handle()
|
||||||
{
|
{
|
||||||
$id = $this->argument('id');
|
$id = $this->argument('id');
|
||||||
$user = User::whereUsername($id)->orWhere('id', $id)->first();
|
if(ctype_digit($id) == true) {
|
||||||
|
$user = User::find($id);
|
||||||
|
} else {
|
||||||
|
$user = User::whereUsername($id)->first();
|
||||||
|
}
|
||||||
if(!$user) {
|
if(!$user) {
|
||||||
$this->error('Could not find any user with that username or id.');
|
$this->error('Could not find any user with that username or id.');
|
||||||
exit;
|
exit;
|
||||||
|
|
|
@ -39,7 +39,11 @@ class UserSuspend extends Command
|
||||||
public function handle()
|
public function handle()
|
||||||
{
|
{
|
||||||
$id = $this->argument('id');
|
$id = $this->argument('id');
|
||||||
$user = User::whereUsername($id)->orWhere('id', $id)->first();
|
if(ctype_digit($id) == true) {
|
||||||
|
$user = User::find($id);
|
||||||
|
} else {
|
||||||
|
$user = User::whereUsername($id)->first();
|
||||||
|
}
|
||||||
if(!$user) {
|
if(!$user) {
|
||||||
$this->error('Could not find any user with that username or id.');
|
$this->error('Could not find any user with that username or id.');
|
||||||
exit;
|
exit;
|
||||||
|
|
|
@ -39,7 +39,11 @@ class UserUnsuspend extends Command
|
||||||
public function handle()
|
public function handle()
|
||||||
{
|
{
|
||||||
$id = $this->argument('id');
|
$id = $this->argument('id');
|
||||||
$user = User::whereUsername($id)->orWhere('id', $id)->first();
|
if(ctype_digit($id) == true) {
|
||||||
|
$user = User::find($id);
|
||||||
|
} else {
|
||||||
|
$user = User::whereUsername($id)->first();
|
||||||
|
}
|
||||||
if(!$user) {
|
if(!$user) {
|
||||||
$this->error('Could not find any user with that username or id.');
|
$this->error('Could not find any user with that username or id.');
|
||||||
exit;
|
exit;
|
||||||
|
|
Loading…
Reference in a new issue