HEX
Server: Apache/2.4.52 (Ubuntu)
System: Linux mail.btech-izolacje.pl 5.15.0-140-generic #150-Ubuntu SMP Sat Apr 12 06:00:09 UTC 2025 x86_64
User: pewna6876 (1017)
PHP: 8.2.28
Disabled: NONE
Upload Files
File: //usr/local/CyberCP/pluginHolder/views.py
# -*- coding: utf-8 -*-
from django.shortcuts import render
from plogical.mailUtilities import mailUtilities
import os
from xml.etree import ElementTree
from plogical.httpProc import httpProc

def installed(request):
    mailUtilities.checkHome()
    pluginPath = '/home/cyberpanel/plugins'
    pluginList = []

    if os.path.exists(pluginPath):
        for plugin in os.listdir(pluginPath):
            data = {}
            completePath = '/usr/local/CyberCP/' + plugin + '/meta.xml'
            pluginMetaData = ElementTree.parse(completePath)

            data['name'] = pluginMetaData.find('name').text
            data['type'] = pluginMetaData.find('type').text
            data['desc'] = pluginMetaData.find('description').text
            data['version'] = pluginMetaData.find('version').text

            pluginList.append(data)

    proc = httpProc(request, 'pluginHolder/plugins.html',
                    {'plugins': pluginList}, 'admin')
    return proc.render()