Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
6 changes: 1 addition & 5 deletions .env.example
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ APP_URL=http://localhost:5002
LOGIN_URL=http://localhost:5002

# ---------------------------------------------------------------------------
# Primary database (MySQL). The app ALSO defines `forum`, `email`, and `moodle`
# Primary database (MySQL). The app ALSO defines `email` and `moodle`
# connections (see config/database.php). They default to the values below if
# their DB_<NAME>_* vars are unset; override them only if those systems exist.
# ---------------------------------------------------------------------------
Expand All @@ -30,10 +30,6 @@ DB_USERNAME=vatusa
DB_PASSWORD=secret

# Auxiliary connections (optional — leave commented unless you have them)
# DB_FORUM_HOST=127.0.0.1
# DB_FORUM_DATABASE=forum
# DB_FORUM_USERNAME=forum
# DB_FORUM_PASSWORD=
# DB_EMAIL_HOST=127.0.0.1
# DB_EMAIL_DATABASE=email
# DB_MOODLE_HOST=127.0.0.1
Expand Down
10 changes: 0 additions & 10 deletions app/ForumCalendar.php

This file was deleted.

9 changes: 0 additions & 9 deletions app/ForumMessages.php

This file was deleted.

217 changes: 0 additions & 217 deletions app/Helpers/SMFHelper.php

This file was deleted.

25 changes: 4 additions & 21 deletions app/Http/Controllers/API/v2/PublicController.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,7 @@

namespace App\Http\Controllers\API\v2;

use App\ForumCalendar;
use App\ForumMessages;
use Cache;
use Carbon\Carbon;
use Illuminate\Http\Request;

