Author: jsuchome Date: Wed Jun 24 11:55:51 2009 New Revision: 57716 URL: http://svn.opensuse.org/viewcvs/yast?rev=57716&view=rev Log: - in firstboot, allow "Use this password for root" check box (fate#306297) - 2.18.5 Modified: trunk/users/VERSION trunk/users/package/yast2-users.changes trunk/users/src/Users.pm trunk/users/src/dialogs.ycp trunk/users/src/inst_root_first.ycp trunk/users/src/inst_user_first.ycp Modified: trunk/users/VERSION URL: http://svn.opensuse.org/viewcvs/yast/trunk/users/VERSION?rev=57716&r1=57715&r2=57716&view=diff ============================================================================== --- trunk/users/VERSION (original) +++ trunk/users/VERSION Wed Jun 24 11:55:51 2009 @@ -1 +1 @@ -2.18.4 +2.18.5 Modified: trunk/users/package/yast2-users.changes URL: http://svn.opensuse.org/viewcvs/yast/trunk/users/package/yast2-users.changes?rev=57716&r1=57715&r2=57716&view=diff ============================================================================== --- trunk/users/package/yast2-users.changes (original) +++ trunk/users/package/yast2-users.changes Wed Jun 24 11:55:51 2009 @@ -1,4 +1,11 @@ ------------------------------------------------------------------- +Wed Jun 24 11:37:53 CEST 2009 - jsuchome@suse.cz + +- in firstboot, allow "Use this password for root" check box + (fate#306297) +- 2.18.5 + +------------------------------------------------------------------- Fri Jun 19 12:13:05 CEST 2009 - mvidner@suse.cz - Using autodocs-ycp.ami, which contains a fix for automake 1.11. Modified: trunk/users/src/Users.pm URL: http://svn.opensuse.org/viewcvs/yast/trunk/users/src/Users.pm?rev=57716&r1=57715&r2=57716&view=diff ============================================================================== --- trunk/users/src/Users.pm (original) +++ trunk/users/src/Users.pm Wed Jun 24 11:55:51 2009 @@ -191,6 +191,10 @@ # if system settings already read by ReadSystemDefaults my $system_defaults_read = 0; +# if new value of root password should be written at the end +my $save_root_password = 0; + + ##------------------------------------ ##------------------- global imports @@ -284,6 +288,13 @@ return $ret; } +# if root password value should be explicitely written +BEGIN { $TYPEINFO{SaveRootPassword} = ["function", "void", "boolean"]; } +sub SaveRootPassword { + my $self = shift; + $save_root_password = bool ($_[0]); +} + BEGIN { $TYPEINFO{NISAvailable} = ["function", "boolean"]; } sub NISAvailable { return $nis_available; @@ -4775,6 +4786,11 @@ undef %user_in_work; } + if (Stage->firstboot () && $save_root_password) { + $self->WriteRootPassword (); + $save_root_password = 0; + } + $users_modified = 0; $groups_modified = 0; Modified: trunk/users/src/dialogs.ycp URL: http://svn.opensuse.org/viewcvs/yast/trunk/users/src/dialogs.ycp?rev=57716&r1=57715&r2=57716&view=diff ============================================================================== --- trunk/users/src/dialogs.ycp (original) +++ trunk/users/src/dialogs.ycp Wed Jun 24 11:55:51 2009 @@ -21,6 +21,7 @@ import "Message"; import "Package"; import "Popup"; +import "ProductFeatures"; import "Report"; import "Stage"; import "String"; @@ -201,6 +202,9 @@ boolean root_mail = haskey (Users::GetRootAliases (), username); boolean root_mail_checked = root_mail; + // if user's password should be set to root + boolean root_pw = false; + // only for LDAP users: string sn = ""; if (haskey (user, "sn")) @@ -386,6 +390,13 @@ `Left( `CheckBox (`id (`autologin),_("A&utomatic Login"), Autologin::used) ) ); + boolean root_pw_feature = ProductFeatures::GetBooleanFeature ("globals", "root_password_as_first_user"); + if (root_pw_feature != nil) + optionbox = add (optionbox, + `Left (`CheckBox (`id (`root_pw), + // checkbox label + _("U&se this password for system administrator"), root_pw, root_pw_feature) + )); } else if (!do_not_edit && !installation ()) { @@ -1163,7 +1174,7 @@ Autologin::modified = true; } } - else + else if (UI::WidgetExists (`id (`ena))) { // -------------------------------------- enable/disable checks @@ -1188,6 +1199,8 @@ } root_mail_checked = (boolean) UI::QueryWidget (`id (`root_mail), `Value); + root_pw = UI::WidgetExists (`id (`root_pw)) && + (boolean) UI::QueryWidget (`id (`root_pw), `Value); // save the username for possible check if it was changed // and home directory should be re-generated if (org_username == "") @@ -1784,6 +1797,14 @@ else Users::RemoveRootAlias (username); } + if (username == "root") + Users::SaveRootPassword (false); + else if (root_pw) + { + // set root's password + Users::SetRootPassword (password); + Users::SaveRootPassword (true); + } } if (contains ([`next,`abort,`back,`cancel,`additional,`nosave], ret)) Modified: trunk/users/src/inst_root_first.ycp URL: http://svn.opensuse.org/viewcvs/yast/trunk/users/src/inst_root_first.ycp?rev=57716&r1=57715&r2=57716&view=diff ============================================================================== --- trunk/users/src/inst_root_first.ycp (original) +++ trunk/users/src/inst_root_first.ycp Wed Jun 24 11:55:51 2009 @@ -25,7 +25,7 @@ } boolean check_CA_constraints = - ProductFeatures::GetBooleanFeature ("globals","root_password_ca_check"); + (ProductFeatures::GetBooleanFeature ("globals","root_password_ca_check") == true); // minimal pw length for CA-management (F#300438) integer pw_min_CA = 4; Modified: trunk/users/src/inst_user_first.ycp URL: http://svn.opensuse.org/viewcvs/yast/trunk/users/src/inst_user_first.ycp?rev=57716&r1=57715&r2=57716&view=diff ============================================================================== --- trunk/users/src/inst_user_first.ycp (original) +++ trunk/users/src/inst_user_first.ycp Wed Jun 24 11:55:51 2009 @@ -31,7 +31,7 @@ string arch = Arch::architecture (); boolean check_CA_constraints = - ProductFeatures::GetBooleanFeature ("globals","root_password_ca_check"); + (ProductFeatures::GetBooleanFeature ("globals","root_password_ca_check") == true); // minimal pw length for CA-management (F#300438) integer pw_min_CA = 4; @@ -511,7 +511,7 @@ // set the initial default value for autologin if (user == $[] && !autologin) { - if (ProductFeatures::GetBooleanFeature ("globals", "enable_autologin")) + if (ProductFeatures::GetBooleanFeature ("globals", "enable_autologin") == true) autologin = true; y2debug ("autologin default value: %1", autologin); } @@ -519,7 +519,7 @@ // set the initial default value for root pw checkbox if (user == $[] && !root_pw) { - if (ProductFeatures::GetBooleanFeature ("globals", "root_password_as_first_user")) + if (ProductFeatures::GetBooleanFeature ("globals", "root_password_as_first_user") == true) root_pw = true; y2debug ("root_pw default value: %1", root_pw); } -- To unsubscribe, e-mail: yast-commit+unsubscribe@opensuse.org For additional commands, e-mail: yast-commit+help@opensuse.org