Commits

Denis Khabarov committed ed54c22

...

  • Participants
  • Parent commits 7ab06c2

Comments (0)

Files changed (1)

File py2shauth.py

 	else:
 		return False
 	
-def send_question():
+def send_question(phoneend):
+	print("We sent a security code to your phone number ending in "+phoneend+".")
 	try:
-		answer=raw_input("Please enter security code: ")
+		answer=raw_input("Enter security code:")
 	except KeyboardInterrupt:
 		print("\nRecv SIGINT. Exiting....\n")
 		logger.info('Recv SIGINT. Exiting...')
 	
 	if user in config['users'] and config['users'][user].has_key('phone'):
 		send_sms(login=str(config['sms_service']['login']), password=str(config['sms_service']['password']),to=str(config['users'][user]['phone']), code=code)
-		answer = send_question()
+		answer = send_question(str(config['users'][user]['phone'])[-4:len(str(config['users'][user]['phone']))])
 		validate=validate_key(answer, code)
 		if not validate:
 			print('Access denied!')