[Tails-dev] #5594: tails-greeter: better administration pass…

Delete this message

Reply to this message
Autor: Andres Gomez Ramirez
Data:  
Dla: tails-dev@boum.org
Temat: [Tails-dev] #5594: tails-greeter: better administration password UI
Hello,

I attached a patch for "#5594: tails-greeter: better administration password UI"
https://labs.riseup.net/code/issues/5594

Cheers,

AndresFrom 21a3920dda03d0f6048aaca5ffd07da1248e843b Mon Sep 17 00:00:00 2001
From: kurono <andres.gomez@???>
Date: Wed, 5 Feb 2014 18:26:35 -0500
Subject: [PATCH] tails-greeter: better administration password UI

---
GdmGreeter/optionswindow.py | 12 +++++++++---
1 file changed, 9 insertions(+), 3 deletions(-)

diff --git a/GdmGreeter/optionswindow.py b/GdmGreeter/optionswindow.py
index 9042cb9..f8d7633 100644
--- a/GdmGreeter/optionswindow.py
+++ b/GdmGreeter/optionswindow.py
@@ -62,10 +62,16 @@ class OptionsWindow(TranslatableWindow):
         """Validate the selected options"""
         auth_password = self.entry_password.get_text()
         test_password = self.entry_password2.get_text()
-        passwords_match = test_password == auth_password
-        if not passwords_match:
+
+        if len(auth_password) == 0 or len(test_password) == 0:
+            self.warning_label.set_markup("<i>Password must not be empty.</i>")
+            self.warning_area.show()
+            return False
+        elif not auth_password == test_password:
+            self.warning_label.set_markup("<i>Passwords do not match.</i>")
             self.warning_area.show()
-        return passwords_match
+            return False
+        return True


     def set_options_and_login(self):
         """Activate the selected options if they are valid"""
-- 
1.7.9.5