[yast-commit] r40814 - in /trunk/dhcp-server/src: DhcpServer.pm dialogs2.ycp widgets.ycp
Author: kmachalkova Date: Fri Sep 7 19:51:39 2007 New Revision: 40814 URL: http://svn.opensuse.org/viewcvs/yast?rev=40814&view=rev Log: If hostname cannot be found, disable selecting LDAP support, do not abort the module (#307019) Modified: trunk/dhcp-server/src/DhcpServer.pm trunk/dhcp-server/src/dialogs2.ycp trunk/dhcp-server/src/widgets.ycp Modified: trunk/dhcp-server/src/DhcpServer.pm URL: http://svn.opensuse.org/viewcvs/yast/trunk/dhcp-server/src/DhcpServer.pm?rev=40814&r1=40813&r2=40814&view=diff ============================================================================== --- trunk/dhcp-server/src/DhcpServer.pm (original) +++ trunk/dhcp-server/src/DhcpServer.pm Fri Sep 7 19:51:39 2007 @@ -72,7 +72,7 @@ my $use_ldap = 0; -my $ldap_available = 0; +my $ldap_available = 1; my $ldap_config_dn = ""; @@ -1338,6 +1338,12 @@ $self->SetModified (); } +BEGIN{$TYPEINFO{GetLdapAvailable} = ["function", "boolean"];} +sub GetLdapAvailable { + my $self = shift; + + return Boolean($ldap_available); +} BEGIN{$TYPEINFO{GetOtherOptions} = ["function", "string"];} sub GetOtherOptions { my $self = shift; @@ -1458,6 +1464,7 @@ # error report Report->Error (__("Cannot determine hostname. LDAP-based configuration of DHCP server will not be available.")); + $ldap_available = 0; } # Firewall settings @@ -2287,7 +2294,6 @@ my $settings_ref = shift; my $report_errors = shift; - $ldap_available = 0; $use_ldap = 0; my $configured_ldap = 0; Modified: trunk/dhcp-server/src/dialogs2.ycp URL: http://svn.opensuse.org/viewcvs/yast/trunk/dhcp-server/src/dialogs2.ycp?rev=40814&r1=40813&r2=40814&view=diff ============================================================================== --- trunk/dhcp-server/src/dialogs2.ycp (original) +++ trunk/dhcp-server/src/dialogs2.ycp Fri Sep 7 19:51:39 2007 @@ -445,9 +445,15 @@ UI::ChangeWidget ( `id ("defaultleasetimeunits"), `Value, unit ); boolean ldap_in_use = DhcpServer::GetUseLdap(); - UI::ChangeWidget (`id ("ldap"), `Value, ldap_in_use); - UI::ChangeWidget (`id ("ldap-dhcp-server-cn"), `Value, DhcpServer::GetLdapDHCPServerCN()); - UI::ChangeWidget (`id ("ldap-dhcp-server-cn"), `Enabled, ldap_in_use); + boolean ldap_available = DhcpServer::GetLdapAvailable(); + + if (ldap_available){ + UI::ChangeWidget (`id ("ldap"), `Value, ldap_in_use); + UI::ChangeWidget (`id ("ldap-dhcp-server-cn"), `Value, DhcpServer::GetLdapDHCPServerCN()); + UI::ChangeWidget (`id ("ldap-dhcp-server-cn"), `Enabled, ldap_in_use); + } + else + UI::ChangeWidget (`id ("ldap"), `Enabled, ldap_available); GlobalSettingsValidChars (); } Modified: trunk/dhcp-server/src/widgets.ycp URL: http://svn.opensuse.org/viewcvs/yast/trunk/dhcp-server/src/widgets.ycp?rev=40814&r1=40813&r2=40814&view=diff ============================================================================== --- trunk/dhcp-server/src/widgets.ycp (original) +++ trunk/dhcp-server/src/widgets.ycp Fri Sep 7 19:51:39 2007 @@ -270,8 +270,13 @@ */ global define void ldapInit (string id) ``{ boolean ul = DhcpServer::GetUseLdap(); + boolean ldap_available = DhcpServer::GetLdapAvailable(); UI::ChangeWidget (`id (id), `Value, ul); - ldapHandle (id, $[ "ID" : "start" ]); + + if (ldap_available) + ldapHandle (id, $[ "ID" : "start" ]); + else + UI::ChangeWidget (`id (id), `Enabled, ldap_available); } /** -- To unsubscribe, e-mail: yast-commit+unsubscribe@opensuse.org For additional commands, e-mail: yast-commit+help@opensuse.org
participants (1)
-
kmachalkova@svn.opensuse.org