+
+ This program is free software: you can redistribute it and/or modify
+ it under the terms of the GNU Affero General Public License as published by
+ the Free Software Foundation, either version 3 of the License, or
+ (at your option) any later version.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU Affero General Public License for more details.
+
+ You should have received a copy of the GNU Affero General Public License
+ along with this program. If not, see .
+
+Also add information on how to contact you by electronic and paper mail.
+
+ If your software can interact with users remotely through a computer
+network, you should also make sure that it provides a way for users to
+get its source. For example, if your program is a web application, its
+interface could display a "Source" link that leads users to an archive
+of the code. There are many ways you could offer source, and different
+solutions will be better for different programs; see section 13 for the
+specific requirements.
+
+ You should also get your employer (if you work as a programmer) or school,
+if any, to sign a "copyright disclaimer" for the program, if necessary.
+For more information on this, and how to apply and follow the GNU AGPL, see
+.
diff --git a/flexiapi/app/Http/Controllers/AccountController.php b/flexiapi/app/Http/Controllers/AccountController.php
index 5857500..e482b57 100644
--- a/flexiapi/app/Http/Controllers/AccountController.php
+++ b/flexiapi/app/Http/Controllers/AccountController.php
@@ -27,6 +27,11 @@ class AccountController extends Controller
]);
}
+ public function terms(Request $request)
+ {
+ return view('account.terms');
+ }
+
public function login(Request $request)
{
return view('account.login');
@@ -34,12 +39,15 @@ class AccountController extends Controller
public function register(Request $request)
{
- return view('account.register');
+ return view('account.register', [
+ 'domain' => '@' . config('app.sip_domain')
+ ]);
}
public function store(Request $request)
{
$request->validate([
+ 'terms' =>'accepted',
'username' => 'required|unique:external.accounts,username|min:6',
'phone' => 'required_without:email|nullable|unique:external.aliases,alias|unique:external.accounts,username|starts_with:+|phone:AUTO',
'g-recaptcha-response' => 'required|captcha',
diff --git a/flexiapi/app/Http/Middleware/Authenticate.php b/flexiapi/app/Http/Middleware/Authenticate.php
index 546d93d..5a9b666 100644
--- a/flexiapi/app/Http/Middleware/Authenticate.php
+++ b/flexiapi/app/Http/Middleware/Authenticate.php
@@ -15,7 +15,7 @@ class Authenticate extends Middleware
protected function redirectTo($request)
{
if (! $request->expectsJson()) {
- return route('account.login');
+ return route('account.register');
}
}
}
diff --git a/flexiapi/resources/views/account/login.blade.php b/flexiapi/resources/views/account/login.blade.php
index 31458ab..5c029b4 100644
--- a/flexiapi/resources/views/account/login.blade.php
+++ b/flexiapi/resources/views/account/login.blade.php
@@ -9,7 +9,7 @@
{!! Form::open(['route' => 'account.authenticate']) !!}
{!! Form::label('username', 'Username') !!}
- {!! Form::text('username', old('username'), ['class' => 'form-control', 'placeholder' => 'username@sip.linphone.org', 'required']) !!}
+ {!! Form::text('username', old('username'), ['class' => 'form-control', 'placeholder' => 'username@'.config('app.sip_domain'), 'required']) !!}
+
+
diff --git a/flexiapi/resources/views/parts/already_auth.blade.php b/flexiapi/resources/views/parts/already_auth.blade.php
index 7ffd292..24831c1 100644
--- a/flexiapi/resources/views/parts/already_auth.blade.php
+++ b/flexiapi/resources/views/parts/already_auth.blade.php
@@ -1,4 +1,4 @@
\ No newline at end of file
diff --git a/flexiapi/routes/web.php b/flexiapi/routes/web.php
index 2afe197..e2b2fd6 100644
--- a/flexiapi/routes/web.php
+++ b/flexiapi/routes/web.php
@@ -23,6 +23,7 @@ Route::get('login', 'AccountController@login')->name('account.login');
Route::post('authenticate', 'AccountController@authenticate')->name('account.authenticate');
Route::get('login/email', 'AccountController@loginEmail')->name('account.login_email');
+Route::get('terms', 'AccountController@terms')->name('account.terms');
Route::post('authenticate/email', 'AccountController@authenticateEmail')->name('account.authenticate_email');
Route::get('authenticate/email/{code}', 'AccountController@authenticateEmailConfirm')->name('account.authenticate_email_confirm');