Added Easy pin
This commit is contained in:
parent
717e802615
commit
78883f2216
1 changed files with 13 additions and 3 deletions
|
@ -199,20 +199,30 @@ class UserClient(threading.Thread):
|
||||||
for user in users:
|
for user in users:
|
||||||
name = user.get("Name")
|
name = user.get("Name")
|
||||||
userHasPassword = False
|
userHasPassword = False
|
||||||
|
userHasPin = False
|
||||||
if (username == name):
|
if (username == name):
|
||||||
# Verify if user has a password
|
# Verify if user has a password
|
||||||
if (user.get("HasPassword") == True):
|
if (user.get("HasPassword") == True):
|
||||||
userHasPassword = True
|
userHasPassword = True
|
||||||
|
# Verify if user enabled easy pin and enabled it's use
|
||||||
|
if (user.get("HasConfiguredEasyPassword") == True) and (user.get("Configuration")["EnableLocalPassword"] == True):
|
||||||
|
userHasPin = True
|
||||||
# If user has password
|
# If user has password
|
||||||
if (userHasPassword):
|
if (userHasPassword) and (userHasPin == False):
|
||||||
password = xbmcgui.Dialog().input("Enter password for user: %s" % username, option=xbmcgui.ALPHANUM_HIDE_INPUT)
|
password = xbmcgui.Dialog().input("Enter password for user: %s" % username, option=xbmcgui.ALPHANUM_HIDE_INPUT)
|
||||||
# If password dialog is cancelled
|
# If password dialog is cancelled
|
||||||
if password == "":
|
if password == "":
|
||||||
self.logMsg("No password entered.", 0)
|
self.logMsg("No password entered.", 0)
|
||||||
#addon.setSetting("username", "")
|
|
||||||
self.WINDOW.setProperty("Server_status", "Stop")
|
self.WINDOW.setProperty("Server_status", "Stop")
|
||||||
self.auth = False
|
self.auth = False
|
||||||
#self.WINDOW.setProperty("Server_status", "")
|
return
|
||||||
|
elif (userHasPassword) and (userHasPin):
|
||||||
|
password = xbmcgui.Dialog().input("Enter easy pin for user: %s" % username, type=xbmcgui.INPUT_NUMERIC)
|
||||||
|
# If password dialog is cancelled
|
||||||
|
if password == "":
|
||||||
|
self.logMsg("No password entered.", 0)
|
||||||
|
self.WINDOW.setProperty("Server_status", "Stop")
|
||||||
|
self.auth = False
|
||||||
return
|
return
|
||||||
break
|
break
|
||||||
else:
|
else:
|
||||||
|
|
Loading…
Reference in a new issue