|
1
|
|
|
<?php |
|
2
|
|
|
/** |
|
3
|
|
|
* Pterodactyl - Panel |
|
4
|
|
|
* Copyright (c) 2015 - 2017 Dane Everitt <[email protected]> |
|
5
|
|
|
* |
|
6
|
|
|
* Permission is hereby granted, free of charge, to any person obtaining a copy |
|
7
|
|
|
* of this software and associated documentation files (the "Software"), to deal |
|
8
|
|
|
* in the Software without restriction, including without limitation the rights |
|
9
|
|
|
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell |
|
10
|
|
|
* copies of the Software, and to permit persons to whom the Software is |
|
11
|
|
|
* furnished to do so, subject to the following conditions: |
|
12
|
|
|
* |
|
13
|
|
|
* The above copyright notice and this permission notice shall be included in all |
|
14
|
|
|
* copies or substantial portions of the Software. |
|
15
|
|
|
* |
|
16
|
|
|
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR |
|
17
|
|
|
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, |
|
18
|
|
|
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE |
|
19
|
|
|
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER |
|
20
|
|
|
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, |
|
21
|
|
|
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE |
|
22
|
|
|
* SOFTWARE. |
|
23
|
|
|
*/ |
|
24
|
|
|
|
|
25
|
|
|
namespace Pterodactyl\Http\Controllers\Auth; |
|
26
|
|
|
|
|
27
|
|
|
use Illuminate\Http\Request; |
|
28
|
|
|
use Illuminate\Support\Facades\Password; |
|
29
|
|
|
use Pterodactyl\Http\Controllers\Controller; |
|
30
|
|
|
use Pterodactyl\Events\Auth\FailedPasswordReset; |
|
31
|
|
|
use Illuminate\Foundation\Auth\SendsPasswordResetEmails; |
|
32
|
|
|
|
|
33
|
|
|
class ForgotPasswordController extends Controller |
|
34
|
|
|
{ |
|
35
|
|
|
/* |
|
36
|
|
|
|-------------------------------------------------------------------------- |
|
37
|
|
|
| Password Reset Controller |
|
38
|
|
|
|-------------------------------------------------------------------------- |
|
39
|
|
|
| |
|
40
|
|
|
| This controller is responsible for handling password reset emails and |
|
41
|
|
|
| includes a trait which assists in sending these notifications from |
|
42
|
|
|
| your application to your users. Feel free to explore this trait. |
|
43
|
|
|
| |
|
44
|
|
|
*/ |
|
45
|
|
|
|
|
46
|
|
|
use SendsPasswordResetEmails; |
|
47
|
|
|
|
|
48
|
|
|
/** |
|
49
|
|
|
* Create a new controller instance. |
|
50
|
|
|
* |
|
51
|
|
|
* @return void |
|
|
|
|
|
|
52
|
|
|
*/ |
|
53
|
|
|
public function __construct() |
|
54
|
|
|
{ |
|
55
|
|
|
$this->middleware('guest'); |
|
56
|
|
|
} |
|
57
|
|
|
|
|
58
|
|
|
/** |
|
59
|
|
|
* Get the response for a failed password reset link. |
|
60
|
|
|
* |
|
61
|
|
|
* @param \Illuminate\Http\Request |
|
62
|
|
|
* @param string $response |
|
63
|
|
|
* @return \Illuminate\Http\RedirectResponse |
|
64
|
|
|
*/ |
|
65
|
|
|
protected function sendResetLinkFailedResponse(Request $request, $response) |
|
|
|
|
|
|
66
|
|
|
{ |
|
67
|
|
|
// As noted in #358 we will return success even if it failed |
|
68
|
|
|
// to avoid pointing out that an account does or does not |
|
69
|
|
|
// exist on the system. |
|
70
|
|
|
event(new FailedPasswordReset($request->ip(), $request->only('email'))); |
|
|
|
|
|
|
71
|
|
|
|
|
72
|
|
|
return $this->sendResetLinkResponse(Password::RESET_LINK_SENT); |
|
73
|
|
|
} |
|
74
|
|
|
} |
|
75
|
|
|
|
Adding a
@returnannotation to a constructor is not recommended, since a constructor does not have a meaningful return value.Please refer to the PHP core documentation on constructors.