diff --git a/api/opfer/delete.php b/api/opfer/delete.php index c701518..8ab0d0e 100644 --- a/api/opfer/delete.php +++ b/api/opfer/delete.php @@ -17,7 +17,6 @@ $id = intval($_POST["id"]); $db = $api->getDB(); $sql = "DELETE FROM opfer WHERE id = :id"; - $stmt = $db->prepare($sql); $sql_exec = $stmt->execute([':id' => $id]); diff --git a/api/test.php b/api/test.php new file mode 100644 index 0000000..d52c8da --- /dev/null +++ b/api/test.php @@ -0,0 +1,16 @@ +getDB(); + +$sql = "SELECT * FROM users WHERE id = :id"; +$stmt = $db->prepare($sql); +$stmt->execute([':id' => $id]); +$result = $stmt->fetch(PDO::FETCH_ASSOC); + +print_r($result); +?> \ No newline at end of file diff --git a/api/users/add.php b/api/users/add.php new file mode 100644 index 0000000..ace229e --- /dev/null +++ b/api/users/add.php @@ -0,0 +1,54 @@ +getConf(); + +if (!$api->checkAuth()) { + header("Location: /users.html?status=500&error=Unauthorized"); + exit; +} + +if (!isset($_POST["name"]) || !isset($_POST["passwd1"]) || !isset($_POST["passwd2"])) { + header("Location: /users.html?status=500&error=Missing fields"); + exit; +} + +$name = htmlspecialchars($_POST["name"]); +$passwd1 = hash("sha256", $_POST["passwd1"]); +$passwd2 = hash("sha256", $_POST["passwd2"]); + +if (!preg_match('/^[a-z]+$/', $name)) { + header("Location: /users.html?status=500&error=Der Benutzername enthält ungültige Zeichen."); + exit; +} + +if ($passwd1 !== $passwd2) { + header("Location: /users.html?status=500&error=Die Passwörter stimmen nicht überein."); + exit; +} + +$db = $api->getDB(); + +$sql = "INSERT INTO users (username, passwd) VALUES (:name, :passwd)"; + +$stmt = $db->prepare($sql); + +$sql_exec = $stmt->execute([':name' => $name, ':passwd' => $passwd2]); + +if (!$sql_exec) { + header("Location: /users.html?status=500&error=SQL Error"); +} + +if (!file_put_contents($conf["PATH"] . "/tmp/user_sessions/" . $name . ".json", '{}')) { + header("Location: /users.html?status=500&error=Error to write session file."); + exit; +} + +header("Location: /users.html?status=200"); +exit; +?> \ No newline at end of file diff --git a/api/users/delete.php b/api/users/delete.php new file mode 100644 index 0000000..375d79d --- /dev/null +++ b/api/users/delete.php @@ -0,0 +1,48 @@ +getConf(); + +if (!$api->checkAuth()) { + die('{"status":500, "error":"Unauthorized"}'); +} + +if (!isset($_POST["id"])) { + die('{"status":500, "error":"Missing fields"}'); +} + +$id = intval($_POST["id"]); + +$db = $api->getDB(); + +$sql = "SELECT COUNT(*) FROM users"; +$stmt = $db->query($sql); + +$count = $stmt->fetchColumn(); + +if ($count == 1) { + die('{"status":500, "error":"Der einzige Benutzer darf NICHT GELÖSCHT WERDEN!"}'); +} + +$sql = "SELECT username FROM users WHERE id = :id"; +$stmt = $db->prepare($sql); +$stmt->execute([':id' => $id]); +$result = $stmt->fetch(PDO::FETCH_ASSOC); +$name = $result["username"]; + +$sql = "DELETE FROM users WHERE id = :id"; +$stmt = $db->prepare($sql); + +$sql_exec = $stmt->execute([':id' => $id]); + +if (!$sql_exec) { + die('{"status":500, "error":"SQL Error"}'); +} + +if (!unlink($conf["PATH"] . "/tmp/user_sessions/" . $name . ".json")) { + die('{"status":500, "error":"Error to remove session file."}'); +} + +die('{"status":200}'); +?> \ No newline at end of file diff --git a/api/users/edit.php b/api/users/edit.php new file mode 100644 index 0000000..0d769dc --- /dev/null +++ b/api/users/edit.php @@ -0,0 +1,83 @@ +checkAuth()) { + header("Location: /users.html?status=500&error=Unauthorized"); + exit; +} + +if (!isset($_POST["id"]) || !isset($_POST["name"]) || !isset($_POST["passwd1"]) || !isset($_POST["passwd2"])) { + die('{"status":500, "error":"Missing fields"}'); +} + +$db = $api->getDB(); + +$id = intval($_POST["id"]); + +$sql = "SELECT username FROM users WHERE id = :id"; + +$stmt = $db->prepare($sql); +$sql_exec = $stmt->execute([':id' => $id]); + +if (!$sql_exec) { + header("Location: /users.html?status=500&error=Alter Benutzername konnte nicht abgerufen werden."); + exit; +} + +$result = $stmt->fetch(PDO::FETCH_ASSOC); + +if ($result) { + $old_name = $result["username"]; +}else{ + header("Location: /users.html?status=500&error=Alter Benutzername konnte nicht ermittelt werden: SQL Error"); + exit; +} + + +$name = $_POST["name"]; + +if (!preg_match('/^[a-z]+$/', $name)) { + header("Location: /users.html?status=500&error=Der Benutzername enthält ungültige Zeichen."); + exit; +} + +if ($name !== $old_name) { + if (file_exists("../../tmp/user_sessions/" . $old_name . ".json")) { + unlink("../../tmp/user_sessions/" . $old_name . ".json"); + } +} + +$passwd1 = hash("sha256", $_POST["passwd1"]); +$passwd2 = hash("sha256", $_POST["passwd2"]); + +if ($passwd1 !== $passwd2) { + header("Location: /users.html?status=500&error=Die Passwörter stimmen nicht überein."); + exit; +} + +$db = $api->getDB(); + +$sql = "UPDATE users SET username = :name, passwd = :passwd WHERE id = :id"; + +$stmt = $db->prepare($sql); + +$sql_exec = $stmt->execute([':name' => $name, ':passwd' => $passwd1, ':id' => $id]); + +if (!$sql_exec) { + header("Location: /users.html?status=500&error=SQL Error"); + exit; +} + +if (file_put_contents("../../tmp/user_sessions/" . $name . ".json", '{"array":true}')) { + header("Location: /users.html?status=200"); +}else{ + header("Location: /users.html?status=500&error=Error to write session file."); +} +exit; +?> \ No newline at end of file diff --git a/api/users/info.php b/api/users/info.php new file mode 100644 index 0000000..db2d0ac --- /dev/null +++ b/api/users/info.php @@ -0,0 +1,33 @@ +checkAuth()) { + die('{"status":500, "error":"Unauthorized"}'); +} + +if (!isset($_POST["id"])) { + die('{"status":500, "error":"Missing parameter"}'); +} + +$id = intval($_POST["id"]); + +$db = $api->getDB(); + +$sql = "SELECT id, username FROM users WHERE id = :id"; +$stmt = $db->prepare($sql); +$stmt->execute([':id' => $id]); + +$result = $stmt->fetch(PDO::FETCH_ASSOC); + +if ($result) { + $json["user"] = $result; + $json["status"] = 200; +}else{ + $json["status"] = 500; + $json["error"] = "Empty SQL Result"; +} + +die(json_encode($json)); +?> \ No newline at end of file diff --git a/api/users/list.php b/api/users/list.php new file mode 100644 index 0000000..8a0b097 --- /dev/null +++ b/api/users/list.php @@ -0,0 +1,34 @@ +checkAuth()) { + die('{"status":500, "error":"Unauthorized"}'); +} + +$db = $api->getDB(); + +$sql = "SELECT * FROM users"; +$stmt = $db->query($sql); +$result = $stmt->fetchAll(PDO::FETCH_ASSOC); + +$all_users = []; + +if ($result) { + foreach ($result as $user_res) { + $user["id"] = $user_res["id"]; + $user["name"] = $user_res["username"]; + + $all_users[] = $user; + } + + $json["users"] = $all_users; +}else{ + $json["users"] = []; +} + +$json["status"] = 200; + +die(json_encode($json)); +?> \ No newline at end of file diff --git a/front/alerts.html b/front/alerts.html index 7ff31aa..d7145a4 100644 --- a/front/alerts.html +++ b/front/alerts.html @@ -139,10 +139,10 @@ href="users.html" @click="selected = (selected === 'Users' ? '':'Users')" class="menu-item group" - :class=" (selected === 'Users') && (page === 'users') ? 'menu-item-active' : 'menu-item-inactive'" + :class=" (selected === 'Users') && (page === 'Users') ? 'menu-item-active' : 'menu-item-inactive'" >
  • @@ -193,47 +193,7 @@ > Einstellungen - - - - - - -
    - -
    -
  • @@ -436,10 +396,10 @@ @click.prevent="dropdownOpen = ! dropdownOpen" > - User + User - Musharof + - Musharof Chowdhury - - - randomuser@pimjo.com + SPAMHASI - @@ -578,6 +461,23 @@ + diff --git a/front/avatars.html b/front/avatars.html index 98540ef..3c09a95 100644 --- a/front/avatars.html +++ b/front/avatars.html @@ -139,10 +139,10 @@ href="users.html" @click="selected = (selected === 'Users' ? '':'Users')" class="menu-item group" - :class=" (selected === 'Users') && (page === 'users') ? 'menu-item-active' : 'menu-item-inactive'" + :class=" (selected === 'Users') && (page === 'Users') ? 'menu-item-active' : 'menu-item-inactive'" >
  • @@ -193,47 +193,7 @@ > Einstellungen - - - - - - -
    - -
    -
  • @@ -436,10 +396,10 @@ @click.prevent="dropdownOpen = ! dropdownOpen" > - User + User - Musharof + - Musharof Chowdhury - - - randomuser@pimjo.com + SPAMHASI - @@ -578,6 +461,23 @@ + diff --git a/front/badge.html b/front/badge.html index bd67517..e952cb7 100644 --- a/front/badge.html +++ b/front/badge.html @@ -139,10 +139,10 @@ href="users.html" @click="selected = (selected === 'Users' ? '':'Users')" class="menu-item group" - :class=" (selected === 'Users') && (page === 'users') ? 'menu-item-active' : 'menu-item-inactive'" + :class=" (selected === 'Users') && (page === 'Users') ? 'menu-item-active' : 'menu-item-inactive'" >
  • @@ -193,47 +193,7 @@ > Einstellungen - - - - - - -
    - -
    -
  • @@ -436,10 +396,10 @@ @click.prevent="dropdownOpen = ! dropdownOpen" > - User + User - Musharof + - Musharof Chowdhury - - - randomuser@pimjo.com + SPAMHASI - @@ -578,6 +461,23 @@ + diff --git a/front/bar-chart.html b/front/bar-chart.html index fa83ca9..0ab1f1a 100644 --- a/front/bar-chart.html +++ b/front/bar-chart.html @@ -139,10 +139,10 @@ href="users.html" @click="selected = (selected === 'Users' ? '':'Users')" class="menu-item group" - :class=" (selected === 'Users') && (page === 'users') ? 'menu-item-active' : 'menu-item-inactive'" + :class=" (selected === 'Users') && (page === 'Users') ? 'menu-item-active' : 'menu-item-inactive'" >
  • @@ -193,47 +193,7 @@ > Einstellungen - - - - - - -
    - -
    -
  • @@ -436,10 +396,10 @@ @click.prevent="dropdownOpen = ! dropdownOpen" > - User + User - Musharof + - Musharof Chowdhury - - - randomuser@pimjo.com + SPAMHASI - @@ -578,6 +461,23 @@ + diff --git a/front/basic-tables.html b/front/basic-tables.html index 8c5dce8..ee5fb6e 100644 --- a/front/basic-tables.html +++ b/front/basic-tables.html @@ -141,10 +141,10 @@ href="users.html" @click="selected = (selected === 'Users' ? '':'Users')" class="menu-item group" - :class=" (selected === 'Users') && (page === 'users') ? 'menu-item-active' : 'menu-item-inactive'" + :class=" (selected === 'Users') && (page === 'Users') ? 'menu-item-active' : 'menu-item-inactive'" >
  • @@ -195,47 +195,7 @@ > Einstellungen - - - - - - -
    - -
    -
  • @@ -438,10 +398,10 @@ @click.prevent="dropdownOpen = ! dropdownOpen" > - User + User - Musharof + - Musharof Chowdhury - - - randomuser@pimjo.com + SPAMHASI - @@ -580,6 +463,23 @@ + diff --git a/front/blank.html b/front/blank.html index 7a1eeae..70296ac 100644 --- a/front/blank.html +++ b/front/blank.html @@ -141,10 +141,10 @@ href="users.html" @click="selected = (selected === 'Users' ? '':'Users')" class="menu-item group" - :class=" (selected === 'Users') && (page === 'users') ? 'menu-item-active' : 'menu-item-inactive'" + :class=" (selected === 'Users') && (page === 'Users') ? 'menu-item-active' : 'menu-item-inactive'" >
  • @@ -195,47 +195,7 @@ > Einstellungen - - - - - - -
    - -
    -
  • @@ -438,10 +398,10 @@ @click.prevent="dropdownOpen = ! dropdownOpen" > - User + User - Musharof + - Musharof Chowdhury - - - randomuser@pimjo.com + SPAMHASI - @@ -580,6 +463,23 @@ + diff --git a/front/buttons.html b/front/buttons.html index e299434..e197bc7 100644 --- a/front/buttons.html +++ b/front/buttons.html @@ -139,10 +139,10 @@ href="users.html" @click="selected = (selected === 'Users' ? '':'Users')" class="menu-item group" - :class=" (selected === 'Users') && (page === 'users') ? 'menu-item-active' : 'menu-item-inactive'" + :class=" (selected === 'Users') && (page === 'Users') ? 'menu-item-active' : 'menu-item-inactive'" >
  • @@ -193,47 +193,7 @@ > Einstellungen - - - - - - -
    - -
    -
  • @@ -436,10 +396,10 @@ @click.prevent="dropdownOpen = ! dropdownOpen" > - User + User - Musharof + - Musharof Chowdhury - - - randomuser@pimjo.com + SPAMHASI - @@ -578,6 +461,23 @@ + diff --git a/front/calendar.html b/front/calendar.html index 0a0f95d..bcb0df2 100644 --- a/front/calendar.html +++ b/front/calendar.html @@ -139,10 +139,10 @@ href="users.html" @click="selected = (selected === 'Users' ? '':'Users')" class="menu-item group" - :class=" (selected === 'Users') && (page === 'users') ? 'menu-item-active' : 'menu-item-inactive'" + :class=" (selected === 'Users') && (page === 'Users') ? 'menu-item-active' : 'menu-item-inactive'" >
  • @@ -193,47 +193,7 @@ > Einstellungen - - - - - - -
    - -
    -
  • @@ -436,10 +396,10 @@ @click.prevent="dropdownOpen = ! dropdownOpen" > - User + User - Musharof + - Musharof Chowdhury - - - randomuser@pimjo.com + SPAMHASI - @@ -578,6 +461,23 @@ + diff --git a/front/form-elements.html b/front/form-elements.html index 60a2783..2662244 100644 --- a/front/form-elements.html +++ b/front/form-elements.html @@ -141,10 +141,10 @@ href="users.html" @click="selected = (selected === 'Users' ? '':'Users')" class="menu-item group" - :class=" (selected === 'Users') && (page === 'users') ? 'menu-item-active' : 'menu-item-inactive'" + :class=" (selected === 'Users') && (page === 'Users') ? 'menu-item-active' : 'menu-item-inactive'" >
  • @@ -195,47 +195,7 @@ > Einstellungen - - - - - - -
    - -
    -
  • @@ -438,10 +398,10 @@ @click.prevent="dropdownOpen = ! dropdownOpen" > - User + User - Musharof + - Musharof Chowdhury - - - randomuser@pimjo.com + SPAMHASI - @@ -580,6 +463,23 @@ + diff --git a/front/images.html b/front/images.html index c5f91e8..368f062 100644 --- a/front/images.html +++ b/front/images.html @@ -139,10 +139,10 @@ href="users.html" @click="selected = (selected === 'Users' ? '':'Users')" class="menu-item group" - :class=" (selected === 'Users') && (page === 'users') ? 'menu-item-active' : 'menu-item-inactive'" + :class=" (selected === 'Users') && (page === 'Users') ? 'menu-item-active' : 'menu-item-inactive'" >
  • @@ -193,47 +193,7 @@ > Einstellungen - - - - - - -
    - -
    -
  • @@ -436,10 +396,10 @@ @click.prevent="dropdownOpen = ! dropdownOpen" > - User + User - Musharof + - Musharof Chowdhury - - - randomuser@pimjo.com + SPAMHASI - @@ -578,6 +461,23 @@ + diff --git a/front/index.html b/front/index.html index c4d44ac..e156198 100644 --- a/front/index.html +++ b/front/index.html @@ -150,10 +150,10 @@ href="users.html" @click="selected = (selected === 'Users' ? '':'Users')" class="menu-item group" - :class=" (selected === 'Users') && (page === 'users') ? 'menu-item-active' : 'menu-item-inactive'" + :class=" (selected === 'Users') && (page === 'Users') ? 'menu-item-active' : 'menu-item-inactive'" >
  • @@ -204,47 +204,7 @@ > Einstellungen - - - - - - -
    - -
    -
  • @@ -447,10 +407,10 @@ @click.prevent="dropdownOpen = ! dropdownOpen" > - User + User - Musharof + - Musharof Chowdhury - - - randomuser@pimjo.com + SPAMHASI - @@ -589,6 +472,23 @@ + @@ -1258,7 +1158,6 @@ .catch(error => console.error("API Error: " + error)) function opferEdit(id) { - console.log(document.getElementById("opfer_name")); fetch("/api/opfer/info.php", { method: "POST", headers: { @@ -1284,8 +1183,8 @@ const toogle_el = document.querySelector('#toggle2'); const toogle_data = Alpine.$data(document.getElementById("toogle2_div")); - toogle_data.switcherToggle = data.status; - toogle_el.checked = data.status; + toogle_data.switcherToggle = true; + toogle_el.checked = true; } }) } diff --git a/front/line-chart.html b/front/line-chart.html index c850897..1eb6fed 100644 --- a/front/line-chart.html +++ b/front/line-chart.html @@ -141,10 +141,10 @@ href="users.html" @click="selected = (selected === 'Users' ? '':'Users')" class="menu-item group" - :class=" (selected === 'Users') && (page === 'users') ? 'menu-item-active' : 'menu-item-inactive'" + :class=" (selected === 'Users') && (page === 'Users') ? 'menu-item-active' : 'menu-item-inactive'" >
  • @@ -195,47 +195,7 @@ > Einstellungen - - - - - - -
    - -
    -
  • @@ -438,10 +398,10 @@ @click.prevent="dropdownOpen = ! dropdownOpen" > - User + User - Musharof + - Musharof Chowdhury - - - randomuser@pimjo.com + SPAMHASI - @@ -580,6 +463,23 @@ + diff --git a/front/opfer.html b/front/opfer.html index 97f782d..97174a8 100644 --- a/front/opfer.html +++ b/front/opfer.html @@ -141,10 +141,10 @@ href="users.html" @click="selected = (selected === 'Users' ? '':'Users')" class="menu-item group" - :class=" (selected === 'Users') && (page === 'users') ? 'menu-item-active' : 'menu-item-inactive'" + :class=" (selected === 'Users') && (page === 'Users') ? 'menu-item-active' : 'menu-item-inactive'" >
  • @@ -195,47 +195,7 @@ > Einstellungen - - - - - - -
    - -
    -
  • @@ -438,10 +398,10 @@ @click.prevent="dropdownOpen = ! dropdownOpen" > - User + User - Musharof + - Musharof Chowdhury - - - randomuser@pimjo.com + SPAMHASI - @@ -580,6 +463,23 @@ + diff --git a/front/profile.html b/front/profile.html index b0e5028..5250301 100644 --- a/front/profile.html +++ b/front/profile.html @@ -139,10 +139,10 @@ href="users.html" @click="selected = (selected === 'Users' ? '':'Users')" class="menu-item group" - :class=" (selected === 'Users') && (page === 'users') ? 'menu-item-active' : 'menu-item-inactive'" + :class=" (selected === 'Users') && (page === 'Users') ? 'menu-item-active' : 'menu-item-inactive'" >
  • @@ -193,47 +193,7 @@ > Einstellungen - - - - - - -
    - -
    -
  • @@ -436,10 +396,10 @@ @click.prevent="dropdownOpen = ! dropdownOpen" > - User + User - Musharof + - Musharof Chowdhury - - - randomuser@pimjo.com + SPAMHASI - @@ -578,6 +461,23 @@ + diff --git a/front/settings.html b/front/settings.html new file mode 100644 index 0000000..cecbbd5 --- /dev/null +++ b/front/settings.html @@ -0,0 +1,588 @@ + + + + + + + + Alle Opfer | Spamhasi + + + + + +
    +
    +
    + + + + +
    + + + + + + +
    + +
    + + + +
    +
    +
    + + + + + + Logo + + + + + + + +
    +
    + + + +
    + + +
    + + + User + + + + + + + + + + +
    +
    + + SPAMHASI + +
    + + +
    + +
    + +
    +
    + +
    + + + +
    +
    + +
    +
    +

    + +
    + + +
    +
    +

    + Inhalt der Mails +

    +
    +
    + +
    + + +
    + + +
    + + +
    + + +
    + + +

    + Please enter a message in the textarea. +

    +
    +
    +
    +
    +
    + +
    + +
    + + + + diff --git a/front/src/images/spamhasi.png b/front/src/images/spamhasi.png new file mode 100644 index 0000000..e394edb Binary files /dev/null and b/front/src/images/spamhasi.png differ diff --git a/front/style.css b/front/style.css index 56935bf..30e3b9d 100644 --- a/front/style.css +++ b/front/style.css @@ -551,9 +551,6 @@ svg{-ms-touch-action:none;touch-action:none}image,text,.jvm-zoomin,.jvm-zoomout{ .-mt-0\.5 { margin-top: calc(var(--spacing) * -0.5); } - .mt-0\.5 { - margin-top: calc(var(--spacing) * 0.5); - } .mt-1 { margin-top: calc(var(--spacing) * 1); } diff --git a/front/users.html b/front/users.html new file mode 100644 index 0000000..cbe7333 --- /dev/null +++ b/front/users.html @@ -0,0 +1,973 @@ + + + + + + + Alle Benutzer | Spamhasi + + + + + + +
    +
    +
    + + + + +
    + + + + + + + +
    + + +
    + +
    +
    +
    + + + + + + Logo + + + + + + + +
    +
    + + + +
    + + +
    + + + User + + + + + + + + + + +
    +
    + + SPAMHASI + +
    + + +
    + +
    + +
    +
    + +
    + + + +
    +
    + + +
    +
    +

    + + +
    + + +
    +
    +
    +
    + + + +
    + +
    +

    + Erfolgreich! +

    + +

    + Die Aktion wurde erfolgreich ausgeführt +

    +
    +
    +
    + +
    +
    +
    + + + +
    + +
    +

    + Es ist ein Fehler aufgetreten +

    + +

    + +

    +
    +
    +
    +
    +
    + + +
    +
    +
    +

    + ALLE OPFER +

    +
    + +
    +
    +
    + + + + + + + + + + + + + +
    +
    +

    + Interne ID +

    +
    +
    +
    +

    + Benutzername +

    +
    +
    +
    +
    +
    + +
    +
    + +
    +
    + + +
    + +
    + + + +
    + +
    + + +
    +

    + Ein neuen Benutzer hinzufügen! +

    +

    + Füge hier einen neuen Benutzer hinzu, damit jeder Spamhasi haben kann! +

    +
    +
    +
    +
    +
    +
    + + +
    + +
    + + +
    + +
    + + +
    +
    +
    +
    +
    + + +
    +
    +
    +
    +
    + +
    + + +
    +

    + Einen Benutzer bearbeiten +

    +

    + Bearbeite einen Benutzer! +

    +
    +
    +
    +
    +
    +
    + + +
    + +
    + + +
    +
    + + +
    +
    +
    +
    + +
    + + + +
    +
    +
    +
    + + \ No newline at end of file diff --git a/front/users_old.html b/front/users_old.html new file mode 100644 index 0000000..72ada47 --- /dev/null +++ b/front/users_old.html @@ -0,0 +1,1009 @@ + + + + + + + + Alle Benutzer | Spamhasi + + + + + +
    +
    +
    + + + + +
    + + + + + + +
    + +
    + + + +
    +
    +
    + + + + + + Logo + + + + + + + +
    +
    + + + +
    + + +
    + + + User + + + + + + + + + + +
    +
    + + SPAMHASI + +
    + + +
    + +
    + +
    +
    + +
    + + + +
    +
    + +
    +
    +

    + +
    +
    +
    +
    +
    + + + +
    + +
    +

    + Erfolgreich! +

    + +

    + Die Aktion wurde erfolgreich ausgeführt +

    +
    +
    +
    +
    +
    +
    + + + +
    + +
    +

    + Es ist ein Fehler aufgetreten +

    + +

    + +

    +
    +
    +
    +
    +
    +
    + + +
    +
    +
    +

    + ALLE OPFER +

    +
    +
    + +
    +
    + + + + + + + + + + + + + +
    +
    +

    + Interne ID +

    +
    +
    +
    +

    + Benutzername +

    +
    +
    +
    +
    + +
    +
    +
    +
    +
    + +
    + +
    + +
    + +
    + + +
    +

    + Ein neuen Benutzer hinzufügen! +

    +

    + Füge hier einen neuen Benutzer hinzu, damit jeder Spamhasi haben kann! +

    +
    +
    +
    +
    +
    +
    + + +
    + +
    + + +
    + +
    + + +
    +
    +
    +
    +
    + + +
    +
    +
    +
    +
    + +
    + + +
    +

    + Einen Benutzer bearbeiten +

    +

    + Bearbeite einen Benutzer! +

    +
    +
    +
    +
    +
    +
    + + +
    + +
    + + +
    +
    + + +
    +
    +
    +
    + +
    + + + +
    +
    +
    +
    + + diff --git a/front/videos.html b/front/videos.html index 68c1f96..7015299 100644 --- a/front/videos.html +++ b/front/videos.html @@ -139,10 +139,10 @@ href="users.html" @click="selected = (selected === 'Users' ? '':'Users')" class="menu-item group" - :class=" (selected === 'Users') && (page === 'users') ? 'menu-item-active' : 'menu-item-inactive'" + :class=" (selected === 'Users') && (page === 'Users') ? 'menu-item-active' : 'menu-item-inactive'" >
  • @@ -193,47 +193,7 @@ > Einstellungen - - - - - - -
    - -
    -
  • @@ -436,10 +396,10 @@ @click.prevent="dropdownOpen = ! dropdownOpen" > - User + User - Musharof + - Musharof Chowdhury - - - randomuser@pimjo.com + SPAMHASI - @@ -578,6 +461,23 @@ + diff --git a/tailadmin/src/images/spamhasi.png b/tailadmin/src/images/spamhasi.png new file mode 100644 index 0000000..e394edb Binary files /dev/null and b/tailadmin/src/images/spamhasi.png differ diff --git a/tailadmin/src/index.html b/tailadmin/src/index.html index 24a80a0..7ca2881 100644 --- a/tailadmin/src/index.html +++ b/tailadmin/src/index.html @@ -244,7 +244,6 @@ .catch(error => console.error("API Error: " + error)) function opferEdit(id) { - console.log(document.getElementById("opfer_name")); fetch("/api/opfer/info.php", { method: "POST", headers: { @@ -270,8 +269,8 @@ const toogle_el = document.querySelector('#toggle2'); const toogle_data = Alpine.$data(document.getElementById("toogle2_div")); - toogle_data.switcherToggle = data.status; - toogle_el.checked = data.status; + toogle_data.switcherToggle = true; + toogle_el.checked = true; } }) } diff --git a/tailadmin/src/partials/header.html b/tailadmin/src/partials/header.html index 8060ab2..b132794 100644 --- a/tailadmin/src/partials/header.html +++ b/tailadmin/src/partials/header.html @@ -154,10 +154,10 @@ @click.prevent="dropdownOpen = ! dropdownOpen" > - User + User - Musharof + - Musharof Chowdhury - - - randomuser@pimjo.com + SPAMHASI - @@ -296,4 +219,21 @@ + diff --git a/tailadmin/src/partials/profile/list.php b/tailadmin/src/partials/profile/list.php new file mode 100644 index 0000000..2546733 --- /dev/null +++ b/tailadmin/src/partials/profile/list.php @@ -0,0 +1,36 @@ +checkAuth()) { + die('{"status":500, "error":"Unauthorized"}'); +} + +$db = $api->getDB(); + +$sql = "SELECT * FROM users"; +$stmt = $db->query($sql); +$result = $stmt->fetchAll(PDO::FETCH_ASSOC); + +$all_users = []; + +if ($result) { + foreach ($result as $user_res) { + $user["id"] = $user_res["id"]; + $user["name"] = $user_res["name"]; + $user["mail"] = $user_res["mail"]; + $user["number"] = $user_res["number"]; + + $all_opfer[] = $opfer; + } + + $json["user"] = $all_user; +}else{ + $json["user"] = []; +} + +$json["status"] = 200; + +die(json_encode($json)); +?> \ No newline at end of file diff --git a/tailadmin/src/partials/profile/user_add.html b/tailadmin/src/partials/profile/user_add.html new file mode 100644 index 0000000..3ab0ebb --- /dev/null +++ b/tailadmin/src/partials/profile/user_add.html @@ -0,0 +1,109 @@ +
    + +
    + + +
    +

    + Ein neuen Benutzer hinzufügen! +

    +

    + Füge hier einen neuen Benutzer hinzu, damit jeder Spamhasi haben kann! +

    +
    +
    +
    +
    +
    +
    + + +
    + +
    + + +
    + +
    + + +
    +
    +
    +
    +
    + + +
    +
    +
    +
    diff --git a/tailadmin/src/partials/profile/user_edit.html b/tailadmin/src/partials/profile/user_edit.html new file mode 100644 index 0000000..2bb0d64 --- /dev/null +++ b/tailadmin/src/partials/profile/user_edit.html @@ -0,0 +1,120 @@ +
    + +
    + + +
    +

    + Einen Benutzer bearbeiten +

    +

    + Bearbeite einen Benutzer! +

    +
    +
    +
    +
    +
    +
    + + +
    + +
    + + +
    +
    + + +
    +
    +
    +
    + +
    + + + +
    +
    +
    +
    \ No newline at end of file diff --git a/tailadmin/src/partials/sidebar.html b/tailadmin/src/partials/sidebar.html index 833abbd..031c491 100644 --- a/tailadmin/src/partials/sidebar.html +++ b/tailadmin/src/partials/sidebar.html @@ -97,10 +97,10 @@ href="users.html" @click="selected = (selected === 'Users' ? '':'Users')" class="menu-item group" - :class=" (selected === 'Users') && (page === 'users') ? 'menu-item-active' : 'menu-item-inactive'" + :class=" (selected === 'Users') && (page === 'Users') ? 'menu-item-active' : 'menu-item-inactive'" >
  • @@ -151,47 +151,7 @@ > Einstellungen - - - - - - -
    - -
    -
  • diff --git a/tailadmin/src/partials/table/table-07.html b/tailadmin/src/partials/table/table-07.html new file mode 100644 index 0000000..cbdb41d --- /dev/null +++ b/tailadmin/src/partials/table/table-07.html @@ -0,0 +1,36 @@ +
    +
    + + + + + + + + + + + + + +
    +
    +

    + Interne ID +

    +
    +
    +
    +

    + Benutzername +

    +
    +
    +
    +
    diff --git a/tailadmin/src/settings.html b/tailadmin/src/settings.html new file mode 100644 index 0000000..fff045e --- /dev/null +++ b/tailadmin/src/settings.html @@ -0,0 +1,145 @@ + + + + + + + + Alle Opfer | Spamhasi + + + + + + + + + +
    + + + + + +
    + + + + + + + + + +
    +
    + +
    +
    +

    + +
    + + +
    +
    +

    + Inhalt der Mails +

    +
    +
    + +
    + + +
    + + +
    + + +
    + + +
    + + +

    + Please enter a message in the textarea. +

    +
    +
    +
    +
    +
    + +
    + +
    + + + + diff --git a/tailadmin/src/users.html b/tailadmin/src/users.html new file mode 100644 index 0000000..f67e1d0 --- /dev/null +++ b/tailadmin/src/users.html @@ -0,0 +1,271 @@ + + + + + + + Alle Benutzer | Spamhasi + + + + + + + + + + +
    + + + + + + +
    + + + + + + + + + +
    +
    + + +
    +
    +

    + + +
    + + +
    +
    +
    +
    + + + +
    + +
    +

    + Erfolgreich! +

    + +

    + Die Aktion wurde erfolgreich ausgeführt +

    +
    +
    +
    + +
    +
    +
    + + + +
    + +
    +

    + Es ist ein Fehler aufgetreten +

    + +

    + +

    +
    +
    +
    +
    +
    + + +
    +
    +
    +

    + ALLE OPFER +

    +
    + +
    + +
    + +
    +
    + +
    +
    + + +
    + +
    + + + + + + + + + \ No newline at end of file diff --git a/tmp/user_sessions/marc.json b/tmp/user_sessions/marc.json index 7657dcf..37ac249 100755 --- a/tmp/user_sessions/marc.json +++ b/tmp/user_sessions/marc.json @@ -1 +1 @@ -{"790":{"session_id":"a1e9095da4163edca39dac5b27750ebabbe40cb047115202465374ced9e3732b"}} \ No newline at end of file +{"266":{"session_id":"d1872a54416992aaf65972760b7fb897b02a4719929f933ea90c2a0e8107097a"}} \ No newline at end of file