summaryrefslogtreecommitdiffstats
path: root/module/plugins/accounts/RPNetBiz.py
diff options
context:
space:
mode:
Diffstat (limited to 'module/plugins/accounts/RPNetBiz.py')
-rw-r--r--module/plugins/accounts/RPNetBiz.py27
1 files changed, 21 insertions, 6 deletions
diff --git a/module/plugins/accounts/RPNetBiz.py b/module/plugins/accounts/RPNetBiz.py
index f973ea4cd..2d2a7fba0 100644
--- a/module/plugins/accounts/RPNetBiz.py
+++ b/module/plugins/accounts/RPNetBiz.py
@@ -7,7 +7,7 @@ from module.common.json_layer import json_loads
class RPNetBiz(Account):
__name__ = "RPNetBiz"
__type__ = "account"
- __version__ = "0.16"
+ __version__ = "0.17"
__status__ = "testing"
__description__ = """RPNet.biz account plugin"""
@@ -15,9 +15,24 @@ class RPNetBiz(Account):
__authors__ = [("Dman", "dmanugm@gmail.com")]
- def grab_info(self, user, password, data, req):
+ def grab_hosters(self, user, password, data):
+ res = self.load("https://premium.rpnet.biz/client_api.php",
+ get={'username': user,
+ 'password': password,
+ 'action' : "showHosterList"})
+ hoster_list = json_loads(res)
+
+ #: If account is not valid thera are no hosters available
+ if 'error' in hoster_list:
+ return []
+
+ #: Extract hosters from json file
+ return hoster_list['hosters']
+
+
+ def grab_info(self, user, password, data):
#: Get account information from rpnet.biz
- res = self.get_account_status(user, password, req)
+ res = self.get_account_status(user, password)
try:
if res['accountInfo']['isPremium']:
#: Parse account info. Change the trafficleft later to support per host info.
@@ -33,16 +48,16 @@ class RPNetBiz(Account):
return account_info
- def login(self, user, password, data, req):
+ def signin(self, user, password, data):
#: Get account information from rpnet.biz
- res = self.get_account_status(user, password, req)
+ res = self.get_account_status(user, password)
#: If we have an error in the res, we have wrong login information
if 'error' in res:
self.fail_login()
- def get_account_status(self, user, password, req):
+ def get_account_status(self, user, password):
#: Using the rpnet API, check if valid premium account
res = self.load("https://premium.rpnet.biz/client_api.php",
get={'username': user, 'password': password,