Set back the set-admin command to id

This commit is contained in:
Timothée Jaussoin 2021-05-12 17:36:17 +02:00
parent 95ff7bc06c
commit 10f31db713
2 changed files with 4 additions and 4 deletions

View file

@ -26,7 +26,7 @@ use App\Admin;
class SetAccountAdmin extends Command
{
protected $signature = 'accounts:set-admin {sip}';
protected $signature = 'accounts:set-admin {id}';
protected $description = 'Give the admin role to an account';
public function __construct()
@ -36,7 +36,7 @@ class SetAccountAdmin extends Command
public function handle()
{
$account = Account::withoutGlobalScopes()->sip($this->argument('sip'))->first();
$account = Account::withoutGlobalScopes()->where('id', $this->argument('id'))->first();
if (!$account) {
$this->error('Account not found, please use an existing SIP address');
@ -47,7 +47,7 @@ class SetAccountAdmin extends Command
$admin->account_id = $account->id;
$admin->save();
$this->info('Account '.$this->argument('sip').' is now admin');
$this->info('Account '.$account->identifier.' is now admin');
return 0;
}

View file

@ -8,7 +8,7 @@
#%define _datadir %{_datarootdir}
#%define _docdir %{_datadir}/doc
%define build_number 73
%define build_number 74
%define var_dir /var/opt/belledonne-communications
%define opt_dir /opt/belledonne-communications/share/flexisip-account-manager