Guest User

Untitled

a guest
Apr 23rd, 2018
83
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 1.44 KB | None | 0 0
  1.     def __OnClickSaveButton(self):
  2.         try:
  3.             if os.path.isfile("VanillaLogin.cfg"):
  4.                 try:
  5.                     import linecache
  6.                     cr_login = linecache.getline("VanillaLogin.cfg",2)
  7.                     if cr_login != "BLANK" and cr_login != "BLANK\n":
  8.                         try:
  9.                             f = open("VanillaLogin.cfg", "w")
  10.                             f.write("BLANK\n")
  11.                             f.write("BLANK\n")
  12.                             f.write("BLANK")
  13.                             f.close()
  14.                             self.PopupNotifyMessage("I dati di autenticazione sono stati eliminati con successo.")
  15.                             self.loginSaveButton.Down()
  16.                         except:
  17.                             self.PopupNotifyMessage("Impossibile cancellare i dati di autenticazione.")
  18.                 except:
  19.                     self.PopupNotifyMessage("Errore generico, riprova.")
  20.                 else:
  21.                     if self.idEditLine.GetText() != "" and self.pwdEditLine.GetText() != "":
  22.                         id = self.idEditLine.GetText()
  23.                         pwd = self.pwdEditLine.GetText()
  24.                         salt = "VanillaMetin2 login settings - GET OUT!"
  25.                         t_id = id + SALT_ID
  26.                         t_pwd = pwd + SALT_PWD
  27.                         c_id = self.enCrypt(t_id)
  28.                         c_pwd =self.enCrypt(t_pwd)
  29.                         f = open("VanillaLogin.cfg", "w")
  30.                         f.write(salt+"\n")
  31.                         f.write(c_id +"\n")
  32.                         f.write(c_pwd)
  33.                         f.close()
  34.                         self.PopupNotifyMessage("I dati di autenticazione sono stati salvati con successo.")
  35.                         self.loginSaveButton.Up()
  36.                     else:
  37.                         self.PopupNotifyMessage("Impossibile salvare dati d'autenticazione nulli.")
  38.         except:
  39.             self.PopupNotifyMessage("Impossibile modificare i dati di autenticazione.")
Add Comment
Please, Sign In to add comment