mirror of
				https://github.com/firefly-iii/firefly-iii.git
				synced 2025-10-31 18:54:58 +00:00 
			
		
		
		
	| @@ -12,6 +12,7 @@ declare(strict_types = 1); | ||||
| namespace FireflyIII\Http\Controllers\Auth; | ||||
|  | ||||
| use Auth; | ||||
| use Config; | ||||
| use FireflyIII\Events\UserRegistration; | ||||
| use FireflyIII\Exceptions\FireflyException; | ||||
| use FireflyIII\Http\Controllers\Controller; | ||||
| @@ -108,6 +109,15 @@ class AuthController extends Controller | ||||
|      */ | ||||
|     public function register(Request $request) | ||||
|     { | ||||
|         // is allowed to? | ||||
|         $singleUserMode = FireflyConfig::get('single_user_mode', Config::get('firefly.configuration.single_user_mode'))->data; | ||||
|         if ($singleUserMode === true) { | ||||
|             $message = 'Registration is currently not available.'; | ||||
|  | ||||
|             return view('error', compact('message')); | ||||
|         } | ||||
|  | ||||
|  | ||||
|         $validator = $this->validator($request->all()); | ||||
|  | ||||
|         if ($validator->fails()) { | ||||
| @@ -145,6 +155,19 @@ class AuthController extends Controller | ||||
|         return redirect($this->redirectPath()); | ||||
|     } | ||||
|  | ||||
|     /** | ||||
|      * Show the application login form. | ||||
|      * | ||||
|      * @return \Illuminate\Http\Response | ||||
|      */ | ||||
|     public function showLoginForm() | ||||
|     { | ||||
|         // is allowed to? | ||||
|         $singleUserMode = FireflyConfig::get('single_user_mode', Config::get('firefly.configuration.single_user_mode'))->data; | ||||
|  | ||||
|         return view('auth.login', compact('singleUserMode')); | ||||
|     } | ||||
|  | ||||
|     /** | ||||
|      * Show the application registration form. | ||||
|      * | ||||
| @@ -154,6 +177,14 @@ class AuthController extends Controller | ||||
|     { | ||||
|         $showDemoWarning = env('SHOW_DEMO_WARNING', false); | ||||
|  | ||||
|         // is allowed to? | ||||
|         $singleUserMode = FireflyConfig::get('single_user_mode', Config::get('firefly.configuration.single_user_mode'))->data; | ||||
|         if ($singleUserMode === true) { | ||||
|             $message = 'Registration is currently not available.'; | ||||
|  | ||||
|             return view('error', compact('message')); | ||||
|         } | ||||
|  | ||||
|         return view('auth.register', compact('showDemoWarning')); | ||||
|     } | ||||
|  | ||||
|   | ||||
		Reference in New Issue
	
	Block a user