• Home
  • Features
  • Pricing
  • Docs
  • Announcements
  • Sign In

yast / yast-users / 5655931893

pending completion
5655931893

Pull #383

github

web-flow
Merge ce91c13cc into c69951855
Pull Request #383: User creation page got messed when going back after importing user(s) from existing installation

4 of 4 new or added lines in 1 file covered. (100.0%)

3395 of 5581 relevant lines covered (60.83%)

35.49 hits per line

Source File
Press 'n' to go to next uncovered line, 'b' for previous

41.18
/src/include/users/complex.rb
1
# encoding: utf-8
2

3
# ------------------------------------------------------------------------------
4
# Copyright (c) 2006-2012 Novell, Inc. All Rights Reserved.
5
#
6
#
7
# This program is free software; you can redistribute it and/or modify it under
8
# the terms of version 2 of the GNU General Public License as published by the
9
# Free Software Foundation.
10
#
11
# This program is distributed in the hope that it will be useful, but WITHOUT
12
# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
13
# FOR A PARTICULAR PURPOSE.  See the GNU General Public License for more details.
14
#
15
# You should have received a copy of the GNU General Public License along with
16
# this program; if not, contact Novell, Inc.
17
#
18
# To contact Novell about this file by physical or electronic mail, you may find
19
# current contact information at www.novell.com.
20
# ------------------------------------------------------------------------------
21

22
# File:        include/users/complex.ycp
23
# Package:        Configuration of users and groups
24
# Summary:        Dialogs definitions
25
# Authors:        Johannes Buchhold <jbuch@suse.de>,
26
#                Jiri Suchomel <jsuchome@suse.cz>
27
#
28
# $Id$
29
module Yast
1✔
30
  module UsersComplexInclude
1✔
31
    def initialize_users_complex(include_target)
1✔
32
      Yast.import "UI"
18✔
33

34
      textdomain "users"
18✔
35

36
      Yast.import "Autologin"
18✔
37
      Yast.import "Label"
18✔
38
      Yast.import "Ldap"
18✔
39
      Yast.import "Popup"
18✔
40
      Yast.import "Report"
18✔
41
      Yast.import "Security"
18✔
42
      Yast.import "Stage"
18✔
43
      Yast.import "Users"
18✔
44
      Yast.import "UsersCache"
18✔
45
      Yast.import "Wizard"
18✔
46

47
      Yast.include include_target, "users/helps.rb"
18✔
48
    end
49

50
    # Return a modification status
51
    # @return true if data was modified
52
    def Modified
1✔
53
      Users.Modified || Autologin.modified
×
54
    end
55

56

57
    # Read settings dialog
58
    # @param [Boolean] useUI boolean use user interface (change progress bar)
59
    # @return [Symbol] `next if success, else `abort
60
    def ReadDialog(useUI)
1✔
61
      # Set help text
62
      Wizard.RestoreHelp(ReadDialogHelp()) if useUI
×
63

64
      # A callback function for abort
65
      abort = lambda { UI.PollInput == :abort }
×
66

67
      Users.SetGUI(useUI)
×
68
      ret = :next
×
69
      if Users.Read != ""
×
70
        ret = :back
×
71
        ret = :nextmodule if Stage.cont
×
72
      end
73
      Users.SetGUI(true)
×
74
      ret
×
75
    end
76

77
    # Write settings dialog
78
    # @param [Boolean] useUI boolean use user interface (change progress bar)
79
    # @return [Symbol] `next if success, else `abort
80
    def WriteDialog(useUI)
1✔
81
      # Set help text
82
      Wizard.RestoreHelp(WriteDialogHelp()) if useUI
×
83

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

93
      Users.SetGUI(useUI)
×
94
      ret = :next
×
95
      ret = :abort if !Stage.cont if Users.Write != ""
×
96
      Users.SetGUI(true)
×
97
      ret
×
98
    end
99

100
    # Set the module into installation mode with
101
    # first dialog for single user addition
102
    # @return [Symbol] for wizard sequencer
103
    def usersInstStart
1✔
104
      Users.SetStartDialog("user_add")
×
105
      Users.AddUser({})
×
106
      :next
×
107
    end
108

109
    # The dialog that appears when the [Abort] button is pressed.
110
    # @return `abort if user really wants to abort
111
    def ReallyAbort
1✔
112
      ret = true
×
113

114
      if !Stage.cont
×
115
        ret = Modified() ? Popup.ReallyAbort(true) : true
×
116
      else
117
        ret = Popup.ConfirmAbort(:incomplete)
×
118
      end
119

120
      if ret
×
121
        return :abort
×
122
      else
123
        return :back
×
124
      end
125
    end
126
  end
127
end
STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2025 Coveralls, Inc