From 0286ce9bbb5d5b2b159fec80071a89cd4966789a Mon Sep 17 00:00:00 2001 From: MinePoS Dedicated Date: Mon, 24 Sep 2018 19:20:24 +0200 Subject: [PATCH] Adding comands --- app/Console/Commands/ChangeEmail.php | 50 +++++++++++++++++++++++++ app/Console/Commands/ResetPassword.php | 51 ++++++++++++++++++++++++++ 2 files changed, 101 insertions(+) create mode 100755 app/Console/Commands/ChangeEmail.php create mode 100755 app/Console/Commands/ResetPassword.php diff --git a/app/Console/Commands/ChangeEmail.php b/app/Console/Commands/ChangeEmail.php new file mode 100755 index 00000000..8bc17d88 --- /dev/null +++ b/app/Console/Commands/ChangeEmail.php @@ -0,0 +1,50 @@ +argument('email'))->get(); + if(sizeof($u) > 0){ + $u = $u[0]; + //$this->info($u->password); + $u->email = $this->argument('newemail'); + $u->save(); + $this->info('Email Changed!'); + }else{ + $this->error('This email isnt linked to a MinePoS admin account!'); + } + } +} diff --git a/app/Console/Commands/ResetPassword.php b/app/Console/Commands/ResetPassword.php new file mode 100755 index 00000000..35163ef5 --- /dev/null +++ b/app/Console/Commands/ResetPassword.php @@ -0,0 +1,51 @@ +argument('email'))->get(); + if(sizeof($u) > 0){ + $u = $u[0]; + //$this->info($u->password); + $u->password = \Hash::make($this->argument('passwd')); + $u->save(); + $this->info('Password Changed!'); + }else{ + $this->error('This email isnt linked to a MinePoS admin account!'); + } + } +}