Add explicit TOC accepted checkbox #244

This commit is contained in:
Nabeel Shahzad
2018-09-20 11:14:18 -05:00
parent fbcaa382f4
commit ab5480fdc9
6 changed files with 65 additions and 4 deletions

View File

@@ -32,6 +32,7 @@ class CreateUsersTable extends Migration
$table->string('timezone', 64)->nullable();
$table->unsignedTinyInteger('status')->nullable()->default(0);
$table->unsignedTinyInteger('state')->nullable()->default(0);
$table->boolean('toc_accepted')->nullable();
$table->boolean('opt_in')->nullable();
$table->boolean('active')->nullable();
$table->ipAddress('last_ip')->nullable();

View File

@@ -25,6 +25,8 @@ users:
flight_time: 0
timezone: America/Chicago
state: 1
opt_in: 1
toc_accepted: 1
created_at: now
updated_at: now
- id: 2
@@ -41,6 +43,8 @@ users:
created_at: now
updated_at: now
state: 0
opt_in: 1
toc_accepted: 1
- id: 3
name: Raymond Pearson
email: raymond.pearson56@example.com
@@ -55,6 +59,8 @@ users:
created_at: now
updated_at: now
state: 1
opt_in: 0
toc_accepted: 1
role_user:
- user_id: 1

View File

@@ -86,6 +86,7 @@ class RegisterController extends Controller
'airline_id' => 'required',
'home_airport_id' => 'required',
'password' => 'required|min:5|confirmed',
'toc_accepted' => 'accepted',
];
if (config('captcha.enabled')) {
@@ -117,7 +118,7 @@ class RegisterController extends Controller
// Convert transfer hours into minutes
if (isset($opts['transfer_time'])) {
$opts['transfer_time'] = $opts['transfer_time'] * 60;
$opts['transfer_time'] *= 60;
}
$user = User::create($opts);
@@ -148,6 +149,7 @@ class RegisterController extends Controller
'timezone' => 'required',
'country' => 'required',
'transfer_time' => 'integer|min:0',
'toc_accepted' => 'accepted',
];
if (config('captcha.enabled')) {

View File

@@ -62,6 +62,7 @@ class User extends Authenticatable
'timezone',
'state',
'status',
'toc_accepted',
'opt_in',
'created_at',
'updated_at',
@@ -83,6 +84,7 @@ class User extends Authenticatable
'balance' => 'double',
'state' => 'integer',
'status' => 'integer',
'toc_accepted' => 'boolean',
'opt_in' => 'boolean',
];