mirror of
https://github.com/invoiceninja/invoiceninja.git
synced 2025-07-09 03:14:30 -04:00
Sign up (#2460)
* Privacy Policy & TOS * configure additional dependency packages for redis and modules, middleware implementation for multi-db * Stub the signup
This commit is contained in:
parent
0f64ade43f
commit
103a95955a
@ -14,6 +14,8 @@ if (! defined('APP_NAME')) {
|
|||||||
define('CONTACT_EMAIL', env('MAIL_FROM_ADDRESS'));
|
define('CONTACT_EMAIL', env('MAIL_FROM_ADDRESS'));
|
||||||
define('CONTACT_NAME', env('MAIL_FROM_NAME'));
|
define('CONTACT_NAME', env('MAIL_FROM_NAME'));
|
||||||
define('SITE_URL', env('APP_URL'));
|
define('SITE_URL', env('APP_URL'));
|
||||||
|
define('APP_VERSION', env('APP_VERSION'));
|
||||||
|
define('NINJA_TERMS_VERSION', '1.0.1');
|
||||||
|
|
||||||
define('ENV_DEVELOPMENT', 'local');
|
define('ENV_DEVELOPMENT', 'local');
|
||||||
define('ENV_STAGING', 'staging');
|
define('ENV_STAGING', 'staging');
|
||||||
@ -24,6 +26,7 @@ if (! defined('APP_NAME')) {
|
|||||||
|
|
||||||
define('BANK_LIBRARY_OFX', 1);
|
define('BANK_LIBRARY_OFX', 1);
|
||||||
define('MULTI_DBS', serialize(['db-ninja-1', 'db-ninja-2']));
|
define('MULTI_DBS', serialize(['db-ninja-1', 'db-ninja-2']));
|
||||||
|
define('RANDOM_KEY_LENGTH', 32); //63340286662973277706162286946811886609896461828096 combinations
|
||||||
|
|
||||||
define('SOCIAL_GOOGLE', 'Google');
|
define('SOCIAL_GOOGLE', 'Google');
|
||||||
define('SOCIAL_FACEBOOK', 'Facebook');
|
define('SOCIAL_FACEBOOK', 'Facebook');
|
||||||
@ -31,4 +34,18 @@ if (! defined('APP_NAME')) {
|
|||||||
define('SOCIAL_LINKEDIN', 'LinkedIn');
|
define('SOCIAL_LINKEDIN', 'LinkedIn');
|
||||||
define('SOCIAL_TWITTER', 'Twitter');
|
define('SOCIAL_TWITTER', 'Twitter');
|
||||||
define('SOCIAL_BITBUCKET', 'Bitbucket');
|
define('SOCIAL_BITBUCKET', 'Bitbucket');
|
||||||
|
|
||||||
|
define('CURRENCY_DOLLAR', 1);
|
||||||
|
define('CURRENCY_EURO', 3);
|
||||||
|
|
||||||
|
define('DEFAULT_TIMEZONE', 'US/Eastern');
|
||||||
|
define('DEFAULT_COUNTRY', 840); // United Stated
|
||||||
|
define('DEFAULT_CURRENCY', CURRENCY_DOLLAR);
|
||||||
|
define('DEFAULT_LANGUAGE', 1); // English
|
||||||
|
define('DEFAULT_DATE_FORMAT', 'M j, Y');
|
||||||
|
define('DEFAULT_DATE_PICKER_FORMAT', 'M d, yyyy');
|
||||||
|
define('DEFAULT_DATETIME_FORMAT', 'F j, Y g:i a');
|
||||||
|
define('DEFAULT_DATETIME_MOMENT_FORMAT', 'MMM D, YYYY h:mm:ss a');
|
||||||
|
define('DEFAULT_LOCALE', 'en');
|
||||||
|
define('DEFAULT_MAP_ZOOM', 10);
|
||||||
}
|
}
|
@ -3,6 +3,10 @@
|
|||||||
namespace App\Http\Controllers;
|
namespace App\Http\Controllers;
|
||||||
|
|
||||||
use App\Http\Requests\SignupRequest;
|
use App\Http\Requests\SignupRequest;
|
||||||
|
use App\Models\Account;
|
||||||
|
use App\Models\User;
|
||||||
|
use App\Models\UserAccount;
|
||||||
|
use Illuminate\Support\Facades\Hash;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Class SignupController
|
* Class SignupController
|
||||||
@ -32,7 +36,39 @@ class SignupController extends Controller
|
|||||||
*/
|
*/
|
||||||
public function processSignup(SignupRequest $request)
|
public function processSignup(SignupRequest $request)
|
||||||
{
|
{
|
||||||
dd($request->validated());
|
//dd($request->validated());
|
||||||
|
|
||||||
|
//created new account
|
||||||
|
|
||||||
|
$ac = new Account();
|
||||||
|
$ac->name = $request->first_name. ' ' .$request->last_name;
|
||||||
|
$ac->account_key = strtolower(str_random(RANDOM_KEY_LENGTH));
|
||||||
|
$ac->ip = $request->ip();
|
||||||
|
$ac->save();
|
||||||
|
|
||||||
|
$user = new User();
|
||||||
|
$user->password = Hash::make($request->input('password'));
|
||||||
|
$user->accepted_terms_version = NINJA_TERMS_VERSION;
|
||||||
|
$user->db = config('database.default');
|
||||||
|
$user->fill($request->all());
|
||||||
|
$user->save();
|
||||||
|
|
||||||
|
$user_account = new UserAccount();
|
||||||
|
$user_account->user_id = $user->id;
|
||||||
|
$user_account->account_id = $ac->id;
|
||||||
|
$user_account->is_owner = TRUE;
|
||||||
|
$user_account->is_admin = TRUE;
|
||||||
|
$user_account->is_default = TRUE;
|
||||||
|
$user_account->is_locked = FALSE;
|
||||||
|
$user_account->permissions = '';
|
||||||
|
$user_account->save();
|
||||||
|
|
||||||
|
dd($user);
|
||||||
|
//log user in
|
||||||
|
|
||||||
|
//fire account created job
|
||||||
|
|
||||||
|
//redirect to localization setup workflow
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
@ -42,7 +42,7 @@ class Kernel extends HttpKernel
|
|||||||
'bindings',
|
'bindings',
|
||||||
],
|
],
|
||||||
'db' => [
|
'db' => [
|
||||||
|
\App\Http\Middleware\SetDb::class,
|
||||||
],
|
],
|
||||||
];
|
];
|
||||||
|
|
||||||
|
@ -5,7 +5,7 @@ namespace App\Http\Middleware;
|
|||||||
use App\Libraries\MultiDB;
|
use App\Libraries\MultiDB;
|
||||||
use Closure;
|
use Closure;
|
||||||
|
|
||||||
class setDb
|
class SetDb
|
||||||
{
|
{
|
||||||
/**
|
/**
|
||||||
* Handle an incoming request.
|
* Handle an incoming request.
|
||||||
@ -16,9 +16,9 @@ class setDb
|
|||||||
*/
|
*/
|
||||||
public function handle($request, Closure $next)
|
public function handle($request, Closure $next)
|
||||||
{
|
{
|
||||||
if (!config('auth.providers.users.driver') == 'eloquent') {
|
if (! config('auth.providers.users.driver') == 'eloquent')
|
||||||
|
{
|
||||||
//MultiDB::setDB(auth()->user()->)
|
MultiDB::setDB(auth()->user()->db);
|
||||||
}
|
}
|
||||||
|
|
||||||
return $next($request);
|
return $next($request);
|
||||||
|
@ -4,6 +4,7 @@ namespace App\Http\Requests;
|
|||||||
|
|
||||||
use App\Http\ValidationRules\UniqueUserRule;
|
use App\Http\ValidationRules\UniqueUserRule;
|
||||||
use Illuminate\Support\Facades\Auth;
|
use Illuminate\Support\Facades\Auth;
|
||||||
|
use Illuminate\Support\Facades\Hash;
|
||||||
|
|
||||||
class SignupRequest extends Request
|
class SignupRequest extends Request
|
||||||
{
|
{
|
||||||
@ -15,7 +16,7 @@ class SignupRequest extends Request
|
|||||||
*/
|
*/
|
||||||
public function authorize()
|
public function authorize()
|
||||||
{
|
{
|
||||||
return ! Auth::user();
|
return ! auth()->user();
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -35,4 +36,14 @@ class SignupRequest extends Request
|
|||||||
'terms_of_service' => 'required'
|
'terms_of_service' => 'required'
|
||||||
];
|
];
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public function sanitize()
|
||||||
|
{
|
||||||
|
$input = $this->all();
|
||||||
|
|
||||||
|
// $this->replace($input);
|
||||||
|
|
||||||
|
return $this->all();
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
@ -63,9 +63,8 @@ class MultiDB
|
|||||||
*/
|
*/
|
||||||
public static function setDB($database) : void
|
public static function setDB($database) : void
|
||||||
{
|
{
|
||||||
/* This will set the default configuration for the request */
|
/* This will set the database connection for the request */
|
||||||
config(['database.default' => $database]);
|
config(['database.default' => $database]);
|
||||||
app('db')->connection(config('database.connections.database.'.$database));
|
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
@ -13,6 +13,9 @@ class User extends Authenticatable
|
|||||||
use SoftDeletes;
|
use SoftDeletes;
|
||||||
|
|
||||||
protected $guard = 'user';
|
protected $guard = 'user';
|
||||||
|
|
||||||
|
protected $dates = ['deleted_at'];
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* The attributes that are mass assignable.
|
* The attributes that are mass assignable.
|
||||||
*
|
*
|
||||||
@ -22,10 +25,10 @@ class User extends Authenticatable
|
|||||||
'first_name',
|
'first_name',
|
||||||
'last_name',
|
'last_name',
|
||||||
'email',
|
'email',
|
||||||
'password',
|
|
||||||
'phone',
|
'phone',
|
||||||
'signature',
|
'signature',
|
||||||
'avatar',
|
'avatar',
|
||||||
|
'accepted_terms_version'
|
||||||
];
|
];
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -34,7 +37,6 @@ class User extends Authenticatable
|
|||||||
* @var array
|
* @var array
|
||||||
*/
|
*/
|
||||||
protected $hidden = [
|
protected $hidden = [
|
||||||
'password',
|
|
||||||
'remember_token',
|
'remember_token',
|
||||||
'confirmation_code',
|
'confirmation_code',
|
||||||
'oauth_user_id',
|
'oauth_user_id',
|
||||||
|
@ -25,6 +25,8 @@
|
|||||||
"laravel/framework": "5.7.*",
|
"laravel/framework": "5.7.*",
|
||||||
"laravel/socialite": "^3.1",
|
"laravel/socialite": "^3.1",
|
||||||
"laravel/tinker": "^1.0",
|
"laravel/tinker": "^1.0",
|
||||||
|
"nwidart/laravel-modules": "^4.0",
|
||||||
|
"predis/predis": "^1.1",
|
||||||
"spatie/laravel-html": "^2.19",
|
"spatie/laravel-html": "^2.19",
|
||||||
"webpatser/laravel-countries": "dev-master#75992ad"
|
"webpatser/laravel-countries": "dev-master#75992ad"
|
||||||
},
|
},
|
||||||
|
122
composer.lock
generated
122
composer.lock
generated
@ -4,7 +4,7 @@
|
|||||||
"Read more about it at https://getcomposer.org/doc/01-basic-usage.md#installing-dependencies",
|
"Read more about it at https://getcomposer.org/doc/01-basic-usage.md#installing-dependencies",
|
||||||
"This file is @generated automatically"
|
"This file is @generated automatically"
|
||||||
],
|
],
|
||||||
"content-hash": "0a3a5aeaabd9e3362e0da55be647367c",
|
"content-hash": "b059d33c67d5ecfe4b761dbc55f4e326",
|
||||||
"packages": [
|
"packages": [
|
||||||
{
|
{
|
||||||
"name": "asgrim/ofxparser",
|
"name": "asgrim/ofxparser",
|
||||||
@ -1347,6 +1347,76 @@
|
|||||||
],
|
],
|
||||||
"time": "2018-10-10T09:24:14+00:00"
|
"time": "2018-10-10T09:24:14+00:00"
|
||||||
},
|
},
|
||||||
|
{
|
||||||
|
"name": "nwidart/laravel-modules",
|
||||||
|
"version": "4.0.0",
|
||||||
|
"source": {
|
||||||
|
"type": "git",
|
||||||
|
"url": "https://github.com/nWidart/laravel-modules.git",
|
||||||
|
"reference": "d487d9be3bfd6b7365678fd805d9ba5f0dd8295c"
|
||||||
|
},
|
||||||
|
"dist": {
|
||||||
|
"type": "zip",
|
||||||
|
"url": "https://api.github.com/repos/nWidart/laravel-modules/zipball/d487d9be3bfd6b7365678fd805d9ba5f0dd8295c",
|
||||||
|
"reference": "d487d9be3bfd6b7365678fd805d9ba5f0dd8295c",
|
||||||
|
"shasum": ""
|
||||||
|
},
|
||||||
|
"require": {
|
||||||
|
"php": ">=7.1"
|
||||||
|
},
|
||||||
|
"require-dev": {
|
||||||
|
"friendsofphp/php-cs-fixer": "^2.7",
|
||||||
|
"laravel/framework": "5.7.*",
|
||||||
|
"mockery/mockery": "~1.0",
|
||||||
|
"orchestra/testbench": "^3.7",
|
||||||
|
"phpstan/phpstan": "^0.9.2",
|
||||||
|
"phpunit/phpunit": "~7.3",
|
||||||
|
"spatie/phpunit-snapshot-assertions": "^1.0"
|
||||||
|
},
|
||||||
|
"type": "library",
|
||||||
|
"extra": {
|
||||||
|
"laravel": {
|
||||||
|
"providers": [
|
||||||
|
"Nwidart\\Modules\\LaravelModulesServiceProvider"
|
||||||
|
],
|
||||||
|
"aliases": {
|
||||||
|
"Module": "Nwidart\\Modules\\Facades\\Module"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"branch-alias": {
|
||||||
|
"dev-master": "4.0-dev"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"autoload": {
|
||||||
|
"psr-4": {
|
||||||
|
"Nwidart\\Modules\\": "src"
|
||||||
|
},
|
||||||
|
"files": [
|
||||||
|
"src/helpers.php"
|
||||||
|
]
|
||||||
|
},
|
||||||
|
"notification-url": "https://packagist.org/downloads/",
|
||||||
|
"license": [
|
||||||
|
"MIT"
|
||||||
|
],
|
||||||
|
"authors": [
|
||||||
|
{
|
||||||
|
"name": "Nicolas Widart",
|
||||||
|
"email": "n.widart@gmail.com",
|
||||||
|
"homepage": "https://nicolaswidart.com",
|
||||||
|
"role": "Developer"
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"description": "Laravel Module management",
|
||||||
|
"keywords": [
|
||||||
|
"laravel",
|
||||||
|
"module",
|
||||||
|
"modules",
|
||||||
|
"nwidart",
|
||||||
|
"rad"
|
||||||
|
],
|
||||||
|
"time": "2018-09-30T10:02:46+00:00"
|
||||||
|
},
|
||||||
{
|
{
|
||||||
"name": "opis/closure",
|
"name": "opis/closure",
|
||||||
"version": "3.1.1",
|
"version": "3.1.1",
|
||||||
@ -1453,6 +1523,56 @@
|
|||||||
],
|
],
|
||||||
"time": "2018-07-02T15:55:56+00:00"
|
"time": "2018-07-02T15:55:56+00:00"
|
||||||
},
|
},
|
||||||
|
{
|
||||||
|
"name": "predis/predis",
|
||||||
|
"version": "v1.1.1",
|
||||||
|
"source": {
|
||||||
|
"type": "git",
|
||||||
|
"url": "https://github.com/nrk/predis.git",
|
||||||
|
"reference": "f0210e38881631afeafb56ab43405a92cafd9fd1"
|
||||||
|
},
|
||||||
|
"dist": {
|
||||||
|
"type": "zip",
|
||||||
|
"url": "https://api.github.com/repos/nrk/predis/zipball/f0210e38881631afeafb56ab43405a92cafd9fd1",
|
||||||
|
"reference": "f0210e38881631afeafb56ab43405a92cafd9fd1",
|
||||||
|
"shasum": ""
|
||||||
|
},
|
||||||
|
"require": {
|
||||||
|
"php": ">=5.3.9"
|
||||||
|
},
|
||||||
|
"require-dev": {
|
||||||
|
"phpunit/phpunit": "~4.8"
|
||||||
|
},
|
||||||
|
"suggest": {
|
||||||
|
"ext-curl": "Allows access to Webdis when paired with phpiredis",
|
||||||
|
"ext-phpiredis": "Allows faster serialization and deserialization of the Redis protocol"
|
||||||
|
},
|
||||||
|
"type": "library",
|
||||||
|
"autoload": {
|
||||||
|
"psr-4": {
|
||||||
|
"Predis\\": "src/"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"notification-url": "https://packagist.org/downloads/",
|
||||||
|
"license": [
|
||||||
|
"MIT"
|
||||||
|
],
|
||||||
|
"authors": [
|
||||||
|
{
|
||||||
|
"name": "Daniele Alessandri",
|
||||||
|
"email": "suppakilla@gmail.com",
|
||||||
|
"homepage": "http://clorophilla.net"
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"description": "Flexible and feature-complete Redis client for PHP and HHVM",
|
||||||
|
"homepage": "http://github.com/nrk/predis",
|
||||||
|
"keywords": [
|
||||||
|
"nosql",
|
||||||
|
"predis",
|
||||||
|
"redis"
|
||||||
|
],
|
||||||
|
"time": "2016-06-16T16:22:20+00:00"
|
||||||
|
},
|
||||||
{
|
{
|
||||||
"name": "psr/container",
|
"name": "psr/container",
|
||||||
"version": "1.0.0",
|
"version": "1.0.0",
|
||||||
|
@ -5,5 +5,17 @@ return [
|
|||||||
'web_url' => 'https://www.invoiceninja.com',
|
'web_url' => 'https://www.invoiceninja.com',
|
||||||
'app_url' => 'https://app-v5.invoiceninja.com',
|
'app_url' => 'https://app-v5.invoiceninja.com',
|
||||||
'site_url' => '',
|
'site_url' => '',
|
||||||
|
'environment' => env('NINJA_ENVIRONMENT', 'selfhost'), // 'hosted', 'development', 'selfhost', 'reseller'
|
||||||
|
|
||||||
|
// Settings used by invoiceninja.com
|
||||||
|
|
||||||
|
'terms_of_service_url' => [
|
||||||
|
'hosted' => env('TERMS_OF_SERVICE_URL', 'https://www.invoiceninja.com/terms/'),
|
||||||
|
'selfhost' => env('TERMS_OF_SERVICE_URL', 'https://www.invoiceninja.com/self-hosting-terms-service/'),
|
||||||
|
],
|
||||||
|
|
||||||
|
'privacy_policy_url' => [
|
||||||
|
'hosted' => env('PRIVACY_POLICY_URL', 'https://www.invoiceninja.com/privacy-policy/'),
|
||||||
|
'selfhost' => env('PRIVACY_POLICY_URL', 'https://www.invoiceninja.com/self-hosting-privacy-data-control/'),
|
||||||
|
],
|
||||||
];
|
];
|
||||||
|
@ -15,9 +15,10 @@ use Faker\Generator as Faker;
|
|||||||
|
|
||||||
$factory->define(App\Models\Contact::class, function (Faker $faker) {
|
$factory->define(App\Models\Contact::class, function (Faker $faker) {
|
||||||
return [
|
return [
|
||||||
'first_name' => $faker->name,
|
'first_name' => $faker->name,
|
||||||
'email' => $faker->unique()->safeEmail,
|
'email' => $faker->unique()->safeEmail,
|
||||||
'password' => bcrypt('secret'),
|
'password' => bcrypt('secret'),
|
||||||
'remember_token' => str_random(10),
|
'remember_token' => str_random(10),
|
||||||
|
'db' => config('database.default')
|
||||||
];
|
];
|
||||||
});
|
});
|
||||||
|
@ -22,5 +22,6 @@ $factory->define(App\Models\User::class, function (Faker $faker) {
|
|||||||
'email_verified_at' => now(),
|
'email_verified_at' => now(),
|
||||||
'password' => '$2y$10$TKh8H1.PfQx37YgCzwiKb.KjNyWgaHb9cbcoQgdIVFlYg7B77UdFm', // secret
|
'password' => '$2y$10$TKh8H1.PfQx37YgCzwiKb.KjNyWgaHb9cbcoQgdIVFlYg7B77UdFm', // secret
|
||||||
'remember_token' => str_random(10),
|
'remember_token' => str_random(10),
|
||||||
|
'db' => config('database.default')
|
||||||
];
|
];
|
||||||
});
|
});
|
||||||
|
@ -0,0 +1,63 @@
|
|||||||
|
<?php
|
||||||
|
|
||||||
|
use Illuminate\Support\Facades\Schema;
|
||||||
|
use Illuminate\Database\Schema\Blueprint;
|
||||||
|
use Illuminate\Database\Migrations\Migration;
|
||||||
|
|
||||||
|
class AddDbToUserTable extends Migration
|
||||||
|
{
|
||||||
|
/**
|
||||||
|
* Run the migrations.
|
||||||
|
*
|
||||||
|
* @return void
|
||||||
|
*/
|
||||||
|
public function up()
|
||||||
|
{
|
||||||
|
Schema::table('users', function (Blueprint $table) {
|
||||||
|
$table->string('db', 100);
|
||||||
|
});
|
||||||
|
|
||||||
|
Schema::table('contacts', function (Blueprint $table) {
|
||||||
|
$table->string('db', 100);
|
||||||
|
});
|
||||||
|
|
||||||
|
Schema::table('users', function (Blueprint $table){
|
||||||
|
$table->dropColumn('confirmed');
|
||||||
|
$table->dropColumn('registered');
|
||||||
|
});
|
||||||
|
|
||||||
|
Schema::table('contacts', function (Blueprint $table){
|
||||||
|
$table->dropColumn('confirmed');
|
||||||
|
$table->dropColumn('registered');
|
||||||
|
|
||||||
|
});
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Reverse the migrations.
|
||||||
|
*
|
||||||
|
* @return void
|
||||||
|
*/
|
||||||
|
public function down()
|
||||||
|
{
|
||||||
|
Schema::table('users', function (Blueprint $table) {
|
||||||
|
$table->dropColumn('db');
|
||||||
|
});
|
||||||
|
|
||||||
|
Schema::table('contacts', function (Blueprint $table) {
|
||||||
|
$table->dropColumn('db');
|
||||||
|
});
|
||||||
|
|
||||||
|
Schema::table('users', function (Blueprint $table){
|
||||||
|
$table->boolean('confirmed');
|
||||||
|
$table->boolean('registered');
|
||||||
|
});
|
||||||
|
|
||||||
|
Schema::table('contacts', function (Blueprint $table){
|
||||||
|
$table->boolean('confirmed');
|
||||||
|
$table->boolean('registered');
|
||||||
|
|
||||||
|
});
|
||||||
|
}
|
||||||
|
}
|
@ -70,7 +70,7 @@
|
|||||||
<i class="icon-lock"></i>
|
<i class="icon-lock"></i>
|
||||||
</span>
|
</span>
|
||||||
</div>
|
</div>
|
||||||
<input id="password" type="password" class="form-control{{ $errors->has('password') ? ' is-invalid' : '' }}" name="password" placeholder="@lang('texts.password')" required>
|
<input id="password" type="password" class="form-control" {{ $errors->has('password') ? ' is-invalid' : '' }} name="password" placeholder="@lang('texts.password')" required>
|
||||||
|
|
||||||
@if ($errors->has('password'))
|
@if ($errors->has('password'))
|
||||||
<span class="invalid-feedback" role="alert">
|
<span class="invalid-feedback" role="alert">
|
||||||
@ -79,17 +79,19 @@
|
|||||||
@endif
|
@endif
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div class="form-check">
|
<div class="form-check" style="margin-top:10px; margin-bottom: 10px;">
|
||||||
<input class="form-check-input" type="checkbox" id="terms_of_service" name="terms_of_service" value="" v-model="checked1" {{(old('terms_of_service') == "1") ? 'checked': ''}}>
|
<input class="form-check-input" type="checkbox" id="terms_of_service" name="terms_of_service" value="1" v-model="checked1" {{(old('terms_of_service') == "1") ? 'checked': ''}}>
|
||||||
<label class="form-check-label" for="terms_of_service">
|
<label class="form-check-label" for="terms_of_service">
|
||||||
@lang('texts.terms_of_service')
|
@lang('texts.agree_to_terms', ['terms' => ''])<a href=" {{config('ninja.terms_of_service_url.' . config('ninja.environment')) }}" target="_blank">@lang('texts.terms_of_service')</a>
|
||||||
|
|
||||||
</label>
|
</label>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div class="form-check">
|
<div class="form-check" style="margin-top:10px; margin-bottom: 10px;">
|
||||||
<input class="form-check-input" type="checkbox" id="privacy_policy" name="privacy_policy" value="" v-model="checked2" {{(old('privacy_policy') == "1") ? 'checked': ''}}>
|
<input class="form-check-input" type="checkbox" id="privacy_policy" name="privacy_policy" value="1" v-model="checked2" {{(old('privacy_policy') == "1") ? 'checked': ''}}>
|
||||||
<label class="form-check-label" for="privacy_policy">
|
<label class="form-check-label" for="privacy_policy">
|
||||||
@lang('texts.privacy_policy')
|
@lang('texts.agree_to_terms', ['terms' => ''])<a href=" {{config('ninja.privacy_policy_url.' . config('ninja.environment')) }}" target="_blank">@lang('texts.privacy_policy')</a>
|
||||||
|
|
||||||
</label>
|
</label>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
@ -137,6 +139,4 @@
|
|||||||
|
|
||||||
</body>
|
</body>
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
</html>
|
</html>
|
@ -1,58 +1,45 @@
|
|||||||
<?php
|
<?php
|
||||||
|
|
||||||
/*
|
/*
|
||||||
|--------------------------------------------------------------------------
|
* Authentication Routes Laravel Defaults... replaces //Auth::routes();
|
||||||
| Web Routes
|
*/
|
||||||
|--------------------------------------------------------------------------
|
|
||||||
|
|
|
||||||
| Here is where you can register web routes for your application. These
|
|
||||||
| routes are loaded by the RouteServiceProvider within a group which
|
|
||||||
| contains the "web" middleware group. Now create something great!
|
|
||||||
|
|
|
||||||
*/
|
|
||||||
|
|
||||||
|
|
||||||
// Authentication Routes Laravel Defaults... replaces //Auth::routes();
|
|
||||||
Route::get('login', 'Auth\LoginController@showLoginForm')->name('login');
|
Route::get('login', 'Auth\LoginController@showLoginForm')->name('login');
|
||||||
Route::post('login', 'Auth\LoginController@login');
|
Route::post('login', 'Auth\LoginController@login');
|
||||||
Route::post('logout', 'Auth\LoginController@logout')->name('logout');
|
Route::post('logout', 'Auth\LoginController@logout')->name('logout');
|
||||||
|
/*
|
||||||
// Social authentication
|
* Signup Routes
|
||||||
|
*/
|
||||||
Route::get('auth/{provider}', 'Auth\LoginController@redirectToProvider');
|
Route::redirect('/', '/login', 301);
|
||||||
Route::get('auth/{provider}/callback', 'Auth\LoginController@handleProviderCallback');
|
Route::get('signup', 'SignupController@signup')->name('signup');
|
||||||
|
Route::post('process_signup', 'SignupController@processSignup')->name('signup.submit');
|
||||||
// Password Reset Routes...
|
Route::get('contact/login', 'Auth\ContactLoginController@showLoginForm')->name('contact.login');
|
||||||
|
Route::post('contact/login', 'Auth\ContactLoginController@login')->name('contact.login.submit');
|
||||||
|
/*
|
||||||
|
* Password Reset Routes...
|
||||||
|
*/
|
||||||
Route::get('password/reset', 'Auth\ForgotPasswordController@showLinkRequestForm')->name('password.request');
|
Route::get('password/reset', 'Auth\ForgotPasswordController@showLinkRequestForm')->name('password.request');
|
||||||
Route::post('password/email', 'Auth\ForgotPasswordController@sendResetLinkEmail')->name('password.email');
|
Route::post('password/email', 'Auth\ForgotPasswordController@sendResetLinkEmail')->name('password.email');
|
||||||
Route::get('password/reset/{token}', 'Auth\ResetPasswordController@showResetForm')->name('password.reset');
|
Route::get('password/reset/{token}', 'Auth\ResetPasswordController@showResetForm')->name('password.reset');
|
||||||
Route::post('password/reset', 'Auth\ResetPasswordController@reset')->name('password.update');
|
Route::post('password/reset', 'Auth\ResetPasswordController@reset')->name('password.update');
|
||||||
|
|
||||||
/*
|
/*
|
||||||
Open Routes
|
* Social authentication
|
||||||
*/
|
*/
|
||||||
//Route::get('/', 'HomeController@index')->name('default');
|
Route::get('auth/{provider}', 'Auth\LoginController@redirectToProvider');
|
||||||
Route::redirect('/', '/login', 301);
|
Route::get('auth/{provider}/callback', 'Auth\LoginController@handleProviderCallback');
|
||||||
|
|
||||||
|
|
||||||
Route::get('/signup', 'SignupController@signup')->name('signup');
|
|
||||||
Route::post('/process_signup', 'SignupController@processSignup')->name('signup.submit');
|
|
||||||
|
|
||||||
Route::get('/contact/login', 'Auth\ContactLoginController@showLoginForm')->name('contact.login');
|
|
||||||
Route::post('/contact/login', 'Auth\ContactLoginController@login')->name('contact.login.submit');
|
|
||||||
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
Authenticated User Routes
|
* Authenticated User Routes
|
||||||
*/
|
*/
|
||||||
Route::group(['middleware' => ['auth:user', 'db']], function () {
|
Route::group(['middleware' => ['auth:user', 'db']], function () {
|
||||||
|
|
||||||
Route::get('/dashboard', 'HomeController@user')->name('user.dashboard');
|
Route::get('dashboard', 'HomeController@user')->name('user.dashboard');
|
||||||
Route::get('/logout', 'Auth\LoginController@logout')->name('user.logout');
|
Route::get('logout', 'Auth\LoginController@logout')->name('user.logout');
|
||||||
Route::resource('/invoices', 'InvoiceController'); // name = (invoices. index / create / show / update / destroy / edit
|
Route::resource('invoices', 'InvoiceController'); // name = (invoices. index / create / show / update / destroy / edit
|
||||||
Route::get('/settings', 'SettingsController@index')->name('user.settings');
|
Route::get('settings', 'SettingsController@index')->name('user.settings');
|
||||||
});
|
|
||||||
|
|
||||||
|
});
|
||||||
|
/*
|
||||||
|
* Inbound routes requiring DB Lookup
|
||||||
|
*/
|
||||||
|
|
||||||
/*
|
/*
|
||||||
Authenticated Contact Routes
|
Authenticated Contact Routes
|
||||||
@ -60,6 +47,6 @@ Authenticated Contact Routes
|
|||||||
Route::group(['prefix' => 'contact', 'middleware' => 'auth:contact'], function () {
|
Route::group(['prefix' => 'contact', 'middleware' => 'auth:contact'], function () {
|
||||||
|
|
||||||
Route::get('/', 'ContactController@index')->name('contact.dashboard');
|
Route::get('/', 'ContactController@index')->name('contact.dashboard');
|
||||||
Route::get('logout/', 'Auth\ContactLoginController@logout')->name('contact.logout');
|
Route::get('logout', 'Auth\ContactLoginController@logout')->name('contact.logout');
|
||||||
|
|
||||||
});
|
});
|
@ -39,7 +39,8 @@ class MultiDBUserTest extends TestCase
|
|||||||
'password' => '$2y$10$TKh8H1.PfQx37YgCzwiKb.KjNyWgaHb9cbcoQgdIVFlYg7B77UdFm', // secret
|
'password' => '$2y$10$TKh8H1.PfQx37YgCzwiKb.KjNyWgaHb9cbcoQgdIVFlYg7B77UdFm', // secret
|
||||||
'remember_token' => str_random(10),
|
'remember_token' => str_random(10),
|
||||||
'email' => 'db1@example.com',
|
'email' => 'db1@example.com',
|
||||||
'oauth_user_id' => '123'
|
'oauth_user_id' => '123',
|
||||||
|
'db' => config('database.default')
|
||||||
];
|
];
|
||||||
|
|
||||||
|
|
||||||
@ -51,7 +52,9 @@ class MultiDBUserTest extends TestCase
|
|||||||
'password' => '$2y$10$TKh8H1.PfQx37YgCzwiKb.KjNyWgaHb9cbcoQgdIVFlYg7B77UdFm', // secret
|
'password' => '$2y$10$TKh8H1.PfQx37YgCzwiKb.KjNyWgaHb9cbcoQgdIVFlYg7B77UdFm', // secret
|
||||||
'remember_token' => str_random(10),
|
'remember_token' => str_random(10),
|
||||||
'email' => 'db2@example.com',
|
'email' => 'db2@example.com',
|
||||||
'oauth_user_id' => 'abc'
|
'oauth_user_id' => 'abc',
|
||||||
|
'db' => config('database.default')
|
||||||
|
|
||||||
];
|
];
|
||||||
|
|
||||||
User::on('db-ninja-1')->create($user);
|
User::on('db-ninja-1')->create($user);
|
||||||
|
@ -34,9 +34,11 @@ class UniqueEmailTest extends TestCase
|
|||||||
$this->rule = new UniqueUserRule();
|
$this->rule = new UniqueUserRule();
|
||||||
|
|
||||||
$user = [
|
$user = [
|
||||||
'first_name' => 'user_db_1',
|
'first_name' => 'user_db_1',
|
||||||
'email' => 'user@example.com',
|
'email' => 'user@example.com',
|
||||||
'password' => Hash::make('password'),
|
'password' => Hash::make('password'),
|
||||||
|
'db' => config('database.default')
|
||||||
|
|
||||||
];
|
];
|
||||||
|
|
||||||
User::on('db-ninja-1')->create($user);
|
User::on('db-ninja-1')->create($user);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user