Subversion-Projekte lars-tiefland.webanos.faltradxxs.de

Revision

Revision 141 | Revision 144 | Zur aktuellen Revision | Ganze Datei anzeigen | Leerzeichen ignorieren | Details | Blame | Letzte Änderung | Log anzeigen | RSS feed

Revision 141 Revision 143
Zeile 15... Zeile 15...
15
    use App\Models\Shop;
15
    use App\Models\Shop;
16
    use App\Models\UserProperty;
16
    use App\Models\UserProperty;
17
    use App\Models\Web;
17
    use App\Models\Web;
18
    use App\Models\WebProperty;
18
    use App\Models\WebProperty;
19
    use Illuminate\Support\Facades\Route;
19
    use Illuminate\Support\Facades\Route;
20
 
-
 
21
    session_start();
20
    session_start();
22
    setlocale( LC_TIME, 'de_DE.UTF-8' );
-
 
23
 
-
 
24
    if ( php_sapi_name() == "cli" )
-
 
25
    {
-
 
26
        return false;
-
 
27
    }
-
 
28
 
-
 
29
    $w = new Web();
-
 
30
    $GLOBALS["web"] = $w->where( "domain", "=", env( 'shop' ) )->first();
-
 
31
    if ( php_sapi_name() != "cli" )
-
 
32
    {
-
 
33
        if ( !file_exists( $_SERVER["DOCUMENT_ROOT"] . "/public/styles/" . $GLOBALS["web"]["domain"] . "_styles.css" ) )
-
 
34
        {
-
 
35
            require_once "styles.php";
-
 
36
        }
-
 
37
    }
-
 
38
    \View::share( "webs", $GLOBALS["web"] );
-
 
39
    $c_bestellarten = array();
-
 
40
    $c_shops = array();
-
 
41
    $d_shops = array();
-
 
42
    $ba = OrderType::get();
-
 
43
    foreach ( $ba as $ba_id => $bestellart )
-
 
44
    {
-
 
45
        $c_bestellarten[$bestellart->id] = $bestellart->name;
-
 
46
    }
-
 
47
    $shops = Shop::get();
-
 
48
    View::share( "shops", $shops );
-
 
49
    foreach ( $shops as $s_id => $shop )
-
 
50
    {
-
 
51
        $c_shops[$shop->id] = $shop->name;
-
 
52
        $d_shops[$shop->id] = $shop;
-
 
53
    }
-
 
54
    \View::share( "c_bestellarten", $c_bestellarten );
-
 
55
    \View::share( "c_shops", $c_shops );
-
 
56
    \View::share( "d_shops", $d_shops );
-
 
57
    $_SESSION["loadingGif"] = "/images/navigation/loading.gif";
-
 
58
    if ( file_exists( $_SERVER["DOCUMENT_ROOT"] . "/images/webelemente/loading.gif" ) )
-
 
59
    {
-
 
60
        $_SESSION["loadingGif"] = "/images/webelemente/loading.gif";
-
 
61
    }
-
 
62
    $webRechte = WebProperty::with( [
-
 
63
        "property",
-
 
64
        "property.tool",
-
 
65
        "property.tool.module"
-
 
66
    ] )->where( "web_id", "=", $GLOBALS["web"]->ID )->get();
-
 
67
    $navi = Module::with( 'tool' )->orderBy( 'modules.rang' )->get();
-
 
68
    \View::share( "navi", $navi );
-
 
69
    foreach ( $webRechte as $web_recht )
-
 
70
    {
-
 
71
        $property = $web_recht->property;
-
 
72
        $tool = $property->tool;
-
 
73
        $module = $tool->module;
-
 
74
        $GLOBALS["web_rechte"][$module->interner_name][$tool->button_name][$property->interner_name] = $web_recht->Bezeichnung;
-
 
75
    }
-
 
76
    \View::share( "web_rechte", $GLOBALS["web_rechte"] );
-
 
77
    if ( isset( $_SESSION["admin"]["uid"] ) )
-
 
78
    {
-
 
79
        $uId = $_SESSION["admin"]["uid"];
-
 
80
        $admin = $_SESSION["admin"]["user"]->admin;
-
 
81
        $GLOBALS["user_rechte"] = $GLOBALS["web_rechte"];
-
 
82
        if ( !$admin )
-
 
83
        {
-
 
84
            $GLOBALS["user_rechte"] = UserProperty::with( [
-
 
85
                "property",
-
 
86
                "tool",
-
 
87
                "module"
-
 
88
            ] )->where( "backend_user_id", "=", $uId )->get();
-
 
89
        }
-
 
90
        \View::share( "user_rechte", $GLOBALS["user_rechte"] );
-
 
91
    }
-
 
Zeile 92... Zeile 21...
92
 
21
 
93
    Route::get( '/login', [
22
    Route::get( '/login', [
94
        BackendController::class,
23
        BackendController::class,
95
        'create'
24
        'create'