Skip to content

Commit ab5fd10

Browse files
Prevent projected class deletion from non-home namespace
1 parent b44bb34 commit ab5fd10

2 files changed

Lines changed: 10 additions & 3 deletions

File tree

export/WebTerminal/Installer.xml

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ Importing this class will install Cache WEB Terminal properly.</Description>
66
<Super>%Projection.AbstractProjection</Super>
77
<TimeChanged>63954,74786.153524</TimeChanged>
88
<TimeCreated>63890,71053.144208</TimeCreated>
9-
<DependsOn>Common,Engine,Router,StaticContent</DependsOn>
9+
<DependsOn>Common,Engine,Router,StaticContent,Autocomplete,Trace</DependsOn>
1010

1111
<Parameter name="DispatchClass">
1212
<Default>WebTerminal.Router</Default>
@@ -70,7 +70,8 @@ This method is invoked when a class is compiled.</Description>
7070
<ReturnType>%Status</ReturnType>
7171
<Implementation><![CDATA[
7272
write !, "Installing WebTerminal application to " _ $NAMESPACE
73-
set ns = $NAMESPACE // has to be package home namespace!
73+
set ns = $NAMESPACE // ought to be package home namespace!
74+
set ^WebTerminal("HomeNamespace") = ns
7475
zn:ns'="%SYS" "%SYS"
7576
do ##class(Security.System).GetInstallationSecuritySetting(.security)
7677
set cspProperties("AutheEnabled") = 32 // password by default, 64 for no password
@@ -129,6 +130,12 @@ This method is invoked when a class is 'uncompiled'.</Description>
129130
<Implementation><![CDATA[
130131
write !, "Uninstalling WebTerminal application from " _ $NAMESPACE
131132
set ns = $NAMESPACE // has to be package home namespace!
133+
if ($get(^WebTerminal("HomeNamespace")) = "") {
134+
write "Terminal home namespace is not defined! Uninstalling will be skipped."
135+
quit '$$$OK
136+
} else {
137+
set ns = ^WebTerminal("HomeNamespace")
138+
}
132139
zn:ns'="%SYS" "%SYS"
133140
do ..RemoveWebApplication("/terminal")
134141
do ..RemoveWebApplication("/terminalsocket")

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
"title": "Cache WEB Terminal",
44
"description": "Web-based terminal emulator for Caché administering.",
55
"author": "ZitRo",
6-
"version": "3.2.4",
6+
"version": "3.2.5",
77
"releaseNumber": 22,
88
"repository": {
99
"type": "git",

0 commit comments

Comments
 (0)