sha1 hash password for tray lock
This commit is contained in:
parent
fd03c62ccb
commit
ca43940c1f
|
@ -162,9 +162,6 @@ class Preferences:
|
|||
self.gtkui_config["start_in_tray"])
|
||||
self.glade.get_widget("chk_lock_tray").set_active(
|
||||
self.gtkui_config["lock_tray"])
|
||||
self.glade.get_widget("txt_tray_password").set_text(
|
||||
self.gtkui_config["tray_password"])
|
||||
|
||||
self.glade.get_widget("combo_file_manager").set_active(
|
||||
self.gtkui_config["stock_file_manager"])
|
||||
self.glade.get_widget("txt_open_folder_location").set_text(
|
||||
|
@ -185,6 +182,7 @@ class Preferences:
|
|||
|
||||
def set_config(self):
|
||||
"""Sets all altered config values in the core"""
|
||||
import sha
|
||||
# Get the values from the dialog
|
||||
new_core_config = {}
|
||||
new_gtkui_config = {}
|
||||
|
@ -251,9 +249,9 @@ class Preferences:
|
|||
self.glade.get_widget("chk_start_in_tray").get_active()
|
||||
new_gtkui_config["lock_tray"] = \
|
||||
self.glade.get_widget("chk_lock_tray").get_active()
|
||||
new_gtkui_config["tray_password"] = \
|
||||
self.glade.get_widget("txt_tray_password").get_text()
|
||||
|
||||
password = sha.new(self.glade.get_widget("txt_tray_password").\
|
||||
get_text()).hexdigest()
|
||||
new_gtkui_config["tray_password"] = password
|
||||
new_gtkui_config["stock_file_manager"] = \
|
||||
self.glade.get_widget("combo_file_manager").get_active()
|
||||
new_gtkui_config["open_folder_location"] = \
|
||||
|
|
|
@ -302,6 +302,7 @@ class SystemTray:
|
|||
self.window.update()
|
||||
|
||||
def unlock_tray(self, comingnext, is_showing_dlg=[False]):
|
||||
import sha
|
||||
log.debug("Show tray lock dialog")
|
||||
if is_showing_dlg[0]:
|
||||
return
|
||||
|
@ -326,7 +327,8 @@ window, please enter your password"))
|
|||
tray_lock.vbox.pack_start(entered_pass)
|
||||
tray_lock.show_all()
|
||||
if tray_lock.run() == gtk.RESPONSE_ACCEPT:
|
||||
if self.config["tray_password"] == entered_pass.get_text():
|
||||
if self.config["tray_password"] == sha.new(entered_pass.get_text())\
|
||||
.hexdigest():
|
||||
if comingnext == "mainwinshow":
|
||||
log.debug("Showing main window via tray")
|
||||
self.window.show()
|
||||
|
|
Loading…
Reference in New Issue