Author: aschnell Date: Tue Jul 28 10:33:53 2009 New Revision: 58184 URL: http://svn.opensuse.org/viewcvs/yast?rev=58184&view=rev Log: - refactoring Modified: trunk/storage/storage/src/modules/Storage.ycp Modified: trunk/storage/storage/src/modules/Storage.ycp URL: http://svn.opensuse.org/viewcvs/yast/trunk/storage/storage/src/modules/Storage.ycp?rev=58184&r1=58183&r2=58184&view=diff ============================================================================== --- trunk/storage/storage/src/modules/Storage.ycp (original) +++ trunk/storage/storage/src/modules/Storage.ycp Tue Jul 28 10:33:53 2009 @@ -5791,21 +5791,24 @@ if (pw1 != pw2) { // popup text - Popup::Message(_("The first and the second version\nof the password do not match. + Popup::Message(_("The first and the second version +of the password do not match. Try again.")); return false; } - if (isempty(pw1) && !empty_allowed) + if (isempty(pw1)) { - // popup text - Popup::Message(_("You did not enter a password. + if (!empty_allowed) + { + // popup text + Popup::Message(_("You did not enter a password. Try again. ")); - return false; + return false; + } } - - if (size(pw1) < min_length && !empty_allowed) + else if (size(pw1) < min_length) { // popup text Popup::Message(sformat(_("The password must have at least %1 characters. @@ -5814,17 +5817,14 @@ return false; } - if (size(pw1) >= min_length || empty_allowed) + string allowed_chars = "0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ#* ,.;:._-+!$%&/|\?{[()]}@^\\<>"; + if (!isempty(pw1) && findfirstnotof(pw1, allowed_chars) != nil) { - any tmp = findfirstnotof( pw1, "0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ#* ,.;:._-+!$%&/|\?{[()]}@^\\<>" ); - if (tmp != nil && size(pw1) > 0) - { - // popup text - Popup::Message(_("The password may only contain the following characters: - 0..9, a..z, A..Z, and any of \"@#* ,.;:._-+!$%&/|\?{[()]}^\\<>\". + // popup text + Popup::Message(_("The password may only contain the following characters: +0..9, a..z, A..Z, and any of \"@#* ,.;:._-+!$%&/|\?{[()]}^\\<>\". Try again.")); - return false; - } + return false; } return true; -- To unsubscribe, e-mail: yast-commit+unsubscribe@opensuse.org For additional commands, e-mail: yast-commit+help@opensuse.org