曾与蒿藜同雨露,한때 잡초와 쑥과 함께 비와 이슬을 나누던 곳이 이제는 소나무와 삼나무와 함께 서리와 눈을 견뎌내고 있다.终随松柏到冰霜.かつては雑草やヨモギと共に雨や露を分かち合っていたが、今では松やヒノキと共に霜や雪に耐えている。曾与蒿藜同雨露,Once sharing rain and dew with weeds and wormwood, now enduring frost and snow with pines and cypresses.终随松柏到冰霜.曾与蒿藜同雨露한때 잡초와 쑥과 함께 비와 이슬을 나누던 곳이 이제는 소나무와 삼나무와 함께 서리와 눈을 견뎌내고 있다.,终随松柏到冰霜.譖セ荳手珍阯懷酔髮ィ髴イ�檎サ磯囂譚セ譟丞芦蜀ー髴�曾与蒿藜同雨露,鏇句笌钂胯棞鍚岄洦闇诧紝缁堥殢鏉炬煆鍒板啺闇�终随松柏到冰霜.曾与蒿藜同雨露,한때 잡초와 쑥과 함께 비와 이슬을 나누던 곳이 이제는 소나무와 삼나무와 함께 서리와 눈을 견뎌내고 있다.终随松柏到冰霜.曾与蒿藜同雨露,终随松柏到冰霜. rahbord-ins.ir - GrazzMean-Shell
Uname: Linux server18.dn-server.com 3.10.0-962.3.2.lve1.5.88.el7.x86_64 #1 SMP Fri Sep 26 14:06:42 UTC 2025 x86_64
Software: LiteSpeed
PHP version: 7.4.33 [ PHP INFO ] PHP os: Linux
Server Ip: 185.126.202.122
Your Ip: 216.73.216.193
User: rahbordf (4876) | Group: rahbordf (4881)
Safe Mode: OFF
Disable Function:
show_source, system, shell_exec, passthru, exec, popen, proc_open

name : plesk.py
#!/usr/bin/python
# -*- coding: utf-8 -*-
import os

try:
    import MySQLdb
except ImportError:
    MySQLdb = None

from clcommon.cpapi.cpapiexceptions import NotSupported, NoPackage
from clcommon import ClPwd


PSA_SHADOW_PATH = "/etc/psa/.psa.shadow"


__cpname__ = 'Plesk'


def detect():
    return os.path.isfile('/usr/local/psa/version')


def db_access(_pass_path=PSA_SHADOW_PATH):
    access = dict()
    access['login'] = 'admin'
    f = open(_pass_path)
    access['pass'] = f.read().strip()
    f.close()
    return access


def cpusers(_accsess=None, _dbname='psa'):
    if not MySQLdb:
        raise NoPackage('Can not connect to database; MySQL-python package not installed.')
    access = _accsess or db_access()
    dbhost = access.get('host', 'localhost')
    dblogin = access['login']
    dbpass = access['pass']
    db = MySQLdb.connect(host=dbhost, user=dblogin, passwd=dbpass, db=_dbname)
    cursor = db.cursor()
    sql = r"SELECT login FROM sys_users"
    cursor.execute(sql)
    cpusers_lst = [fetched_one[0] for fetched_one in cursor.fetchall()]
    db.close()
    return cpusers_lst


def dblogin_cplogin_pairs(cplogin_lst=None, with_system_users=False):
    raise NotSupported('Getting binding credentials in the database to the user name in the system is not currently '
                       'supported. Is under development.')

def homedirs(_sysusers=None, _cpusers=None):
    """
    Detects and returns list of folders contained the home dirs of users of the DirectAdmin

    :param str|None _sysusers: for testing
    :param str|None _path: for testing
    :return: list of folders, which are parent of home dirs of users of the panel
    """

    homedirs = []

    if _cpusers is None:
        try:
            results = cpusers()
        except NoPackage:
            results = None
    else:
        results = _cpusers

    users = []
    if results is not None:
        users = [line.encode('utf8') for line in results]

    # Plesk assumes MIN_UID as 10000
    clpwd = ClPwd(10000)
    users_dict = clpwd.get_user_dict()

    # for testing only
    if isinstance(_sysusers, (list, tuple)):
        class pw(object):
            def __init__(self, name, dir):
                self.pw_name = name
                self.pw_dir = dir

        users_dict = {}
        for (name,dir) in _sysusers:
            users_dict[name] = pw(name, dir)

    for user_name in users_dict:
        if len(users) and user_name not in users:
            continue
        homedir = os.path.dirname(users_dict[user_name].pw_dir)
        if homedir not in homedirs:
            homedirs.append(homedir)

    return homedirs

© 2026 GrazzMean-Shell