Subversion-Projekte lars-tiefland.laravel_shop

Revision

Revision 1117 | Revision 1122 | Zur aktuellen Revision | Details | Vergleich mit vorheriger | Letzte Änderung | Log anzeigen | RSS feed

Revision Autor Zeilennr. Zeile
964 lars 1
<?php
2
 
992 lars 3
    use App\Http\Controllers\BackendController;
1118 lars 4
    use App\Http\Controllers\ToolboxController;
1093 lars 5
    use App\Models\Module;
1106 lars 6
    use App\Models\UserProperty;
1071 lars 7
    use App\Models\Web;
1076 lars 8
    use App\Models\WebProperty;
1107 lars 9
    use Illuminate\Support\Facades\Auth;
964 lars 10
    use Illuminate\Support\Facades\Route;
11
 
1068 lars 12
    /*$bc = new BackendController();
1061 lars 13
    $user_rechte = $bc->getUserRechte();
1068 lars 14
    \View::share( "user_rechte", $user_rechte );*/
1061 lars 15
 
1071 lars 16
    $w = new Web();
17
    $GLOBALS["web"] = $w->where( "domain", "=", env( 'shop' ) )->first();
18
    \View::share( "web", $GLOBALS["web"] );
1100 lars 19
    $webRechte = WebProperty::with( [ "property", "property.tool", "property.tool.module" ] )->where( "web_id", "=", $GLOBALS["web"]->ID )->get();
1107 lars 20
    $navi = Module::with( 'tool' )->orderBy( 'modules.rang' )->get();
1092 lars 21
    \View::share( "navi", $navi );
1087 lars 22
    foreach ( $webRechte as $web_recht )
1081 lars 23
    {
1087 lars 24
        $property = $web_recht->property;
25
        $tool = $property->tool;
26
        $module = $tool->module;
1113 lars 27
        $GLOBALS["web_rechte"][$module->interner_name][$tool->button_name][$property->interner_name] = $web_recht->Bezeichnung;
1081 lars 28
    }
1088 lars 29
    \View::share( "web_rechte", $GLOBALS["web_rechte"] );
1110 lars 30
    if ( isset( $_SESSION["admin"]["uid"] ) )
1106 lars 31
    {
1110 lars 32
        $uId = $_SESSION["admin"]["uid"];
1108 lars 33
        $admin = $_SESSION["admin"]["user"]->admin;
34
        $user_rechte = $GLOBALS["web_rechte"];
35
        if ( !$admin )
36
        {
37
            $user_rechte = UserProperty::with( [ "property", "tool", "module" ] )->where( "backend_user_id", "=", $uId )->get();
38
        }
1109 lars 39
        \View::share( "user_rechte", $user_rechte );
1106 lars 40
    }
1081 lars 41
    //dump( $web_rechte );
1071 lars 42
 
980 lars 43
    $_SESSION["jquery_js"] = "/js/jquery-1.7.2.min.js";
44
    $_SESSION["jquery_ui_js"] = "/js/jquery-ui-1.8.23.custom.min.js";
45
    $_SESSION["jquery_style"] = "/css/start/jquery-ui.custom.css";
46
 
47
    $_SESSION["jquery_new"] = "/css/start_new/jquery.min.js";
48
    $_SESSION["jquery_ui_new"] = "/css/start_new/jquery-ui.min.js";
49
    $_SESSION["jquery_style_new"] = "/css/start_new/jquery-ui.custom.css";
50
 
51
    $_SESSION["loadingGif"] = "/images/navigation/loading.gif";
52
 
53
    /*if ( file_exists( $_SERVER["DOCUMENT_ROOT"] . "/css/" . $site . "/jquery-ui.custom.css" ) )
54
    {
55
        $_SESSION["jquery_style"] = "/css/" . $site . "/jquery-ui.custom.css";
56
    }
57
 
58
    if ( file_exists( $_SERVER["DOCUMENT_ROOT"] . "/css/" . $site . "/images/loading.gif" ) )
59
    {
60
        $_SESSION["loadingGif"] = "/css/" . $site . "/images/loading.gif";
61
    }
62
 
63
    if ( file_Exists( $_SERVER["DOCUMENT_ROOT"] . "/css/" . $site . "_new/jquery.min.js" ) )
64
    {
65
        $_SESSION["jquery_new"] = "/css/" . $site . "_new/jquery.min.js";
66
        $_SESSION["jquery_ui_new"] = "/css/" . $site . "_new/jquery-ui.min.js";
67
        $_SESSION["jquery_style_new"] = "/css/" . $site . "_new/jquery-ui.custom.css";
68
    }
69
    if ( file_exists( $_SERVER["DOCUMENT_ROOT"] . "/css/" . $site . "_new/images/loading.gif" ) )
70
    {
71
        $_SESSION["loadingGif"] = "/css/" . $site . "_new/images/loading.gif";
72
    }*/
73
 
1070 lars 74
    Route::get( '/admin/login', [ BackendController::class, 'create' ] )->name( 'login' );
992 lars 75
    Route::post( '/admin/login', [ BackendController::class, 'store' ] );
1067 lars 76
    Route::prefix( 'admin' )->middleware( 'auth:admin' )->group( function ()
964 lars 77
    {
1027 lars 78
        Route::get( '/logout', [ BackendController::class, 'destroy' ] )->name( 'logout' );
1117 lars 79
        Route::prefix( "/toolbox" )->group( function ()
80
        {
81
            Route::get( "/", [ ToolboxController::class, "create" ] );
82
        } );
1041 lars 83
        Route::view( "/index", "admin/index" );
965 lars 84
    } );