Subversion-Projekte lars-tiefland.laravel_shop

Revision

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