Skip to content

Commit

Permalink
Update "GET SERVERPREFS" command to get blocking new users setting fo…
Browse files Browse the repository at this point in the history
…r Claris FileMaker Server 2024 (#38)
  • Loading branch information
matsuo committed Jun 18, 2024
1 parent c8ea3ae commit 791d70c
Show file tree
Hide file tree
Showing 3 changed files with 31 additions and 0 deletions.
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@ Features
- View and change the setting for parallel backup (for FileMaker Server 19.5.1 or later)
- FileMaker Admin API PKI Authentication (for FileMaker Server 19.6.1 or later)
- View the setting for the persistent cache (for FileMaker Server 20.1.1 or later)
- View the setting for blocking new users (for FileMaker Server 21.0.1 or later)

Supported Servers
-----
Expand Down
28 changes: 28 additions & 0 deletions fmcsadmin.go
Original file line number Diff line number Diff line change
Expand Up @@ -1061,6 +1061,7 @@ func (c *cli) Run(args []string) int {
startupRestoration = true
case "authenticatedstream", "parallelbackupenabled":
case "persistcacheenabled", "syncpersistcache":
case "blocknewusersenabled":
default:
exitStatus = 10001
}
Expand Down Expand Up @@ -1111,6 +1112,8 @@ func (c *cli) Run(args []string) int {
printOptions = append(printOptions, "persistcacheenabled")
case "syncpersistcache":
printOptions = append(printOptions, "syncpersistcache")
case "blocknewusersenabled":
printOptions = append(printOptions, "blocknewusersenabled")
default:
exitStatus = 10001
}
Expand All @@ -1135,6 +1138,9 @@ func (c *cli) Run(args []string) int {
printOptions = append(printOptions, "persistcacheenabled")
printOptions = append(printOptions, "syncpersistcache")
}
if !usingCloud && version >= 21.0 {
printOptions = append(printOptions, "blocknewusersenabled")
}
}

if version >= 19.2 && startupRestoration {
Expand Down Expand Up @@ -1185,6 +1191,18 @@ func (c *cli) Run(args []string) int {
}
}
}

if option == "blocknewusersenabled" {
if usingCloud {
// for Claris FileMaker Cloud
exitStatus = 3
} else {
// for Claris FileMaker Server
if version < 21.0 {
exitStatus = 3
}
}
}
}
}

Expand Down Expand Up @@ -3859,6 +3877,12 @@ func getServerGeneralConfigurations(urlString string, token string, printOptions
getServerSettingAsBool(strings.Replace(urlString, "/general", "/persistentcache", 1), token, []string{option})
}
}

if option == "blocknewusersenabled" {
if version >= 21.0 {
getServerSettingAsBool(strings.Replace(urlString, "/general", "/blocknewusers", 1), token, []string{option})
}
}
}
}

Expand Down Expand Up @@ -3941,6 +3965,8 @@ func getServerSettingAsBool(urlString string, token string, printOptions []strin
if syncPersistCacheEnabled {
syncPersistCacheEnabledStr = "true"
}
} else if u.Path == path.Join(getAPIBasePath(urlString), "server", "config", "blocknewusers") {
err = scan.ScanTree(v, "/response/blockNewUsers", &enabled)
}

enabledStr = "false"
Expand All @@ -3962,6 +3988,8 @@ func getServerSettingAsBool(urlString string, token string, printOptions []strin
fmt.Println("PersistCacheEnabled = " + enabledStr + " [default: false] ")
case "syncpersistcache":
fmt.Println("SyncPersistCache = " + syncPersistCacheEnabledStr + " [default: false] ")
case "blocknewusersenabled":
fmt.Println("BlockNewUsersEnabled = " + enabledStr + " [default: false] ")
default:
}
}
Expand Down
2 changes: 2 additions & 0 deletions release-notes.txt
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,11 @@ fmcsadmin
This software is distributed under the Apache License, Version 2.0, see LICENSE.txt and NOTICE.txt for more information.

Version: 2.2.0 (in development)
- Add support for Claris FileMaker Server 2024 (21.0).
- Add support for Claris FileMaker Server 2023 (20.1, 20.2 and 20.3).
- Add support for Ubuntu 22.04 LTS (on amd64 architecture).
- Add support for Ubuntu 22.04 LTS on arm64 architecture.
- Update "GET SERVERPREFS" command to get blocking new users setting for Claris FileMaker Server 2024 (21.0). (Usage: "fmcsadmin get serverprefs BlockNewUsersEnabled")
- Update "GET SERVERPREFS" command to get persistent cache setting for Claris FileMaker Server 2023 (20.1). (Usage: "fmcsadmin get serverprefs PersistCacheEnabled")
- Update "GET SERVERPREFS" command to get persistent cache sync setting for Claris FileMaker Server 2023 (20.1). (Usage: "fmcsadmin get serverprefs SyncPersistCache")
- Update "GET SERVERCONFIG" command and "GET SERVERPREFS" command due to increasing the maximum number of hosted database files per FileMaker Server instance.
Expand Down

0 comments on commit 791d70c

Please sign in to comment.