w7O*\d D d Z ddlZddlZddlmZmZ G d d ZdS )u
This program is free software: you can redistribute it and/or modify it under
the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License,
or (at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
See the GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program. If not, see .
Copyright © 2019 Cloud Linux Software Inc.
This software is also available under ImunifyAV commercial license,
see
N)PIPEcheck_outputc e Zd ZdZdZdZed
dedefd Zed Z ed Z
ed
Zed ZdS )PleskSdkzPHP wrapper for Plesk SDK)pleskphpz-rzf
require_once("sdk.php");
pm_Context::init("revisium-antivirus");
{};
Tr returnc | j | }d t dd | D }|rt
j dd| }|S )zW
Append a piece of code to the header and make it a single-line string
Nc 3 > K | ]}| V d S )N)strip).0lines S/opt/imunify360/venv/lib/python3.11/site-packages/imav/migration_utils/plesk_sdk.py z!PleskSdk._join../ s* !M!M4$**,,!M!M!M!M!M!M z(\W)\s+|\s+(\W)z\1\2)_phpformatr
joinfilter
splitlinesresub)clsr strip_whitespacescoders r _joinzPleskSdk._join) st
xsyy{{++GGF4!M!M4??;L;L!M!M!MNNOO 7)7A66Ar c r g | j | | |R }t |t d S )NT)stderrtext)_cmdr r r )r r argscmds r execz
PleskSdk.exec4 s: 00#))C..0400C48888r c , | d S )Nzecho pm_Context::getVarDir())r% )r s r context__get_var_dirzPleskSdk.context__get_var_dir9 s xx6777r c T | d|t j | S )Nz)echo pm_Settings::get($argv[1], $argv[2]))r% jsondumps)r keydefaults r
settings__getzPleskSdk.settings__get= s+ xx7Jw
r c ` d}t j | | }|r|ni S )Na
echo json_encode(
array_map(
function ($domain) {
$props = [
"id" => ["getId", []],
"name" => ["getName", []],
"document_root" => ["getDocumentRoot", []],
"owner" => ["getSysUserLogin", []],
"imav_cleanup_allowed" => ["hasPermission", ["ra_cleanup_allowed"]],
];
$result = (object)[];
foreach ($props as $property => [$method, $args]) {
try {
$result->{$property} = call_user_func_array([$domain, $method], $args);
} catch (Throwable $ignored) {}
}
return $result;
},
pm_Domain::getAllDomains()
)
);
)r) loadsr% )r r domainss r domain__get_all_domainsz PleskSdk.domain__get_all_domainsE s5 . *SXXc]]++ ")wwr)r N)T)
__name__
__module____qualname____doc__r" r classmethodstrr r% r' r- r1 r r r r s ##D
D [ 9 9 [9 8 8 [8
[
* * [* * *r r )r5 r) r
subprocessr r r r8 r r r: sw * ) ) ) ) ) ) ) )F* F* F* F* F* F* F* F* F* F*r