Module: Yast::LdapServerTreeStructureInclude
- Defined in:
- ../../src/include/ldap-server/tree_structure.rb
Instance Method Summary (collapse)
-
- (Object) addDatabaseWidgetMap(type, label, item_name, index, new_db)
**************************************** tree generation functions ** ***************************************.
-
- (Object) cb_check_allow
**************************** * global allow handlers ***************************.
-
- (Object) cb_check_default
**************************** * default handlers ***************************.
-
- (Object) cb_check_loglevel
**************************** * global loglevel handlers ***************************.
- - (Object) cb_check_synccons
- - (Object) cb_input_acl
- - (Object) cb_input_bdb_index
- - (Object) cb_input_confdb
- - (Object) cb_input_databases
- - (Object) cb_input_db
- - (Object) cb_input_ppolicy
- - (Object) cb_input_schema
- - (Object) cb_input_synccons
- - (Object) cb_input_syncprov
- - (Object) cb_input_tls
- - (Object) cb_read_acl
- - (Object) cb_read_allow
- - (Object) cb_read_bdb_index
- - (Object) cb_read_confdb
- - (Object) cb_read_daemon
-
- (Object) cb_read_databases
**************************************** * handlers for database parent widget ***************************************.
- - (Object) cb_read_db
- - (Object) cb_read_default
- - (Object) cb_read_loglevel
- - (Object) cb_read_ppolicy
- - (Object) cb_read_schema
- - (Object) cb_read_synccons
- - (Object) cb_read_syncprov
-
- (Object) cb_read_tls
**************************** * tls handlers ***************************.
- - (Object) cb_write_acl
- - (Object) cb_write_allow
- - (Object) cb_write_confdb
- - (Object) cb_write_daemon
- - (Object) cb_write_databases
-
- (Object) cb_write_db
**************************** * database handlers ***************************.
- - (Object) cb_write_default
- - (Object) cb_write_loglevel
- - (Object) cb_write_ppolicy
- - (Object) cb_write_synccons
- - (Object) cb_write_syncprov
- - (Object) cb_write_tls
- - (Object) deleteDynamicTreeItems
- - (Object) generateDynamicTreeItems
- - (Object) initialize_ldap_server_tree_structure(include_target)
-
- (Object) update_schemalist(l)
**************************** * global schema handlers ***************************.
Instance Method Details
- (Object) addDatabaseWidgetMap(type, label, item_name, index, new_db)
**************************************** tree generation functions ** ***************************************
1277 1278 1279 1280 1281 1282 1283 1284 1285 1286 1287 1288 1289 1290 1291 1292 1293 1294 1295 1296 1297 1298 1299 1300 1301 1302 1303 1304 1305 1306 1307 1308 1309 1310 1311 1312 1313 1314 1315 1316 1317 1318 1319 1320 1321 1322 1323 1324 1325 1326 1327 1328 1329 1330 1331 1332 1333 1334 1335 1336 1337 1338 1339 1340 1341 1342 1343 1344 1345 1346 1347 1348 1349 1350 1351 1352 1353 1354 1355 1356 1357 1358 1359 1360 1361 1362 1363 1364 1365 1366 1367 1368 1369 1370 1371 1372 1373 1374 1375 1376 1377 1378 1379 1380 1381 1382 1383 1384 1385 1386 1387 1388 1389 1390 1391 1392 1393 1394 1395 1396 1397 1398 1399 1400 |
# File '../../src/include/ldap-server/tree_structure.rb', line 1277 def addDatabaseWidgetMap(type, label, item_name, index, new_db) return if Builtins.haskey(@widget_map, item_name) dbIndex = { "name" => _("Index Configuration"), "widget" => @editBdbIndexes, "index" => index, "cb_read" => lambda { cb_read_bdb_index }, "cb_input" => lambda { cb_input_bdb_index }, "help_page" => "index_edit" } dbPpolicy = { "name" => _("Password Policy Configuration"), "widget" => LdapDatabase.GetPpolicyWidget, "index" => index, "cb_read" => lambda { cb_read_ppolicy }, "cb_input" => lambda { cb_input_ppolicy }, "cb_write" => lambda { cb_write_ppolicy }, "help_page" => "ppolicy_edit" } dbAcl = { "name" => _("Access Control Configuration"), "widget" => LdapDatabase.GetAclWidget, "index" => index, "cb_read" => lambda { cb_read_acl }, "cb_write" => lambda { cb_write_acl }, "cb_input" => lambda { cb_input_acl }, "help_page" => "acl_edit" } dbSyncProv = { "name" => _("Replication Provider"), "widget" => LdapDatabase.GetSyncProvWidget, "index" => index, "cb_read" => lambda { cb_read_syncprov }, "cb_write" => lambda { cb_write_syncprov }, "cb_input" => lambda { cb_input_syncprov }, "help_page" => "syncprov_edit" } dbSyncCons = { "name" => _("Replication Consumer"), "widget" => LdapDatabase.GetSyncConsWidget, "index" => index, "cb_read" => lambda { cb_read_synccons }, "cb_write" => lambda { cb_write_synccons }, "cb_input" => lambda { cb_input_synccons }, "cb_check" => lambda { cb_check_synccons }, "help_page" => "synccons_edit" } item_map = { "name" => label, "children" => [Ops.add(item_name, "_acl")], "index" => index, "widget" => @editGenericDatabase, "new_db" => new_db, "dynamic" => true, "help_page" => "database_detail_unsupported" } bdb_item_map = { "name" => label, "children" => [ Ops.add(item_name, "_index"), Ops.add(item_name, "_ppolicy"), Ops.add(item_name, "_acl"), Ops.add(item_name, "_syncprov"), Ops.add(item_name, "_synccons") ], "index" => index, "widget" => @editBdbDatabase, "new_db" => new_db, "dynamic" => true, "help_page" => "database_detail", "cb_read" => lambda { cb_read_db }, "cb_write" => lambda { cb_write_db }, "cb_input" => lambda { cb_input_db } } confdb_item_map = { "name" => label, "children" => [ Ops.add(item_name, "_acl"), Ops.add(item_name, "_syncprov"), Ops.add(item_name, "_synccons") ], "index" => index, "widget" => @editConfigDatabase, "new_db" => new_db, "dynamic" => true, "help_page" => "database_detail_config", "cb_read" => lambda { cb_read_confdb }, "cb_write" => lambda { cb_write_confdb }, "cb_input" => lambda { cb_input_confdb } } Builtins.y2milestone( "adding database item '%1' as '%2'", label, item_name ) if type == "bdb" || type == "hdb" Ops.set(@widget_map, item_name, bdb_item_map) Ops.set(@widget_map, Ops.add(item_name, "_index"), dbIndex) Ops.set(@widget_map, Ops.add(item_name, "_ppolicy"), dbPpolicy) Ops.set(@widget_map, Ops.add(item_name, "_acl"), dbAcl) Ops.set(@widget_map, Ops.add(item_name, "_syncprov"), dbSyncProv) Ops.set(@widget_map, Ops.add(item_name, "_synccons"), dbSyncCons) elsif type == "config" Ops.set(@widget_map, item_name, confdb_item_map) Ops.set(@widget_map, Ops.add(item_name, "_acl"), dbAcl) Ops.set(@widget_map, Ops.add(item_name, "_syncprov"), dbSyncProv) Ops.set(@widget_map, Ops.add(item_name, "_synccons"), dbSyncCons) else Ops.set(@widget_map, item_name, item_map) Ops.set(@widget_map, Ops.add(item_name, "_acl"), dbAcl) end Ops.set( @widget_map, ["databases", "children"], Builtins.add( Ops.get_list(@widget_map, ["databases", "children"], []), item_name ) ) nil end |
- (Object) cb_check_allow
**************************** * global allow handlers ***************************
336 337 338 |
# File '../../src/include/ldap-server/tree_structure.rb', line 336 def cb_check_allow true end |
- (Object) cb_check_default
**************************** * default handlers ***************************
133 134 135 136 |
# File '../../src/include/ldap-server/tree_structure.rb', line 133 def cb_check_default Builtins.y2milestone("calling default check handler") true end |
- (Object) cb_check_loglevel
**************************** * global loglevel handlers ***************************
308 309 310 |
# File '../../src/include/ldap-server/tree_structure.rb', line 308 def cb_check_loglevel true end |
- (Object) cb_check_synccons
1199 1200 1201 1202 1203 1204 1205 1206 1207 1208 |
# File '../../src/include/ldap-server/tree_structure.rb', line 1199 def cb_check_synccons Builtins.y2milestone("cb_check_synccons()") treeItem = @current_tree_item index = Ops.get_integer(@widget_map, [@current_tree_item, "index"]) if UI.WidgetExists(:cb_syncrepl) return LdapDatabase.DbSyncConsCheck(index) else return true end end |
- (Object) cb_input_acl
1105 1106 1107 1108 1109 1110 1111 |
# File '../../src/include/ldap-server/tree_structure.rb', line 1105 def cb_input_acl Builtins.y2milestone("cb_input_acl()") treeItem = @current_tree_item index = Ops.get_integer(@widget_map, [@current_tree_item, "index"]) Builtins.y2milestone("calling acl input handler for item '%1'", treeItem) LdapDatabase.DbAclInput(@handler_cmd, index) end |
- (Object) cb_input_bdb_index
1047 1048 1049 1050 1051 1052 1053 1054 1055 1056 1057 1058 1059 1060 1061 1062 1063 1064 1065 1066 1067 1068 1069 1070 1071 1072 1073 1074 1075 1076 1077 1078 1079 1080 1081 1082 1083 1084 1085 1086 1087 1088 1089 1090 1091 1092 1093 1094 |
# File '../../src/include/ldap-server/tree_structure.rb', line 1047 def cb_input_bdb_index Builtins.y2milestone("cb_input_bdb_index, handlercmd: %1", @handler_cmd) index = Ops.get_integer(@widget_map, [@current_tree_item, "index"]) if @handler_cmd == :pb_idx_add || @handler_cmd == :pb_idx_edit skip = [] editAttr = "" idx = {} idxMap = LdapServer.ReadDatabaseIndexes(index) if @handler_cmd == :pb_idx_add # skip attribute that already have an index defined Builtins.foreach(idxMap) do |attr, idx2| skip = Builtins.add(skip, attr) end else current_item_id = UI.QueryWidget(:tab_idx, :CurrentItem) editAttr = Convert.to_string( UI.QueryWidget(:tab_idx, Cell(current_item_id, 0)) ) idx = Ops.get(idxMap, editAttr, {}) Builtins.y2milestone( "Selected Attr: %1 %2 %3", current_item_id, editAttr, idx ) end newIdx = DatabaseIndexPopup(skip, editAttr, idx) if Ops.greater_than(Builtins.size(newIdx), 0) LdapServer.ChangeDatabaseIndex(index, newIdx) cb_read_bdb_index end elsif @handler_cmd == :pb_idx_del current_item_id = UI.QueryWidget(:tab_idx, :CurrentItem) editAttr = Convert.to_string( UI.QueryWidget(:tab_idx, Cell(current_item_id, 0)) ) Builtins.y2milestone("Selected Attr: %1 %2", current_item_id, editAttr) delIdx = {} Ops.set(delIdx, "name", editAttr) Ops.set(delIdx, "sub", false) Ops.set(delIdx, "pres", false) Ops.set(delIdx, "eq", false) LdapServer.ChangeDatabaseIndex(index, delIdx) cb_read_bdb_index end true end |
- (Object) cb_input_confdb
967 968 969 970 971 972 973 974 975 976 977 978 979 980 981 982 983 984 985 986 987 988 989 990 991 992 993 994 995 996 997 998 999 1000 1001 1002 1003 1004 1005 1006 1007 1008 1009 1010 1011 1012 1013 1014 1015 |
# File '../../src/include/ldap-server/tree_structure.rb', line 967 def cb_input_confdb treeItem = @current_tree_item Builtins.y2milestone("calling db input handler for item '%1'", treeItem) index = Ops.get_integer(@widget_map, [@current_tree_item, "index"]) if @handler_cmd == :pb_changepw newpw = ChangeAdminPassword() if newpw != nil Builtins.y2milestone("set password") newhash = LdapServer.HashPassword( Ops.get(newpw, "hashAlgo", ""), Ops.get(newpw, "password", "") ) Builtins.y2milestone("new hash: %1", newhash) LdapServer.UpdateDatabase(index, { "rootpw" => newhash }) else Builtins.y2milestone("password change cancelled") end elsif @handler_cmd == :cb_conf_ldapsimplebind db = LdapServer.ReadDatabase(index) if Convert.to_boolean(UI.QueryWidget(:cb_conf_ldapsimplebind, :Value)) if Ops.get_string(db, "rootpw", "") == "" UI.ReplaceWidget( :rp_confpw, VBox( Password(Id(:te_rootpw), _("New Administrator &Password")), HSpacing(0.5), Password(Id(:te_valid_rootpw), _("&Validate Password")), HSpacing(0.5), ComboBox( Id(:cb_cryptmethod), _("Password &Encryption"), @enc_types ) ) ) else UI.ReplaceWidget( :rp_confpw, PushButton(Id(:pb_changepw), _("Change Administration Password")) ) end UI.ChangeWidget(:rp_confpw, :Enabled, true) else UI.ChangeWidget(:rp_confpw, :Enabled, false) end end true end |
- (Object) cb_input_databases
609 610 611 612 613 614 615 616 617 618 619 620 621 622 623 624 625 626 627 628 629 630 631 632 633 634 635 636 637 638 639 640 641 642 643 644 645 646 647 648 649 650 651 652 653 654 655 656 657 658 659 660 661 662 663 664 665 666 667 668 669 670 671 672 673 674 675 676 677 678 679 680 681 682 683 684 685 686 687 688 689 690 691 692 693 694 695 696 697 698 699 700 701 702 703 704 705 706 707 708 709 710 711 712 713 714 715 716 717 718 719 720 721 722 723 724 725 |
# File '../../src/include/ldap-server/tree_structure.rb', line 609 def cb_input_databases Builtins.y2milestone("calling databases input handler") if @handler_cmd == :pb_add ret = nil ret = LdapDatabase.AddDbWizard Builtins.y2milestone("Database wizard returned %1", ret) if ret == :next @rebuild_widget_tree = true newDb = LdapDatabase.GetDatabase if !LdapServer.AddDatabase( 0, newDb, LdapDatabase.GetCreateDir, LdapDatabase.GetCreateBase ) err = LdapServer.ReadError @callback_error = Ops.add( Ops.add(Ops.get(err, "msg", ""), "\n"), Ops.get(err, "details", "") ) return false end LdapDatabase.ResetCreateBase syncrepl = LdapDatabase.GetSyncRepl if Ops.greater_than(Builtins.size(syncrepl), 0) && Ops.greater_than( Builtins.size(Ops.get_map(syncrepl, "syncrepl", {})), 0 ) dblist = LdapServer.ReadDatabaseList dbindex = 0 Builtins.foreach(dblist) do |db| if Ops.get(db, "suffix", "") == Ops.get_string(newDb, "suffix", "") dbindex = Builtins.tointeger(Ops.get(db, "index", "0")) raise Break end end if Ops.greater_than(dbindex, 0) if !LdapServer.WriteSyncRepl( dbindex, Ops.get_map(syncrepl, "syncrepl", {}) ) err = LdapServer.ReadError @callback_error = Ops.add( Ops.add(Ops.get(err, "msg", ""), "\n"), Ops.get(err, "details", "") ) return false end LdapServer.WriteUpdateRef( dbindex, Ops.get_map(syncrepl, "updateref", {}) ) end end ppolicy = LdapDatabase.GetPpolicy if Ops.greater_than(Builtins.size(ppolicy), 0) dblist = LdapServer.ReadDatabaseList dbindex = 0 Builtins.foreach(dblist) do |db| if Ops.get(db, "suffix", "") == Ops.get_string(newDb, "suffix", "") dbindex = Builtins.tointeger(Ops.get(db, "index", "0")) raise Break end end if Ops.greater_than(dbindex, 0) if !LdapServer.AddPasswordPolicy(dbindex, ppolicy) err = LdapServer.ReadError @callback_error = Ops.add( Ops.add(Ops.get(err, "msg", ""), "\n"), Ops.get(err, "details", "") ) return false end end end LdapServer.WriteLdapConfBase(LdapDatabase.GetLdapConfBase) else Builtins.y2milestone("Database creating aborted") end elsif @handler_cmd == :pb_del selected = Convert.to_integer(UI.QueryWidget(:tab_db, :CurrentItem)) if selected != nil dblist = LdapServer.ReadDatabaseList db = Convert.convert( Ops.get(dblist, selected), :from => "map", :to => "map <string, string>" ) if db != nil Builtins.y2milestone( "Trying to delete datbase %1 %2", Ops.get(db, "suffix", ""), Ops.get(db, "type", "") ) if Ops.get(db, "type", "") == "frontend" Popup.Error(_("Cannot delete Frontend database")) elsif Ops.get(db, "type", "") == "config" Popup.Error(_("Cannot delete Config database")) else if Popup.YesNo(_("Do you really want to delete the database?")) LdapServer.UpdateDatabase( Builtins.tointeger(Ops.get(db, "index", "")), {} ) cb_read_databases @rebuild_widget_tree = true end end end end end true end |
- (Object) cb_input_db
843 844 845 846 847 848 849 850 851 852 853 854 855 856 857 858 859 860 861 862 863 |
# File '../../src/include/ldap-server/tree_structure.rb', line 843 def cb_input_db treeItem = @current_tree_item Builtins.y2milestone("calling db input handler for item '%1'", treeItem) index = Ops.get_integer(@widget_map, [@current_tree_item, "index"]) if @handler_cmd == :pb_changepw newpw = ChangeAdminPassword() if newpw != nil Builtins.y2milestone("set password") newhash = LdapServer.HashPassword( Ops.get(newpw, "hashAlgo", ""), Ops.get(newpw, "password", "") ) Builtins.y2milestone("new hash: %1", newhash) LdapServer.UpdateDatabase(index, { "rootpw" => newhash }) else Builtins.y2milestone("password change cancelled") end end true end |
- (Object) cb_input_ppolicy
1232 1233 1234 1235 1236 1237 1238 1239 1240 |
# File '../../src/include/ldap-server/tree_structure.rb', line 1232 def cb_input_ppolicy Builtins.y2milestone("cb_input_ppolicy()") index = Ops.get_integer(@widget_map, [@current_tree_item, "index"]) Builtins.y2milestone( "calling db input handler for item '%1'", @current_tree_item ) LdapDatabase.DbPpolicyInput(@handler_cmd, index) end |
- (Object) cb_input_schema
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 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 |
# File '../../src/include/ldap-server/tree_structure.rb', line 239 def cb_input_schema Builtins.y2milestone("calling schema input handler") inclist = LdapServer.ReadSchemaList current_item = Convert.to_string( UI.QueryWidget(:sb_schemalist, :CurrentItem) ) Builtins.y2milestone("current_item is '%1'", current_item) if @handler_cmd == :pb_add #add a new file to the list # file dialog heading new_item = UI.AskForExistingFile( "/etc/openldap/schema/", "*.ldif *", _("Select New Schema File") ) return true if new_item == nil if Builtins.contains(inclist, new_item) # error popup @callback_error = _("The schema file is already in the list.") return false end if Builtins.regexpmatch(new_item, ".*.schema$") if !LdapServer.AddSchemaToSchemaList(new_item) err = LdapServer.ReadError @callback_error = Ops.add( Ops.add(Ops.get(err, "msg", ""), "\n"), Ops.get(err, "details", "") ) return false end inclist2 = LdapServer.ReadSchemaList update_schemalist(inclist2) elsif !LdapServer.AddLdifToSchemaList(new_item) err = LdapServer.ReadError @callback_error = Ops.add( Ops.add(Ops.get(err, "msg", ""), "\n"), Ops.get(err, "details", "") ) return false else inclist2 = LdapServer.ReadSchemaList update_schemalist(inclist2) end # Deleteing Schema ist not supported on the server side yet elsif @handler_cmd == :pb_del return true if current_item == nil LdapServer.RemoveFromSchemaList(current_item) inclist2 = LdapServer.ReadSchemaList update_schemalist(inclist2) elsif @handler_cmd == :sb_schemalist if LdapServer.IsSchemaDeletable(current_item) UI.ChangeWidget(:pb_del, :Enabled, true) else UI.ChangeWidget(:pb_del, :Enabled, false) end end true end |
- (Object) cb_input_synccons
1188 1189 1190 1191 1192 1193 1194 1195 1196 1197 |
# File '../../src/include/ldap-server/tree_structure.rb', line 1188 def cb_input_synccons Builtins.y2milestone("cb_input_synccons()") treeItem = @current_tree_item index = Ops.get_integer(@widget_map, [@current_tree_item, "index"]) if UI.WidgetExists(:cb_syncrepl) return LdapDatabase.DbSyncConsInput(@handler_cmd, index) else return true end end |
- (Object) cb_input_syncprov
1145 1146 1147 1148 1149 1150 1151 |
# File '../../src/include/ldap-server/tree_structure.rb', line 1145 def cb_input_syncprov Builtins.y2milestone("cb_input_syncprov()") treeItem = @current_tree_item index = Ops.get_integer(@widget_map, [@current_tree_item, "index"]) Builtins.y2milestone("calling sync input handler for item '%1'", treeItem) LdapDatabase.DbSyncProvInput(@handler_cmd, index) end |
- (Object) cb_input_tls
491 492 493 494 495 496 497 498 499 500 501 502 503 504 505 506 507 508 509 510 511 512 513 514 515 516 517 518 519 520 521 522 523 524 525 526 527 528 529 530 531 532 533 534 535 536 537 538 539 540 541 542 543 544 545 546 547 548 549 550 551 552 553 554 555 556 557 558 559 560 561 562 563 564 565 566 567 568 569 570 571 572 573 574 575 576 577 578 579 580 581 582 |
# File '../../src/include/ldap-server/tree_structure.rb', line 491 def cb_input_tls Builtins.y2milestone("calling tls input handler") common_cert_available = LdapServer.HaveCommonServerCertificate if @handler_cmd == :cb_tls_enabled tls_enabled_cb = Convert.to_boolean( UI.QueryWidget(:cb_tls_enabled, :Value) ) if tls_enabled_cb UI.ChangeWidget(:cb_ssl_listener_enabled, :Enabled, true) UI.ChangeWidget(:cb_ssl_listener_enabled, :Value, true) if common_cert_available UI.ChangeWidget(:cb_use_common_cert, :Enabled, true) UI.ChangeWidget(:cb_use_common_cert, :Value, true) UI.ChangeWidget(:te_ca_file, :Value, "/etc/ssl/certs/YaST-CA.pem") UI.ChangeWidget( :te_cert_file, :Value, "/etc/ssl/servercerts/servercert.pem" ) UI.ChangeWidget( :te_key_file, :Value, "/etc/ssl/servercerts/serverkey.pem" ) UI.ChangeWidget(:fr_import_cert, :Enabled, false) else UI.ChangeWidget(:fr_import_cert, :Enabled, true) end else UI.ChangeWidget(:cb_ssl_listener_enabled, :Enabled, false) UI.ChangeWidget(:cb_use_common_cert, :Enabled, false) UI.ChangeWidget(:fr_import_cert, :Enabled, false) end elsif @handler_cmd == :cb_use_common_cert use_common_cert = Convert.to_boolean( UI.QueryWidget(:cb_use_common_cert, :Value) ) if use_common_cert if common_cert_available UI.ChangeWidget(:te_ca_file, :Value, "/etc/ssl/certs/YaST-CA.pem") UI.ChangeWidget( :te_cert_file, :Value, "/etc/ssl/servercerts/servercert.pem" ) UI.ChangeWidget( :te_key_file, :Value, "/etc/ssl/servercerts/serverkey.pem" ) UI.ChangeWidget(:fr_import_cert, :Enabled, false) else Popup.Error(_("A common server certificate is not available.")) UI.ChangeWidget(:cb_use_common_cert, :Value, false) UI.ChangeWidget(:cb_use_common_cert, :Enabled, false) end else UI.ChangeWidget(:fr_import_cert, :Enabled, true) end elsif @handler_cmd == :pb_ca_file # file selection headline name = UI.AskForExistingFile( "/etc/ssl/certs", "*.pem *.crt *", _("Select CA Certificate File") ) UI.ChangeWidget(:te_ca_file, :Value, name) if name != nil elsif @handler_cmd == :pb_cert_file # file selection headline name = UI.AskForExistingFile( "/var/lib/CAM", "*.pem *.crt *", _("Select Certificate File") ) UI.ChangeWidget(:te_cert_file, :Value, name) if name != nil elsif @handler_cmd == :pb_key_file # file selection headline name = UI.AskForExistingFile( "/var/lib/CAM", "*.pem *.crt *", _("Select Certificate Key File") ) UI.ChangeWidget(:te_key_file, :Value, name) if name != nil elsif @handler_cmd == :pb_launch_ca WFM.CallFunction("ca_mgm", []) cb_read_tls end #reread tls page true end |
- (Object) cb_read_acl
1096 1097 1098 1099 1100 1101 1102 1103 |
# File '../../src/include/ldap-server/tree_structure.rb', line 1096 def cb_read_acl Builtins.y2milestone("cb_read_acl()") treeItem = @current_tree_item index = Ops.get_integer(@widget_map, [@current_tree_item, "index"]) acllist = LdapServer.ReadDatabaseAcl(index) LdapDatabase.DbAclRead(index, acllist) end |
- (Object) cb_read_allow
340 341 342 343 344 345 346 347 |
# File '../../src/include/ldap-server/tree_structure.rb', line 340 def cb_read_allow Builtins.y2milestone("calling allow read handler") allowlist = LdapServer.ReadAllowFeatures disallowlist = LdapServer.ReadDisallowFeatures UI.ChangeWidget(:msb_allow, :SelectedItems, allowlist) UI.ChangeWidget(:msb_disallow, :SelectedItems, disallowlist) true end |
- (Object) cb_read_bdb_index
1017 1018 1019 1020 1021 1022 1023 1024 1025 1026 1027 1028 1029 1030 1031 1032 1033 1034 1035 1036 1037 1038 1039 1040 1041 1042 1043 1044 1045 |
# File '../../src/include/ldap-server/tree_structure.rb', line 1017 def cb_read_bdb_index index = Ops.get_integer(@widget_map, [@current_tree_item, "index"]) Builtins.y2milestone( "cb_read_bdb_index current item: %1, index %2", @current_tree_item, index ) idxMap = LdapServer.ReadDatabaseIndexes(index) i = 0 newItems = [] Builtins.foreach(idxMap) do |attr, idx| eqIdx = _("No") presIdx = _("No") substrIdx = _("No") approxIdx = _("No") Builtins.y2milestone("index attr: %1", attr) eqIdx = _("Yes") if Ops.get(idx, "eq", false) presIdx = _("Yes") if Ops.get(idx, "pres", false) substrIdx = _("Yes") if Ops.get(idx, "sub", false) newItems = Builtins.add( newItems, Item(Id(i), attr, presIdx, eqIdx, substrIdx, approxIdx) ) i = Ops.add(i, 1) end UI.ChangeWidget(:tab_idx, :Items, newItems) true end |
- (Object) cb_read_confdb
926 927 928 929 930 931 932 933 934 935 936 937 938 939 940 941 942 943 944 945 946 947 948 949 950 951 952 953 954 955 956 957 958 959 960 961 962 963 964 965 |
# File '../../src/include/ldap-server/tree_structure.rb', line 926 def cb_read_confdb Builtins.y2milestone("cb_read_db current item: %1", @current_tree_item) index = Ops.get_integer(@widget_map, [@current_tree_item, "index"]) if index == nil @callback_error = _("Unable to read settings for the current database.") Builtins.y2error( "'index' entry for item '%1' is nil", @current_tree_item ) return false end db = LdapServer.ReadDatabase(index) UI.ChangeWidget( :cb_conf_ldapsimplebind, :Value, Ops.get_boolean(db, "secure_only", false) ) if Ops.get_boolean(db, "secure_only", false) if Ops.get_string(db, "rootpw", "") == "" UI.ReplaceWidget( :rp_confpw, VBox( Password(Id(:te_rootpw), _("New Administrator &Password")), HSpacing(0.5), Password(Id(:te_valid_rootpw), _("&Validate Password")), HSpacing(0.5), ComboBox( Id(:cb_cryptmethod), _("Password &Encryption"), @enc_types ) ) ) end else UI.ChangeWidget(:rp_confpw, :Enabled, false) end true end |
- (Object) cb_read_daemon
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 |
# File '../../src/include/ldap-server/tree_structure.rb', line 162 def cb_read_daemon Builtins.y2milestone("calling read handler for item \"daemon\"") enabled = LdapServer.ReadServiceEnabled CWMFirewallInterfaces.OpenFirewallInit(@fw_widget, "") if enabled UI.ChangeWidget(:rb_service_enable, :CurrentButton, :rb_yes) else UI.ChangeWidget(:rb_service_enable, :CurrentButton, :rb_no) end if LdapServer.ReadSLPEnabled UI.ChangeWidget(:cb_register_slp, :Value, true) else UI.ChangeWidget(:cb_register_slp, :Value, false) end if LdapServer.ReadProtocolListenerEnabled("ldap") UI.ChangeWidget(:cb_interface_ldap, :Value, true) else UI.ChangeWidget(:cb_interface_ldap, :Value, false) end if LdapServer.ReadProtocolListenerEnabled("ldaps") UI.ChangeWidget(:cb_interface_ldaps, :Value, true) else UI.ChangeWidget(:cb_interface_ldaps, :Value, false) end true end |
- (Object) cb_read_databases
**************************************** * handlers for database parent widget ***************************************
588 589 590 591 592 593 594 595 596 597 598 599 600 601 602 603 |
# File '../../src/include/ldap-server/tree_structure.rb', line 588 def cb_read_databases Builtins.y2milestone("calling databases read handler") dblist = LdapServer.ReadDatabaseList pos = -1 itemlist = Builtins.maplist(dblist) do |v| pos = Ops.add(pos, 1) Item( Id(pos), Ops.get_string(v, "suffix", ""), Ops.get_string(v, "type", "") ) end UI.ChangeWidget(:tab_db, :Items, itemlist) true end |
- (Object) cb_read_db
789 790 791 792 793 794 795 796 797 798 799 800 801 802 803 804 805 806 807 808 809 810 811 812 813 814 815 816 817 818 819 820 821 822 823 824 825 826 827 828 829 830 831 832 833 834 835 836 837 838 839 840 841 |
# File '../../src/include/ldap-server/tree_structure.rb', line 789 def cb_read_db Builtins.y2milestone("cb_read_db current item: %1", @current_tree_item) index = Ops.get_integer(@widget_map, [@current_tree_item, "index"]) if index == nil @callback_error = _("Unable to read settings for the current database.") Builtins.y2error( "'index' entry for item '%1' is nil", @current_tree_item ) return false end db = LdapServer.ReadDatabase(index) UI.ChangeWidget(:te_basedn, :Value, Ops.get_string(db, "suffix", "")) rootdn = Ops.get_string(db, "rootdn", "") append_checked = false pos = Builtins.search(rootdn, Ops.get_string(db, "suffix", "")) if Ops.greater_than(pos, -1) chkSuffix = Builtins.substring(rootdn, pos) if chkSuffix == Ops.get_string(db, "suffix", "") rootdn = Builtins.substring(rootdn, 0, Ops.subtract(pos, 1)) append_checked = true end end UI.ChangeWidget(:te_rootdn, :Value, rootdn) UI.ChangeWidget(:cb_append_basedn, :Value, append_checked) UI.ChangeWidget( :if_entrycache, :Value, Builtins.tointeger(Ops.get_string(db, "entrycache", "")) ) UI.ChangeWidget( :if_idlcache, :Value, Builtins.tointeger(Ops.get_string(db, "idlcache", "")) ) checkpoint = Ops.get_list(db, "checkpoint", []) UI.ChangeWidget( :if_checkpoint_kb, :Value, Builtins.tointeger(Ops.get_string(checkpoint, 0, "")) ) UI.ChangeWidget( :if_checkpoint_min, :Value, Builtins.tointeger(Ops.get_string(checkpoint, 1, "")) ) true end |
- (Object) cb_read_default
138 139 140 141 |
# File '../../src/include/ldap-server/tree_structure.rb', line 138 def cb_read_default Builtins.y2milestone("calling default read handler") true end |
- (Object) cb_read_loglevel
312 313 314 315 316 317 318 |
# File '../../src/include/ldap-server/tree_structure.rb', line 312 def cb_read_loglevel Builtins.y2milestone("calling loglevel read handler") lvls = LdapServer.ReadLogLevels UI.ChangeWidget(:msb_loglevel, :SelectedItems, lvls) true end |
- (Object) cb_read_ppolicy
1242 1243 1244 1245 1246 |
# File '../../src/include/ldap-server/tree_structure.rb', line 1242 def cb_read_ppolicy Builtins.y2milestone("cb_read_ppolicy()") index = Ops.get_integer(@widget_map, [@current_tree_item, "index"]) LdapDatabase.DbPpolicyRead(index) end |
- (Object) cb_read_schema
232 233 234 235 236 237 |
# File '../../src/include/ldap-server/tree_structure.rb', line 232 def cb_read_schema Builtins.y2milestone("calling schema read handler") inclist = LdapServer.ReadSchemaList update_schemalist(inclist) true end |
- (Object) cb_read_synccons
1170 1171 1172 1173 1174 1175 1176 1177 1178 1179 1180 1181 1182 1183 1184 1185 1186 |
# File '../../src/include/ldap-server/tree_structure.rb', line 1170 def cb_read_synccons Builtins.y2milestone("cb_read_synccons()") treeItem = @current_tree_item index = Ops.get_integer(@widget_map, [@current_tree_item, "index"]) srl = LdapServer.ReadSyncRepl(index) if Ops.greater_than(Builtins.size(srl), 1) UI.ReplaceWidget( :syncConsWidget, Label(_("Multiple Replication Consumers not supported currently")) ) return true else sr = Ops.get(srl, 0, {}) updateref = LdapServer.ReadUpdateRef(index) return LdapDatabase.DbSyncConsRead(index, sr, updateref) end end |
- (Object) cb_read_syncprov
1137 1138 1139 1140 1141 1142 1143 |
# File '../../src/include/ldap-server/tree_structure.rb', line 1137 def cb_read_syncprov Builtins.y2milestone("cb_read_syncprov()") treeItem = @current_tree_item index = Ops.get_integer(@widget_map, [@current_tree_item, "index"]) sp = LdapServer.ReadSyncProv(index) LdapDatabase.DbSyncProvRead(@handler_cmd, index, sp) end |
- (Object) cb_read_tls
**************************** * tls handlers ***************************
374 375 376 377 378 379 380 381 382 383 384 385 386 387 388 389 390 391 392 393 394 395 396 397 398 399 400 401 402 403 404 405 406 407 408 409 410 411 412 413 414 415 416 417 418 419 420 421 422 423 |
# File '../../src/include/ldap-server/tree_structure.rb', line 374 def cb_read_tls Builtins.y2milestone("calling tls read handler") tls = LdapServer.ReadTlsConfig Builtins.y2milestone("tls config %1", tls) if (Ops.get_string(tls, "caCertFile", "") != "" || Ops.get_string(tls, "caCertDir", "") != "") && Ops.get_string(tls, "certFile", "") != "" && Ops.get_string(tls, "certKeyFile", "") != "" UI.ChangeWidget(:cb_tls_enabled, :Value, true) UI.ChangeWidget(:cb_ssl_listener_enabled, :Enabled, true) if Ops.get_string(tls, "caCertFile", "") == "/etc/ssl/certs/YaST-CA.pem" && Ops.get_string(tls, "certFile", "") == "/etc/ssl/servercerts/servercert.pem" && Ops.get_string(tls, "certKeyFile", "") == "/etc/ssl/servercerts/serverkey.pem" UI.ChangeWidget(:cb_use_common_cert, :Value, true) UI.ChangeWidget(:fr_import_cert, :Enabled, false) else UI.ChangeWidget(:cb_use_common_cert, :Value, false) UI.ChangeWidget(:fr_import_cert, :Enabled, true) end else UI.ChangeWidget(:cb_ssl_listener_enabled, :Enabled, false) UI.ChangeWidget(:cb_use_common_cert, :Enabled, false) UI.ChangeWidget(:fr_import_cert, :Enabled, false) end UI.ChangeWidget( :cb_ssl_listener_enabled, :Value, LdapServer.ReadProtocolListenerEnabled("ldaps") ) UI.ChangeWidget( :te_ca_file, :Value, Ops.get_string(tls, "caCertFile", "") ) UI.ChangeWidget( :te_cert_file, :Value, Ops.get_string(tls, "certFile", "") ) UI.ChangeWidget( :te_key_file, :Value, Ops.get_string(tls, "certKeyFile", "") ) true end |
- (Object) cb_write_acl
1113 1114 1115 1116 1117 1118 1119 1120 1121 1122 1123 1124 1125 1126 1127 1128 1129 1130 1131 1132 1133 1134 1135 |
# File '../../src/include/ldap-server/tree_structure.rb', line 1113 def cb_write_acl Builtins.y2milestone("cb_write_acl()") treeItem = @current_tree_item index = Ops.get_integer(@widget_map, [@current_tree_item, "index"]) changedAcls = LdapDatabase.DbAclWrite(index) return true if changedAcls == nil ret = LdapServer.ChangeDatabaseAcl( index, Convert.convert( changedAcls, :from => "list <map>", :to => "list <map <string, any>>" ) ) if !ret err = LdapServer.ReadError @callback_error = Ops.add( Ops.add(Ops.get(err, "msg", ""), "\n"), Ops.get(err, "details", "") ) end ret end |
- (Object) cb_write_allow
349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 |
# File '../../src/include/ldap-server/tree_structure.rb', line 349 def cb_write_allow Builtins.y2milestone("calling allow write handler") allowlist = [] disallowlist = [] allowlist = Convert.convert( UI.QueryWidget(:msb_allow, :SelectedItems), :from => "any", :to => "list <string>" ) disallowlist = Convert.convert( UI.QueryWidget(:msb_disallow, :SelectedItems), :from => "any", :to => "list <string>" ) Builtins.y2milestone("writing allowlist: '%1'", allowlist) LdapServer.WriteAllowFeatures(allowlist) LdapServer.WriteDisallowFeatures(disallowlist) true end |
- (Object) cb_write_confdb
865 866 867 868 869 870 871 872 873 874 875 876 877 878 879 880 881 882 883 884 885 886 887 888 889 890 891 892 893 894 895 896 897 898 899 900 901 902 903 904 905 906 907 908 909 910 911 912 913 914 915 916 917 918 919 920 921 922 923 924 |
# File '../../src/include/ldap-server/tree_structure.rb', line 865 def cb_write_confdb index = Ops.get_integer(@widget_map, [@current_tree_item, "index"]) Builtins.y2milestone( "calling confdb write handler for '%1'", @current_tree_item ) if index == nil # Error Popup @callback_error = _( "Unable to write settings for the current database." ) Builtins.y2error( "'name' entry for item '%1' is nil", @current_tree_item ) return false end db = {} olddb = LdapServer.ReadDatabase(index) Ops.set( db, "secure_only", Convert.to_boolean(UI.QueryWidget(:cb_conf_ldapsimplebind, :Value)) ) if Ops.get_boolean(db, "secure_only", false) if Ops.get_string(olddb, "rootpw", "") == "" pw = Convert.to_string(UI.QueryWidget(:te_rootpw, :Value)) verifypw = Convert.to_string(UI.QueryWidget(:te_valid_rootpw, :Value)) hashAlgo = Convert.to_string(UI.QueryWidget(:cb_cryptmethod, :Value)) if Builtins.size(pw) == 0 Popup.Error(_("Enter a password")) UI.ChangeWidget(:te_rootpw, :Value, "") UI.ChangeWidget(:te_valid_rootpw, :Value, "") return false elsif pw != verifypw Popup.Error( _("The passwords you have entered do not match. Try again.") ) UI.ChangeWidget(:te_rootpw, :Value, "") UI.ChangeWidget(:te_valid_rootpw, :Value, "") pw = "" verifypw = "" return false end if pw != "" Builtins.y2milestone("set password") newhash = LdapServer.HashPassword(hashAlgo, pw) Builtins.y2milestone("new hash: %1", newhash) Ops.set(db, "rootpw", newhash) end end else Ops.set(db, "rootpw", "") end res = LdapServer.UpdateDatabase(index, db) true end |
- (Object) cb_write_daemon
189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 |
# File '../../src/include/ldap-server/tree_structure.rb', line 189 def cb_write_daemon Builtins.y2milestone("calling write handler for item \"daemon\"") serviceEnabled = Convert.to_symbol( UI.QueryWidget(Id(:rb_service_enable), :CurrentButton) ) CWMFirewallInterfaces.OpenFirewallStore(@fw_widget, "", {}) if serviceEnabled == :rb_yes LdapServer.WriteServiceEnabled(true) else LdapServer.WriteServiceEnabled(false) end LdapServer.WriteSLPEnabled( Convert.to_boolean(UI.QueryWidget(Id(:cb_register_slp), :Value)) ) LdapServer.WriteProtocolListenerEnabled( "ldap", Convert.to_boolean(UI.QueryWidget(Id(:cb_interface_ldap), :Value)) ) LdapServer.WriteProtocolListenerEnabled("ldapi", true) if Convert.to_boolean(UI.QueryWidget(Id(:cb_interface_ldaps), :Value)) tls = LdapServer.ReadTlsConfig if Ops.get_string(tls, "caCertFile", "") != "" && Ops.get_string(tls, "certFile", "") != "" && Ops.get_string(tls, "certKeyFile", "") != "" LdapServer.WriteProtocolListenerEnabled("ldaps", true) else if Popup.YesNoHeadline( _("Your TLS/SSL Configuration seems to be incomplete."), _("Do you really want to enable the \"ldaps\" protocol listener?") ) LdapServer.WriteProtocolListenerEnabled("ldaps", true) else LdapServer.WriteProtocolListenerEnabled("ldaps", false) end end else LdapServer.WriteProtocolListenerEnabled("ldaps", false) end true end |
- (Object) cb_write_databases
605 606 607 |
# File '../../src/include/ldap-server/tree_structure.rb', line 605 def cb_write_databases true end |
- (Object) cb_write_db
**************************** * database handlers ***************************
731 732 733 734 735 736 737 738 739 740 741 742 743 744 745 746 747 748 749 750 751 752 753 754 755 756 757 758 759 760 761 762 763 764 765 766 767 768 769 770 771 772 773 774 775 776 777 778 779 780 781 782 783 784 785 786 787 |
# File '../../src/include/ldap-server/tree_structure.rb', line 731 def cb_write_db index = Ops.get_integer(@widget_map, [@current_tree_item, "index"]) Builtins.y2milestone( "calling db write handler for '%1'", @current_tree_item ) if index == nil # Error Popup @callback_error = _( "Unable to write settings for the current database." ) Builtins.y2error( "'name' entry for item '%1' is nil", @current_tree_item ) return false end db = {} Ops.set( db, "rootdn", Convert.to_string(UI.QueryWidget(:te_rootdn, :Value)) ) if Ops.get_string(db, "rootdn", "") != "" && Convert.to_boolean(UI.QueryWidget(:cb_append_basedn, :Value)) olddb = LdapServer.ReadDatabase(index) suffix = Ops.get_string(olddb, "suffix", "") Ops.set( db, "rootdn", Ops.add(Ops.add(Ops.get_string(db, "rootdn", ""), ","), suffix) ) end Ops.set( db, "entrycache", Convert.to_integer(UI.QueryWidget(:if_entrycache, :Value)) ) Ops.set( db, "idlcache", Convert.to_integer(UI.QueryWidget(:if_idlcache, :Value)) ) kbytes = Convert.to_integer(UI.QueryWidget(:if_checkpoint_kb, :Value)) min = Convert.to_integer(UI.QueryWidget(:if_checkpoint_min, :Value)) checkpoint = [kbytes, min] Ops.set(db, "checkpoint", checkpoint) Builtins.y2milestone("updated Database: %1", db) res = LdapServer.UpdateDatabase(index, db) true end |
- (Object) cb_write_default
143 144 145 146 |
# File '../../src/include/ldap-server/tree_structure.rb', line 143 def cb_write_default Builtins.y2milestone("calling default write handler") true end |
- (Object) cb_write_loglevel
320 321 322 323 324 325 326 327 328 329 330 |
# File '../../src/include/ldap-server/tree_structure.rb', line 320 def cb_write_loglevel Builtins.y2milestone("calling loglevel write handler") idlist = Convert.convert( UI.QueryWidget(:msb_loglevel, :SelectedItems), :from => "any", :to => "list <string>" ) Builtins.y2milestone("writing loglevel: '%1'", idlist) LdapServer.WriteLogLevels(idlist) end |
- (Object) cb_write_ppolicy
1248 1249 1250 1251 1252 1253 1254 1255 1256 1257 1258 1259 1260 1261 1262 1263 1264 1265 1266 1267 1268 1269 1270 1271 |
# File '../../src/include/ldap-server/tree_structure.rb', line 1248 def cb_write_ppolicy treeItem = @current_tree_item Builtins.y2milestone("cb_write_policy() treeitem: '%1'", treeItem) index = Ops.get_integer(@widget_map, [@current_tree_item, "index"]) result = true ppolicy = LdapDatabase.DbPpolicyWrite(index) if Ops.greater_than(Builtins.size(ppolicy), 0) result = LdapServer.AddPasswordPolicy(index, ppolicy) else ppolicy_old = LdapServer.ReadPpolicyOverlay(index) if Ops.greater_than(Builtins.size(ppolicy_old), 0) # delete ppolicy result = LdapServer.AddPasswordPolicy(index, {}) end end if !result err = LdapServer.ReadError @callback_error = Ops.add( Ops.add(Ops.get(err, "msg", ""), "\n"), Ops.get(err, "details", "") ) end result end |
- (Object) cb_write_synccons
1210 1211 1212 1213 1214 1215 1216 1217 1218 1219 1220 1221 1222 1223 1224 1225 1226 1227 1228 1229 1230 |
# File '../../src/include/ldap-server/tree_structure.rb', line 1210 def cb_write_synccons Builtins.y2milestone("cb_write_synccons()") treeItem = @current_tree_item index = Ops.get_integer(@widget_map, [@current_tree_item, "index"]) return true if !UI.WidgetExists(:cb_syncrepl) syncrepl = LdapDatabase.DbSyncConsWrite(index) result = false result = LdapServer.WriteSyncRepl( index, Ops.get_map(syncrepl, "syncrepl", {}) ) if !result err = LdapServer.ReadError @callback_error = Ops.add( Ops.add(Ops.get(err, "msg", ""), "\n"), Ops.get(err, "details", "") ) end LdapServer.WriteUpdateRef(index, Ops.get_map(syncrepl, "updateref", {})) result end |
- (Object) cb_write_syncprov
1153 1154 1155 1156 1157 1158 1159 1160 1161 1162 1163 1164 1165 1166 1167 1168 |
# File '../../src/include/ldap-server/tree_structure.rb', line 1153 def cb_write_syncprov Builtins.y2milestone("cb_write_syncprov()") result = false treeItem = @current_tree_item index = Ops.get_integer(@widget_map, [@current_tree_item, "index"]) syncprov = LdapDatabase.DbSyncProvWrite(index) result = LdapServer.WriteSyncProv(index, syncprov) if !result err = LdapServer.ReadError @callback_error = Ops.add( Ops.add(Ops.get(err, "msg", ""), "\n"), Ops.get(err, "details", "") ) end result end |
- (Object) cb_write_tls
425 426 427 428 429 430 431 432 433 434 435 436 437 438 439 440 441 442 443 444 445 446 447 448 449 450 451 452 453 454 455 456 457 458 459 460 461 462 463 464 465 466 467 468 469 470 471 472 473 474 475 476 477 478 479 480 481 482 483 484 485 486 487 488 489 |
# File '../../src/include/ldap-server/tree_structure.rb', line 425 def cb_write_tls Builtins.y2milestone("calling tls write handler") tls_active = Convert.to_boolean(UI.QueryWidget(:cb_tls_enabled, :Value)) if tls_active == true cafile = Convert.to_string(UI.QueryWidget(:te_ca_file, :Value)) tlsSettings = { "certKeyFile" => Convert.to_string( UI.QueryWidget(:te_key_file, :Value) ), "certFile" => Convert.to_string( UI.QueryWidget(:te_cert_file, :Value) ), "caCertFile" => Convert.to_string( UI.QueryWidget(:te_ca_file, :Value) ), "caCertDir" => "", "crlFile" => "", "crlCheck" => 0, "verifyClient" => 0, "tls_active" => true } if Ops.get_string(tlsSettings, "caCertFile", "") == "" @callback_error = _("Select a Valid CA Certificate File") return false end if Ops.get_string(tlsSettings, "certFile", "") == "" @callback_error = _("Select a valid Certificate File") return false end if Ops.get_string(tlsSettings, "certKeyFile", "") == "" @callback_error = _("Select a valid Certificate Key File") return false end if !LdapServer.WriteTlsConfig(tlsSettings) err = LdapServer.ReadError @callback_error = Ops.add( Ops.get(err, "msg", ""), Ops.get(err, "details", "") ) return false end LdapServer.WriteProtocolListenerEnabled( "ldaps", Convert.to_boolean( UI.QueryWidget(Id(:cb_ssl_listener_enabled), :Value) ) ) else tlsSettings = { "tls_active" => false, "certKeyFile" => "", "certFile" => "", "caCertFile" => "", "caCertDir" => "", "crlFile" => "", "crlCheck" => 0, "verifyClient" => 0 } LdapServer.WriteTlsConfig(tlsSettings) LdapServer.WriteProtocolListenerEnabled("ldaps", false) end true end |
- (Object) deleteDynamicTreeItems
1432 1433 1434 1435 1436 1437 1438 1439 1440 1441 |
# File '../../src/include/ldap-server/tree_structure.rb', line 1432 def deleteDynamicTreeItems Builtins.y2milestone("deleting dynamic tree items") @widget_map = Builtins.filter(@widget_map) do |key, val| !Ops.get_boolean(val, "dynamic", false) end Ops.set(@widget_map, ["databases", "children"], []) nil end |
- (Object) generateDynamicTreeItems
1402 1403 1404 1405 1406 1407 1408 1409 1410 1411 1412 1413 1414 1415 1416 1417 1418 1419 1420 1421 1422 1423 1424 1425 1426 1427 1428 1429 1430 |
# File '../../src/include/ldap-server/tree_structure.rb', line 1402 def generateDynamicTreeItems Builtins.y2debug("generating database tree items") #generate database entries dblist = LdapServer.ReadDatabaseList i = 0 Builtins.foreach(dblist) do |db| tmp = Builtins.sformat( "%1 (%2)", Ops.get(db, "suffix", ""), Ops.get(db, "type", "") ) name = Ops.add("database-", Builtins.tostring(i)) addDatabaseWidgetMap( Ops.get(db, "type", ""), tmp, name, Builtins.tointeger(Ops.get(db, "index", "0")), false ) i = Ops.add(i, 1) end Builtins.y2debug( "databases map is '%1'", Ops.get(@widget_map, "databases", {}) ) nil end |
- (Object) initialize_ldap_server_tree_structure(include_target)
11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 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 |
# File '../../src/include/ldap-server/tree_structure.rb', line 11 def initialize_ldap_server_tree_structure(include_target) Yast.import "UI" textdomain "ldap-server" Yast.import "LdapServer" Yast.import "LdapDatabase" Yast.import "Report" Yast.import "Label" Yast.import "HTML" Yast.import "String" Yast.include include_target, "ldap-server/widgets.rb" # forward declaration of the widget tree @widget_map = nil # error string, all callbacks return false and set this to an error description @callback_error = "" @widget_tree = nil # this is set to true when the widget tree must be rebuilt, that is, when dynamic tree # items are added/removed @rebuild_widget_tree = true # command for input handlers, is set in the main UserInput loop in dialogs.ycp # --> pseudo function argument for input callbacks @handler_cmd = nil # current_tree_item, is set in main UserInput loop. The widget_map key of the currently # active tree item. Used by callbacks of dynamic items. # --> pseudo function argument for dynamic callbacks @current_tree_item = "" #**************************************** #* tree structure definition ** #*************************************** @widget_map = { "base" => { "children" => ["daemon", "global", "schema", "databases"] }, "daemon" => { "name" => _("Startup Configuration"), "widget" => @dlg_service, "cb_read" => lambda { cb_read_daemon }, "cb_write" => lambda { cb_write_daemon }, "help_page" => "startup_config" }, "global" => { "children" => ["g_loglevel", "g_allow", "g_tls"], # Tree item "name" => _("Global Settings"), "widget" => Empty() }, "schema" => { # Tree item "name" => _("Schema Files"), "widget" => @schemaWidget, "inclist" => [], "cb_read" => lambda { cb_read_schema }, "cb_input" => lambda { cb_input_schema } }, "g_loglevel" => { # Tree item "name" => _("Log Level Settings"), "widget" => @loglevelWidget, "cb_check" => lambda { cb_check_loglevel }, "cb_read" => lambda { cb_read_loglevel }, "cb_write" => lambda { cb_write_loglevel } }, "g_allow" => { # Tree item "name" => _("Allow/Disallow Features"), "widget" => @allowWidget, "cb_check" => lambda { cb_check_allow }, "cb_read" => lambda { cb_read_allow }, "cb_write" => lambda { cb_write_allow } }, "g_tls" => { # Tree item "name" => _("TLS Settings"), "widget" => @tlsWidget, "cb_read" => lambda { cb_read_tls }, "cb_write" => lambda { cb_write_tls }, "cb_input" => lambda { cb_input_tls }, "help_page" => "tls_dialog" }, "databases" => { # Tree item "name" => _("Databases"), "widget" => VBox( MinSize( 60, 7, Table( Id(:tab_db), Opt(:keepSorting), Header(_("Suffix DN"), _("Database Type")) ) ), Left( HBox( PushButton(Id(:pb_add), Label.AddButton), PushButton(Id(:pb_del), Label.DeleteButton) ) ) ), "cb_read" => lambda { cb_read_databases }, "cb_write" => lambda { cb_write_databases }, "cb_input" => lambda { cb_input_databases } } } end |
- (Object) update_schemalist(l)
**************************** * global schema handlers ***************************
152 153 154 155 156 157 158 159 160 |
# File '../../src/include/ldap-server/tree_structure.rb', line 152 def update_schemalist(l) l = deep_copy(l) l = [] if l == nil #widget_map["g_schema","inclist"] = l; UI.ChangeWidget(:sb_schemalist, :Items, l) UI.ChangeWidget(:pb_del, :Enabled, false) nil end |