Skip to content

Commit 15661aa

Browse files
committed
Empty role fix, better error message on uninstall
1 parent 3c0471a commit 15661aa

1 file changed

Lines changed: 4 additions & 3 deletions

File tree

export/WebTerminal/Installer.xml

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -84,7 +84,8 @@ This method is invoked when a class is compiled.</Description>
8484
set cspProperties("AutheEnabled") = 64
8585
set cspProperties("Description") = "An application representing the open socket for /terminal application. Required since 2016.* Cache versions changed WebSocket behavior. PLEASE LEAVE THIS APPLICATION UNAUTHENTICATED, but do not worry: the socket won't accept anyone without the key."
8686
set cspProperties("DispatchClass") = ""
87-
set cspProperties("MatchRoles")=":%DB_CACHESYS:" _ ..GetDBRole(dbdir)
87+
set role = ..GetDBRole(dbdir)
88+
set cspProperties("MatchRoles")=":%DB_CACHESYS" _ $case($get(role)'="", 1: ":"_role, :"")
8889
do ..RegisterWebApplication("/terminalsocket", .cspProperties)
8990
set status = ##Class(Config.Namespaces).Get("%All")
9091
if ($$$ISERR(status)) { // no namespace %All
@@ -133,8 +134,8 @@ This method is invoked when a class is 'uncompiled'.</Description>
133134
write !, "Uninstalling WebTerminal application from " _ $NAMESPACE
134135
set ns = $NAMESPACE // has to be package home namespace!
135136
if ($get(^WebTerminal("HomeNamespace")) = "") {
136-
set msg = "Terminal home namespace is not defined! Uninstalling will be skipped."
137-
set msg = msg _ $Char(13,10) _ "Set ^WebTerminal(""HomeNamespace"") global equal to home namespace"
137+
set msg = "Please, set ^WebTerminal(""HomeNamespace"") global equal to " _
138+
"the namespace WebTerminal was installed to before uninstalling."
138139
quit $$$ERROR($$$GeneralError, msg)
139140
} else {
140141
set ns = ^WebTerminal("HomeNamespace")

0 commit comments

Comments
 (0)