From 02c2e8201e6cdcab0f0f5b38fe08c82cf5977c89 Mon Sep 17 00:00:00 2001 From: Ted Trask Date: Tue, 17 May 2011 08:19:32 +0000 Subject: Passwords must be at least three digits --- vmail-model.lua | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'vmail-model.lua') diff --git a/vmail-model.lua b/vmail-model.lua index 3073c51..f329b27 100644 --- a/vmail-model.lua +++ b/vmail-model.lua @@ -38,7 +38,7 @@ local table_creation_scripts = { "INSERT INTO voicemail_params VALUES(null, 'username', 'text', 'Extension', '', '')", "INSERT INTO voicemail_params VALUES(null, 'firstname', 'text', 'User First Name', '', '')", "INSERT INTO voicemail_params VALUES(null, 'lastname', 'text', 'User Last Name', '', '')", - "INSERT INTO voicemail_params VALUES(null, 'vm-password', 'text', 'Voicemail Password', '', '')", + "INSERT INTO voicemail_params VALUES(null, 'vm-password', 'text', 'Voicemail Password', 'Passwords must be all numbers and at least three digits', '')", "INSERT INTO voicemail_params VALUES(null, 'vm-password-confirm', 'text', 'Enter again to confirm', '', '')", "INSERT INTO voicemail_params VALUES(null, 'vm-mailto', 'text', 'Email Address', 'Email a notification, including audio file if enabled', '')", "INSERT INTO voicemail_params VALUES(null, 'vm-email-all-messages', 'boolean', 'Email Enable', '', 'false')", @@ -697,11 +697,11 @@ update_usersettings = function(usersettings, create) local success = true local errtxt -- Validate the settings - if not validator.is_integer(usersettings.value["vm-password"].value) then + if usersettings.value["vm-password"] and not string.match(usersettings.value["vm-password"].value, "^%d%d%d+$") then success = false - usersettings.value["vm-password"].errtxt = "Password must be all numbers" + usersettings.value["vm-password"].errtxt = "Passwords must be all numbers and at least three digits" end - if usersettings.value["vm-password"].value ~= usersettings.value["vm-password-confirm"].value then + if usersettings.value["vm-password"] and usersettings.value["vm-password-confirm"] and usersettings.value["vm-password"].value ~= usersettings.value["vm-password-confirm"].value then success = false usersettings.value["vm-password-confirm"].errtxt = "Password does not match" end -- cgit v1.2.3