diff --git a/.env.example b/.env.example index 3bf3d26b..e5f3a79c 100644 --- a/.env.example +++ b/.env.example @@ -1,4 +1,7 @@ DB_HOST=localhost DB_USER=root DB_PASS= -DB_NAME=intrarp \ No newline at end of file +DB_NAME=intrarp + +DISCORD_CLIENT_ID= +DISCORD_CLIENT_SECRET= \ No newline at end of file diff --git a/README.md b/README.md index 30a3b58b..a7cf7299 100644 --- a/README.md +++ b/README.md @@ -1,5 +1,7 @@ ![intraRP Logo](/.github/intrarp_banner.png) +![GitHub Release](https://img.shields.io/github/v/release/intraRP/intraRP) [![PHP Composer](https://github.com/intraRP/intraRP/actions/workflows/php.yml/badge.svg)](https://github.com/intraRP/intraRP/actions/workflows/php.yml) ![GitHub Downloads (all assets, all releases)](https://img.shields.io/github/downloads/intraRP/intraRP/total) ![GitHub commit activity](https://img.shields.io/github/commit-activity/m/intraRP/intraRP) + # intraRP - Roleplay Intranet für fiktive Fraktionen Das Ziel von **intraRP** ist es eine Allround-Lösung für die Fraktionsverwaltung fiktiver Feuerwehren & Rettungsdienste vor allem für FiveM und andere ähnliche Settings anzubieten. Das System ist grundsätzlich zur Verwaltung eines deutschen Systems ausgelegt, kann aber mit eigenen Veränderungen durchaus auch an ein amerikanisches oder anderes Setting angepasst werden. Es handelt sich hierbei um eine Weiterentwicklung bzw. den Nachfolger von [intra.stettbeck.de](https://github.com/itshypax/intra.stettbeck.de). Das System befindet sich in aktuell in Entwicklung und wird stetig verändert. @@ -10,6 +12,8 @@ Das Projekt wird hobbymäßig weiterentwickelt und ist für jegliche Unterstütz ### Wiki & Informationen +- [Setup - Discord-Applikation erstellen](https://github.com/intraRP/intraRP/wiki/Setup-%E2%80%90-Discord%E2%80%90Applikation-erstellen) + - [Discord-Applikation erstellen & konfigurieren](https://github.com/intraRP/intraRP/wiki/Setup-%E2%80%90-Discord%E2%80%90Applikation-erstellen#discord-applikation-erstellen--konfigurieren) - [Setup ‐ intraRP aufsetzen & einrichten](https://github.com/itshypax/intraRP/wiki/Setup-%E2%80%90-intraRP-aufsetzen-&-einrichten) - [Was wird benötigt?](https://github.com/itshypax/intraRP/wiki/Setup-%E2%80%90-intraRP-aufsetzen-&-einrichten#was-wird-ben%C3%B6tigt) - [intraRP aufsetzen](https://github.com/itshypax/intraRP/wiki/Setup-%E2%80%90-intraRP-aufsetzen-&-einrichten#intrarp-aufsetzen) diff --git a/admin/edivi/list.php b/admin/edivi/list.php index c140b8c2..d052c4ca 100644 --- a/admin/edivi/list.php +++ b/admin/edivi/list.php @@ -113,7 +113,7 @@ $freigabe_status = ""; break; case 1: - $freigabe_status = "F"; + $freigabe_status = "F"; break; } diff --git a/admin/index.php b/admin/index.php index 14e60311..d8d093d4 100644 --- a/admin/index.php +++ b/admin/index.php @@ -11,6 +11,10 @@ use App\Helpers\Flash; +if (!isset($_SESSION['cirs_user']) || empty($_SESSION['cirs_user'])) { + header("Location: /admin/users/editprofile.php"); +} + ?> @@ -57,7 +61,7 @@
-
+

Dashboard

+
+
+

Eigene Dokumente

+ +
+
+
+
+

Eigene Anträge

+ +
+
+
+
+

Eigene eDIVI-Protokolle

+ +
+
- - - - - - - - - - - - - - - " /> - - - - - -
- - - -
-
-
-
-

Benutzer anlegen

-
-
- -
-
- - -
-
- - -
-
- -
- - - -
-
-
-
-
- - -
-
- - -
-
-
-
-
- -
-
-
-
-
-
-
- - - - - - - \ No newline at end of file diff --git a/admin/users/edit.php b/admin/users/edit.php index 91659efc..4623f23b 100644 --- a/admin/users/edit.php +++ b/admin/users/edit.php @@ -115,7 +115,7 @@

-

Benutzer bearbeiten

+

Benutzer bearbeiten

@@ -223,38 +223,20 @@
- - - - -
- - -
-
-
-
- - -
-
- - -
+ +
+ + +
+
diff --git a/admin/users/generatenewpass.php b/admin/users/generatenewpass.php deleted file mode 100644 index f942f6b8..00000000 --- a/admin/users/generatenewpass.php +++ /dev/null @@ -1,43 +0,0 @@ -prepare("SELECT username FROM intra_users WHERE id = :id"); -$stmt->bindParam(':id', $id); -$stmt->execute(); -$user = $stmt->fetch(); - -// Passwort aktualisieren -$stmt = $pdo->prepare("UPDATE intra_users SET passwort = :passwort WHERE id = :id"); -$stmt->bindParam(':passwort', $hashedPassword); -$stmt->bindParam(':id', $id); -$stmt->execute(); - -Flash::set('user', 'new-password', ['username' => $user['username'], 'pass' => $newPassword]); -$auditLogger = new AuditLogger($pdo); -$auditLogger->log($userid, 'Neues Passwort generiert [ID: ' . $id . ']', null, 'Benutzer', 1); -header("Location: /admin/users/list.php"); -exit; diff --git a/antraege/befoerderung.php b/antraege/befoerderung.php index cf16abca..91217e99 100644 --- a/antraege/befoerderung.php +++ b/antraege/befoerderung.php @@ -4,6 +4,16 @@ require_once $_SERVER['DOCUMENT_ROOT'] . '/assets/config/config.php'; require_once $_SERVER['DOCUMENT_ROOT'] . '/vendor/autoload.php'; require $_SERVER['DOCUMENT_ROOT'] . "/assets/config/database.php"; +if (!isset($_SESSION['userid']) || !isset($_SESSION['permissions'])) { + $_SESSION['redirect_url'] = $_SERVER['REQUEST_URI']; + + header("Location: /admin/login.php"); + exit(); +} + +if (!isset($_SESSION['cirs_user']) || empty($_SESSION['cirs_user'])) { + header("Location: /admin/users/editprofile.php"); +} if (isset($_POST['new']) && $_POST['new'] == 1) { $name_dn = $_REQUEST['name_dn']; @@ -17,13 +27,14 @@ $count = $stmt->fetchColumn(); } while ($count > 0); - $stmt = $pdo->prepare("INSERT INTO intra_antrag_bef (`name_dn`, `dienstgrad`, `freitext`, `uniqueid`) VALUES (:name_dn, :dienstgrad, :freitext, :uniqueid)"); + $stmt = $pdo->prepare("INSERT INTO intra_antrag_bef (`name_dn`, `dienstgrad`, `freitext`, `uniqueid`, `discordid`) VALUES (:name_dn, :dienstgrad, :freitext, :uniqueid, :discordtag)"); $stmt->execute([ ':name_dn' => $name_dn, ':dienstgrad' => $dienstgrad, ':freitext' => $freitext, - ':uniqueid' => $random_number + ':uniqueid' => $random_number, + ':discordtag' => $_SESSION['discordtag'] ]); header('Location: view.php?antrag=' . $random_number . ''); diff --git a/antraege/view.php b/antraege/view.php index 4a8d1397..f4e10ef2 100644 --- a/antraege/view.php +++ b/antraege/view.php @@ -76,23 +76,23 @@
-

Antrag ansehen

+

Antrag ansehen


diff --git a/assets/components/footer.php b/assets/components/footer.php index ead39e61..30c5ebbc 100644 --- a/assets/components/footer.php +++ b/assets/components/footer.php @@ -10,7 +10,8 @@

© intraRP | Alle Rechte vorbehalten

-

Version

+
Version
+

Fehler melden

diff --git a/assets/components/index/applications.php b/assets/components/index/applications.php new file mode 100644 index 00000000..a506ed23 --- /dev/null +++ b/assets/components/index/applications.php @@ -0,0 +1,61 @@ + + + + + + + + + + prepare($query); + $stmt->execute(['discordtag' => $_SESSION['discordtag']]); + $appresult = $stmt->fetchAll(PDO::FETCH_ASSOC); + + if (empty($appresult)) { + echo ""; + } else { + foreach ($appresult as $row) { + $adddat = date("d.m.Y | H:i", strtotime($row['time_added'])); + $cirs_state = "Unbekannt"; + $bgColor = ""; + switch ($row['cirs_status']) { + case 0: + $cirs_state = "In Bearbeitung"; + $badge_color = "text-bg-info"; + break; + case 1: + $cirs_state = "Abgelehnt"; + $badge_color = "text-bg-danger"; + $badge_text = "Abgelehnt"; + break; + case 2: + $cirs_state = "Aufgeschoben"; + $badge_color = "text-bg-warning"; + break; + case 3: + $cirs_state = "Angenommen"; + $badge_color = "text-bg-success"; + break; + default: + $cirs_state = "Unbekannt"; + $badge_color = "text-bg-dark"; + break; + } + + + + echo " + + + + + + "; + } + } + ?> + +
Status#BearbeiterAm
Es sind keine Anträge hinterlegt.
" . $cirs_state . "{$row['uniqueid']}" . (!empty($row['cirs_manager']) ? htmlspecialchars($row['cirs_manager']) : '---') . "{$row['time_added']}{$adddat}Ansehen
\ No newline at end of file diff --git a/assets/components/index/documents.php b/assets/components/index/documents.php new file mode 100644 index 00000000..492a6d54 --- /dev/null +++ b/assets/components/index/documents.php @@ -0,0 +1,60 @@ + + + + + + + + + + prepare($query); + $stmt->execute(['discordtag' => $_SESSION['discordtag']]); + $dokuresult = $stmt->fetchAll(PDO::FETCH_ASSOC); + + $arten = [ + 0 => "Ernennungsurkunde", + 1 => "Beförderungsurkunde", + 2 => "Entlassungsurkunde", + 3 => "Ausbildungsvertrag", + 5 => "Ausbildungszertifikat", + 6 => "Lehrgangszertifikat", + 7 => "Lehrgangszertifikat (Fachdienste)", + 10 => "Schriftliche Abmahnung", + 11 => "Vorläufige Dienstenthebung", + 12 => "Dienstentfernung", + 13 => "Außerordentliche Kündigung", + ]; + + if (empty($dokuresult)) { + echo ""; + } else { + foreach ($dokuresult as $doks) { + $austdatum = date("d.m.Y", strtotime($doks['ausstellungsdatum'])); + $docart = isset($arten[$doks['type']]) ? $arten[$doks['type']] : ''; + $path = "/assets/functions/docredir.php?docid=" . $doks['docid']; + + if ($doks['type'] <= 3) { + $bg = "text-bg-secondary"; + } elseif ($doks['type'] == 5 || $doks['type'] == 6 || $doks['type'] == 7) { + $bg = "text-bg-dark"; + } elseif ($doks['type'] >= 10 && $doks['type'] <= 12) { + $bg = "text-bg-danger"; + } + + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + } + } + ?> + +
Dokumenten-Typ#ErstellerAm
Es sind keine Dokumente hinterlegt.
" . $docart . "" . $doks['docid'] . "" . $doks['fullname'] . "" . $austdatum . ""; + echo "Ansehen"; + echo "
\ No newline at end of file diff --git a/assets/components/index/protocols.php b/assets/components/index/protocols.php new file mode 100644 index 00000000..0f687ca2 --- /dev/null +++ b/assets/components/index/protocols.php @@ -0,0 +1,67 @@ + + + + + + + + + + prepare(" + SELECT + e.enr, + e.sendezeit, + e.protokoll_status, + e.bearbeiter, + e.freigegeben + FROM intra_edivi e + JOIN intra_mitarbeiter m ON e.pfname = m.fullname + WHERE m.id = :aktenid + ORDER BY e.sendezeit DESC + LIMIT 1"); + $stmtdivi->execute(['aktenid' => $_SESSION['aktenid']]); + $ediviRows = $stmtdivi->fetchAll(PDO::FETCH_ASSOC); + + if (empty($ediviRows)) { + echo ""; + } else { + foreach ($ediviRows as $row) { + $datetime = new DateTime($row['sendezeit']); + $date = $datetime->format('d.m.Y | H:i'); + switch ($row['protokoll_status']) { + case 0: + $status = "Ungesehen"; + break; + case 1: + $status = "in Prüfung"; + break; + case 2: + $status = "Geprüft"; + break; + default: + $status = "Ungenügend"; + break; + } + + switch ($row['freigegeben']) { + default: + $freigabe_status = ""; + break; + case 1: + $freigabe_status = "F"; + break; + } + + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + } + } + ?> + +
Status#BearbeiterDatum
Es sind keine Protokolle hinterlegt.
" . $status . "" . $row['enr'] . " " . $freigabe_status . "" . (!empty($row['bearbeiter']) ? htmlspecialchars($row['bearbeiter']) : '---') . "" . $row['sendezeit'] . "" . $date . "Ansehen
\ No newline at end of file diff --git a/assets/components/navbar.php b/assets/components/navbar.php index 008e6239..cda36007 100644 --- a/assets/components/navbar.php +++ b/assets/components/navbar.php @@ -17,9 +17,6 @@