Ӻh#ddlZddlZddlZddlmcmZddlmZddl m Z ddl m Z ddl mZmZmZmZmZmZmZddlmZddlmZmZddlmZdd lmZmZmZm Z m!Z!dd l"m#Z#dd l$m%Z%m&Z&m'Z'dd l(m)Z)m*Z*dd l+m,Z,m-Z-m.Z.dZ/hdZ0e#Z1dZ2dZ3e/fdZ4d3dZ5d4dZ6dZ7dZ8dZ9dZ:dZ; d5dZd!Z?d"Z@d#ZAeAd4d$ZBd6d%ZCd4d&ZDd7d'ZEd8d(ZFd)ZGd*ZHd+ZId,ZJd-ZKd.eLd/eMfd0ZNGd1d2e%ZOdS)9N) defaultdictwraps) format_exc)ListAnyTupleDictAnyStrOptionalUnion)urlparse)ClPwd mysql_lib)Feature) NotSupported NoPanelUser NoPackageNoDomain DuplicateData)uid_max)GeneralPanelPluginV1PHPDescriptionDomainDescription)get_domains_via_custom_binary"_docroot_under_user_via_custom_bin) run_commandfind_module_param_in_configExternalProgramFailedz/etc/psa/.psa.shadow>dnsmaillocalecploginpackageresellerPleskc@tjdS)N/usr/local/psa/version)ospathisfile|/builddir/build/BUILD/imunify360-venv-2.5.2/opt/imunify360/venv/lib/python3.11/site-packages/clcommon/cpapi/plugins/plesk.pydetectr/!s 7>>2 3 33r-ci}d|d<t|dd5}||d<dddn #1swxYwY|S)Nadminloginrutf-8encodingpass)openreadstrip) _pass_pathaccessfs r. db_accessr>%s FF7O j# 0 0 0*A))v*************** Ms*AAApsaFc .|p t}|dd}|d}|d}tj||||dd|} | 5} | ||cd d d S#1swxYwYd S) a Return the result of a Plesk database query :param query: SQL query string with possible parameters :param data: arguments for the SQL parameter insertion :param _access: database authentication data :param _dbname: the name of the database :param as_dict: controls the format of the output data :type query: str :type _access: dict :type as_dict: bool :return: Tuple of rows according to the query in the format specified by as_dict :rtype: tuple(tuple) or tuple(dict) host localhostr2r7Tutf8)rAuserpasswddb use_unicodecharsetas_dict)argsN)r>getrMySQLConnectorconnect execute_query) querydata_access_dbnamerIr<dbhostdblogindbpass connectorrFs r. query_sqlrW-s0 # F ZZ , ,FWoG F^F(f76,3v18:::I     2D11222222222222222222s&B  BBc:dtdD}|S)Ncg|] }|d Srr,).0 fetched_ones r. zcpusers..QsQQQk;q>QQQr-)r#)keylscpinfo)rQrR cpusers_lsts r.cpusersrbPs&QQV-5P5P5PQQQK r-c8d}dt|DS)Nz?SELECT clients.login FROM clients WHERE clients.type='reseller'cg|]\}|Sr,r,r[r#s r.r]zresellers..Ws 6 6 6 G 6 6 6r-rWsqls r. resellersriUs! KC 6 6y~~ 6 6 66r-cRd}tdt|DS)Nz