Fix up email sending and add more notifications to the panel.

Closes #265
This commit is contained in:
Dane Everitt 2017-02-17 19:23:27 -05:00
parent 95171a3e41
commit 008cccb098
No known key found for this signature in database
GPG key ID: EEA66103B3D71F53
23 changed files with 489 additions and 122 deletions

View file

@ -96,4 +96,51 @@
@section('footer-scripts')
@parent
{!! Theme::js('js/frontend/server.socket.js') !!}
<script>
$(document).ready(function () {
$('[data-action="delete"]').click(function (event) {
event.preventDefault();
var self = $(this);
swal({
type: 'warning',
title: 'Delete Subuser',
text: 'This will immediately remove this user from this server and revoke all permissions.',
showCancelButton: true,
showConfirmButton: true,
closeOnConfirm: false,
showLoaderOnConfirm: true
}, function () {
$.ajax({
method: 'DELETE',
url: Router.route('server.subusers.delete', {
server: Pterodactyl.server.uuidShort,
id: self.data('id'),
}),
headers: {
'X-CSRF-TOKEN': $('meta[name="_token"]').attr('content'),
}
}).done(function () {
self.parent().parent().slideUp();
swal({
type: 'success',
title: '',
text: 'Subuser was successfully deleted.'
});
}).fail(function (jqXHR) {
console.error(jqXHR);
var error = 'An error occured while trying to process this request.';
if (typeof jqXHR.responseJSON !== 'undefined' && typeof jqXHR.responseJSON.error !== 'undefined') {
error = jqXHR.responseJSON.error;
}
swal({
type: 'error',
title: 'Whoops!',
text: error
});
});
});
});
});
</script>
@endsection

View file

@ -1,28 +0,0 @@
{{-- Copyright (c) 2015 - 2017 Dane Everitt <dane@daneeveritt.com> --}}
{{-- 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. --}}
<html>
<head>
<title>Pterodactyl - You've been added to a Server</title>
</head>
<body>
<center><h1>Pterodactyl - Added to Server</h1></center>
<p>You are recieving this email because you have been added as a subuser for <a href="{{ $url }}">{{ $serverName }}</a> on Pterodactyl Panel.</p>
</body>
</html>

View file

@ -1,31 +0,0 @@
{{-- Copyright (c) 2015 - 2017 Dane Everitt <dane@daneeveritt.com> --}}
{{-- 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. --}}
<html>
<head>
<title>Pterodactyl - New Account</title>
</head>
<body>
<center><h1>Pterodactyl - Account Created</h1></center>
<p>You are recieving this email because an account has been created for you on Pterodactyl Panel.</p>
<p>Login: <a href="{{ $login }}">{{ $login }}</a></p>
<p>Email: {{ $email }}</p>
<p>Forgot your password? <a href="{{ $forgot }}">{{ $forgot }}</a></p>
</body>
</html>

View file

@ -1,32 +0,0 @@
{{-- Copyright (c) 2015 - 2017 Dane Everitt <dane@daneeveritt.com> --}}
{{-- 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. --}}
<html>
<head>
<title>Pterodactyl - Admin Reset Password</title>
</head>
<body>
<center><h1>Pterodactyl - Admin Reset Password</h1></center>
<p>Hello there! You are receiving this email because an admin has reset the password on your Pterodactyl account.</p>
<p><strong>Login:</strong> <a href="{{ config('app.url') }}/auth/login">{{ config('app.url') }}/auth/login</a><br>
<strong>Email:</strong> {{ $user->email }}<br>
<strong>Password:</strong> {{ $password }}</p>
<p>Thanks,<br>Pterodactyl</p>
</body>
</html>

View file

@ -19,4 +19,4 @@ if (! empty($outroLines)) {
}
echo 'Regards,', "\n";
echo Settings::get('company'), "\n";
echo Settings::get('company', 'Pterodactyl Panel'), "\n";

View file

@ -71,7 +71,7 @@ $style = [
<tr>
<td style="{{ $style['email-masthead'] }}">
<a style="{{ $fontFamily }} {{ $style['email-masthead_name'] }}" href="{{ url('/') }}" target="_blank">
{{ Settings::get('company') }}
{{ Settings::get('company', 'Pterodactyl Panel') }}
</a>
</td>
</tr>
@ -176,7 +176,7 @@ $style = [
<td style="{{ $fontFamily }} {{ $style['email-footer_cell'] }}">
<p style="{{ $style['paragraph-sub'] }}">
&copy; {{ date('Y') }}
<a style="{{ $style['anchor'] }}" href="{{ url('/') }}" target="_blank">{{ Settings::get('company') }}</a>.
<a style="{{ $style['anchor'] }}" href="{{ url('/') }}" target="_blank">{{ Settings::get('company', 'Pterodactyl Panel') }}</a>.
All rights reserved.
</p>
</td>