Skip to content

Commit

Permalink
Fix checking for OES
Browse files Browse the repository at this point in the history
  • Loading branch information
varkoly committed Mar 12, 2014
1 parent 8d1e62f commit e9c4b68
Showing 1 changed file with 2 additions and 27 deletions.
29 changes: 2 additions & 27 deletions src/Ldap.rb
Original file line number Diff line number Diff line change
Expand Up @@ -35,10 +35,7 @@ def main
Yast.import "UI"
textdomain "ldap"

Yast.import "Autologin"
Yast.import "Directory"
Yast.import "FileUtils"
Yast.import "DNS"
Yast.import "Hostname"
Yast.import "Label"
Yast.import "Message"
Expand All @@ -47,7 +44,6 @@ def main
Yast.import "Package"
Yast.import "Pam"
Yast.import "Popup"
Yast.import "ProductFeatures"
Yast.import "Progress"
Yast.import "Report"
Yast.import "Service"
Expand All @@ -73,7 +69,6 @@ def main

# Are LDAP services available via nsswitch.conf?
@start = false
@old_start = false

# Is NIS service available? If yes, and LDAP client will be enabled, warn
# user (see bug #36981)
Expand All @@ -89,11 +84,9 @@ def main

# which attribute have LDAP groups for list of members
@member_attribute = ""
@old_member_attribute = ""

# IP addresses of LDAP server.
@server = ""
@old_server = ""

# local settings modified?
@modified = false
Expand All @@ -103,8 +96,6 @@ def main

# base DN
@base_dn = ""
@old_base_dn = ""
@base_dn_changed = false

@ldap_tls = true

Expand Down Expand Up @@ -156,9 +147,6 @@ def main
# DN of currently edited template
@current_template_dn = ""

# if LDAP configuration objects should be created automaticaly
@create_ldap = false

# if eDirectory is used as server
@nds = false

Expand All @@ -170,9 +158,6 @@ def main
# if OES is used as a client
@oes = false

# expert ui means "server product"
@expert_ui = false

# defaults for adding new config objects and templates
@new_objects = {
"suseUserConfiguration" => {
Expand Down Expand Up @@ -345,9 +330,8 @@ def GetDomain
# Set new LDAP base DN
# @param [String] new_base_dn a new base DN
def SetBaseDN(new_base_dn)
@base_dn_changed = true if @base_dn != new_base_dn
@base_dn = new_base_dn
@base_dn_changed = true if @base_dn != @old_base_dn && @old_base_dn != ""

nil
end

Expand Down Expand Up @@ -492,16 +476,13 @@ def ReadLdapHosts
# Reads LDAP settings from the SCR
# @return success
def Read
@expert_ui = ProductFeatures.GetFeature("globals", "ui_mode") == "expert"

CheckOES()

["passwd", "group", "passwd_compat", "group_compat"].each { |db| @nsswitch[db] = Nsswitch.ReadDb(db) }

# 'start' means that LDAP is present in nsswitch somehow... either as 'compat'/'ldap'...
@start = @nsswitch["passwd"].include?("ldap") ||
( @nsswitch["passwd"].include?("compat") && @nsswitch["passwd_compat"].include?("ldap") ) ||
( @auth["oes"] && @nsswitch["passwd"].include?("nam") )
( CheckOES && @nsswitch["passwd"].include?("nam") )

if @start
# nss_ldap is used
Expand Down Expand Up @@ -2247,19 +2228,15 @@ def get_string(object, attr)
publish :variable => :required_packages, :type => "list <string>"
publish :variable => :write_only, :type => "boolean"
publish :variable => :start, :type => "boolean"
publish :variable => :old_start, :type => "boolean"
publish :variable => :nis_available, :type => "boolean"
publish :variable => :_autofs_allowed, :type => "boolean"
publish :variable => :_start_autofs, :type => "boolean"
publish :variable => :login_enabled, :type => "boolean"
publish :variable => :member_attribute, :type => "string"
publish :variable => :old_member_attribute, :type => "string"
publish :variable => :server, :type => "string"
publish :variable => :old_server, :type => "string"
publish :variable => :modified, :type => "boolean"
publish :variable => :openldap_modified, :type => "boolean"
publish :variable => :base_dn, :type => "string", :private => true
publish :variable => :old_base_dn, :type => "string", :private => true
publish :variable => :base_dn_changed, :type => "boolean", :private => true
publish :variable => :ldap_tls, :type => "boolean"
publish :variable => :tls_cacertdir, :type => "string"
Expand All @@ -2280,12 +2257,10 @@ def get_string(object, attr)
publish :variable => :bind_dn, :type => "string"
publish :variable => :current_module_dn, :type => "string"
publish :variable => :current_template_dn, :type => "string"
publish :variable => :create_ldap, :type => "boolean"
publish :variable => :nds, :type => "boolean"
publish :variable => :tls_switched_off, :type => "boolean"
publish :variable => :nds_checked, :type => "boolean", :private => true
publish :variable => :oes, :type => "boolean", :private => true
publish :variable => :expert_ui, :type => "boolean", :private => true
publish :variable => :new_objects, :type => "map"
publish :variable => :base_template_dn, :type => "string"
publish :variable => :ldap_modified, :type => "boolean"
Expand Down

0 comments on commit e9c4b68

Please sign in to comment.