j ddlZddlZddlZddlmZddlmZddlmZddl m Z ddl m Z dZ ejdZd Zd Zefd Zd ZddZdZGddeZdS)N)Dict NotSupported)GeneralPanelPluginV1)_dblogin_cplogin_pairs)Feature InterWorxz(.+)://(.+):(.+)@.*z/usr/local/interworx/iworx.inicJtjtSN)ospathisfile IWORX_INI/builddir/build/BUILDROOT/alt-python27-cllib-3.4.36-1.el9.cloudlinux.x86_64/opt/cloudlinux/venv/lib/python3.11/site-packages/clcommon/cpapi/plugins/interworx.pydetectrs 7>>) $ $$rci}tjd}|||ddd}t |}d\}}}|r|dd d \}}}||d <||d <|dd d|d<||d<|S)NF)strictmysqlrootdsn)sectionoption")NNNloginpassdefault_serverhostdb) configparser ConfigParserreadgetstripPARSE_URI_PATTERNsearchgroup) _conf_pathaccess data_config mysql_uri parse_resultr"rpasswds r db_accessr1s F+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)messagecontextrrrrcpusersr6-s* ;QR  rFcDt}t||}|S)N) cplogin_lstr,)r1r)r8with_system_usersr,datas rdblogin_cplogin_pairsr;4s" [[F !k& I I ID Krcd|dS)Nzhttps://z:2443r)domains rget_user_login_urlr>:s #f # # ##rcjeZdZfdZdZdZdZedZdZ dZ de e fd Z xZS) PanelPlugincHtdSr )super__init__)self __class__s rrCzPanelPlugin.__init__?s rctS)z4 Return panel name :return: ) __cpname__rDs r getCPNamezPanelPlugin.getCPNameBs rc ttdd5}|}dddn #1swxYwY|ddddd dd dd d }t |dd S#t $rYdSwxYw)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 rzutf-8)encodingNversion =r[r)namerMadditional_info)openrr%splitreplacerG Exception)rDfoutrMs rget_cp_descriptionzPanelPlugin.get_cp_descriptionIs iw777 1ffhh               ii **1-55dB??GGRPPXXY\^`aagghkllmnoG&&'+-- -   44 s/C: C>C>A=C C CctS)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 )r1rHs rr1zPanelPlugin.db_accessZs{{rcgS)z Return aliases from user domain :param str|unicode cpuser: user login :param str|unicode domain: :return list of aliases r)cpuserr=s r useraliaseszPanelPlugin.useraliaseses  rctS)z Generates a list of cpusers registered in the control panel :return: list of cpusers registered in the control panel :rtype: tuple )r6rHs rr6zPanelPlugin.cpusersosyyrc t|S)z` Get login url for current panel; :type domain: str :rtype: str )r>)rDr=s rr>zPanelPlugin.get_user_login_urlxs "&)))rreturncttjtjtjtjtjgSr )r RUBY_SELECTORPYTHON_SELECTORNODEJS_SELECTORRESELLER_LIMITSWPOSrHs rget_unsupported_cl_featuresz'PanelPlugin.get_unsupported_cl_featuress)  !  #  #  # L   r)__name__ __module__ __qualname__rCrIr[r1 staticmethodr_r6r>listrri __classcell__)rEs@rr@r@>s"   \*** T']        rr@)NF)r#r retypingrclcommon.cpapi.cpapiexceptionsrclcommon.cpapi.GeneralPanelr clcommon.cpapi.plugins.universalrclcommon.featuresrrGcompiler(rrr1r6r;r>r@rrrrws7 777777<<<<<<CCCCCC%%%%%%  BJ566 - %%%#" $$$I I I I I &I I I I I r