Subversion-Projekte lars-tiefland.laravel_shop

Revision

Revision 1106 | Revision 1108 | 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;
26
        $GLOBALS["web_rechte"][$module->nume][$tool->button_name][$property->interner_name] = $property->Bezeichnung;
1081 lars 27
    }
1088 lars 28
    \View::share( "web_rechte", $GLOBALS["web_rechte"] );
1107 lars 29
    $uId = Auth::guard( 'admin' )->id();
30
    $admin = Auth::guard( "admin" )->user()->admin;
1106 lars 31
    $user_rechte = $GLOBALS["web_rechte"];
32
    if ( !$admin )
33
    {
34
        $user_rechte = UserProperty::with( [ "property", "tool", "module" ] )->where( "backend_user_id", "=", $uId )->get();
35
    }
36
    \View::share( "user_rechte", $this->getUserRechte() );
1081 lars 37
    //dump( $web_rechte );
1071 lars 38
 
980 lars 39
    $_SESSION["jquery_js"] = "/js/jquery-1.7.2.min.js";
40
    $_SESSION["jquery_ui_js"] = "/js/jquery-ui-1.8.23.custom.min.js";
41
    $_SESSION["jquery_style"] = "/css/start/jquery-ui.custom.css";
42
 
43
    $_SESSION["jquery_new"] = "/css/start_new/jquery.min.js";
44
    $_SESSION["jquery_ui_new"] = "/css/start_new/jquery-ui.min.js";
45
    $_SESSION["jquery_style_new"] = "/css/start_new/jquery-ui.custom.css";
46
 
47
    $_SESSION["loadingGif"] = "/images/navigation/loading.gif";
48
 
49
    /*if ( file_exists( $_SERVER["DOCUMENT_ROOT"] . "/css/" . $site . "/jquery-ui.custom.css" ) )
50
    {
51
        $_SESSION["jquery_style"] = "/css/" . $site . "/jquery-ui.custom.css";
52
    }
53
 
54
    if ( file_exists( $_SERVER["DOCUMENT_ROOT"] . "/css/" . $site . "/images/loading.gif" ) )
55
    {
56
        $_SESSION["loadingGif"] = "/css/" . $site . "/images/loading.gif";
57
    }
58
 
59
    if ( file_Exists( $_SERVER["DOCUMENT_ROOT"] . "/css/" . $site . "_new/jquery.min.js" ) )
60
    {
61
        $_SESSION["jquery_new"] = "/css/" . $site . "_new/jquery.min.js";
62
        $_SESSION["jquery_ui_new"] = "/css/" . $site . "_new/jquery-ui.min.js";
63
        $_SESSION["jquery_style_new"] = "/css/" . $site . "_new/jquery-ui.custom.css";
64
    }
65
    if ( file_exists( $_SERVER["DOCUMENT_ROOT"] . "/css/" . $site . "_new/images/loading.gif" ) )
66
    {
67
        $_SESSION["loadingGif"] = "/css/" . $site . "_new/images/loading.gif";
68
    }*/
69
 
1070 lars 70
    Route::get( '/admin/login', [ BackendController::class, 'create' ] )->name( 'login' );
992 lars 71
    Route::post( '/admin/login', [ BackendController::class, 'store' ] );
1067 lars 72
    Route::prefix( 'admin' )->middleware( 'auth:admin' )->group( function ()
964 lars 73
    {
1027 lars 74
        Route::get( '/logout', [ BackendController::class, 'destroy' ] )->name( 'logout' );
1041 lars 75
        Route::view( "/index", "admin/index" );
965 lars 76
    } );