Skip to content

Commit

Permalink
Merge branch 'hotfix/0.5.1-8'
Browse files Browse the repository at this point in the history
  • Loading branch information
WaveHack committed Jan 3, 2019
2 parents 000efcb + 2e2bccd commit dfca4f4
Show file tree
Hide file tree
Showing 4 changed files with 15 additions and 9 deletions.
5 changes: 3 additions & 2 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ The format is based on [Keep a Changelog](http://keepachangelog.com/en/1.0.0/).

## [Unreleased]

## [0.5.1-4] and [0.5.1-7] - 2018-10-04
## [0.5.1-4] and [0.5.1-8] - 2018-10-04
## Fixed
- Fix user IP resolving when behind Cloudflare DNS with trusted proxies.
- Dominion numbering on the realm page now correctly starts at 1, instead of 0.
Expand Down Expand Up @@ -110,7 +110,8 @@ The format is based on [Keep a Changelog](http://keepachangelog.com/en/1.0.0/).
### Added
- This CHANGELOG file.

[Unreleased]: https://github.com/WaveHack/OpenDominion/compare/0.5.1-7...HEAD
[Unreleased]: https://github.com/WaveHack/OpenDominion/compare/0.5.1-8...HEAD
[0.5.1-8]: https://github.com/WaveHack/OpenDominion/compare/0.5.1-7...0.5.1-8
[0.5.1-7]: https://github.com/WaveHack/OpenDominion/compare/0.5.1-6...0.5.1-7
[0.5.1-6]: https://github.com/WaveHack/OpenDominion/compare/0.5.1-5...0.5.1-6
[0.5.1-5]: https://github.com/WaveHack/OpenDominion/compare/0.5.1-4...0.5.1-5
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,6 @@ public function up()
DB::transaction(function () use ($output) {

// First pass: Delete unactivated users
$output->writeln('Pruning unactivated users');

$users = DB::table('users')
->where('activated', 0)
->get();
Expand All @@ -33,11 +31,13 @@ public function up()
->delete();
});

$output->writeln("Pruned {$users->count()} users");
$usersCount = $users->count();

// Second pass: Delete all users with no dominions
$output->writeln('Pruning users with no dominion');
if ($usersCount > 0) {
$output->writeln("Pruned {$users->count()} users");
}

// Second pass: Delete all users with no dominions
$usersPrunedCount = 0;

DB::table('users')
Expand All @@ -62,7 +62,9 @@ public function up()
$usersPrunedCount++;
});

$output->writeln("Pruned {$usersPrunedCount} users");
if ($usersPrunedCount > 0) {
$output->writeln("Pruned {$usersPrunedCount} users");
}
});
}

Expand Down
3 changes: 2 additions & 1 deletion app/routes/web.php
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
<?php

use Illuminate\Routing\Router;
use Spatie\Honeypot\ProtectAgainstSpam;

/** @var Router $router */
$router->get('/')->uses('HomeController@getIndex')->name('home');
Expand All @@ -17,7 +18,7 @@

// Registration
$router->get('register')->uses('Auth\RegisterController@showRegistrationForm')->name('register');
$router->post('register')->uses('Auth\RegisterController@register');
$router->post('register')->uses('Auth\RegisterController@register')->middleware(ProtectAgainstSpam::class);
$router->get('activate/{activation_code}')->uses('Auth\RegisterController@activate')->name('activate');

// Password Reset
Expand Down
2 changes: 2 additions & 0 deletions tests/AbstractBrowserKitTestCase.php
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,8 @@ protected function setUp()
{
parent::setUp();

config()->set('honeypot.enabled', false);

// Bus::fake();
// Event::fake();
// Mail::fake();
Expand Down

0 comments on commit dfca4f4

Please sign in to comment.