Commit 91dc08e3 authored by rgaudin's avatar rgaudin
Browse files

forbid admin login and password from being equal as mediawiki (wikifundi) does not allow it

parent 4fb80afa
......@@ -124,7 +124,7 @@ def build_extra_vars(name, timezone, language, language_name, wifi_pwd,
'captive_portal': True,
'custom_branding_path': '/tmp',
'admin_account': "admin",
'admin_password': "admin",
'admin_password': "admin-password",
}
if wifi_pwd:
......
......@@ -870,8 +870,8 @@ class Application:
"login": self.component.admin_account_login_entry.get_text(),
"pwd": self.component.admin_account_pwd_entry.get_text(),
}
login_condition = len(admin_account["login"]) <= 31 and set(admin_account["login"]) <= set(string.ascii_uppercase + string.ascii_lowercase + string.digits)
pwd_condition = len(admin_account["pwd"]) <= 31 and set(admin_account["pwd"]) <= set(string.ascii_uppercase + string.ascii_lowercase + string.digits)
login_condition = len(admin_account["login"]) <= 31 and set(admin_account["login"]) <= set(string.ascii_uppercase + string.ascii_lowercase + string.digits + '-' + '_')
pwd_condition = len(admin_account["pwd"]) <= 31 and set(admin_account["pwd"]) <= set(string.ascii_uppercase + string.ascii_lowercase + string.digits + '-' + '_') and (admin_account["pwd"] != admin_account["login"])
self.component.admin_account_login_constraints_revealer.set_reveal_child(not login_condition)
self.component.admin_account_pwd_constraints_revealer.set_reveal_child(not pwd_condition)
validate_label(self.component.admin_account_login_label, login_condition)
......
......@@ -395,7 +395,7 @@
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="label" translatable="yes">Must contains only 1 to 31 ASCII letters 'A' to 'z'
and digits '0' to '9' and hyphen '-'</property>
and digits '0' to '9', space and hyphen '-'</property>
<attributes>
<attribute name="foreground" value="#efef29292929"/>
</attributes>
......@@ -780,8 +780,8 @@ and digits '0' to '9'</property>
<object class="GtkLabel" id="no_id_72">
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="label" translatable="yes">Must contains only 0 to 31 ASCII letters 'A' to 'z'
and digits '0' to '9'</property>
<property name="label" translatable="yes">Must contains only 0 to 31 ASCII letters 'A' to 'z',
digits '0' to '9', hyphen '_' and underscore '_'</property>
<attributes>
<attribute name="foreground" value="#efef29292929"/>
</attributes>
......@@ -840,8 +840,9 @@ and digits '0' to '9'</property>
<object class="GtkLabel" id="no_id_74">
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="label" translatable="yes">Must contains only 0 to 31 ASCII letters 'A' to 'z'
and digits '0' to '9'</property>
<property name="label" translatable="yes">Must contains only 0 to 31 ASCII letters 'A' to 'z',
digits '0' to '9', hyphen '-' and underscore '_'
Must be different than login</property>
<attributes>
<attribute name="foreground" value="#efef29292929"/>
</attributes>
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment