installer fixes; user's name
This commit is contained in:
6
Makefile
6
Makefile
@@ -90,10 +90,8 @@ deploy-package:
|
|||||||
|
|
||||||
.PHONY: reset-installer
|
.PHONY: reset-installer
|
||||||
reset-installer:
|
reset-installer:
|
||||||
@cp .env.dev.example .env
|
@php artisan database:create --reset
|
||||||
@make clean
|
@php artisan migrate:refresh --seed
|
||||||
mysql -uroot -e "DROP DATABASE IF EXISTS phpvms"
|
|
||||||
mysql -uroot -e "CREATE DATABASE phpvms"
|
|
||||||
|
|
||||||
.PHONY: docker
|
.PHONY: docker
|
||||||
docker:
|
docker:
|
||||||
|
|||||||
2
Procfile
2
Procfile
@@ -1,5 +1,5 @@
|
|||||||
dnsmasq: /usr/local/sbin/dnsmasq --keep-in-foreground
|
dnsmasq: /usr/local/sbin/dnsmasq --keep-in-foreground
|
||||||
php-fpm: /usr/local/sbin/php-fpm --nodaemonize
|
php-fpm: /usr/local/sbin/php-fpm --nodaemonize
|
||||||
nginx: /usr/local/bin/nginx
|
nginx: /usr/local/bin/nginx
|
||||||
#mysql: /usr/local/bin/mysqld
|
mysql: /usr/local/bin/mysqld
|
||||||
mailhog: /usr/local/bin/mailhog
|
mailhog: /usr/local/bin/mailhog
|
||||||
|
|||||||
@@ -2,6 +2,10 @@
|
|||||||
|
|
||||||
namespace App\Console\Commands;
|
namespace App\Console\Commands;
|
||||||
|
|
||||||
|
use App\Models\Airline;
|
||||||
|
use App\Models\Permission;
|
||||||
|
use App\Models\Role;
|
||||||
|
use App\Models\User;
|
||||||
use App\Services\DatabaseService;
|
use App\Services\DatabaseService;
|
||||||
use DB;
|
use DB;
|
||||||
|
|
||||||
@@ -28,8 +32,8 @@ class DevCommands extends BaseCommand
|
|||||||
|
|
||||||
$commands = [
|
$commands = [
|
||||||
'clear-acars' => 'clearAcars',
|
'clear-acars' => 'clearAcars',
|
||||||
|
'clear-users' => 'clearUsers',
|
||||||
'compile-assets' => 'compileAssets',
|
'compile-assets' => 'compileAssets',
|
||||||
'test-api' => 'testApi',
|
|
||||||
];
|
];
|
||||||
|
|
||||||
if(!array_key_exists($command, $commands)) {
|
if(!array_key_exists($command, $commands)) {
|
||||||
@@ -59,6 +63,26 @@ class DevCommands extends BaseCommand
|
|||||||
$this->info('ACARS and PIREPs cleared!');
|
$this->info('ACARS and PIREPs cleared!');
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Delete all the data from the ACARS and PIREP tables
|
||||||
|
*/
|
||||||
|
protected function clearUsers()
|
||||||
|
{
|
||||||
|
if (config('database.default') === 'mysql') {
|
||||||
|
DB::statement('SET foreign_key_checks=0');
|
||||||
|
}
|
||||||
|
|
||||||
|
DB::statement('TRUNCATE `role_user`');
|
||||||
|
Airline::truncate();
|
||||||
|
User::truncate();
|
||||||
|
|
||||||
|
if (config('database.default') === 'mysql') {
|
||||||
|
DB::statement('SET foreign_key_checks=1');
|
||||||
|
}
|
||||||
|
|
||||||
|
$this->info('Users cleared!');
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Compile all the CSS/JS assets into their respective files
|
* Compile all the CSS/JS assets into their respective files
|
||||||
* Calling the webpack compiler
|
* Calling the webpack compiler
|
||||||
|
|||||||
@@ -217,6 +217,7 @@ class InstallerController extends AppBaseController
|
|||||||
$validator = Validator::make($request->all(), [
|
$validator = Validator::make($request->all(), [
|
||||||
'airline_name' => 'required',
|
'airline_name' => 'required',
|
||||||
'airline_icao' => 'required|unique:airlines,icao',
|
'airline_icao' => 'required|unique:airlines,icao',
|
||||||
|
'name' => 'required',
|
||||||
'email' => 'required|email|unique:users,email',
|
'email' => 'required|email|unique:users,email',
|
||||||
'password' => 'required|confirmed'
|
'password' => 'required|confirmed'
|
||||||
]);
|
]);
|
||||||
@@ -259,9 +260,7 @@ class InstallerController extends AppBaseController
|
|||||||
Log::info('User registered: ', $user->toArray());
|
Log::info('User registered: ', $user->toArray());
|
||||||
|
|
||||||
# Set the intial admin e-mail address
|
# Set the intial admin e-mail address
|
||||||
$admin_email = Setting::where('key', 'general.admin_email');
|
setting('general.admin_email', $user->email);
|
||||||
$admin_email->value = $user->email;
|
|
||||||
$admin_email->save();
|
|
||||||
|
|
||||||
return view('installer::steps/step3a-completed', []);
|
return view('installer::steps/step3a-completed', []);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -36,7 +36,17 @@
|
|||||||
</tr>
|
</tr>
|
||||||
|
|
||||||
<tr>
|
<tr>
|
||||||
<td><p>Admin Email</p></td>
|
<td><p>Name</p></td>
|
||||||
|
<td>
|
||||||
|
<div class="form-group">
|
||||||
|
{!! Form::input('text', 'name', null, ['class' => 'form-control']) !!}
|
||||||
|
@include('installer::flash/check_error', ['field' => 'name'])
|
||||||
|
</div>
|
||||||
|
</td>
|
||||||
|
</tr>
|
||||||
|
|
||||||
|
<tr>
|
||||||
|
<td><p>Email</p></td>
|
||||||
<td>
|
<td>
|
||||||
<div class="form-group">
|
<div class="form-group">
|
||||||
{!! Form::input('text', 'email', null, ['class' => 'form-control']) !!}
|
{!! Form::input('text', 'email', null, ['class' => 'form-control']) !!}
|
||||||
|
|||||||
@@ -30,9 +30,9 @@ DB_PREFIX=
|
|||||||
MAIL_DRIVER=smtp
|
MAIL_DRIVER=smtp
|
||||||
MAIL_FROM_ADDRESS=no-reply@phpvms.net
|
MAIL_FROM_ADDRESS=no-reply@phpvms.net
|
||||||
MAIL_FROM_NAME="phpVMS Admin"
|
MAIL_FROM_NAME="phpVMS Admin"
|
||||||
MAIL_HOST=smtp.mailgun.org
|
MAIL_HOST=
|
||||||
MAIL_PORT=587
|
MAIL_PORT=
|
||||||
MAIL_ENCRYPTION=tls
|
MAIL_ENCRYPTION=
|
||||||
MAIL_USERNAME=
|
MAIL_USERNAME=
|
||||||
MAIL_PASSWORD=
|
MAIL_PASSWORD=
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user