From f71190e286b53466b8daa92ad1873903945ee7ba Mon Sep 17 00:00:00 2001 From: printempw Date: Sun, 30 Oct 2016 14:12:22 +0800 Subject: [PATCH] update ciphers --- .env.example | 2 +- app/Events/PlayerWillBeAdded.php | 21 +++++++++++++++++++++ app/Http/Controllers/PlayerController.php | 3 +++ app/Services/Cipher/CrazyCrypt1.php | 22 ---------------------- app/Services/Cipher/SALTED2SHA256.php | 17 +++++++++++++++++ app/Services/Cipher/SALTED2SHA512.php | 17 +++++++++++++++++ app/Services/Cipher/SHA256.php | 2 +- app/Services/Cipher/SHA512.php | 17 +++++++++++++++++ 8 files changed, 77 insertions(+), 24 deletions(-) create mode 100644 app/Events/PlayerWillBeAdded.php delete mode 100644 app/Services/Cipher/CrazyCrypt1.php create mode 100644 app/Services/Cipher/SALTED2SHA256.php create mode 100644 app/Services/Cipher/SALTED2SHA512.php create mode 100644 app/Services/Cipher/SHA512.php diff --git a/.env.example b/.env.example index 7a04de6e..eb61f69d 100644 --- a/.env.example +++ b/.env.example @@ -29,7 +29,7 @@ DB_PREFIX = null # Encrypt Method for Passwords. # -# Available values: MD5, SALTED2MD5, SHA256 +# Available values: MD5, SALTED2MD5, (SALTED2)SHA256, (SALTED2)SHA512 PWD_METHOD = SALTED2MD5 # Salt diff --git a/app/Events/PlayerWillBeAdded.php b/app/Events/PlayerWillBeAdded.php new file mode 100644 index 00000000..947f936b --- /dev/null +++ b/app/Events/PlayerWillBeAdded.php @@ -0,0 +1,21 @@ +playerName = $player_name; + } + +} diff --git a/app/Http/Controllers/PlayerController.php b/app/Http/Controllers/PlayerController.php index 83a3a0d9..15144f76 100644 --- a/app/Http/Controllers/PlayerController.php +++ b/app/Http/Controllers/PlayerController.php @@ -13,6 +13,7 @@ use Illuminate\Http\Request; use App\Events\PlayerWasAdded; use App\Events\PlayerWasDeleted; use App\Events\CheckPlayerExists; +use App\Events\PlayerWillBeAdded; use App\Exceptions\PrettyPageException; use App\Services\Repositories\UserRepository; @@ -61,6 +62,8 @@ class PlayerController extends Controller return json(trans('user.player.add.lack-score'), 7); } + Event::fire(new PlayerWillBeAdded($request->input('player_name'))); + $player = new Player; $player->uid = $this->user->uid; diff --git a/app/Services/Cipher/CrazyCrypt1.php b/app/Services/Cipher/CrazyCrypt1.php deleted file mode 100644 index 13d3896c..00000000 --- a/app/Services/Cipher/CrazyCrypt1.php +++ /dev/null @@ -1,22 +0,0 @@ -