class PublicController extends APIController
Expand All @@ -16,7 +13,7 @@ class PublicController extends APIController
* @OA\Get(
* path="/public/events/(limit)",
* summary="Get events.",
* description="Get events (from Forums) set with a specific limit",
* description="Get events set with a specific limit",
* tags={"public"},
* @OA\Parameter(name="limit", in="path", @OA\Schema(type="integer"), description="Limit"),
* @OA\Response(
Expand All @@ -37,21 +34,15 @@ class PublicController extends APIController

public function getEvents(Request $request, $limit = 100)
{
$data = ForumCalendar::limit($limit)
->where('start_date', '>=', Carbon::now()->subHours(24))
->orderBy('start_date')
->get()
->toArray();

return response()->api($data);
return response()->api([]);
}

/**
*
* @OA\Get(
* path="/public/news/(limits)",
* summary="Get news.",
* description="Get news (from Forums) set with a specific limit",
* description="Get news set with a specific limit",
* tags={"public"},
* @OA\Parameter(name="limit", in="path", @OA\Schema(type="integer"), description="Limit"),
* @OA\Response(
Expand All @@ -71,15 +62,7 @@ public function getEvents(Request $request, $limit = 100)
*/
public function getNews(Request $request, $limit = 100)
{
$data = ForumMessages::where('smf_messages.id_board', 47)
->join("smf_topics", "id_msg", "id_first_msg")
->orderByDesc('id_msg')
->limit($limit)
->get()
->makeHidden(['poster_email', 'poster_ip'])
->toArray();

return response()->api($data);
return response()->api([]);
}

/**
Expand Down
33 changes: 0 additions & 33 deletions app/User.php
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@
use App\Helpers\EmailHelper;
use App\Helpers\RatingHelper;
use App\Helpers\RoleHelper;
use App\Helpers\SMFHelper;
use App\Helpers\VATSIMApi2Helper;
use App\Models\ControllerEligibilityCache;
use Illuminate\Auth\Authenticatable;
Expand Down Expand Up @@ -176,16 +175,6 @@ public function lastActivityWebsite()
return $this->lastactivity->diffInDays(null);
}

/**
* @return string
*/
public function lastActivityForum()
{
$f = \DB::connection('forum')->table("smf_members")->where("member_name", $this->cid)->first();

return ($f) ? Carbon::createFromTimestamp($f->last_login)->diffInDays(null) : "Unknown";
}

public function hasEmailAccess($email)
{
$eparts = explode("@", $email);
Expand Down Expand Up @@ -366,11 +355,6 @@ public function removeFromFacility($by = "Automated", $msg = "None provided", $n
Cache::forget("roster-$old_facility-home");
Cache::forget("roster-$old_facility-both");

if ($this->rating >= RatingHelper::shortToInt("I1")) {
SMFHelper::createPost(7262, 82,
"User Removal: " . $this->fullname() . " (" . RatingHelper::intToShort($this->rating) . ") from " . $old_facility,
"User " . $this->fullname() . " (" . $this->cid . "/" . RatingHelper::intToShort($this->rating) . ") was removed from $old_facility and holds a higher rating. Please check for demotion requirements. [url=https://www.vatusa.net/mgt/controller/" . $this->cid . "]Member Management[/url]");
}
}

public function addToFacility($facility)
Expand All @@ -383,37 +367,20 @@ public function addToFacility($facility)
$this->facility_join = Carbon::now();
$this->save();

if ($this->rating >= RatingHelper::shortToInt("I1") && $this->rating < RatingHelper::shortToInt("SUP")) {
SMFHelper::createPost(7262, 82,
"User Addition: " . $this->fullname() . " (" . RatingHelper::intToShort($this->rating) . ") to " . $this->facility,
"User " . $this->fullname() . " (" . $this->cid . "/" . RatingHelper::intToShort($this->rating) . ") was added to " . $this->facility . " and holds a higher rating.\n\nPlease check for demotion requirements.\n\n[url=https://www.vatusa.net/mgt/controller/" . $this->cid . "]Member Management[/url]");
}

$fc = 0;

if ($oldfac->id != "ZZN" && $oldfac->id != "ZAE") {
if (RoleHelper::has($this, $oldfac->id, "ATM") || RoleHelper::has($this, $oldfac->id, "DATM")) {
EmailHelper::sendEmail(["vatusa2@vatusa.net"], "ATM or DATM discrepancy",
"emails.transfers.atm", ["user" => $this, "oldfac" => $oldfac]);
$fc = 1;
} elseif (RoleHelper::has($this, $oldfac->id, "TA")) {
EmailHelper::sendEmail(["vatusa3@vatusa.net"], "TA discrepancy", "emails.transfers.ta",
["user" => $this, "oldfac" => $oldfac]);
$fc = 1;
} elseif (RoleHelper::has($this, $oldfac->id, "EC") || RoleHelper::has($this, $oldfac->id,
"FE") || RoleHelper::has($this, $oldfac->id, "WM")) {
EmailHelper::sendEmail([$oldfac->id . "-atm@vatusa.net", $oldfac->id . "-datm@vatusa.net"],
"Staff discrepancy", "emails.transfers.otherstaff", ["user" => $this, "oldfac" => $oldfac]);
$fc = 1;
}
}

if ($fc) {
SMFHelper::createPost(7262, 82,
"Staff discrepancy on transfer: " . $this->fullname() . " (" . RatingHelper::intToShort($this->rating),
"User " . $this->fullname() . " (" . $this->cid . "/" . RatingHelper::intToShort($this->rating) . ") was added to facility " . $this->facility . " but holds a staff position at " . $oldfac->id . ".\n\nPlease check for accuracy.\n\n[url=https://www.vatusa.net/mgt/controller/" . $this->cid . "]Member Management[/url] [url=https://www.vatusa.net/mgt/facility/" . $oldfac->id . "]Facility Management for Old Facility[/url] [url=https://www.vatusa.net/mgt/facility/" . $this->facility . "]Facility Management for New Facility[/url]");
}

if ($facility->active) {
$welcome = $facility->welcome_text;
$fac = $facility->id;
Expand Down
Loading
Loading