def verify(self): __user__ = str(self.ui.adminUname.text()) __pass__ = str(self.ui.adminPass.text()) databag = function.dict_object('data.json') __spass__ = databag['auth'] if __user__ == 'admin' and function.computeHash(__pass__) == __spass__: self.ui.authError.hide() self.close() window.hide() manageCourse.hide() administration.show() else: function.talk("Invalid authentication") self.ui.authError.show()
def changePass(self): """Changes administrator's password""" newpass = str( self.ui.passwordChange.text() ) if newpass == '': self.ui.passwordChanged.setText('Password Field cannot be left blank') self.ui.passwordChanged.show() function.talk('password empty!') else: self.databag['auth'] = str(function.computeHash(newpass)) function.dump_data(self.databag) self.ui.passwordChanged.setText('Password Updated') self.ui.passwordChanged.show() self.ui.passwordChange.clear() function.talk('password updated')
def changePass(self): """Changes administrator's password""" newpass = str(self.ui.passwordChange.text()) if newpass == '': self.ui.passwordChanged.setText( 'Password Field cannot be left blank') self.ui.passwordChanged.show() function.talk('password empty!') else: self.databag['auth'] = str(function.computeHash(newpass)) function.dump_data(self.databag) self.ui.passwordChanged.setText('Password Updated') self.ui.passwordChanged.show() self.ui.passwordChange.clear() function.talk('password updated')