2016-09-03 21:09:00 +00:00
|
|
|
<?php
|
2017-03-30 21:44:20 +00:00
|
|
|
/**
|
|
|
|
* Pterodactyl - Panel
|
2017-04-01 00:48:35 +00:00
|
|
|
* Copyright (c) 2015 - 2017 Dane Everitt <dane@daneeveritt.com>.
|
2017-03-30 21:44:20 +00:00
|
|
|
*
|
|
|
|
* Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
|
|
* of this software and associated documentation files (the "Software"), to deal
|
|
|
|
* in the Software without restriction, including without limitation the rights
|
|
|
|
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
|
|
* copies of the Software, and to permit persons to whom the Software is
|
|
|
|
* furnished to do so, subject to the following conditions:
|
|
|
|
*
|
|
|
|
* The above copyright notice and this permission notice shall be included in all
|
|
|
|
* copies or substantial portions of the Software.
|
|
|
|
*
|
|
|
|
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
|
|
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
|
|
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
|
|
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
|
|
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
|
|
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
|
|
* SOFTWARE.
|
|
|
|
*/
|
2016-09-03 21:09:00 +00:00
|
|
|
|
|
|
|
namespace Pterodactyl\Http\Controllers\Auth;
|
|
|
|
|
2017-03-30 21:44:20 +00:00
|
|
|
use Illuminate\Http\Request;
|
|
|
|
use Illuminate\Support\Facades\Password;
|
2016-09-03 21:09:00 +00:00
|
|
|
use Pterodactyl\Http\Controllers\Controller;
|
2017-03-30 21:44:20 +00:00
|
|
|
use Pterodactyl\Events\Auth\FailedPasswordReset;
|
2016-09-03 21:09:00 +00:00
|
|
|
use Illuminate\Foundation\Auth\SendsPasswordResetEmails;
|
|
|
|
|
|
|
|
class ForgotPasswordController extends Controller
|
|
|
|
{
|
|
|
|
/*
|
|
|
|
|--------------------------------------------------------------------------
|
|
|
|
| Password Reset Controller
|
|
|
|
|--------------------------------------------------------------------------
|
|
|
|
|
|
|
|
|
| This controller is responsible for handling password reset emails and
|
|
|
|
| includes a trait which assists in sending these notifications from
|
|
|
|
| your application to your users. Feel free to explore this trait.
|
|
|
|
|
|
|
|
|
*/
|
|
|
|
|
|
|
|
use SendsPasswordResetEmails;
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Create a new controller instance.
|
|
|
|
*
|
|
|
|
* @return void
|
|
|
|
*/
|
|
|
|
public function __construct()
|
|
|
|
{
|
|
|
|
$this->middleware('guest');
|
|
|
|
}
|
2017-03-30 21:44:20 +00:00
|
|
|
|
|
|
|
/**
|
|
|
|
* Get the response for a failed password reset link.
|
|
|
|
*
|
|
|
|
* @param \Illuminate\Http\Request
|
|
|
|
* @param string $response
|
|
|
|
* @return \Illuminate\Http\RedirectResponse
|
|
|
|
*/
|
|
|
|
protected function sendResetLinkFailedResponse(Request $request, $response)
|
|
|
|
{
|
|
|
|
// As noted in #358 we will return success even if it failed
|
|
|
|
// to avoid pointing out that an account does or does not
|
|
|
|
// exist on the system.
|
|
|
|
event(new FailedPasswordReset($request->ip(), $request->only('email')));
|
|
|
|
|
|
|
|
return $this->sendResetLinkResponse(Password::RESET_LINK_SENT);
|
|
|
|
}
|
2016-09-03 21:09:00 +00:00
|
|
|
}
|