!C99Shell v. 2.5 [PHP 8 Update] [24.05.2025]!

Software: Apache. PHP/8.1.30 

uname -a: Linux server1.tuhinhossain.com 5.15.0-151-generic #161-Ubuntu SMP Tue Jul 22 14:25:40 UTC
2025 x86_64
 

uid=1002(picotech) gid=1003(picotech) groups=1003(picotech),0(root)  

Safe-mode: OFF (not secure)

/home/picotech/domains/smabpro.picotech.app/public_html/app/Http/Controllers/   drwxr-xr-x
Free 28.6 GB of 117.98 GB (24.24%)
Home    Back    Forward    UPDIR    Refresh    Search    Buffer    Encoder    Tools    Proc.    FTP brute    Sec.    SQL    PHP-code    Update    Self remove    Logout    


Viewing file:     LabelController.php (6.77 KB)      -rw-r--r--
Select action/file-type:
(+) | (+) | (+) | Code (+) | Session (+) | (+) | SDB (+) | (+) | (+) | (+) | (+) | (+) |
<?php

namespace App\Http\Controllers;

use 
App\Models\Label;
use 
App\Models\Pipeline;
use 
Illuminate\Http\Request;

class 
LabelController extends Controller
{
    public function 
__construct()
    {
        
$this->middleware(
            [
                
'auth',
                
'XSS',
            ]
        );
    }

    
/**
     * Display a listing of the relabel.
     *
     * @return \Illuminate\Http\Response
     */
    
public function index()
    {
        if(
\Auth::user()->can('manage label'))
        {
            
$labels   Label::select('labels.*''pipelines.name as pipeline')->join('pipelines''pipelines.id''=''labels.pipeline_id')->where('pipelines.created_by''='\Auth::user()->ownerId())->where('labels.created_by''='\Auth::user()->ownerId())->orderBy('labels.pipeline_id')->get();
            
$label Label::where('created_by',\Auth::user()->ownerId())->get();
            
$pipelines = [];

            foreach(
$labels as $label)
            {
                if(!
array_key_exists($label->pipeline_id$pipelines))
                {
                    
$pipelines[$label->pipeline_id]           = [];
                    
$pipelines[$label->pipeline_id]['name']   = $label['pipeline'];
                    
$pipelines[$label->pipeline_id]['labels'] = [];
                }
                
$pipelines[$label->pipeline_id]['labels'][] = $label;
            }

            return 
view('labels.index')->with('pipelines'$pipelines);
        }
        else
        {
            return 
redirect()->back()->with('error'__('Permission Denied.'));
        }
    }

    
/**
     * Show the form for creating a new relabel.
     *
     * @return \Illuminate\Http\Response
     */
    
public function create()
    {
        if(
\Auth::user()->can('create label'))
        {
            
$pipelines Pipeline::where('created_by''='\Auth::user()->ownerId())->get()->pluck('name''id');
            
$colors Label::$colors;

            return 
view('labels.create')->with('pipelines'$pipelines)->with('colors'$colors);
        }
        else
        {
            return 
response()->json(['error' => __('Permission Denied.')], 401);
        }
    }

    
/**
     * Store a newly created relabel in storage.
     *
     * @param \Illuminate\Http\Request $request
     *
     * @return \Illuminate\Http\Response
     */
    
public function store(Request $request)
    {
        if(
\Auth::user()->can('create label'))
        {

            
$validator \Validator::make(
                
$request->all(), [
                                   
'name' => 'required|max:20',
                                   
'pipeline_id' => 'required',
                                   
'color' => 'required',
                               ]
            );

            if(
$validator->fails())
            {
                
$messages $validator->getMessageBag();

                return 
redirect()->route('labels.index')->with('error'$messages->first());
            }

            
$label              = new Label();
            
$label->name        $request->name;
            
$label->color       $request->color;
            
$label->pipeline_id $request->pipeline_id;
            
$label->created_by  \Auth::user()->ownerId();
            
$label->save();

            return 
redirect()->route('labels.index')->with('success'__('Label successfully created!'));
        }
        else
        {
            return 
redirect()->back()->with('error'__('Permission Denied.'));
        }
    }

    
/**
     * Display the specified relabel.
     *
     * @param \App\Label $label
     *
     * @return \Illuminate\Http\Response
     */
    
public function show(Label $label)
    {
        return 
redirect()->route('labels.index');
    }

    
/**
     * Show the form for editing the specified relabel.
     *
     * @param \App\Label $label
     *
     * @return \Illuminate\Http\Response
     */
    
public function edit(Label $label)
    {
        if(
\Auth::user()->can('edit label'))
        {
            if(
$label->created_by == \Auth::user()->ownerId())
            {
                
$pipelines Pipeline::where('created_by''='\Auth::user()->ownerId())->get()->pluck('name''id');
                
$colors    Label::$colors;

                return 
view('labels.edit'compact('label''pipelines''colors'));
            }
            else
            {
                return 
response()->json(['error' => __('Permission Denied.')], 401);
            }
        }
        else
        {
            return 
response()->json(['error' => __('Permission Denied.')], 401);
        }
    }

    
/**
     * Update the specified relabel in storage.
     *
     * @param \Illuminate\Http\Request $request
     * @param \App\Label $label
     *
     * @return \Illuminate\Http\Response
     */
    
public function update(Request $requestLabel $label)
    {
        if(
\Auth::user()->can('edit label'))
        {

            if(
$label->created_by == \Auth::user()->ownerId())
            {

                
$validator \Validator::make(
                    
$request->all(), [
                                       
'name' => 'required|max:20',
                                       
'pipeline_id' => 'required',
                                       
'color' => 'required',
                                   ]
                );

                if(
$validator->fails())
                {
                    
$messages $validator->getMessageBag();

                    return 
redirect()->route('users')->with('error'$messages->first());
                }

                
$label->name        $request->name;
                
$label->color       $request->color;
                
$label->pipeline_id $request->pipeline_id;
                
$label->save();

                return 
redirect()->route('labels.index')->with('success'__('Label successfully updated!'));
            }
            else
            {
                return 
redirect()->back()->with('error'__('Permission Denied.'));
            }
        }
        else
        {
            return 
redirect()->back()->with('error'__('Permission Denied.'));
        }
    }

    
/**
     * Remove the specified relabel from storage.
     *
     * @param \App\Label $label
     *
     * @return \Illuminate\Http\Response
     */
    
public function destroy(Label $label)
    {
        if(
\Auth::user()->can('delete label'))
        {
            if(
$label->created_by == \Auth::user()->ownerId())
            {
                
$label->delete();

                return 
redirect()->route('labels.index')->with('success'__('Label successfully deleted!'));
            }
            else
            {
                return 
redirect()->back()->with('error'__('Permission Denied.'));
            }
        }
        else
        {
            return 
redirect()->back()->with('error'__('Permission Denied.'));
        }
    }
}

:: Command execute ::

Enter:
 
Select:
 

:: Search ::
  - regexp 

:: Upload ::
 
[ ok ]

:: Make Dir ::
 
[ ok ]
:: Make File ::
 
[ ok ]

:: Go Dir ::
 
:: Go File ::
 

--[ c99shell v. 2.5 [PHP 8 Update] [24.05.2025] | Generation time: 0.0036 ]--