Module: Yast::UsersComplexInclude

Defined in:
../../src/include/users/complex.rb

Instance Method Summary (collapse)

Instance Method Details

- (Object) initialize_users_complex(include_target)



31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
# File '../../src/include/users/complex.rb', line 31

def initialize_users_complex(include_target)
  Yast.import "UI"

  textdomain "users"

  Yast.import "Autologin"
  Yast.import "Label"
  Yast.import "Ldap"
  Yast.import "Popup"
  Yast.import "Report"
  Yast.import "Security"
  Yast.import "Stage"
  Yast.import "Users"
  Yast.import "UsersCache"
  Yast.import "Wizard"

  Yast.include include_target, "users/helps.rb"
end

- (Object) Modified

Return a modification status

Returns:

  • true if data was modified



52
53
54
# File '../../src/include/users/complex.rb', line 52

def Modified
  Users.Modified || Autologin.modified
end

- (Symbol) ReadDialog(useUI)

Read settings dialog

Parameters:

  • useUI (Boolean)

    boolean use user interface (change progress bar)

Returns:

  • (Symbol)

    next if success, elseabort



60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
# File '../../src/include/users/complex.rb', line 60

def ReadDialog(useUI)
  # Set help text
  Wizard.RestoreHelp(ReadDialogHelp()) if useUI

  # A callback function for abort
  abort = lambda { UI.PollInput == :abort }

  Users.SetGUI(useUI)
  ret = :next
  if Users.Read != ""
    ret = :back
    ret = :nextmodule if Stage.cont
  end
  Users.SetGUI(true)
  ret
end

- (Object) ReallyAbort

The dialog that appears when the [Abort] button is pressed.

Returns:

  • `abort if user really wants to abort



111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
# File '../../src/include/users/complex.rb', line 111

def ReallyAbort
  ret = true

  if !Stage.cont
    ret = Modified() ? Popup.ReallyAbort(true) : true
  else
    ret = Popup.ConfirmAbort(:incomplete)
  end

  if ret
    return :abort
  else
    return :back
  end
end

- (Symbol) usersInstStart

Set the module into installation mode with first dialog for single user addition

Returns:

  • (Symbol)

    for wizard sequencer



103
104
105
106
107
# File '../../src/include/users/complex.rb', line 103

def usersInstStart
  Users.SetStartDialog("user_add")
  Users.AddUser({})
  :next
end

- (Symbol) WriteDialog(useUI)

Write settings dialog

Parameters:

  • useUI (Boolean)

    boolean use user interface (change progress bar)

Returns:

  • (Symbol)

    next if success, elseabort



80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
# File '../../src/include/users/complex.rb', line 80

def WriteDialog(useUI)
  # Set help text
  Wizard.RestoreHelp(WriteDialogHelp()) if useUI

  if Users.LDAPModified && (Ldap.anonymous || Ldap.bind_pass == nil)
    # ask for real LDAP password if reading was anonymous
    Ldap.SetBindPassword(Ldap.LDAPAskAndBind(false))
    if Ldap.bind_pass == nil
      # popup text
      return :back if Popup.YesNo(_("Really abort the writing process?"))
    end
  end

  Users.SetGUI(useUI)
  ret = :next
  ret = :abort if !Stage.cont if Users.Write != ""
  Users.SetGUI(true)
  ret
end