403Webshell
Server IP : 202.61.199.114  /  Your IP : 216.73.217.139
Web Server : nginx/1.22.1
System : Linux de.arni-solutions.de 6.1.0-49-amd64 #1 SMP PREEMPT_DYNAMIC Debian 6.1.174-1 (2026-05-26) x86_64
User : web20 ( 1018)
PHP Version : 8.4.23
Disable Function : NONE
MySQL : OFF  |  cURL : ON  |  WGET : ON  |  Perl : ON  |  Python : OFF  |  Sudo : ON  |  Pkexec : ON
Directory :  /var/www/clients/client2/web18/web/Codiad/components/active/

Upload File :
current_dir [ Writeable ] document_root [ Writeable ]

 

Command :


[ Back ]     

Current File : /var/www/clients/client2/web18/web/Codiad/components/active/class.active.php
<?php

/*
*  Copyright (c) Codiad & Kent Safranski (codiad.com), distributed
*  as-is and without warranty under the MIT License. See
*  [root]/license.txt for more. This information must remain intact.
*/

require_once('../../common.php');

class Active extends Common
{

    //////////////////////////////////////////////////////////////////
    // PROPERTIES
    //////////////////////////////////////////////////////////////////

    public $username    = "";
    public $path        = "";
    public $new_path    = "";
    public $actives     = "";

    //////////////////////////////////////////////////////////////////
    // METHODS
    //////////////////////////////////////////////////////////////////

    // -----------------------------||----------------------------- //

    //////////////////////////////////////////////////////////////////
    // Construct
    //////////////////////////////////////////////////////////////////

    public function __construct()
    {
        $this->actives = getJSON('active.php');
    }

    //////////////////////////////////////////////////////////////////
    // List User's Active Files
    //////////////////////////////////////////////////////////////////

    public function ListActive()
    {
        $active_list = array();
        $tainted = false;
        $root = WORKSPACE;
        if ($this->actives) {
            foreach ($this->actives as $active => $data) {
                if (is_array($data) && isset($data['username']) && $data['username']==$this->username) {
                    if ($this->isAbsPath($data['path'])) {
                        $root = "";
                    } else {
                        $root = $root.'/';
                    }
                    if (file_exists($root.$data['path'])) {
                        $focused = isset($data['focused']) ? $data['focused'] : false;
                        $active_list[] = array('path'=>$data['path'], 'focused'=>$focused);
                    } else {
                        unset($this->actives[$active]);
                        $tainted = true;
                    }
                }
            }
        }
        if ($tainted) {
            saveJSON('active.php', $this->actives);
        }
        echo formatJSEND("success", $active_list);
    }

    //////////////////////////////////////////////////////////////////
    // Check File
    //////////////////////////////////////////////////////////////////

    public function Check()
    {
        $cur_users = array();
        foreach ($this->actives as $active => $data) {
            if (is_array($data) && isset($data['username']) && $data['username']!=$this->username && $data['path']==$this->path) {
                $cur_users[] = $data['username'];
            }
        }
        if (count($cur_users)!=0) {
            echo formatJSEND("error", "Warning: File ".substr($this->path, strrpos($this->path, "/")+1)." Currently Opened By: " . implode(", ", $cur_users));
        } else {
            echo formatJSEND("success");
        }
    }

    //////////////////////////////////////////////////////////////////
    // Add File
    //////////////////////////////////////////////////////////////////

    public function Add()
    {
        $process_add = true;
        foreach ($this->actives as $active => $data) {
            if (is_array($data) && isset($data['username']) && $data['username']==$this->username && $data['path']==$this->path) {
                $process_add = false;
            }
        }
        if ($process_add) {
            $this->actives[] = array("username"=>$this->username,"path"=>$this->path);
            saveJSON('active.php', $this->actives);
            echo formatJSEND("success");
        }
    }

    //////////////////////////////////////////////////////////////////
    // Rename File
    //////////////////////////////////////////////////////////////////

    public function Rename()
    {
        $revised_actives = array();
        foreach ($this->actives as $active => $data) {
            if (is_array($data) && isset($data['username'])) {
                $revised_actives[] = array("username"=>$data['username'],"path"=>str_replace($this->path, $this->new_path, $data['path']));
            }
        }
        saveJSON('active.php', $revised_actives);
        echo formatJSEND("success");
    }

    //////////////////////////////////////////////////////////////////
    // Remove File
    //////////////////////////////////////////////////////////////////

    public function Remove()
    {
        foreach ($this->actives as $active => $data) {
            if (is_array($data) && isset($data['username']) && $this->username==$data['username'] && $this->path==$data['path']) {
                unset($this->actives[$active]);
            }
        }
        saveJSON('active.php', $this->actives);
        echo formatJSEND("success");
    }
    
    //////////////////////////////////////////////////////////////////
    // Remove All Files
    //////////////////////////////////////////////////////////////////

    public function RemoveAll()
    {
        foreach ($this->actives as $active => $data) {
            if (is_array($data) && isset($data['username']) && $this->username==$data['username']) {
                unset($this->actives[$active]);
            }
        }
        saveJSON('active.php', $this->actives);
        echo formatJSEND("success");
    }
    
    //////////////////////////////////////////////////////////////////
    // Mark File As Focused
    //  All other files will be marked as non-focused.
    //////////////////////////////////////////////////////////////////

    public function MarkFileAsFocused()
    {
        foreach ($this->actives as $active => $data) {
            if (is_array($data) && isset($data['username']) && $this->username==$data['username']) {
                $this->actives[$active]['focused']=false;
                if ($this->path==$data['path']) {
                    $this->actives[$active]['focused']=true;
                }
            }
        }
        saveJSON('active.php', $this->actives);
        echo formatJSEND("success");
    }
}

Youez - 2016 - github.com/yon3zu
LinuXploit