mirror of
https://gitlab.linphone.org/BC/public/flexisip-account-manager.git
synced 2026-01-17 18:08:06 +00:00
Add a --and-confirmed parameter to the accounts:clear-unconfirmed command
Update the documentation Bump the package number
This commit is contained in:
parent
b48c8f505d
commit
dcbd01e5e3
3 changed files with 8 additions and 4 deletions
|
|
@ -139,7 +139,7 @@ This will remove the nonces stored that were not updated after `x minutes`.
|
|||
|
||||
This request will remove the accounts that were not confirmed after `x days`. In the database an unconfirmed account is having the `activated` attribute set to `false`.
|
||||
|
||||
php artisan accounts:clear-unconfirmed {days} {--apply}
|
||||
php artisan accounts:clear-unconfirmed {days} {--apply} {--and-confirmed}
|
||||
|
||||
The base request will not delete the related accounts by default. You need to add `--apply` to remove them.
|
||||
|
||||
|
|
|
|||
|
|
@ -26,7 +26,7 @@ use App\Account;
|
|||
|
||||
class RemoveUnconfirmedAccounts extends Command
|
||||
{
|
||||
protected $signature = 'accounts:clear-unconfirmed {days} {--apply}';
|
||||
protected $signature = 'accounts:clear-unconfirmed {days} {--apply} {--and-confirmed}';
|
||||
protected $description = 'Clear unconfirmed accounts after n days';
|
||||
|
||||
public function __construct()
|
||||
|
|
@ -36,10 +36,14 @@ class RemoveUnconfirmedAccounts extends Command
|
|||
|
||||
public function handle()
|
||||
{
|
||||
$accounts = Account::where('activated', false)->where('creation_time', '<',
|
||||
$accounts = Account::where('creation_time', '<',
|
||||
Carbon::now()->subDays($this->argument('days'))->toDateTimeString()
|
||||
);
|
||||
|
||||
if (!$this->option('and-confirmed')) {
|
||||
$accounts = $accounts->where('activated', false);
|
||||
}
|
||||
|
||||
if ($this->option('apply')) {
|
||||
$this->info($accounts->count() . ' accounts deleted');
|
||||
$accounts->delete();
|
||||
|
|
|
|||
|
|
@ -8,7 +8,7 @@
|
|||
#%define _datadir %{_datarootdir}
|
||||
#%define _docdir %{_datadir}/doc
|
||||
|
||||
%define build_number 95
|
||||
%define build_number 96
|
||||
%define var_dir /var/opt/belledonne-communications
|
||||
%define opt_dir /opt/belledonne-communications/share/flexisip-account-manager
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue