Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
51 commits
Select commit Hold shift + click to select a range
9b01c4c
Merge pull request #38 from intraRP/main
itshypax Apr 26, 2025
8cb08c8
test
itshypax Apr 26, 2025
556ff55
Update discord.php
itshypax Apr 26, 2025
4302f32
Update discord.php
itshypax Apr 26, 2025
4a80989
Update callback.php
itshypax Apr 26, 2025
5f0750b
Update callback.php
itshypax Apr 26, 2025
afb2e8c
Update callback.php
itshypax Apr 26, 2025
4f271b5
Update callback.php
itshypax Apr 26, 2025
b449fcd
Update callback.php
itshypax Apr 26, 2025
6eb392e
Update callback.php
itshypax Apr 26, 2025
89efb8f
Update callback.php
itshypax Apr 26, 2025
87acf70
Update callback.php
itshypax Apr 26, 2025
91ff1fc
Added env var
itshypax Apr 26, 2025
1b9bc35
Update login.php
itshypax Apr 26, 2025
6b17a96
Update login.php
itshypax Apr 26, 2025
e8919b3
Update callback.php
itshypax Apr 26, 2025
5cea4ca
Update callback.php
itshypax Apr 26, 2025
198e373
Update callback.php
itshypax Apr 26, 2025
49af09e
Add warning on missing fullname
itshypax Apr 26, 2025
087bceb
Update Flash.php
itshypax Apr 26, 2025
cae62bf
Added warning on missing name
itshypax Apr 26, 2025
8c7d777
Update editprofile.php
itshypax Apr 26, 2025
920902a
Updated Readme
itshypax Apr 26, 2025
68737d6
Update README.md
itshypax Apr 26, 2025
c0101de
Merge pull request #40 from intraRP/main
itshypax May 1, 2025
76f6629
Update editprofile.php
itshypax May 1, 2025
67d2703
Update editprofile.php
itshypax May 1, 2025
67941e5
Update editprofile.php
itshypax May 1, 2025
06616a8
Certificates not working properly
itshypax May 1, 2025
d07f3c9
Update dokument-delete.php
itshypax May 1, 2025
171d73c
Anpassung login.php Styling
itshypax May 3, 2025
f8d8856
Neues Passwort generieren entfernt
itshypax May 3, 2025
189f5d5
Delete create.php
itshypax May 3, 2025
90180fe
Update README.md
itshypax May 3, 2025
57e23ad
Update footer.php
itshypax May 3, 2025
f59ecdd
Update footer.php
itshypax May 3, 2025
3adc542
Update footer.php
itshypax May 3, 2025
c4b3eb3
Versionsnummer des Updates angepasst
itshypax May 3, 2025
3a75e70
Merge pull request #44 from intraRP/main
itshypax May 4, 2025
afa2932
Dokumente speichern jetzt Discord-ID des Benutzers
itshypax May 4, 2025
01dd2e2
Discord-ID kann jetzt nur noch eine Nummer sein
itshypax May 4, 2025
cb7e0c7
Dokumentenübersicht auf Index-Seite
itshypax May 4, 2025
fdc3c0d
Beförderungsanträge speichern nun Discord-ID
itshypax May 4, 2025
ead1d30
Anträge werden auf Index angezeigt
itshypax May 4, 2025
5db3f74
Update applications.php
itshypax May 4, 2025
cfaceef
eNOTF-Protokoll sollte nun Namen vorschlagen
itshypax May 4, 2025
7529b33
eDIVI-Protokolle sollten nun auch zugeordnet werden
itshypax May 4, 2025
69bc2ba
Update index.php
itshypax May 4, 2025
2203332
Update protocols.php
itshypax May 4, 2025
7ab4adc
Badge-Styling gefixt
itshypax May 4, 2025
9a92996
Datenbank SQL aktualisiert
itshypax May 4, 2025
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
5 changes: 4 additions & 1 deletion .env.example
Original file line number Diff line number Diff line change
@@ -1,4 +1,7 @@
DB_HOST=localhost
DB_USER=root
DB_PASS=
DB_NAME=intrarp
DB_NAME=intrarp

DISCORD_CLIENT_ID=
DISCORD_CLIENT_SECRET=
4 changes: 4 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -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.
Expand All @@ -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)
Expand Down
2 changes: 1 addition & 1 deletion admin/edivi/list.php
Original file line number Diff line number Diff line change
Expand Up @@ -113,7 +113,7 @@
$freigabe_status = "";
break;
case 1:
$freigabe_status = "<span title='Freigeber: " . $row['freigeber_name'] . "' class='text-badge bg-success'>F</span>";
$freigabe_status = "<span title='Freigeber: " . $row['freigeber_name'] . "' class='badge text-bg-success'>F</span>";
break;
}

Expand Down
24 changes: 23 additions & 1 deletion admin/index.php
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,10 @@

use App\Helpers\Flash;

if (!isset($_SESSION['cirs_user']) || empty($_SESSION['cirs_user'])) {
header("Location: /admin/users/editprofile.php");
}

?>

<!DOCTYPE html>
Expand Down Expand Up @@ -57,7 +61,7 @@
<!-- ------------ -->
<div class="container">
<div class="row" id="startpage">
<div class="col mb-5">
<div class="col">
<hr class="text-light my-3">
<h1>Dashboard</h1>
<?php
Expand Down Expand Up @@ -177,6 +181,24 @@
</div>
</div>
</div>
<div class="row mt-4">
<div class="col intra__tile">
<h4 class="mt-2 mb-3">Eigene Dokumente</h4>
<?php include $_SERVER['DOCUMENT_ROOT'] . '/assets/components/index/documents.php' ?>
</div>
</div>
<div class="row mt-4">
<div class="col intra__tile">
<h4 class="mt-2 mb-3">Eigene Anträge</h4>
<?php include $_SERVER['DOCUMENT_ROOT'] . '/assets/components/index/applications.php' ?>
</div>
</div>
<div class="row mt-4 mb-5">
<div class="col intra__tile">
<h4 class="mt-2 mb-3">Eigene eDIVI-Protokolle</h4>
<?php include $_SERVER['DOCUMENT_ROOT'] . '/assets/components/index/protocols.php' ?>
</div>
</div>
</div>
</div>
<script>
Expand Down
97 changes: 3 additions & 94 deletions admin/login.php
Original file line number Diff line number Diff line change
@@ -1,7 +1,5 @@
<?php
require $_SERVER['DOCUMENT_ROOT'] . '/assets/config/config.php';
require $_SERVER['DOCUMENT_ROOT'] . '/assets/config/database.php';

ini_set('session.gc_maxlifetime', 604800);
ini_set('session.cookie_path', '/'); // Set the cookie path to the root directory
ini_set('session.cookie_domain', SYSTEM_URL); // Set the cookie domain to your domain
Expand All @@ -13,63 +11,6 @@
if (isset($_SESSION['userid']) && isset($_SESSION['permissions'])) {
header('Location: /admin/index.php');
}

$checkStmt = $pdo->query("SELECT COUNT(*) FROM intra_users");
$userCount = $checkStmt->fetchColumn();

if ($userCount == 0 && $_SERVER['REQUEST_METHOD'] === 'POST') {
$username = trim($_POST['username']);
$fullname = trim($_POST['fullname']);
$passwort = $_POST['passwort'];
$passwortConfirm = $_POST['passwort_confirm'];

if ($passwort !== $passwortConfirm) {
$errorMessage = "Passwörter stimmen nicht überein.";
} else {
$hashedPassword = password_hash($passwort, PASSWORD_BCRYPT);

$stmt = $pdo->prepare("INSERT INTO intra_users (username, fullname, passwort, role, full_admin) VALUES (:username, :fullname, :passwort, :role, :full_admin)");
$stmt->execute([
'username' => $username,
'fullname' => $fullname,
'passwort' => $hashedPassword,
'role' => 0,
'full_admin' => 1
]);

header("Refresh: 0");
exit();
}
}

if (isset($_GET['login'])) {
$username = $_POST['username'];
$passwort = $_POST['passwort'];

$statement = $pdo->prepare("SELECT * FROM intra_users WHERE username = :username");
$result = $statement->execute(array('username' => $username));
$user = $statement->fetch();

if ($user !== false && password_verify($passwort, $user['passwort'])) {
$_SESSION['userid'] = $user['id'];
$_SESSION['cirs_user'] = $user['fullname'];
$_SESSION['cirs_username'] = $user['username'];
$_SESSION['aktenid'] = $user['aktenid'];
$permissions = json_decode($user['permissions'], true) ?? [];
$_SESSION['permissions'] = $permissions;

if (isset($_SESSION['redirect_url'])) {
$redirect_url = $_SESSION['redirect_url'];
unset($_SESSION['redirect_url']); // Remove the stored URL
header("Location: $redirect_url");
exit();
} else {
header('Location: /admin/index.php');
}
} else {
$errorMessage = "Benutzername oder Passwort ungültig.<br>";
}
}
?>
<!DOCTYPE html>
<html>
Expand Down Expand Up @@ -109,42 +50,10 @@
<div class="card px-4 py-3">
<h1 id="loginHeader"><?php echo SYSTEM_NAME ?></h1>
<p class="subtext">Das Intranet der Stadt <?php echo SERVER_CITY ?>!</p>
<?php
if (isset($errorMessage)) {
echo '<div class="alert alert-danger mb-5" role="alert">';
echo $errorMessage;
echo '</div>';
}
?>

<?php if ($userCount == 0) : ?>
<div class="alert alert-info mb-3">Kein Benutzer gefunden. Du erstellst jetzt den ersten Administrator-Account.</div>
<form method="post">
<strong>Benutzername:</strong><br>
<input class="form-control" type="text" size="40" maxlength="250" name="username" required><br><br>

<strong>Vor- und Zuname (RP):</strong><br>
<input class="form-control" type="text" size="40" maxlength="250" name="fullname" required><br><br>

<strong>Passwort:</strong><br>
<input class="form-control" type="password" size="40" maxlength="250" name="passwort" required><br>

<strong>Passwort wiederholen:</strong><br>
<input class="form-control" type="password" name="passwort_confirm" required><br>

<input class="btn btn-primary w-100" type="submit" value="Erstellen">
</form>
<?php else : ?>
<form action="?login=1" method="post">
<strong>Benutzername:</strong><br>
<input class="form-control" type="text" size="40" maxlength="250" name="username" required><br><br>

<strong>Passwort:</strong><br>
<input class="form-control" type="password" size="40" maxlength="250" name="passwort" required><br>

<input class="btn btn-primary w-100" type="submit" value="Anmelden">
</form>
<?php endif; ?>
<div class="text-center mb-3">
<a href="/auth/discord.php" class="btn btn-primary btn-lg w-100"><i class="lab la-discord la-2x mb-2"></i><br>Mit Discord anmelden</a>
</div>
</div>
</div>
</div>
Expand Down
4 changes: 2 additions & 2 deletions admin/personal/create.php
Original file line number Diff line number Diff line change
Expand Up @@ -228,8 +228,8 @@
</td>
</tr>
<tr>
<td class="fw-bold text-center">Discord</td>
<td><input class="form-control" type="text" name="discordtag" id="discordtag" value=""></td>
<td class="fw-bold text-center">Discord-ID</td>
<td><input class="form-control" type="number" name="discordtag" id="discordtag" value="" minlength="17" maxlength="18" required></td>
</tr>
<tr>
<td class="fw-bold text-center">Telefonnummer</td>
Expand Down
2 changes: 1 addition & 1 deletion admin/personal/dokument-delete.php
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@
$id = $_GET['id'];
$pid = $_GET['pid'];

$stmt = $pdo->prepare("DELETE FROM intra_mitarbeiter_dokumente WHERE id = :id");
$stmt = $pdo->prepare("DELETE FROM intra_mitarbeiter_dokumente WHERE docid = :id");
$stmt->bindParam(':id', $id);
$stmt->execute();

Expand Down
16 changes: 10 additions & 6 deletions admin/personal/profile.php
Original file line number Diff line number Diff line change
Expand Up @@ -326,12 +326,14 @@
$erhalter_gebdat = $_POST['erhalter_gebdat'];
$erhalter_rang = $_POST['erhalter_rang'] ?? NULL;
$erhalter_rang_rd = $_POST['erhalter_rang_rd'] ?? NULL;
$erhalter_quali = $_POST['erhalter_quali'] ?? NULL;
$ausstellerid = $_POST['ausstellerid'];
$aussteller_name = $_POST['aussteller_name'];
$aussteller_rang = $_POST['aussteller_rang'];
$profileid = $_POST['profileid'];
$docType = $_POST['docType'];
$anrede = $_POST['anrede'];
$discordtag = $row['discordtag'];

$ausstDtNr = in_array($docType, ['10', '11', '12', '13']) ? '10' : $docType;

Expand All @@ -347,8 +349,8 @@
$new_number = $random_number;

$docStmt = $pdo->prepare("INSERT INTO intra_mitarbeiter_dokumente
(docid, type, anrede, erhalter, inhalt, suspendtime, erhalter_gebdat, erhalter_rang, erhalter_rang_rd, ausstellungsdatum, ausstellerid, profileid, aussteller_name, aussteller_rang)
VALUES (:docid, :type, :anrede, :erhalter, :inhalt, :suspendtime, :erhalter_gebdat, :erhalter_rang, :erhalter_rang_rd, :ausstellungsdatum, :ausstellerid, :profileid, :aussteller_name, :aussteller_rang)");
(docid, type, anrede, erhalter, inhalt, suspendtime, erhalter_gebdat, erhalter_rang, erhalter_rang_rd, erhalter_quali, ausstellungsdatum, ausstellerid, profileid, aussteller_name, aussteller_rang, discordid)
VALUES (:docid, :type, :anrede, :erhalter, :inhalt, :suspendtime, :erhalter_gebdat, :erhalter_rang, :erhalter_rang_rd, :erhalter_quali, :ausstellungsdatum, :ausstellerid, :profileid, :aussteller_name, :aussteller_rang, :discordtag)");

$docStmt->execute([
'docid' => $new_number,
Expand All @@ -360,11 +362,13 @@
'erhalter_gebdat' => $erhalter_gebdat,
'erhalter_rang' => $erhalter_rang,
'erhalter_rang_rd' => $erhalter_rang_rd,
'erhalter_quali' => $erhalter_quali,
'ausstellungsdatum' => $ausstellungsdatum,
'ausstellerid' => $ausstellerid,
'profileid' => $profileid,
'aussteller_name' => $aussteller_name,
'aussteller_rang' => $aussteller_rang
'aussteller_rang' => $aussteller_rang,
'discordtag' => $discordtag
]);

$logContent = 'Ein neues Dokument (<a href="/assets/functions/docredir.php?docid=' . $new_number . '" target="_blank">#' . $new_number . '</a>) wurde erstellt.';
Expand Down Expand Up @@ -535,7 +539,7 @@ function removeEditParamFromURL()
</tr>
<?php endif; ?>
<tr>
<td class="fw-bold">Discord</td>
<td class="fw-bold">Discord-ID</td>
<td><?= $row['discordtag'] ?? 'N. hinterlegt' ?></td>
</tr>
<tr>
Expand Down Expand Up @@ -590,8 +594,8 @@ function removeEditParamFromURL()
</tr>
<?php endif; ?>
<tr>
<td class="fw-bold">Discord</td>
<td><input class="form-control" type="text" name="discordtag" id="discordtag" value="<?= $row['discordtag'] ?>"></td>
<td class="fw-bold">Discord-ID</td>
<td><input class="form-control" type="number" name="discordtag" id="discordtag" value="<?= $row['discordtag'] ?>" minlength="17" maxlength="18" required></td>
</tr>
<tr>
<td class="fw-bold">Telefonnummer</td>
Expand Down
Loading