示例#1
0
def CheckUsername():
    utils.log('================== in CheckUsername ==================')
    user = USERNAME
    pwd  = PASSWORD

    if user != '' and pwd != '':
        return True

    dlg = utils.yesno('VPNicity requires a subscription.', '', 'Would you like to enter your account details now?')

    if dlg == 1:
        user = utils.dialogKB('', 'Enter Your VPNicity Username')
        pwd  = utils.dialogKB('', 'Enter Your VPNicity Password')
        
        ADDON.setSetting('USER', user)
        ADDON.setSetting('PASS', pwd)
        
        SetupAccount()
        
    return True
示例#2
0
def SetupAccount():
    utils.checkOS()
    os = utils.GetSetting('OS')

    if os == 'MacOS':
        utils.dialogOK('It appears you are running on Mac OS.', '', 'You may need administrator access to run VPNicity.')

        sudo = utils.dialogKB('', "Enter the 'User Account' password for your computer.")

        ADDON.setSetting('SUDO', 'true')
        ADDON.setSetting('SUDOPASS', sudo)

        utils.dialogOK('We will now finish your installation.', 'Please double check your settings after we are done.', 'Thank you!')
        xbmc.executebuiltin('XBMC.RunScript(special://home/addons/plugin.program.vpnicity/install.py)')

    if os == 'OpenELEC':
        utils.dialogOK('It appears you are running on OpenELEC.', 'We will now finish your installation.', 'Please double check your settings after we are done.')    
        xbmc.executebuiltin('XBMC.RunScript(/storage/.kodi/addons/plugin.program.vpnicity/install.py)')
        
    else:
        return