Subversion-Projekte lars-tiefland.laravel_shop

Revision

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