Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
183 commits
Select commit Hold shift + click to select a range
b39e971
Dose #1
dqwiki Sep 23, 2023
5f608cf
Push first view
dqwiki Sep 23, 2023
62b48f8
expand to include global
dqwiki Sep 23, 2023
b5cf991
+1 row
dqwiki Sep 23, 2023
cbb4e81
+1 chart
dqwiki Sep 23, 2023
3aa6651
fix chart
dqwiki Sep 23, 2023
e80b163
pull debug
dqwiki Sep 23, 2023
5515b1d
change to weeks
dqwiki Sep 23, 2023
eabff5b
I may have this right?
dqwiki Sep 23, 2023
681a9e2
go back to days, other fixes
dqwiki Sep 23, 2023
8d96b32
modify circumstances
dqwiki Sep 23, 2023
925167d
add global
dqwiki Sep 23, 2023
c3c4339
forgot to pull this
dqwiki Sep 23, 2023
ded4f2e
whoops
dqwiki Sep 23, 2023
91d2f29
+1 chart
dqwiki Sep 23, 2023
062b95f
was supposed to be a bar chart
dqwiki Sep 23, 2023
7932662
fix
dqwiki Sep 23, 2023
c71a1db
pull admins less than 10
dqwiki Sep 23, 2023
d9e054d
Tweaks
dqwiki Sep 23, 2023
87b8ae1
wrong way
dqwiki Sep 23, 2023
840a287
Increase count
dqwiki Sep 23, 2023
33443ba
+another
dqwiki Sep 23, 2023
f8f2bcd
fix instruction
dqwiki Sep 24, 2023
f426f2b
another parse attempt
dqwiki Sep 24, 2023
eca0d6f
another attempt
dqwiki Sep 24, 2023
c51994e
keeping it simple
dqwiki Sep 24, 2023
012deda
quotes?
dqwiki Sep 24, 2023
9ae866f
formatting means everything
dqwiki Sep 24, 2023
9486d82
duh
dqwiki Sep 24, 2023
95ea72a
simplify
dqwiki Sep 24, 2023
59585f0
bugfix
dqwiki Sep 24, 2023
4c1c8e7
wrong var
dqwiki Sep 24, 2023
6ba7c2e
Simplification
dqwiki Sep 24, 2023
a951e41
count
dqwiki Sep 24, 2023
db4adf9
keep for now
dqwiki Sep 24, 2023
e886926
fixes
dqwiki Sep 24, 2023
e4251c2
keyerror
dqwiki Sep 24, 2023
2f3efc6
nuke private data
dqwiki Sep 24, 2023
e608436
syntax
dqwiki Sep 24, 2023
44b5d44
split other
dqwiki Sep 24, 2023
ec36fbe
debug
dqwiki Sep 24, 2023
6386b5e
to text?
dqwiki Sep 24, 2023
a370512
debug
dqwiki Sep 24, 2023
bfdeed7
simplify
dqwiki Sep 24, 2023
5b42813
keys
dqwiki Sep 24, 2023
f3a21d7
double thinking
dqwiki Sep 24, 2023
84baaa2
stupid reverse logic
dqwiki Sep 24, 2023
bb3e788
test on bigger set
dqwiki Sep 24, 2023
8a9be96
another attempt
dqwiki Sep 24, 2023
1505fd4
fix?
dqwiki Sep 24, 2023
66817cb
ugh
dqwiki Sep 24, 2023
a5838b1
loop
dqwiki Sep 24, 2023
fd8f844
regex syntax
dqwiki Sep 24, 2023
f2cd29b
clear extraineos
dqwiki Sep 24, 2023
e116067
leave this
dqwiki Sep 24, 2023
578ebff
fix templates getting cut
dqwiki Sep 24, 2023
25e541f
more logic issues
dqwiki Sep 24, 2023
016dfff
cleanup
dqwiki Sep 24, 2023
06f923c
limits
dqwiki Sep 24, 2023
a606d60
pull debug
dqwiki Sep 24, 2023
56fcc43
clear for now
dqwiki Sep 24, 2023
1bfcfce
split into individual charts
dqwiki Sep 24, 2023
6b79df1
Error prompting and global fixes
dqwiki Sep 24, 2023
d3ad762
less strict on global
dqwiki Sep 24, 2023
5ab7059
group anything proxy related
dqwiki Sep 24, 2023
a9d9aaf
need to debug live
dqwiki Sep 24, 2023
88f7617
more debug
dqwiki Sep 24, 2023
359cf21
logic flow
dqwiki Sep 24, 2023
d1856b0
display debug
dqwiki Sep 24, 2023
ae24581
logic issue
dqwiki Sep 24, 2023
f7bc3f5
word
dqwiki Sep 24, 2023
4650d77
more generic
dqwiki Sep 24, 2023
20cdaa6
fixes
dqwiki Sep 24, 2023
541f8e8
limit calc
dqwiki Sep 24, 2023
998788f
pull debug and cleanup
dqwiki Sep 24, 2023
188cd78
+handling admins
dqwiki Sep 25, 2023
e6a7498
int to username
dqwiki Sep 25, 2023
2233be0
pull active opens
dqwiki Sep 25, 2023
51a41b6
fix
dqwiki Sep 25, 2023
58f50d2
Pull unhandled, harder to track
dqwiki Sep 25, 2023
abe7299
fix message
dqwiki Sep 25, 2023
6d80f72
Swap dependency
laravel-shift Oct 2, 2023
3224a4e
Convert `Form` facade
laravel-shift Oct 2, 2023
6bda3a5
preform all updates
dqwiki Oct 2, 2023
db18317
fixes
dqwiki Oct 2, 2023
427ba19
change tests
dqwiki Oct 2, 2023
0d8d03b
forgot to upgrade
dqwiki Oct 2, 2023
c841cf4
Migrate to `spatie/laravel-html` (#726)
dqwiki Oct 2, 2023
a862194
fix main table + other working features
dqwiki Oct 3, 2023
5123cc2
try a limit
dqwiki Oct 3, 2023
12aec01
Move users to it's own page
dqwiki Oct 3, 2023
a9577a5
Add proxy flag migration and update dependencies
dqwiki Dec 9, 2023
992f49a
further additions
dqwiki Jan 1, 2024
7ae95de
add additional mail support
dqwiki Jan 7, 2024
2a6a51e
further push
dqwiki Jan 10, 2024
4d59808
Merge branch 'master' into utrs3-dev
dqwiki Jan 10, 2024
5479811
add trait
dqwiki Jan 10, 2024
42a4da2
allow nullification
dqwiki Jan 10, 2024
8b47e01
pull two tests moved to python scripts
dqwiki Jan 10, 2024
6337012
major push
dqwiki Feb 10, 2024
999f655
Further mass push
dqwiki Feb 17, 2024
665592f
pass vairable correctly
dqwiki Feb 17, 2024
8d835c6
make use statement
dqwiki Feb 17, 2024
283851a
fix?
dqwiki Feb 17, 2024
1fa5ef3
correct to a function
dqwiki Feb 17, 2024
9c2e8f8
switch to the class
dqwiki Feb 17, 2024
f7c12e2
pull the results to avoid a belongsto causing error
dqwiki Feb 17, 2024
32b55df
conflicted points
dqwiki Feb 17, 2024
82354f6
Fix test
dqwiki Feb 17, 2024
cc6b944
array/string issue
dqwiki Feb 17, 2024
cda48a6
static
dqwiki Feb 17, 2024
0a9254c
revert
dqwiki Feb 17, 2024
8f74159
capital
dqwiki Feb 17, 2024
ba3a9ad
test to see inside view
dqwiki Feb 17, 2024
fe402ac
upgrade
dqwiki Feb 17, 2024
c5460fa
several fixes based on all wikis being null
dqwiki Feb 17, 2024
83e7b9e
update tests & interface
dqwiki Feb 18, 2024
c20fb5c
Permission fix
dqwiki Feb 18, 2024
6a28038
in reality, they should be able to see all wikis but not edit them
dqwiki Feb 18, 2024
e54a407
final fixes and unabstract
dqwiki Feb 18, 2024
8bbd9e9
upgrade XML
dqwiki Feb 18, 2024
e38b7c4
updates
dqwiki Feb 18, 2024
6976820
readd packages
dqwiki Feb 18, 2024
a5c3747
updated ccs/js
dqwiki Feb 18, 2024
2f11e98
more changes
dqwiki Feb 18, 2024
640df71
missing console 0
dqwiki Feb 18, 2024
062bdde
updates?
dqwiki Feb 18, 2024
e31176c
allow phpunit 10
dqwiki Feb 18, 2024
b5aaf71
don't allow 8 for now
dqwiki Feb 18, 2024
8c9413f
phpu10
dqwiki Feb 18, 2024
347bf00
push lock
dqwiki Feb 18, 2024
05fff9e
details
dqwiki Feb 18, 2024
06df827
last debug attempt tonight
dqwiki Feb 18, 2024
4dfaded
+
dqwiki Mar 3, 2024
674cb09
wrong thing
dqwiki Mar 3, 2024
488d64a
+1
dqwiki Mar 3, 2024
7bf3622
dusk diagnostics
dqwiki Mar 3, 2024
d86742a
have to create a log create entry to be able to see anything on the a…
dqwiki Mar 3, 2024
2edecf2
Change into lang statements - bancreateupdate
dqwiki Mar 3, 2024
618c985
Another round of test modifications
dqwiki Mar 3, 2024
5fd5ff8
Further test corrections
dqwiki Mar 3, 2024
cdb85a1
fix one live
dqwiki Mar 3, 2024
51775db
additional testing
dqwiki Mar 3, 2024
3bb1f23
attempt fix
dqwiki Mar 4, 2024
9a1a7ab
Few more attempts
dqwiki Mar 4, 2024
ae93aec
Fix the email not being requested and internal errors otherwise
dqwiki Mar 4, 2024
37d4ac7
more fixes
dqwiki Mar 4, 2024
d357348
Full update including pulling language files
dqwiki Mar 17, 2024
160ea9e
Further mass updates
dqwiki Mar 29, 2024
7acfe7f
update and dropdown fix
dqwiki Mar 29, 2024
d52e485
add reasons
dqwiki Mar 29, 2024
4c948d0
Add front end for email bans
dqwiki Mar 29, 2024
2ae8499
more email stuff & change actions
dqwiki Mar 30, 2024
83d3d42
isolate so not to error on everything
dqwiki Mar 30, 2024
2696e47
more required transfers
dqwiki Mar 30, 2024
140caec
course correct
dqwiki Mar 30, 2024
eaea523
Pull fillers
dqwiki Mar 30, 2024
afcff2a
convert and attempt w/ fixes
dqwiki Mar 30, 2024
aae003a
modify emailban linked appeals to die if none
dqwiki Mar 30, 2024
2e465c2
quick tests
dqwiki Mar 30, 2024
a823439
change button code
dqwiki Mar 30, 2024
7591814
functions not talking right
dqwiki Mar 30, 2024
a671589
more pushes
dqwiki Mar 30, 2024
a11ae20
more test fix
dqwiki Mar 30, 2024
7869177
one time check
dqwiki Mar 30, 2024
af735a9
forgot to change other thigns
dqwiki Mar 30, 2024
4c07a69
pull dusk testing - out of date and causing intercept issues left rig…
dqwiki Mar 30, 2024
2322530
further pushes
dqwiki Apr 14, 2024
a30d982
change security
dqwiki Apr 14, 2024
a7fb20a
live debug
dqwiki Apr 14, 2024
c9bad8e
more live testing
dqwiki Apr 14, 2024
cf8e676
it was right to start
dqwiki Apr 14, 2024
877d3c3
push from last coding
dqwiki Aug 4, 2024
e0da7bc
eb8ac4d & a4e4928
dqwiki Aug 4, 2024
e73253e
Merge branch 'master' into utrs3-dev
dqwiki Aug 4, 2024
9e2f57c
upgrade
dqwiki Aug 4, 2024
def477d
push latest
dqwiki Dec 27, 2024
756967b
push final run
dqwiki Feb 20, 2026
9746e26
Merge branch 'master' into utrs3-dev
dqwiki Feb 20, 2026
7514aae
forgot to disable translate link
dqwiki Feb 20, 2026
3a9c2d0
forgot comment section
dqwiki Feb 20, 2026
28aa860
spacing
dqwiki Feb 20, 2026
d6ffa68
fix missing colors
dqwiki Feb 20, 2026
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions .env.example
Original file line number Diff line number Diff line change
Expand Up @@ -63,3 +63,6 @@ DEVELOPER_USER_GRANT_ADMIN=""
DEVELOPER_USER_GRANT_TOOLADMIN=""
DEVELOPER_USER_GRANT_DEVELOPER=""

DEEPL_AUTH_KEY=""

PROHIBITED_EMAIL_DOMAINS=""
26 changes: 4 additions & 22 deletions .github/workflows/laravel-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,7 @@ jobs:
strategy:
matrix:
php-versions:
- 7.3 # current production
- 8.3 # target, https://github.com/UTRS2/utrs/issues/375
- 8.3
services:
mysql:
image: mariadb:10.5
Expand All @@ -28,7 +27,7 @@ jobs:
with:
extensions: zip, mbstring, dom, fileinfo, mysql
php-version: ${{ matrix.php-versions }}
- uses: actions/checkout@v1
- uses: actions/checkout@v4
- name: Copy env file
run: cp .env.ci .env
- name: Cache Composer dependencies
Expand Down Expand Up @@ -66,23 +65,6 @@ jobs:
- name: Build assets
run: npm run production
- name: Run tests
run: composer test
run: composer test --verbose
env:
DB_PORT: ${{ job.services.mysql.ports['3306'] }}
- name: Start chromedriver
run: chromedriver &
- name: Start Laravel Server
run: php artisan serve &
env:
DB_PORT: ${{ job.services.mysql.ports['3306'] }}
- name: Run Browser Tests
run: php artisan dusk
continue-on-error: true # Tests need to be fixed
env:
DB_PORT: ${{ job.services.mysql.ports['3306'] }}
- uses: actions/upload-artifact@v4
name: Save Dusk screenshots
if: failure()
with:
name: dusk-screenshots
path: tests/Browser/screenshots/*.png
DB_PORT: ${{ job.services.mysql.ports['3306'] }}
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -26,3 +26,6 @@ _ide_helper_models.php

resources/lang/vendor/*
!resources/lang/vendor/torblock
python/config.py
resources/lang/en/utrs.code-workspace
.phpunit.cache/test-results
Original file line number Diff line number Diff line change
Expand Up @@ -22,5 +22,6 @@ public function handle()
$this->line("Scheduling for $wiki");
UpdateWikiAppealListJob::dispatchNow($wiki);
}
return 0;
}
}
134 changes: 71 additions & 63 deletions app/Http/Controllers/Admin/BanController.php
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
use App\Models\Ban;
use App\Models\LogEntry;
use App\Models\User;
use App\Models\EmailBan;
use App\Http\Controllers\Controller;
use App\Http\Requests\Admin\Bans\CreateBanRequest;
use App\Http\Requests\Admin\Bans\UpdateBanRequest;
Expand All @@ -16,6 +17,7 @@
use Illuminate\Http\Request;
use Illuminate\Support\Facades\DB;
use Illuminate\Validation\ValidationException;
use Illuminate\Support\Facades\Auth;

class BanController extends Controller
{
Expand All @@ -41,75 +43,50 @@ public function index(Request $request)
return '';
}

$allbans = Ban::where(function (Builder $query) use ($wikis, $canSeeGlobal) {
return $query
->whereIn('wiki_id', $wikis)
->when($canSeeGlobal, function (Builder $query) {
return $query->orWhereNull('wiki_id');
});
})
->with('wiki')
->get();
$allbans = Ban::paginate(50);

/** @var User $user */
$user = $request->user();

$protectedBansVisible = false;

$tableheaders = [ 'ID', 'Target', 'Expires', 'Reason' ];
if ($wikis->count() > ($canSeeGlobal ? 0 : 1)) {
$tableheaders[] = 'Wiki';
$tableheaders = [
__('admin.bans.id'),
__('admin.bans.target'),
__('admin.bans.expires'),
__('admin.bans.reason'),
"Wiki"
];

$admin = $user->hasAnySpecifiedPermsOnAnyWiki(['steward', 'staff', 'developer']);

//dependent on if the user is a checkuser on any wiki, mark the $checkuser variable
$checkuser = false;
//for each wiki the user has permissions on, check if they have checkuser
foreach ($user->permissions as $permission) {
if ($permission->hasAnySpecifiedPerms(['checkuser']) || $user->hasAnySpecifiedPermsOnAnyWiki(['steward', 'staff', 'developer'])) {
$checkuser = true;
}
}

$rowcontents = [];

foreach ($allbans as $ban) {
$idbutton = '<a href="' . route('admin.bans.view', $ban) . '" class="btn ' . ($ban->is_protected ? 'btn-danger' : 'btn-primary') . '">' . $ban->id . '</a>';
$targetName = htmlspecialchars($ban->target);

if ($ban->is_protected) {
$canSee = $user->can('viewName', $ban);

if (!$protectedBansVisible && $canSee) {
$protectedBansVisible = true;
//if the user has tooladmin, steward, staff, or developer globally, then add all wikis to the allowed wikis array
$allowedwikis = [];
if ($admin) {
$allowedwikis = Wiki::get()->pluck('id')->toArray();
} else {
//otherwise, add the wikis that the user has permissions on to the allowed wikis array
foreach ($user->permissions as $permission) {
if ($permission->hasAnySpecifiedPerms(['tooladmin'])) {
$allowedwikis[] = Wiki::where('database_name',$permission->wiki)->first()->id;
$admin = true;
}

$targetName = $canSee ? '<i class="text-danger">' . $targetName . '</i>'
: '<i class="text-muted">(ban target removed)</i>';
}

$expiry = Carbon::createFromFormat('Y-m-d H:i:s', $ban->expiry);
$formattedExpiry = $expiry->year >= 2000 ? $ban->expiry : 'indefinite';

if (!$ban->is_active) {
$formattedExpiry .= ' <i class="text-muted">(unbanned)</i>';
}

if ($expiry->isPast() && $expiry->year >= 2000) {
$formattedExpiry .= ' <i class="text-danger">(expired)</i>';
}

$rowcontents[$ban->id] = [ $idbutton, $targetName, $formattedExpiry, htmlspecialchars($ban->reason) ];

if ($wikis->count() > 1) {
$wikiName = $ban->wiki ? $ban->wiki->display_name . ' (' . $ban->wiki->database_name . ')' : 'All UTRS wikis';
$rowcontents[$ban->id][] = $wikiName;
}
}

$caption = null;
if ($protectedBansVisible) {
$caption = "Any ban showing in red has been oversighted and should not be shared to others who do not have access to it.";
}
// define createlink as the route to create a new ban
$createlink = route('admin.bans.new');

return view('admin.tables', [
'title' => 'All Bans',
'tableheaders' => $tableheaders,
'rowcontents' => $rowcontents,
'caption' => $caption,
'createlink' => $user->can('create', Ban::class) ? route('admin.bans.new') : null,
'createtext' => 'Add ban',
]);
return view('admin.bans', ['title' => __('admin.bans.all'), 'tableheaders' => $tableheaders, 'bans' => $allbans, 'allowed' => $allowedwikis, 'admin' => $admin, 'checkuser' => $checkuser, 'createlink' => $createlink]);
}

public function new(Request $request)
Expand Down Expand Up @@ -162,23 +139,23 @@ public function create(CreateBanRequest $request)

public function show(Request $request, Ban $ban)
{
$this->authorize('view', $ban);
$this->authorize('view', [Auth::user(),$ban]);

$target = $request->user()->can('viewName', $ban) ? $ban->target : '(ban target removed)';
$target = $request->user()->can('viewName', $ban) ? $ban->target : __('admin.bans.ban-target-removed');
$targetHtml = $request->user()->can('viewName', $ban)
? ($ban->is_protected ? '<span class="text-danger">' : '') . htmlspecialchars($ban->target) . ($ban->is_protected ? '</span>' : '')
: '<i class="text-muted">(ban target removed)</i>';
: '<i class="text-muted">'.__('admin.bans.ban-target-removed').'</i>';

$expiry = Carbon::createFromFormat('Y-m-d H:i:s', $ban->expiry);
$formattedExpiry = $expiry->year >= 2000 ? $ban->expiry : 'indefinite';
$formOldExpiry = $expiry->year >= 2000 ? $ban->expiry : 'indefinite';
$formattedExpiry = $expiry->year >= 2000 ? $ban->expiry : __('admin.bans.indefinite');
$formOldExpiry = $expiry->year >= 2000 ? $ban->expiry : __('admin.bans.indefinite');

if (!$ban->is_active) {
$formattedExpiry .= ' <i class="text-muted">(unbanned)</i>';
$formattedExpiry .= ' <i class="text-muted">'.__('admin.bans.unbanned').'</i>';
}

if ($expiry->isPast() && $expiry->year >= 2000) {
$formattedExpiry .= ' <i class="text-muted">(expired)</i>';
$formattedExpiry .= ' <i class="text-muted">'.__('admin.bans.expired').'</i>';
}

$wikis = $this->constructWikiDropdown($request->user());
Expand Down Expand Up @@ -264,4 +241,35 @@ private function constructWikiDropdown(User $user): array

return $wikis;
}

public function banEmail(string $code)
{
return view('admin.bans.emailban', [
'code' => $code,
]);
}

public function banEmailSubmit(Request $request)
{
//validate that
$this->validate($request, [
'uid' => 'required|string',
]);

//find the email and set the ban
$email = EmailBan::where('email', $address)->firstOrFail();
//set the appealban to match the value from the request
$email->appealbanned = $request->input('appealbanned', false);
//set the accountban to match the value from the request
$email->accountbanned = $request->input('accountbanned', false);


$ban->addLog(
new RequestLogContext($request),
'email ban modified',
'Appeal: '.$request->input('appealbanned', false) . ' Account: ' . $request->input('accountbanned', false)
);

return redirect()->route('admin.bans.view', [ 'ban' => $ban ]);
}
}
100 changes: 100 additions & 0 deletions app/Http/Controllers/Admin/EmailBanController.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,100 @@
<?php

namespace App\Http\Controllers\Admin;

use App\Models\LogEntry;
use App\Models\User;
use App\Models\EmailBan;
use App\Http\Controllers\Controller;
use App\Http\Requests\Admin\Bans\CreateBanRequest;
use App\Http\Requests\Admin\Bans\UpdateBanRequest;
use App\Policies\Admin\BanPolicy;
use Illuminate\Support\Facades\Auth;
use Illuminate\Http\Request;

class EmailBanController extends Controller
{
public function __construct()
{
$this->middleware('auth');
}

public function index()
{
$banlist = EmailBan::paginate(50);

return view('admin.emailbans', [
'emailBans' => $banlist,
]);

}

public function appeal(Request $request, $id) {
$reason = $request->input('reason');
// if reason is blank or less than 5 characters, return to the form with an error
if (strlen($reason) < 5) {
return redirect()->back()->with('error', 'Reason must be at least 5 characters');
}
$user = Auth::user();
$ban = EmailBan::findOrFail($id);
//check the status of appeal ban, and then reverse it and log it
if ($ban->appealbanned == 0) {
$ban->appealbanned = 1;
$ban->save();
$ban->logEmailBan($user, $ban, ' has been prohibited from appealing', $reason);
// return to the email ban list with a success message
return redirect()->route('admin.emailban.list')->with('success', 'Email Ban Appeal Status Updated');
} else {
$ban->appealbanned = 0;
$ban->save();
$ban->logEmailBan($user, $ban, ' has been allowed to appeal again', $reason);
// return to the email ban list with a success message
return redirect()->route('admin.emailban.list')->with('success', 'Email Ban Appeal Status Updated');
}
}

public function account(Request $request, $id) {
$reason = $request->input('reason');
// if reason is blank or less than 5 characters, return to the form with an error
if (strlen($reason) < 5) {
return redirect()->back()->with('error', 'Reason must be at least 5 characters');
}
$ban = EmailBan::findOrFail($id);
$user = Auth::user();
//check the status of emailban account field, and then reverse it and log it
if ($ban->accountbanned == 0) {
$ban->accountbanned = 1;
$ban->save();
$ban->logEmailBan($user, $ban, ' has been prohibited from adding this email to an account', $reason);
// return to the email ban list with a success message
return redirect()->route('admin.emailban.list')->with('success', 'Email Ban Account Status Updated');
} else {
$ban->accountbanned = 0;
$ban->save();
$ban->logEmailBan($user, $ban, ' has been allowed to add this email to an account again', $reason);
// return to the email ban list with a success message
return redirect()->route('admin.emailban.list')->with('success', 'Email Ban Account Status Updated');
}
}

public function appealreason($ban) {
$type = 'appeal';
$ban = EmailBan::findOrFail($ban);

return view('admin.emailbanreason', [
'emailBan' => $ban,
'type' => $type,

]);
}

public function accountreason($ban) {
$type = 'account';
$ban = EmailBan::findOrFail($ban);

return view('admin.emailbanreason', [
'emailBan' => $ban,
'type' => $type,
]);
}
}
27 changes: 27 additions & 0 deletions app/Http/Controllers/Admin/LogListController.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
<?php

namespace App\Http\Controllers\Admin;

use Illuminate\Http\Request;
use App\Http\Controllers\Controller;
use App\Models\LogEntry;
use App\Models\User;
use Illuminate\Support\Facades\Auth;

class LogListController extends Controller
{
public function index() {
// check if the user is a developer, if not, throw a 403
$user = Auth::user();
$isDeveloper = $user->hasAnySpecifiedLocalOrGlobalPerms([], 'developer');
if (!$isDeveloper) {
return abort(403);
}
$logs = LogEntry::orderBy('id','desc')->paginate(100);

return view('admin.logs', [
'logs' => $logs,
'users' => \App\Models\User::all(),
]);
}
}
Loading
Loading