mirror of
https://github.com/firefly-iii/firefly-iii.git
synced 2025-10-12 23:45:10 +00:00
Merge branch 'release/3.4.9'
This commit is contained in:
@@ -5,6 +5,7 @@ use FireflyIII\Http\Controllers\Controller;
|
|||||||
use FireflyIII\Models\Role;
|
use FireflyIII\Models\Role;
|
||||||
use FireflyIII\User;
|
use FireflyIII\User;
|
||||||
use Illuminate\Foundation\Auth\AuthenticatesAndRegistersUsers;
|
use Illuminate\Foundation\Auth\AuthenticatesAndRegistersUsers;
|
||||||
|
use Illuminate\Foundation\Auth\ThrottlesLogins;
|
||||||
use Illuminate\Http\Request;
|
use Illuminate\Http\Request;
|
||||||
use Illuminate\Mail\Message;
|
use Illuminate\Mail\Message;
|
||||||
use Mail;
|
use Mail;
|
||||||
@@ -19,6 +20,8 @@ use Validator;
|
|||||||
*/
|
*/
|
||||||
class AuthController extends Controller
|
class AuthController extends Controller
|
||||||
{
|
{
|
||||||
|
use AuthenticatesAndRegistersUsers, ThrottlesLogins;
|
||||||
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
|--------------------------------------------------------------------------
|
|--------------------------------------------------------------------------
|
||||||
@@ -31,7 +34,54 @@ class AuthController extends Controller
|
|||||||
|
|
|
|
||||||
*/
|
*/
|
||||||
|
|
||||||
use AuthenticatesAndRegistersUsers;
|
|
||||||
|
/**
|
||||||
|
* Handle a login request to the application.
|
||||||
|
*
|
||||||
|
* @param \Illuminate\Http\Request $request
|
||||||
|
*
|
||||||
|
* @return \Illuminate\Http\Response
|
||||||
|
*/
|
||||||
|
public function postLogin(Request $request)
|
||||||
|
{
|
||||||
|
$this->validate(
|
||||||
|
$request, [
|
||||||
|
$this->loginUsername() => 'required', 'password' => 'required',
|
||||||
|
]
|
||||||
|
);
|
||||||
|
|
||||||
|
// If the class is using the ThrottlesLogins trait, we can automatically throttle
|
||||||
|
// the login attempts for this application. We'll key this by the username and
|
||||||
|
// the IP address of the client making these requests into this application.
|
||||||
|
$throttles = $this->isUsingThrottlesLoginsTrait();
|
||||||
|
|
||||||
|
if ($throttles && $this->hasTooManyLoginAttempts($request)) {
|
||||||
|
return $this->sendLockoutResponse($request);
|
||||||
|
}
|
||||||
|
|
||||||
|
$credentials = $this->getCredentials($request);
|
||||||
|
$credentials['blocked'] = 0;
|
||||||
|
|
||||||
|
if (Auth::attempt($credentials, $request->has('remember'))) {
|
||||||
|
return $this->handleUserWasAuthenticated($request, $throttles);
|
||||||
|
}
|
||||||
|
|
||||||
|
// If the login attempt was unsuccessful we will increment the number of attempts
|
||||||
|
// to login and redirect the user back to the login form. Of course, when this
|
||||||
|
// user surpasses their maximum number of attempts they will get locked out.
|
||||||
|
if ($throttles) {
|
||||||
|
$this->incrementLoginAttempts($request);
|
||||||
|
}
|
||||||
|
|
||||||
|
return redirect($this->loginPath())
|
||||||
|
->withInput($request->only($this->loginUsername(), 'remember'))
|
||||||
|
->withErrors(
|
||||||
|
[
|
||||||
|
$this->loginUsername() => $this->getFailedLoginMessage(),
|
||||||
|
]
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
public $redirectTo = '/';
|
public $redirectTo = '/';
|
||||||
|
|
||||||
|
@@ -53,6 +53,7 @@ class NewUserController extends Controller
|
|||||||
// create normal asset account:
|
// create normal asset account:
|
||||||
$assetAccount = [
|
$assetAccount = [
|
||||||
'name' => $request->get('bank_name'),
|
'name' => $request->get('bank_name'),
|
||||||
|
'iban' => null,
|
||||||
'accountType' => 'asset',
|
'accountType' => 'asset',
|
||||||
'virtualBalance' => 0,
|
'virtualBalance' => 0,
|
||||||
'active' => true,
|
'active' => true,
|
||||||
@@ -69,6 +70,7 @@ class NewUserController extends Controller
|
|||||||
if (strlen($request->get('savings_balance') > 0)) {
|
if (strlen($request->get('savings_balance') > 0)) {
|
||||||
$savingsAccount = [
|
$savingsAccount = [
|
||||||
'name' => $request->get('bank_name') . ' savings account',
|
'name' => $request->get('bank_name') . ' savings account',
|
||||||
|
'iban' => null,
|
||||||
'accountType' => 'asset',
|
'accountType' => 'asset',
|
||||||
'virtualBalance' => 0,
|
'virtualBalance' => 0,
|
||||||
'active' => true,
|
'active' => true,
|
||||||
@@ -86,6 +88,7 @@ class NewUserController extends Controller
|
|||||||
if (strlen($request->get('credit_card_limit') > 0)) {
|
if (strlen($request->get('credit_card_limit') > 0)) {
|
||||||
$creditAccount = [
|
$creditAccount = [
|
||||||
'name' => 'Credit card',
|
'name' => 'Credit card',
|
||||||
|
'iban' => null,
|
||||||
'accountType' => 'asset',
|
'accountType' => 'asset',
|
||||||
'virtualBalance' => floatval($request->get('credit_card_limit')),
|
'virtualBalance' => floatval($request->get('credit_card_limit')),
|
||||||
'active' => true,
|
'active' => true,
|
||||||
|
@@ -28,6 +28,7 @@ return [
|
|||||||
|
|
||||||
'default' => env('DB_CONNECTION', 'mysql'),
|
'default' => env('DB_CONNECTION', 'mysql'),
|
||||||
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
|--------------------------------------------------------------------------
|
|--------------------------------------------------------------------------
|
||||||
| Database Connections
|
| Database Connections
|
||||||
|
@@ -2,7 +2,7 @@
|
|||||||
|
|
||||||
return [
|
return [
|
||||||
'chart' => 'chartjs',
|
'chart' => 'chartjs',
|
||||||
'version' => '3.4.8',
|
'version' => '3.4.9',
|
||||||
'index_periods' => ['1D', '1W', '1M', '3M', '6M', '1Y', 'custom'],
|
'index_periods' => ['1D', '1W', '1M', '3M', '6M', '1Y', 'custom'],
|
||||||
'budget_periods' => ['daily', 'weekly', 'monthly', 'quarterly', 'half-year', 'yearly'],
|
'budget_periods' => ['daily', 'weekly', 'monthly', 'quarterly', 'half-year', 'yearly'],
|
||||||
'csv_import_enabled' => true,
|
'csv_import_enabled' => true,
|
||||||
|
@@ -2,22 +2,6 @@
|
|||||||
|
|
||||||
return [
|
return [
|
||||||
|
|
||||||
/*
|
|
||||||
|--------------------------------------------------------------------------
|
|
||||||
| Default Session Driver
|
|
||||||
|--------------------------------------------------------------------------
|
|
||||||
|
|
|
||||||
| This option controls the default session "driver" that will be used on
|
|
||||||
| requests. By default, we will use the lightweight native driver but
|
|
||||||
| you may specify any of the other wonderful drivers provided here.
|
|
||||||
|
|
|
||||||
| Supported: "file", "cookie", "database", "apc",
|
|
||||||
| "memcached", "redis", "array"
|
|
||||||
|
|
|
||||||
*/
|
|
||||||
|
|
||||||
'driver' => env('SESSION_DRIVER', 'file'),
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
|--------------------------------------------------------------------------
|
|--------------------------------------------------------------------------
|
||||||
| Session Lifetime
|
| Session Lifetime
|
||||||
@@ -33,18 +17,6 @@ return [
|
|||||||
|
|
||||||
'expire_on_close' => false,
|
'expire_on_close' => false,
|
||||||
|
|
||||||
/*
|
|
||||||
|--------------------------------------------------------------------------
|
|
||||||
| Session Encryption
|
|
||||||
|--------------------------------------------------------------------------
|
|
||||||
|
|
|
||||||
| This option allows you to easily specify that all of your session data
|
|
||||||
| should be encrypted before it is stored. All encryption will be run
|
|
||||||
| automatically by Laravel and you can use the Session like normal.
|
|
||||||
|
|
|
||||||
*/
|
|
||||||
|
|
||||||
'encrypt' => false,
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
|--------------------------------------------------------------------------
|
|--------------------------------------------------------------------------
|
||||||
@@ -59,18 +31,6 @@ return [
|
|||||||
|
|
||||||
'files' => storage_path() . '/framework/sessions',
|
'files' => storage_path() . '/framework/sessions',
|
||||||
|
|
||||||
/*
|
|
||||||
|--------------------------------------------------------------------------
|
|
||||||
| Session Database Connection
|
|
||||||
|--------------------------------------------------------------------------
|
|
||||||
|
|
|
||||||
| When using the "database" or "redis" session drivers, you may specify a
|
|
||||||
| connection that should be used to manage these sessions. This should
|
|
||||||
| correspond to a connection in your database configuration options.
|
|
||||||
|
|
|
||||||
*/
|
|
||||||
|
|
||||||
'connection' => null,
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
|--------------------------------------------------------------------------
|
|--------------------------------------------------------------------------
|
||||||
@@ -98,18 +58,13 @@ return [
|
|||||||
|
|
||||||
'lottery' => [2, 100],
|
'lottery' => [2, 100],
|
||||||
|
|
||||||
/*
|
'driver' => env('SESSION_DRIVER', 'database'),
|
||||||
|--------------------------------------------------------------------------
|
'cookie' => 'firefly_session',
|
||||||
| Session Cookie Name
|
|
||||||
|--------------------------------------------------------------------------
|
|
||||||
|
|
|
||||||
| Here you may change the name of the cookie used to identify a session
|
|
||||||
| instance by ID. The name specified here will get used every time a
|
|
||||||
| new session cookie is created by the framework for every driver.
|
|
||||||
|
|
|
||||||
*/
|
|
||||||
|
|
||||||
'cookie' => 'laravel_session',
|
'connection' => env('DB_CONNECTION', 'mysql'),
|
||||||
|
|
||||||
|
|
||||||
|
'encrypt' => true,
|
||||||
|
|
||||||
/*
|
/*
|
||||||
|--------------------------------------------------------------------------
|
|--------------------------------------------------------------------------
|
||||||
|
35
database/migrations/2015_07_14_204645_changes_for_v349.php
Normal file
35
database/migrations/2015_07_14_204645_changes_for_v349.php
Normal file
@@ -0,0 +1,35 @@
|
|||||||
|
<?php
|
||||||
|
|
||||||
|
use Illuminate\Database\Migrations\Migration;
|
||||||
|
use Illuminate\Database\Schema\Blueprint;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Class ChangesForV349
|
||||||
|
*/
|
||||||
|
class ChangesForV349 extends Migration
|
||||||
|
{
|
||||||
|
/**
|
||||||
|
* Run the migrations.
|
||||||
|
*
|
||||||
|
* @return void
|
||||||
|
*/
|
||||||
|
public function up()
|
||||||
|
{
|
||||||
|
// add "blocked" to users:
|
||||||
|
Schema::table(
|
||||||
|
'users', function (Blueprint $table) {
|
||||||
|
$table->boolean('blocked')->default(0);
|
||||||
|
}
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Reverse the migrations.
|
||||||
|
*
|
||||||
|
* @return void
|
||||||
|
*/
|
||||||
|
public function down()
|
||||||
|
{
|
||||||
|
//
|
||||||
|
}
|
||||||
|
}
|
Reference in New Issue
Block a user