コード例 #1
0
ファイル: main.py プロジェクト: halfiHamza/PyDesktop
 def Authentication(self):
     path = MainCore()
     file = configparser.ConfigParser()
     file.read(path.resource('config.ini'))
     operation = MySQL(file.get('DATABASE', 'host'),
                       file.get('DATABASE', 'user'),
                       file.get('DATABASE', 'password'),
                       file.get('DATABASE', 'database'))
     result = operation.user_login(self.user_name.text(),
                                   self.password.text())
     if len(list(result[1])) == 0:
         self.label_error.setStyleSheet('color: red')
         self.label_error.setText('Access denied !')
     else:
         permission = result[1][0]
         RootWindow.show()
         self.close()