[yast-commit] r38058 - in /trunk/packager: package/yast2-packager.changes src/modules/SourceDialogs.ycp
Author: jsrain Date: Mon May 21 13:01:51 2007 New Revision: 38058 URL: http://svn.opensuse.org/viewcvs/yast?rev=38058&view=rev Log: check if host name specified is valid (#232887) Modified: trunk/packager/package/yast2-packager.changes trunk/packager/src/modules/SourceDialogs.ycp Modified: trunk/packager/package/yast2-packager.changes URL: http://svn.opensuse.org/viewcvs/yast/trunk/packager/package/yast2-packager.changes?rev=38058&r1=38057&r2=38058&view=diff ============================================================================== --- trunk/packager/package/yast2-packager.changes (original) +++ trunk/packager/package/yast2-packager.changes Mon May 21 13:01:51 2007 @@ -1,4 +1,9 @@ ------------------------------------------------------------------- +Mon May 21 13:59:38 CEST 2007 - jsrain@suse.cz + +- check if host name specified is valid (#232887) + +------------------------------------------------------------------- Thu May 17 12:29:56 CEST 2007 - locilka@suse.cz - Sort licenses alphabetically using an lsort instead of common Modified: trunk/packager/src/modules/SourceDialogs.ycp URL: http://svn.opensuse.org/viewcvs/yast/trunk/packager/src/modules/SourceDialogs.ycp?rev=38058&r1=38057&r2=38058&view=diff ============================================================================== --- trunk/packager/src/modules/SourceDialogs.ycp (original) +++ trunk/packager/src/modules/SourceDialogs.ycp Mon May 21 13:01:51 2007 @@ -27,6 +27,7 @@ import "Report"; import "NetworkPopup"; import "String"; +import "Hostname"; // common functions / data @@ -827,6 +828,19 @@ } } +boolean ServerValidate (string key, map event) { + string host = NormalizeHost ((string)UI::QueryWidget (`id (`server), `Value)); + if (! Hostname::CheckFQ (host)) + { + UI::SetFocus (`server); + Popup::Message (Hostname::ValidFQ ()); + return false; + } + + return true; +} + + /** * Store function of a widget * @param key string widget key @@ -898,6 +912,13 @@ directory = directory + ";workgroup=" + workgroup; } parsed["path"] = directory; + + // set HTTP/HTTPS port + if (type == `http || type == `https) + { + parsed["port"] = (string)UI::QueryWidget(`id(`port), `Value); + } + y2milestone("Entered URL: %1", parsed); _url = URL::Build (parsed); y2milestone("URL::Build: %1", _url); @@ -908,11 +929,6 @@ _url = PosprocessISOURL (_url); } - // set HTTP/HTTPS port - if (type == `http || type == `https) - { - parsed["port"] = (string)UI::QueryWidget(`id(`port), `Value); - } } @@ -935,6 +951,8 @@ `ReplacePoint (`id (`server_rp), `Empty ()) ), "init" : ServerInit, + "validate_type" : `function, + "validate_function" : ServerValidate, "store" : ServerStore, "handle" : ServerHandle, // help text - server dialog -- To unsubscribe, e-mail: yast-commit+unsubscribe@opensuse.org For additional commands, e-mail: yast-commit+help@opensuse.org
participants (1)
-
jsrain@svn.opensuse.org