def Auth(username, rawPassword): """ Get authorization token by username and password :param username: unique username string, in pattern of username@domain :param rawPassword: password without encryption :return: """ retVal = SessionManager.Login(username, EncryptUtil.EncryptSHA256(rawPassword)) return retVal is not None, retVal
def Connect(username, encrypted_password): """ Connect to the engine. :param username: username to connect :param encrypted_password: password string with specific encryption """ try: success_flag = UserModel.Verify(username, encrypted_password) if success_flag is False: return True, None session_id = SessionManager.Login(username, encrypted_password) return True, session_id except Exception as e: print "Exception in COrgan: %s" % str(e) return False, e
def start(dbconnectionstring, username, password): Database.StartEngine(dbconnectionstring) session = SessionManager() if username != '' and password != '': if session.Login(username, password): print "Login success" else: print "Login Error Invalid Username/Password" peripherals = Peripherals from ReciptPrinter import ReciptPrinter peripherals.ReciptPrinter = ReciptPrinter #from EpsonEscPos import EpsonEscPos #peripherals.ReciptPrinter = EpsonEscPos app = Vikuraa(session, peripherals) app.MainLoop()