Author: jdsn
Date: Tue Jan 29 21:34:24 2008
New Revision: 43987
URL: http://svn.opensuse.org/viewcvs/yast?rev=43987&view=rev
Log:
autoyast registration with yep, certificate file fixes
Modified:
branches/SuSE-SLE-10-SP2-Branch/registration/src/clients/suse_register_auto.ycp
branches/SuSE-SLE-10-SP2-Branch/registration/src/config/registration.rnc
branches/SuSE-SLE-10-SP2-Branch/registration/src/modules/Register.ycp
Modified: branches/SuSE-SLE-10-SP2-Branch/registration/src/clients/suse_register_auto.ycp
URL: http://svn.opensuse.org/viewcvs/yast/branches/SuSE-SLE-10-SP2-Branch/registration/src/clients/suse_register_auto.ycp?rev=43987&r1=43986&r2=43987&view=diff
==============================================================================
--- branches/SuSE-SLE-10-SP2-Branch/registration/src/clients/suse_register_auto.ycp (original)
+++ branches/SuSE-SLE-10-SP2-Branch/registration/src/clients/suse_register_auto.ycp Tue Jan 29 21:34:24 2008
@@ -81,6 +81,16 @@
summary = Summary::CloseList(summary);
}
+ if ( Register::yep_server != "")
+ {
+ summary = Summary::AddHeader (summary, _("YEP Server Settings") );
+ summary = Summary::OpenList(summary);
+ summary = Summary::AddListItem (summary, sformat(_("YEP Server: %1"), Register::yep_server) );
+ if ( Register::yep_server_cert != "")
+ summary = Summary::AddListItem (summary, sformat(_("YEP Certificate: %1"), Register::yep_server_cert) );
+ summary = Summary::CloseList(summary);
+ }
+
return summary;
}
@@ -185,12 +195,22 @@
"<p>Other information used for registration is shown in <b>Registration Data</b>.<br>Add a new key and value pair by pressing <b>Add</b> and then entering the appropriate values. These parameters are the ones that can be passed with <tt>suse_register -a</tt>.<br>Get more information about them with <tt>suse_register -p</tt>. Remove a pair with <b>Delete</b> or modify an existing pair with <b>Edit</b>.</p>"
);
- string help_text = help_text_caption + help_text_para1 + help_text_para2 + help_text_para3;
+ string help_text_para4 = _("<p>If your network deploys a custom YEP server, please set the URL of the YEP Server and the location of the YEP Certificate in <b>YEP Server Settings</b>. Please see your YEP manual for further assistance.</p>");
+
- term contents = `VBox(
- `VBox (
- // Translators: Text for UI Label - capitalized
- `Left( `CheckBox(`id(`run), `opt(`notify), _("Run Product Registration"), false )),
+ string help_text = help_text_caption + help_text_para1 + help_text_para2 + help_text_para3 + help_text_para4;
+
+ term yepsettings = `VBox(
+ // Translators: Text for UI Label - capitalized
+ `Left( `Label(_("YEP Server Settings"))),
+ // Translators: Text for UI Label - capitalized
+ `TextEntry(`id(`yepurl), `opt(`hstretch, `notify), _("YEP Server"), ""),
+ // Translators: Text for UI Label - capitalized
+ `TextEntry(`id(`yepcert), `opt(`hstretch, `notify), _("YEP Certificate"), "")
+ );
+
+ term regsettings = `VBox(
+ `Left( `CheckBox(`id(`run), `opt(`notify), _("Run Product Registration"), false )),
`HBox( `HSpacing (3.0) , `VBox(
// Translators: Text for UI Label - capitalized
`Left( `Label( _("Include in Registration") ) ),
@@ -198,8 +218,13 @@
`Left( `CheckBox(`id(`sub_hw), `opt(`notify), _("Hardware Profile"), false )),
// Translators: Text for UI Label - capitalized
`Left( `CheckBox(`id(`sub_opt), `opt(`notify), _("Optional Information"), false ))
- ))
- ),
+ )
+ ),
+ `VSpacing(1));
+
+
+ term contents = `VBox(
+ `HBox ( regsettings, yepsettings ),
`VBox ( `VSpacing(0.5),
// Translators: Text for UI Label - capitalized
`Left( `Label( _("Registration Data to Use")) ),
@@ -232,6 +257,8 @@
UI::ChangeWidget(`id(`run), `Value, Register::do_registration);
UI::ChangeWidget(`id(`sub_hw ), `Value, Register::submit_hwdata);
UI::ChangeWidget(`id(`sub_opt), `Value, Register::submit_optional);
+ UI::ChangeWidget(`id(`yepurl), `Value, Register::yep_server);
+ UI::ChangeWidget(`id(`yepcert), `Value, Register::yep_server_cert);
integer items=size(table_items);
UI::ChangeWidget(`id(`edit), `Enabled, items > 0);
UI::ChangeWidget(`id(`delete), `Enabled, items > 0);
@@ -304,9 +331,35 @@
}
else if ( ret == `abort || ret == `cancel )
{
- if(Popup::ReallyAbort(true)) break;
- else continue;
- }
+ if(Popup::ReallyAbort(true)) break;
+ else continue;
+ }
+ else if ( ret == `next )
+ {
+ string yepServer = (string) UI::QueryWidget(`id(`yepurl), `Value);
+ string yepServerCert = (string) UI::QueryWidget(`id(`yepcert), `Value);
+
+ if ( (! regexpmatch(yepServer, "^https://.+") && yepServer != "" ) ||
+ ( yepServer == "" && yepServerCert != "" )
+ )
+ {
+ Popup::Message(_("YEP Server URL must start with https://"));
+ ret = nil;
+ }
+
+ if (! regexpmatch(yepServerCert, "^(https?|ftp)://.+") &&
+ ! regexpmatch(yepServerCert, "^floppy/.+") &&
+ ! regexpmatch(yepServerCert, "^/.+") &&
+ ! regexpmatch(yepServerCert, "^(ask|done)$") &&
+ yepServerCert != ""
+ )
+ {
+ Popup::Message(_("Location of YEP Certificate invalid.\nPlease see your YEP documentation."));
+ ret = nil;
+ }
+ Register::yep_server = yepServer;
+ Register::yep_server_cert = yepServerCert;
+ }
// refresh counter and buttons
items = size(table_items);
@@ -332,6 +385,8 @@
y2debug("submit_hwdata: %1", Register::submit_hwdata);
y2debug("submit_optional: %1", Register::submit_optional);
y2debug("registration_data: %1", Register::registration_data);
+ y2debug("yep_server: %1", Register::yep_server);
+ y2debug("yep_server_cert: %1", Register::yep_server_cert);
}
UI::CloseDialog();
Modified: branches/SuSE-SLE-10-SP2-Branch/registration/src/config/registration.rnc
URL: http://svn.opensuse.org/viewcvs/yast/branches/SuSE-SLE-10-SP2-Branch/registration/src/config/registration.rnc?rev=43987&r1=43986&r2=43987&view=diff
==============================================================================
--- branches/SuSE-SLE-10-SP2-Branch/registration/src/config/registration.rnc (original)
+++ branches/SuSE-SLE-10-SP2-Branch/registration/src/config/registration.rnc Tue Jan 29 21:34:24 2008
@@ -2,11 +2,14 @@
namespace a = "http://relaxng.org/ns/compatibility/annotations/1.0"
namespace config = "http://www.suse.com/1.0/configns"
-customer_center = element customer_center { do_registration? & submit_hwdata? & submit_optional? & registration_data? & register_regularly? }
+customer_center = element customer_center { do_registration? & submit_hwdata? & submit_optional? & registration_data? & register_regularly? & yep_server? & yep_server_cert? }
do_registration = element do_registration { BOOLEAN }
submit_hwdata = element submit_hwdata { BOOLEAN }
submit_optional = element submit_optional { BOOLEAN }
register_regularly = element register_regularly { BOOLEAN }
+yep_server = element yep_server { text }
+yep_server_cert = element yep_server_cert { text }
+
registration_data =
element registration_data {
Modified: branches/SuSE-SLE-10-SP2-Branch/registration/src/modules/Register.ycp
URL: http://svn.opensuse.org/viewcvs/yast/branches/SuSE-SLE-10-SP2-Branch/registration/src/modules/Register.ycp?rev=43987&r1=43986&r2=43987&view=diff
==============================================================================
--- branches/SuSE-SLE-10-SP2-Branch/registration/src/modules/Register.ycp (original)
+++ branches/SuSE-SLE-10-SP2-Branch/registration/src/modules/Register.ycp Tue Jan 29 21:34:24 2008
@@ -53,8 +53,8 @@
global boolean use_proxy = false;
global string http_proxy = "";
global string https_proxy = "";
-global string yep_server = nil; // (FATE #302966)
-global string yep_server_cert = nil; // (FATE #302966)
+global string yep_server = ""; // (FATE #302966)
+global string yep_server_cert = ""; // (FATE #302966)
global map