ӺhddlZddlZddlZddlmZddlmZddlmZddl m Z ddl m Z dZ ejdZd Zd Zefd Zd ZddZdZGdde ZdS)N)Dict NotSupported)_dblogin_cplogin_pairs)Feature)GeneralPanelPluginV1 InterWorxz(.+)://(.+):(.+)@.*z/usr/local/interworx/iworx.inicJtjtSN)ospathisfile IWORX_INI/builddir/build/BUILD/imunify360-venv-2.5.2/opt/imunify360/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;5s" [[F !k& I I ID Krcd|dS)Nzhttps://z:2443r)domains rget_user_login_urlr>;s #f # # ##rcneZdZfdZdZdZdZedZdZ dZ de e d ffd Z xZS) PanelPlugincHtdSr )super__init__)self __class__s rrCzPanelPlugin.__init__@s rctS)z4 Return panel name :return: ) __cpname__rDs r getCPNamezPanelPlugin.getCPNameCs 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_descriptionJs 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_access[s{{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.useraliasesfs  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.cpuserspsyyrc t|S)z` Get login url for current panel; :type domain: str :rtype: str )r>)rDr=s rr>zPanelPlugin.get_user_login_urlys "&)))rreturn.cttjtjtjtjtjfSr )r RUBY_SELECTORPYTHON_SELECTORNODEJS_SELECTORRESELLER_LIMITSWPOSrHs rget_unsupported_cl_featuresz'PanelPlugin.get_unsupported_cl_featuress)  !  #  #  # L   r)__name__ __module__ __qualname__rCrIr[r1 staticmethodr_r6r>tuplerri __classcell__)rEs@rr@r@?s"   \*** U7C<-@        rr@)NF)r r#retypingrclcommon.cpapi.cpapiexceptionsr clcommon.cpapi.plugins.universalrclcommon.featuresrclcommon.cpapi.GeneralPanelrrGcompiler(rrr1r6r;r>r@rrrrws9  777777CCCCCC%%%%%%<<<<<< BJ566 - %%%#" $$$I I I I I &I I I I I r