Module: Yast::AuthServerComplexInclude
- Defined in:
- ../../src/include/auth-server/complex.rb
Instance Method Summary (collapse)
- - (Object) DisplayError(error)
- - (Object) DoMigration
- - (Object) initialize_auth_server_complex(include_target)
- - (Object) MigrationMainDialog
-
- (Object) ReadDialog
Read settings dialog.
-
- (Object) SummaryDialog
Summary dialog.
-
- (Object) WriteDialog
Write settings dialog.
-
- (Object) WriteServiceDialog
Write service settings dialog.
Instance Method Details
- (Object) DisplayError(error)
26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 |
# File '../../src/include/auth-server/complex.rb', line 26 def DisplayError(error) error = deep_copy(error) if Ops.get(error, "msg") != nil if Ops.get(error, "details") != nil Popup.ErrorDetails( Ops.get(error, "msg", ""), Ops.get(error, "details", "") ) else Popup.Error(Ops.get(error, "msg", "")) end end nil end |
- (Object) DoMigration
195 196 197 198 199 200 201 202 203 204 |
# File '../../src/include/auth-server/complex.rb', line 195 def DoMigration AuthServer.UseLdapiForConfig(true) if !AuthServer.MigrateSlapdConf Builtins.y2milestone("AuthServer::MigrateSlapdConf failed") DisplayError(AuthServer.ReadError) return :abort end AuthServer.Read :next end |
- (Object) initialize_auth_server_complex(include_target)
11 12 13 14 15 16 17 18 19 20 21 22 23 24 |
# File '../../src/include/auth-server/complex.rb', line 11 def initialize_auth_server_complex(include_target) Yast.import "UI" textdomain "auth-server" Yast.import "Label" Yast.import "Popup" Yast.import "Wizard" Yast.import "AuthServer" Yast.import "Package" Yast.import "Service" Yast.include include_target, "auth-server/helps.rb" end |
- (Object) MigrationMainDialog
133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 |
# File '../../src/include/auth-server/complex.rb', line 133 def MigrationMainDialog caption = _("Migrate existing Configuration") summary = _( "Your system is currently configured to use the configuration file\n" + "/etc/openldap/slapd.conf. YaST only supports the dynamic configuration\n" + "database of OpenLDAP (back-config). Do you want to migrate your existing\n" + "configuration to the configuration database?\n" ) contents = VBox( HSquash( RadioButtonGroup( Id(:rb), VBox( Label(summary), Left( RadioButton(Id(0), _("Migrate existing configuration"), true) ), Left( RadioButton(Id(1), _("Create a new configuration from scratch")) ) ) ) ) ) Wizard.SetContentsButtons( caption, contents, Ops.get_string(@HELPS, "summary", ""), Label.BackButton, Label.NextButton ) ret = :next while true ret = Convert.to_symbol(UI.UserInput) # abort? if ret == :abort || ret == :cancel if Popup.ReallyAbort(true) break else next end elsif ret == :next current = Convert.to_integer(UI.QueryWidget(Id(:rb), :CurrentButton)) if current == 0 ret = :next else ret = :initial end break elsif ret == :back break else Builtins.y2error("unexpected retcode: %1", ret) next end end ret end |
- (Object) ReadDialog
Read settings dialog
44 45 46 47 48 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 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 |
# File '../../src/include/auth-server/complex.rb', line 44 def ReadDialog Wizard.RestoreHelp(Ops.get_string(@HELPS, "read", "")) # ensure openldap2 package is installed if !Package.InstallAll(["openldap2", "krb5-server", "krb5-client"]) if !Package.Available("openldap2") # translators: error popup before aborting the module Popup.Error( Builtins.sformat( _( "The package '%1' is not available.\n" + "YaST2 cannot continue the configuration\n" + "without installing the package." ), "openldap2" ) ) else # translators: error popup before aborting the module Popup.Error( _( "YaST2 cannot continue the configuration\nwithout installing the required packages." ) ) end return :abort end ret = AuthServer.Read if !ret DisplayError(AuthServer.ReadError) return :abort end hasBackconfig = AuthServer.IsUsingBackconfig configModified = AuthServer.SlapdConfChanged #original shipped slapd.conf? serviceEnabled = AuthServer.ReadServiceEnabled serviceRunning = AuthServer.ReadServiceRunning kerberosEnabled = AuthServer.ReadKerberosEnabled switchToBackConfig = false convert = false #y2milestone("OpenLDAP running: %1", isRunning); Builtins.y2milestone("OpenLDAP using backConfig: %1", hasBackconfig) Builtins.y2milestone("OpenLDAP modifed config: %1", configModified) configFile = "/etc/openldap/slapd.conf" if !hasBackconfig if configModified return :migrate else # Start new config wizward AuthServer.InitDbDefaults return :initial end else if !configModified # Start new config wizward AuthServer.InitDbDefaults return :initial elsif !serviceRunning ret2 = Popup.AnyQuestion3( _("Existing configuration detected."), _( "You have an existing configuration, but the LDAP server is currently not running.\n" + "Do you want to start the server now and re-read its configuration data or do you \n" + "want to create a new configuration from scratch?" ), _("Restart"), Label.CancelButton, _("New Configuration"), :focus_yes ) if ret2 == :yes AuthServer.WriteRestartRequired(true) return :reread elsif ret2 == :no return :abort elsif ret2 == :retry # Start new config wizward AuthServer.InitDbDefaults return :initial end end end :next end |
- (Object) SummaryDialog
Summary dialog
229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 |
# File '../../src/include/auth-server/complex.rb', line 229 def SummaryDialog # LdapServer summary dialog caption caption = _("Authentication Server Configuration Summary") summary = AuthServer.Summary # Frame label contents = VBox( RichText(summary) #, #`Right( # `PushButton( `id(`pb_advanced), _("Advanced Configuration") ) #) ) Wizard.SetContentsButtons( caption, contents, Ops.get_string(@HELPS, "summary", ""), Label.BackButton, Label.FinishButton ) ret = nil while true ret = UI.UserInput # abort? if ret == :abort || ret == :cancel if Popup.ReallyAbort(true) break else next end elsif ret == :pb_advanced Popup.Error("Not there yet") AuthServer.ReadFromDefaults ret = :advanced break elsif ret == :next if !AuthServer.ReadFromDefaults DisplayError(AuthServer.ReadError) ret = :abort end break elsif ret == :back break else Builtins.y2error("unexpected retcode: %1", ret) next end end deep_copy(ret) end |
- (Object) WriteDialog
Write settings dialog
217 218 219 220 221 222 223 224 225 |
# File '../../src/include/auth-server/complex.rb', line 217 def WriteDialog Wizard.RestoreHelp(Ops.get_string(@HELPS, "write", "")) ret = AuthServer.Write if !ret DisplayError(AuthServer.ReadError) return :abort end ret ? :next : :abort end |
- (Object) WriteServiceDialog
Write service settings dialog. This dialog writes only the service settings (sysconfig and init.d stuff)
209 210 211 212 213 |
# File '../../src/include/auth-server/complex.rb', line 209 def WriteServiceDialog Wizard.RestoreHelp(Ops.get_string(@HELPS, "write", "")) ret = AuthServer.WriteServiceSettings ret ? :next : :reread end |