diff --git a/pfosten/app/Http/Controllers/Auth/ForgotPasswordController.php b/pfosten/app/Http/Controllers/Auth/ForgotPasswordController.php index 6a247fef..4bce8461 100644 --- a/pfosten/app/Http/Controllers/Auth/ForgotPasswordController.php +++ b/pfosten/app/Http/Controllers/Auth/ForgotPasswordController.php @@ -29,4 +29,15 @@ class ForgotPasswordController extends Controller { $this->middleware('guest'); } + + /** + * Display the form to request a password reset link. + * + * @return \Illuminate\Http\Response + */ + public function showLinkRequestForm() + { + return view('auth.passwords.email'); + } + } diff --git a/pfosten/app/Http/Controllers/UsersController.php b/pfosten/app/Http/Controllers/UsersController.php index 3b8cdf08..7b2c9a42 100755 --- a/pfosten/app/Http/Controllers/UsersController.php +++ b/pfosten/app/Http/Controllers/UsersController.php @@ -12,6 +12,14 @@ use App\Tipp; use App\Quota; use App\Mail\RoundmailMailer; +use Password; +use Illuminate\Contracts\Auth\Guard; +//use Illuminate\Contracts\Auth\PasswordBroker; +use Illuminate\Foundation\Auth\ResetsPasswords; +use Illuminate\Auth\Passwords\PasswordBroker; + + + use DB; use Auth; use Log; @@ -21,14 +29,11 @@ use Carbon; class UsersController extends Controller { public function main() { + $currentSeason=Season::getCurrent(); $roundname=""; $report=""; - $result=User::hasMissingJoker(1); - Log::info("!!! =>".$result); - if (!$result) { Log::info("Joker is missing");} - $currentSeason=Season::getCurrent(); - + // display_rounds berechnen für Nav und Rundenberichte $display_rounds=array(); if ($currentSeason) { $round_id = Round::getLastCompleteRoundId(); @@ -47,7 +52,23 @@ class UsersController extends Controller } else { Log::info("No round identified. Last Locked=".$round_id); $report="";} } else {Log::info("No current season");} - return view('main',compact('roundname','display_rounds')); + $nextRoundName=""; + $nextRoundId = Round::getFirstIncompleteRound(); + if ($nextRoundId>-1) { $nextRoundName = Round::where('id','=',$nextRoundId)->first()->name; } + + $user=Auth::user(); + $message_text_tipps=""; + $message_text_joker=""; + if ($user && $currentSeason) { + if (User::hasMissingTipp($user->id)) { + $message_text_tipps="Fehlende Tipps für ".$nextRoundName; + } + if (User::hasMissingJoker($user->id)) { + $message_text_joker="Fehlender Joker für ".$nextRoundName; + } + } + + return view('main',compact('roundname','display_rounds','message_text_joker','message_text_tipps','nextRoundName')); } public function index() { @@ -444,4 +465,28 @@ class UsersController extends Controller } + + public function test() { + //Password::sendResetLink(['email','magus@zauberturm.de']); + $request = new Request(); + $request->merge(['email'=>'magus@zauberturm.de']); + + $broker = $this->getBroker(); + + $response = Password::broker($broker)->sendResetLink($request->only('email'), function (Message $message) { + $message->subject($this->getEmailSubject()); + }); + } + + // App\Http\Controllers\Auth\ForgotPasswordController@sendResetLinkEmail + public function reset() { + return view('auth.passwords.email'); + } + + public function processReset(Request $request) { + $response = $this->broker()->sendResetLink( + $request->only('email') + ); + } + } diff --git a/pfosten/app/User.php b/pfosten/app/User.php index d42fe861..bf8dabff 100644 --- a/pfosten/app/User.php +++ b/pfosten/app/User.php @@ -3,7 +3,7 @@ namespace App; use Illuminate\Notifications\Notifiable; -use Illuminate\Foundation\Auth\User as Authenticatable; +use Illuminate\Foundation\Auth\User as Authenticatable; // already implements CanResetPassword use App\Season; use App\Payment; use App\Round; @@ -134,18 +134,12 @@ class User extends Authenticatable $round_id = Round::getFirstIncompleteRound(); $games = Game::where('round_id','=',$round_id)->get(); - - foreach ($games as $game) { $tipp = Tipp::where([['game_id','=',$game->id],['user_id','=',$user_id]])->first(); if ($tipp->score1 == -1 || $tipp->score2 == -1) { Log::info("!!! User ".$user_id." has a missing tipp for game_id ".$game->id.", round = ".$round_id); return 1; - } else { - if ($user_id==2) { - - } } } return 0; @@ -176,4 +170,5 @@ class User extends Authenticatable return true; } + } diff --git a/pfosten/public/css/album.css b/pfosten/public/css/album.css index f125d45b..1bfc46f6 100644 --- a/pfosten/public/css/album.css +++ b/pfosten/public/css/album.css @@ -55,4 +55,32 @@ footer { footer p { margin-bottom: .25rem; +} + + +.blink_text { + + animation:1s blinker linear infinite; + -webkit-animation:1s blinker linear infinite; + -moz-animation:1s blinker linear infinite; + + color: red; +} + +@-moz-keyframes blinker { + 0% { opacity: 1.0; } + 50% { opacity: 0.0; } + 100% { opacity: 1.0; } +} + +@-webkit-keyframes blinker { + 0% { opacity: 1.0; } + 50% { opacity: 0.0; } + 100% { opacity: 1.0; } +} + +@keyframes blinker { + 0% { opacity: 1.0; } + 50% { opacity: 0.0; } + 100% { opacity: 1.0; } } \ No newline at end of file diff --git a/pfosten/resources/views/auth/login.blade.php b/pfosten/resources/views/auth/login.blade.php new file mode 100644 index 00000000..07924ce6 --- /dev/null +++ b/pfosten/resources/views/auth/login.blade.php @@ -0,0 +1,69 @@ +@extends('layouts.app') + +@section('content') +
+
+
+
+
Login
+ +
+
+ {{ csrf_field() }} + +
+ + +
+ + + @if ($errors->has('email')) + + {{ $errors->first('email') }} + + @endif +
+
+ +
+ + +
+ + + @if ($errors->has('password')) + + {{ $errors->first('password') }} + + @endif +
+
+ +
+
+
+ +
+
+
+ +
+
+ + + + Forgot Your Password? + +
+
+
+
+
+
+
+
+@endsection diff --git a/pfosten/resources/views/auth/passwords/email.blade.php b/pfosten/resources/views/auth/passwords/email.blade.php new file mode 100644 index 00000000..fbcb241c --- /dev/null +++ b/pfosten/resources/views/auth/passwords/email.blade.php @@ -0,0 +1 @@ +Hallo Welt ! (email.blade.php) \ No newline at end of file diff --git a/pfosten/resources/views/auth/passwords/reset.blade.php b/pfosten/resources/views/auth/passwords/reset.blade.php new file mode 100644 index 00000000..84ec0101 --- /dev/null +++ b/pfosten/resources/views/auth/passwords/reset.blade.php @@ -0,0 +1,70 @@ +@extends('layouts.app') + +@section('content') +
+
+
+
+
Reset Password
+ +
+
+ {{ csrf_field() }} + + + +
+ + +
+ + + @if ($errors->has('email')) + + {{ $errors->first('email') }} + + @endif +
+
+ +
+ + +
+ + + @if ($errors->has('password')) + + {{ $errors->first('password') }} + + @endif +
+
+ +
+ +
+ + + @if ($errors->has('password_confirmation')) + + {{ $errors->first('password_confirmation') }} + + @endif +
+
+ +
+
+ +
+
+
+
+
+
+
+
+@endsection diff --git a/pfosten/resources/views/auth/register.blade.php b/pfosten/resources/views/auth/register.blade.php new file mode 100644 index 00000000..38eef838 --- /dev/null +++ b/pfosten/resources/views/auth/register.blade.php @@ -0,0 +1,77 @@ +@extends('layouts.app') + +@section('content') +
+
+
+
+
Register
+ +
+
+ {{ csrf_field() }} + +
+ + +
+ + + @if ($errors->has('name')) + + {{ $errors->first('name') }} + + @endif +
+
+ +
+ + +
+ + + @if ($errors->has('email')) + + {{ $errors->first('email') }} + + @endif +
+
+ +
+ + +
+ + + @if ($errors->has('password')) + + {{ $errors->first('password') }} + + @endif +
+
+ +
+ + +
+ +
+
+ +
+
+ +
+
+
+
+
+
+
+
+@endsection diff --git a/pfosten/resources/views/emails/password.blade.php b/pfosten/resources/views/emails/password.blade.php new file mode 100644 index 00000000..828a6714 --- /dev/null +++ b/pfosten/resources/views/emails/password.blade.php @@ -0,0 +1 @@ +Click here to reset your password: {{ url('password/reset/'.$token) }} \ No newline at end of file diff --git a/pfosten/resources/views/main.blade.php b/pfosten/resources/views/main.blade.php index 15e41724..365864d4 100644 --- a/pfosten/resources/views/main.blade.php +++ b/pfosten/resources/views/main.blade.php @@ -2,6 +2,13 @@ @section('content')
+ @if (strlen($message_text_tipps)>0) +
+ @endif + @if (strlen($message_text_joker)>0) +
+ @endif +

Hoschis Tippspiel

Eine Tippgemeinschaft unter Freunden.

diff --git a/pfosten/routes/web.php b/pfosten/routes/web.php index 94f71092..131f5704 100644 --- a/pfosten/routes/web.php +++ b/pfosten/routes/web.php @@ -53,4 +53,20 @@ Route::get('/email','UsersController@mailtest'); Route::get('/roundmails','RoundmailController@index'); Route::get('/roundmails/show/{mail_id}','RoundmailController@show'); -Route::post('/roundmails/send','RoundmailController@send'); \ No newline at end of file +Route::post('/roundmails/send','RoundmailController@send'); + + + +Route::get('/resetpassword','Auth\ResetPasswordController@showResetForm'); +Route::get('test','UsersController@test'); + +/* +Route::get('/reset','UsersController@reset')->name('password.email'); +Route::post('/reset','UsersController@processReset')->name('password.request'); +*/ + +Route::get('/password/reset','Auth\ForgotPasswordController@showLinkRequestForm')->name('password.request'); +Route::post('/password/email','Auth\ForgotPasswordController@sendResetLinkEmail')->name('password.email'); + +Route::get('/abc','Auth\ForgotPasswordController@abc'); +//Route::auth(); \ No newline at end of file