Exemplo n.º 1
0
    # Delete the user key and cert files
    elif action == "user":
        if addon.getSetting("1_vpn_validated") == "" or xbmcgui.Dialog().yesno(
                addon_name,
                "Deleting key and certificate files will disconnect and reset all VPN connections. Connections must be re-validated before use. Continue?"
        ):

            # Disconnect so that live files are not being modified
            if isVPNConnected(): resetVPNConnections(addon)

            # Select the provider
            provider_list = []
            for provider in providers:
                if usesUserKeys(provider):
                    provider_list.append(getVPNDisplay(provider))
            provider_list.sort()
            index = xbmcgui.Dialog().select("Select VPN provider",
                                            provider_list)
            provider_display = provider_list[index]
            provider = getVPNLocation(provider_display)
            # Get the key/cert pairs for that provider and offer up for deletion
            user_keys = getUserKeys(provider)
            user_certs = getUserCerts(provider)
            if len(user_keys) > 0 or len(user_certs) > 0:
                still_deleting = True
                while still_deleting:
                    if len(user_keys) > 0 or len(user_certs) > 0:

                        # Build a list of things to display.  We should always have pairs, but if
                        # something didn't copy or the user has messed with the dir this will cope
Exemplo n.º 2
0
        errorTrace("managefiles.py", dialog_message + " " + log_path + ", " + dest_path)
    xbmcgui.Dialog().ok("Log Copy", dialog_message)


# Delete the user key and cert files        
elif action == "user":
    if addon.getSetting("1_vpn_validated") == "" or xbmcgui.Dialog().yesno(addon_name, "Deleting key and certificate files will reset all VPN connections.  Connections must be re-validated before use.\nContinue?"):

        # Reset the connection before we do anything else
        if isVPNConnected(): resetVPNConnections(addon)
    
        # Select the provider
        provider_list = []
        for provider in providers:
            if usesUserKeys(provider):
                provider_list.append(getVPNDisplay(provider))
        provider_list.sort()
        index = xbmcgui.Dialog().select("Select VPN provider", provider_list)
        provider_display = provider_list[index]
        provider = getVPNLocation(provider_display)
        # Get the key/cert pairs for that provider and offer up for deletion
        user_keys = getUserKeys(provider)
        user_certs = getUserCerts(provider)
        if len(user_keys) > 0 or len(user_certs) > 0:
            still_deleting = True
            while still_deleting:
                if len(user_keys) > 0 or len(user_certs) > 0:
                
                    # Build a list of things to display.  We should always have pairs, but if
                    # something didn't copy or the user has messed with the dir this will cope
                    all_user = []