Class List Method List File List

# Module: Yast::SudoWizardsInclude

Defined in:
  ../../src/include/sudo/wizards.rb

## Instance Method Summary (collapse)

- - (Object) initialize_sudo_wizards(include_target)
- - (Object) MainSequence

  Main workflow of sudo configuration.

- - (Object) SudoSequence

  Whole configuration of sudo.

## Instance Method Details

### - (`Object`) initialize_sudo_wizards(include_target)

    30
    31
    32
    33
    34
    35
    36
    37
    38
    39
    40
    41
    42
    43
    44
    45
    # File '../../src/include/sudo/wizards.rb', line 30

    def initialize_sudo_wizards(include_target)
      Yast.import "UI"

      textdomain "sudo"

      Yast.import "Sequencer"
      Yast.import "Wizard"

      Yast.include include_target, "sudo/complex.rb"
      Yast.include include_target, "sudo/dialogs.rb"
      Yast.include include_target, "sudo/dialog-spec.rb"
      Yast.include include_target, "sudo/dialog-user.rb"
      Yast.include include_target, "sudo/dialog-host.rb"
      Yast.include include_target, "sudo/dialog-runas.rb"
      Yast.include include_target, "sudo/dialog-cmnd.rb"
    end

### - (`Object`) MainSequence

Main workflow of sudo configuration

    49
    50
    51
    52
    53
    54
    55
    56
    57
    58
    59
    60
    61
    62
    63
    64
    65
    66
    67
    68
    69
    70
    71
    72
    73
    74
    75
    76
    77
    78
    79
    80
    81
    82
    83
    84
    85
    86
    87
    88
    89
    90
    91
    92
    93
    94
    95
    96
    97
    98
    99
    100
    101
    # File '../../src/include/sudo/wizards.rb', line 49

    def MainSequence
      aliases = {
        "configuration"    => lambda { RunSudoDialogs() },
        "user_spec_add"    => lambda { AddEditUserSpecDialog("Add") },
        "user_spec_edit"   => lambda { AddEditUserSpecDialog("Edit") },
        "user_spec_save"   => lambda { SaveUserSpec() },
        "user_alias_add"   => lambda { AddEditUserAliasDialog("Add") },
        "user_alias_edit"  => lambda { AddEditUserAliasDialog("Edit") },
        "user_alias_save"  => lambda { SaveUserAliases() },
        "host_alias_add"   => lambda { AddEditHostAliasDialog("Add") },
        "host_alias_edit"  => lambda { AddEditHostAliasDialog("Edit") },
        "host_alias_save"  => lambda { SaveHostAliases() },
        "runas_alias_add"  => lambda { AddEditRunAsAliasDialog("Add") },
        "runas_alias_edit" => lambda { AddEditRunAsAliasDialog("Edit") },
        "runas_alias_save" => lambda { SaveRunAsAliases() },
        "cmnd_alias_add"   => lambda { AddEditCmndAliasDialog("Add") },
        "cmnd_alias_edit"  => lambda { AddEditCmndAliasDialog("Edit") }
      }

      sequence = {
        "ws_start"         => "configuration",
        "configuration"    => {
          :add_spec     => "user_spec_add",
          :edit_spec    => "user_spec_edit",
          :add_u_alias  => "user_alias_add",
          :edit_u_alias => "user_alias_edit",
          :add_h_alias  => "host_alias_add",
          :edit_h_alias => "host_alias_edit",
          :add_r_alias  => "runas_alias_add",
          :edit_r_alias => "runas_alias_edit",
          :save_r_alias => "runas_alias_save",
          :add_c_alias  => "cmnd_alias_add",
          :edit_c_alias => "cmnd_alias_edit",
          :abort        => :abort,
          :next         => :next
        },
        "user_spec_add"    => { :abort => :abort, :next => "user_spec_save" },
        "user_spec_edit"   => { :abort => :abort, :next => "user_spec_save" },
        "user_spec_save"   => { :abort => :abort, :next => "configuration" },
        "user_alias_add"   => { :abort => :abort, :next => "user_alias_save" },
        "user_alias_edit"  => { :abort => :abort, :next => "user_alias_save" },
        "user_alias_save"  => { :abort => :abort, :next => "configuration" },
        "host_alias_add"   => { :abort => :abort, :next => "configuration" },
        "host_alias_edit"  => { :abort => :abort, :next => "configuration" },
        "runas_alias_add"  => { :abort => :abort, :next => "configuration" },
        "runas_alias_edit" => { :abort => :abort, :next => "configuration" },
        "cmnd_alias_add"   => { :abort => :abort, :next => "configuration" },
        "cmnd_alias_edit"  => { :abort => :abort, :next => "configuration" }
      }
      ret = Sequencer.Run(aliases, sequence)

      deep_copy(ret)
    end

### - (`Object`) SudoSequence

Whole configuration of sudo

Returns:

- sequence result

    105
    106
    107
    108
    109
    110
    111
    112
    113
    114
    115
    116
    117
    118
    119
    120
    121
    122
    123
    124
    # File '../../src/include/sudo/wizards.rb', line 105

    def SudoSequence
      aliases = { "main" => lambda { MainSequence() }, "write" => [lambda do
        WriteDialog()
      end, true] }

      sequence = {
        "ws_start" => "main",
        "main"     => { :abort => :abort, :next => "write" },
        "write"    => { :abort => :abort, :next => :next }
      }

      Wizard.CreateDialog
      Wizard.SetDesktopTitleAndIcon("sudo")
      return :abort if !Sudo.Read

      ret = Sequencer.Run(aliases, sequence)

      UI.CloseDialog
      deep_copy(ret)
    end