}Ce<ddlmZddlmZddlmZddlZddlZddlZddlmZddl m Z ddl m Z ddl mZdd lmZd Zejd Zd Zd ZefdZdZddZdZGddeZdS))absolute_import)division)print_functionN)Dict NotSupported)_dblogin_cplogin_pairs)Feature)GeneralPanelPluginV1 InterWorxz(.+)://(.+):(.+)@.*z/usr/local/interworx/iworx.inicJtjtSN)ospathisfile IWORX_INI/builddir/build/BUILDROOT/alt-python27-cllib-3.3.7-2.el7.cloudlinux.x86_64/opt/cloudlinux/venv/lib/python3.11/site-packages/clcommon/cpapi/plugins/interworx.pydetectrs 7>>) $ $$rct}tjd}|||ddd}t |}d\}}}|r|dd d \}}}||d <||d <|dd d|d<||d<|S)NF)strictmysqlrootdsn)sectionoption")NNNloginpassdefault_serverhostdb) dict configparser ConfigParserreadgetstripPARSE_URI_PATTERNsearchgroup) _conf_pathaccess data_config mysql_uri parse_resultr%r!passwds r db_accessr5 s VVF+5999KZ    BBHHNNI$++I66L,R:*00Aq99UFF7OF6N __W=M_NNTTUYZZF6NF4L Mrc*tdddid)Nz&%(action)s is not currently supported.actionz1Getting all users registered in the Control Panel)messagecontextrrrrcpusersr:1s* ;QR  rFcDt}t||}|S)N) cplogin_lstr0)r5r )r<with_system_usersr0datas rdblogin_cplogin_pairsr?8s" [[F !k& I I ID Krc.d|S)Nzhttps://{domain}:2443domain)formatrAs rget_user_login_urlrD>s " ) ) ) 8 88rcreZdZfdZdZdZdZedZdZ dZ de e e fffd ZxZS) PanelPlugincVtt|dSr)superrF__init__)self __class__s rrIzPanelPlugin.__init__Cs% k4  ))+++++rctS)z4 Return panel name :return: ) __cpname__rJs r getCPNamezPanelPlugin.getCPNameFs rc ttd}|}|t|dddddddddd d d S#Yd SxYw) z Retrieve panel name and it's version :return: dict: { 'name': 'panel_name', 'version': 'panel_version', 'additional_info': 'add_info'} or None if can't get info rversion =r[rN)namerRadditional_info)openrr)closerMsplitreplace)rJfouts rget_cp_descriptionzPanelPlugin.get_cp_descriptionMs  Y$$A&&((C GGIII&"yy33A6>>tRHHPPQTVXYYaabegijjppqtuuvwx'+-- - 44s B5B88B=ctS)z Getting root access to mysql database. For example {'login': 'root', 'db': 'mysql', 'host': 'localhost', 'pass': '9pJUv38sAqqW'} :return: root access to mysql database :rtype: dict :raises: NoDBAccessData )r5rNs rr5zPanelPlugin.db_access]s{{rcgS)z Return aliases from user domain :param str|unicode cpuser: user login :param str|unicode domain: :return list of aliases r)cpuserrBs r useraliaseszPanelPlugin.useraliaseshs  rctS)z Generates a list of cpusers registered in the control panel :return: list of cpusers registered in the control panel :rtype: tuple )r:rNs rr:zPanelPlugin.cpusersrsyyrc t|S)z` Get login url for current panel; :type domain: str :rtype: str )rD)rJrBs rrDzPanelPlugin.get_user_login_url{s "&)))rreturnc6tt|}i|tjdtjdtjdtjdtjdtj dtj dtj dtj di S)NTF) rHrFget_supported_cl_featuresr PHP_SELECTOR RUBY_SELECTORPYTHON_SELECTORNODEJS_SELECTORLSAPIGOVERNORCAGEFSRESELLER_LIMITSWPOS)rJsupported_featuresrKs rriz%PanelPlugin.get_supported_cl_featuress";55OOQQ      $  !5  #U  #U M4  d ND  #U L%   r)__name__ __module__ __qualname__rIrOr`r5 staticmethodrdr:rDrstrboolri __classcell__)rKs@rrFrFBs,,,,,   \***  4T ?           rrF)NF) __future__rrrrr'retypingrclcommon.cpapi.cpapiexceptionsr clcommon.cpapi.plugins.universalr clcommon.constr clcommon.cpapi.GeneralPanelr rMcompiler,rrr5r:r?rDrFrrrrso'&&&&&%%%%%%  777777CCCCCC""""""<<<<<< BJ566 - %%%#" 999N N N N N &N N N N N r