source: trunk/guitools/smbmon/smbmon.vrx@ 1036

Last change on this file since 1036 was 1036, checked in by Herwig Bauernfeind, 8 years ago

SMBMon 2.6: More work on ACLS browser, added tooltips, fixed several bugs, changed icons

File size: 108.7 KB
Line 
1/*:VRX Main
2*/
3/* Samba Status Monitor for OS/2
4Copyright (C) 2007-2017 Herwig Bauernfeind for bww bitwise works GmbH.
5
6This program is free software: you can redistribute it and/or modify
7it under the terms of the GNU General Public License as published by
8the Free Software Foundation, either version 3 of the License, or
9(at your option) any later version.
10
11This program is distributed in the hope that it will be useful,
12but WITHOUT ANY WARRANTY; without even the implied warranty of
13MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14GNU General Public License for more details.
15
16You should have received a copy of the GNU General Public License
17along with this program. If not, see <http://www.gnu.org/licenses/>.
18 */
19/* Main
20*/
21Main:
22/* Process the arguments.
23 Get the parent window.
24*/
25 parse source . calledAs .
26 parent = ""
27 argCount = arg()
28 argOff = 0
29 if( calledAs \= "COMMAND" )then do
30 if argCount >= 1 then do
31 parent = arg(1)
32 argCount = argCount - 1
33 argOff = 1
34 end
35 end; else do
36 call VROptions 'ImplicitNames'
37 call VROptions 'NoEchoQuit'
38 end
39 InitArgs.0 = argCount
40 if( argCount > 0 )then do i = 1 to argCount
41 InitArgs.i = arg( i + argOff )
42 end
43 drop calledAs argCount argOff
44
45/* Load the windows
46*/
47 call VRInit
48 parse source . . spec
49 _VREPrimaryWindowPath = ,
50 VRParseFileName( spec, "dpn" ) || ".VRW"
51 _VREPrimaryWindow = ,
52 VRLoad( parent, _VREPrimaryWindowPath )
53 drop parent spec
54 if( _VREPrimaryWindow == "" )then do
55 call VRMessage "", "Cannot load window:" VRError(), ,
56 "Error!"
57 _VREReturnValue = 32000
58 signal _VRELeaveMain
59 end
60
61/* Process events
62*/
63 call Init
64 signal on halt
65 do while( \ VRGet( _VREPrimaryWindow, "Shutdown" ) )
66 _VREEvent = VREvent()
67 interpret _VREEvent
68 end
69_VREHalt:
70 _VREReturnValue = Fini()
71 call VRDestroy _VREPrimaryWindow
72_VRELeaveMain:
73 call VRFini
74exit _VREReturnValue
75
76VRLoadSecondary:
77 __vrlsWait = abbrev( 'WAIT', translate(arg(2)), 1 )
78 if __vrlsWait then do
79 call VRFlush
80 end
81 __vrlsHWnd = VRLoad( VRWindow(), VRWindowPath(), arg(1) )
82 if __vrlsHWnd = '' then signal __vrlsDone
83 if __vrlsWait \= 1 then signal __vrlsDone
84 call VRSet __vrlsHWnd, 'WindowMode', 'Modal'
85 __vrlsTmp = __vrlsWindows.0
86 if( DataType(__vrlsTmp) \= 'NUM' ) then do
87 __vrlsTmp = 1
88 end
89 else do
90 __vrlsTmp = __vrlsTmp + 1
91 end
92 __vrlsWindows.__vrlsTmp = VRWindow( __vrlsHWnd )
93 __vrlsWindows.0 = __vrlsTmp
94 do while( VRIsValidObject( VRWindow() ) = 1 )
95 __vrlsEvent = VREvent()
96 interpret __vrlsEvent
97 end
98 __vrlsTmp = __vrlsWindows.0
99 __vrlsWindows.0 = __vrlsTmp - 1
100 call VRWindow __vrlsWindows.__vrlsTmp
101 __vrlsHWnd = ''
102__vrlsDone:
103return __vrlsHWnd
104
105/*:VRX __VXREXX____APPENDS__
106*/
107__VXREXX____APPENDS__:
108/*
109#append ..\shared\inittempdir.vrs
110#append ..\shared\sambainit.vrs
111#append ..\shared\nlv.vrs
112#append ..\shared\smbtree.vrs
113#append ..\shared\browse.VRS
114#append ..\shared\usercredmem.vrs
115#append ..\shared\rxrpclib.vrs
116*/
117return
118
119/*:VRX _ChkTDB
120*/
121_ChkTDB:
122
123ok = SysFileTree(etc'\samba\lock\*.TDB',tdb.,'FO')
124say etc'\samba\lock\*.TDB 'tdb.0
125
126error = 0
127ok = VRMethod("CN_CHKTDB", "RemoveRecord", "ALL")
128
129RecHandleArray.0 = 0
130ok = VRSet("CN_CHKTDB", "Painting", 0)
131
132do I = 1 to tdb.0
133 RecHandleArray.I = VRMethod("CN_CHKTDB", "Addrecord")
134end
135ok = VRSet("CN_CHKTDB", "Painting", 1)
136
137/* ok = VRSet("CN_CHKTDB", "Painting", 0) */
138
139do I = 1 to tdb.0
140 RecHandle = RecHandleArray.I
141 TDBFile =left(filespec('N',tdb.I), 22)
142 TDBSize = stream(tdb.I,'c','query size')
143 ok = VRMethod("CN_CHKTDB", "SetFieldData", RecHandle, ChkTDBFilesFH, TDBFile, ChkTDBIconFH, "$50", ChkTDBSizeFH, TDBSize||" Bytes" )
144 address cmd '@tdbtool 'tdb.I' check 2>'tdb.I'.err 1>'tdb.I'.out'
145 ok = file2stem(tdb.I'.out',"out.")
146 out = out.ok
147 say out
148 if pos('integrity is OK',out) > 0 then do /* integrity is ok */
149 ok = SysFileDelete(tdb.I'.err')
150 ok = SysFileDelete(tdb.I'.out')
151 out = left(out,length(out)-1)
152 TDBRecords = substr(out, pos("and has", out) + 7,)
153 ok = VRMethod("CN_CHKTDB", "SetFieldData", RecHandle, ChkTDBStatusFH, TDBRecords )
154
155 address cmd '@tdbbackup -s.bak 'tdb.I' 2>NUL 1>NUL'
156 end
157 else do /* tdb error */
158 ok = VRMethod("CN_CHKTDB", "SetFieldData", RecHandle, ChkTDBIconFH, "$51" )
159 error = 1
160 count = 0
161 out = ""
162 do while lines(tdb.I'.err') > 0 & count < 5
163 errline = linein(tdb.I'.err')
164 select
165 /* skip unnecessary lines of log */
166 when pos("bww ",errline) > 0 then iterate
167 when pos("fcntl",errline) > 0 then iterate
168 otherwise do
169 out = out||errline'. '
170 count = count + 1
171 end
172 end
173 end
174 ok = VRMethod("CN_CHKTDB", "SetFieldData", RecHandle, ChkTDBStatusFH, out )
175 ok = VRSet("CN_CHKTDB", "Painting", 1)
176 ok = VRSet("CN_CHKTDB", "Painting", 0)
177
178 ok = stream(tdb.I'.err','c','close')
179 end
180
181/*
182 call charout , left(filespec('N',tdb.I), 22)
183 address cmd '@tdbtool 'tdb.I' check 2>'tdb.I'.err 1>'tdb.I'.out'
184 out = linein(tdb.I'.out')
185 ok = stream(tdb.I'.out','c','close')
186 say out
187 if pos('integrity is OK',out) = 0 then do
188 call beep 880, 20
189 address cmd '@tdbbackup -s.bak -v 'tdb.I' 2>NUL 1>NUL'
190 error = 1
191 count = 0
192 do while lines(tdb.I'.err') > 0 & count < 5
193 errline = linein(tdb.I'.err')
194 select
195 /* skip unnecessary lines of log */
196 when pos("bww ",errline) > 0 then iterate
197 when pos("fcntl",errline) > 0 then iterate
198 otherwise do
199 say right(copies(' ',22)'Cause: 'errline'!',min(length(errline)+22,79))
200 count = count + 1
201 end
202 end
203 end
204 ok = stream(tdb.I'.err','c','close')
205 end
206 else do
207 ok = SysFileDelete(tdb.I'.err')
208 ok = SysFileDelete(tdb.I'.out')
209 address cmd '@tdbbackup -s.bak 'tdb.I' 2>NUL 1>NUL'
210 end */
211end
212
213ok = VRSet("CN_CHKTDB", "Painting", 1)
214
215return
216
217/*:VRX _ColumnShow
218*/
219_ColumnShow:
220 userdata = VRGet(VRInfo("Object"),"Userdata")
221 parse var userdata Container '|' fieldh '|' VisStatus
222say userdata
223 ok = VRMethod(Container,"SetFieldAttr", fieldh, "Visible", \VisStatus )
224return
225
226/*:VRX _ColumnsMenu
227*/
228_ColumnsMenu:
229 Container = arg(1)
230 ok = VRMethod(Container, "GetFieldList", "Fields." )
231
232 do I = 1 to 14
233 R2I = right("0"||I,2)
234 if I <= fields.0 then do
235/* say "Columns_"||R2I' 'VRMethod(Container, "GetFieldAttr", fields.I, "Title" ) */
236 ok = VRset("Columns_"||R2I, "Visible", 1)
237 ok = VRset("Columns_"||R2I, "Caption", VRMethod(Container, "GetFieldAttr", fields.I, "Title" ))
238 ok = VRset("Columns_"||R2I, "Checked", VRMethod(Container, "GetFieldAttr", fields.I, "Visible" ))
239 ok = VRset("Columns_"||R2I, "Userdata", Container'|'fields.I'|'VRMethod(Container, "GetFieldAttr", fields.I, "Visible" ))
240 end
241 else ok = VRset("Columns_"||R2I, "Visible", 0)
242 end
243 ok = VRMethod( "Columns", "Popup", , , "", "" )
244return
245
246/*:VRX _ContainerInit
247*/
248_ContainerInit:
249 say '_ContainerInit() started.'
250
251 /* Users */
252 UIconH = VRMethod( "CN_Users", "AddField", "Icon", NLVGetMessage(148) )
253 UsernameFH = VRMethod( "CN_Users", "AddField", "String", NLVGetMessage(131) )
254 GroupFH = VRMethod( "CN_Users", "AddField", "String", NLVGetMessage(132) )
255 UMachineFH = VRMethod( "CN_Users", "AddField", "String", NLVGetMessage(133) )
256 UIPAdrFH = VRMethod( "CN_Users", "AddField", "String", NLVGetMessage(147) )
257 UPIDFH = VRMethod( "CN_Users", "AddField", "String", NLVGetMessage(130) )
258
259 /* Files */
260 FIconH = VRMethod( "CN_Files", "AddField", "Icon", NLVGetMessage(148) )
261 FileFH = VRMethod( "CN_Files", "AddField", "String", NLVGetMessage(134) )
262 FUserFH = VRMethod( "CN_Files", "AddField", "String", NLVGetMessage(131) )
263 FPIDFH = VRMethod( "CN_Files", "AddField", "String", NLVGetMessage(130) )
264 DenyModeFH = VRMethod( "CN_Files", "AddField", "String", NLVGetMessage(135) )
265 TimeFH = VRMethod( "CN_Files", "AddField", "String", NLVGetMessage(136) )
266 DateFH = VRMethod( "CN_Files", "AddField", "String", NLVGetMessage(149) )
267 AccessFH = VRMethod( "CN_Files", "AddField", "String", NLVGetMessage(137) )
268 RWFH = VRMethod( "CN_Files", "AddField", "String", NLVGetMessage(138) )
269 OplockFH = VRMethod( "CN_Files", "AddField", "String", NLVGetMessage(139) )
270 UIDFH = VRMethod( "CN_Files", "AddField", "String", NLVGetMessage(140) )
271 SharePathFH= VRMethod( "CN_Files", "AddField", "String", NLVGetMessage(141) )
272 NameFH = VRMethod( "CN_Files", "AddField", "String", NLVGetMessage(142) )
273
274 /* Service */
275 SIconH = VRMethod( "CN_Service", "AddField", "Icon", NLVGetMessage(148) )
276 SPIDFH = VRMethod( "CN_Service", "AddField", "String", NLVGetMessage(130) )
277 ServiceFH = VRMethod( "CN_Service", "AddField", "String", NLVGetMessage(143) )
278 SMachineFH = VRMethod( "CN_Service", "AddField", "String", NLVGetMessage(133) )
279 ConnectedFH= VRMethod( "CN_Service", "AddField", "String", NLVGetMessage(144) )
280
281 /* Daemons */
282 DaemonFH = VRMethod( "CN_Daemons", "AddField", "String", NLVGetMessage(145) )
283 DStatusFH = VRMethod( "CN_Daemons", "AddField", "String", NLVGetMessage(146) )
284 DPidsFH = VRMethod( "CN_Daemons", "AddField", "String", NLVGetMessage(130) )
285
286 smbdHandle = VRMethod("CN_Daemons", "Addrecord",, ,NLVGetMessage(77),"$41") /* smbd.exe */
287 nmbdHandle = VRMethod("CN_Daemons", "Addrecord", ,,NLVGetMessage(78),"$41") /* nmbd.exe */
288 winbHandle = VRMethod("CN_Daemons", "Addrecord",, ,NLVGetMessage(79),"$41") /* winbindd.exe */
289
290 ok = VRMethod("CN_Daemons", "SetFieldData", smbdHandle, DaemonFH, NLVGetMessage(77)) /* smbd.exe */
291 ok = VRMethod("CN_Daemons", "SetFieldData", nmbdHandle, DaemonFH, NLVGetMessage(78)) /* nmbd.exe */
292 ok = VRMethod("CN_Daemons", "SetFieldData", winbHandle, DaemonFH, NLVGetMessage(79)) /* winbindd.exe */
293 ok = (stream(samba.!bin'\winbindd.exe','c','query exists') <> "")
294 ok = VRMethod("CN_Daemons", "SetRecordAttr", winbHandle, "Visible", ok)
295 ok = VRMethod("CN_Daemons", "SetRecordAttr","All", "Collapsed", 0 )
296
297
298 /* SMBTree */
299 WorkgroupFH = VRMethod( "CN_SMBTREE", "AddField", "String", NLVGetMessage(150) )
300 NBFH = VRMethod( "CN_SMBTREE", "AddField", "String", "NetBIOS name" )
301 IpFH = VRMethod( "CN_SMBTREE", "AddField", "String", NLVGetMessage(147) )
302 MBFH = VRMethod( "CN_SMBTREE", "AddField", "String", "DMB/LMB" )
303 OSFH = VRMethod( "CN_SMBTREE", "AddField", "String", "OS" )
304 /* VersionFH = VRMethod( "CN_SmbTree", "AddField", "String", "Version" ) */
305 CommentFH = VRMethod( "CN_SMBTREE", "AddField", "String", NLVGetMessage(151) )
306 MacFH = VRMethod( "CN_SMBTREE", "AddField", "String", "MAC" )
307
308 ok = VRMethod("CN_SMBTREE","SetfieldAttr",IPFH, "ReadOnly", 1)
309 ok = VRMethod("CN_SMBTREE","SetfieldAttr",NBFH, "ReadOnly", 1)
310 ok = VRMethod("CN_SMBTREE","SetfieldAttr",MBFH, "ReadOnly", 1)
311 ok = VRMethod("CN_SMBTREE","SetfieldAttr",WorkGroupFH,"ReadOnly", 1)
312 ok = VRMethod("CN_SMBTREE","SetfieldAttr",OSFH, "ReadOnly", 1)
313 ok = VRMethod("CN_SMBTREE","SetfieldAttr",MacFH, "ReadOnly", 1)
314
315 /* ChkTdb */
316 ChkTDBFilesFH = VRMethod( "CN_CHKTDB", "AddField", "String", NLVGetMessage(134) )
317 ChkTDBIconFH = VRMethod( "CN_CHKTDB", "AddField", "Icon", NLVGetMessage(146) )
318 ChkTDBSizeFH = VRMethod( "CN_CHKTDB", "AddField", "String", NLVGetMessage(152) )
319 ChkTDBStatusFH= VRMethod( "CN_CHKTDB", "AddField", "String", NLVGetMessage(151) )
320
321 ok = VRMethod( "CN_CHKTDB", "SetfieldAttr", ChkTDBIconFH, "Justification","Center", "ReadOnly", 1)
322 ok = VRMethod( "CN_CHKTDB", "SetfieldAttr", ChkTDBSizeFH, "Justification","Right", "ReadOnly", 1)
323 ok = VRMethod( "CN_CHKTDB", "SetfieldAttr", ChkTDBStatusFH, "Justification","Right", "ReadOnly", 1)
324
325 say '_ContainerInit() done.'
326return
327/*:VRX _ContainerSort
328*/
329_ContainerSort:
330 ok = VRMethod( "LB_SortFields", "GetSelectedList", "SortFields." )
331 if Fields.0 = 0 then return
332 idx = SortFields.1
333 ok = VRset( Container, "DetailSort", Fields.idx )
334 ok = VRSet( Container, "Sort", SortOrder )
335 ok = VRMethod( Container, "SortRecords" )
336return
337
338/*:VRX _ContextMenuSelectedSet
339*/
340_ContextMenuSelectedSet:
341 ok = VRSet("ContextMenu_Tree_Login", "Visible", 0)
342 ok = VRSet("ContextMenu_Tree_ACLS", "Visible", 0)
343 ok = VRSet("ContextMenu_Tree_SendMsg", "Visible", 0)
344 ok = VRSet("ContextMenu_Tree_Logoff", "Visible", 0)
345 ok = VRSet("ContextMenu_Tree_Sep1", "Visible", 0)
346 ok = VRSet("ContextMenu_Tree_MiniIcons", "Visible", 0)
347 ok = VRSet("ContextMenu_Tree_Tree", "Visible", 1)
348 ok = VRSet("ContextMenu_Tree_Details", "Visible", 1)
349 ok = VRSet("ContextMenu_Tree_Icons", "Visible", 1)
350 ok = VRSet("ContextMenu_Tree_Sort", "Visible", 0) /* FIXME: Crashes */
351 say ' SMBObj.udatatype = "'SMBObj.udatatype'"'
352 select
353 when SMBObj.udatatype = "WORKGROUP" then do
354 ok = VRSet("ContextMenu_Tree_MiniIcons", "Visible", 1)
355 end
356 when SMBObj.udatatype = "SERVER" then do
357 ok = VRSet("ContextMenu_Tree_Login", "Visible", 1)
358 ok = VRSet("ContextMenu_Tree_SendMsg", "Visible", 1)
359 ok = VRSet("ContextMenu_Tree_Logoff", "Visible", 1)
360 ok = VRSet("ContextMenu_Tree_Sep1", "Visible", 1)
361 ok = VRSet("ContextMenu_Tree_MiniIcons", "Visible", 1)
362 end
363 when SMBObj.udatatype = "DISK" then do
364 ok = VRSet("ContextMenu_Tree_ACLS", "Visible", 1)
365 ok = VRSet("ContextMenu_Tree_Sep1", "Visible", 1)
366 ok = VRSet("ContextMenu_Tree_MiniIcons", "Visible", 1)
367 end
368 when SMBObj.udatatype = "PRINTER" then do
369 ok = VRSet("ContextMenu_Tree_MiniIcons", "Visible", 1)
370 end
371 when SMBObj.udatatype = "DIRECTORY" then do
372 ok = VRSet("ContextMenu_Tree_ACLS", "Visible", 1)
373 ok = VRSet("ContextMenu_Tree_Sep1", "Visible", 1)
374 end
375 when SMBObj.udatatype = "FILE" then do
376 ok = VRSet("ContextMenu_Tree_ACLS", "Visible", 1)
377 ok = VRSet("ContextMenu_Tree_Sep1", "Visible", 1)
378 end
379 otherwise do /* No other value known - default */
380 ok = VRSet("ContextMenu_Tree_Tree", "Visible", 1)
381 ok = VRSet("ContextMenu_Tree_Details", "Visible", 1)
382 ok = VRSet("ContextMenu_Tree_Icons", "Visible", 1)
383 ok = VRSet("ContextMenu_Tree_Sort", "Visible", 1)
384 end
385 end
386return
387
388/*:VRX _CreateSmbStarter
389*/
390_CreateSmbStarter:
391ok = SysFileDelete(samba.!bin'\smbstarter.cmd')
392call lineout samba.!bin'\smbstarter.cmd', '/* REXX */'
393call lineout samba.!bin'\smbstarter.cmd', 'signal on failure name CLEANUP'
394call lineout samba.!bin'\smbstarter.cmd', 'signal on halt name CLEANUP'
395call lineout samba.!bin'\smbstarter.cmd', 'signal on syntax name CLEANUP'
396call lineout samba.!bin'\smbstarter.cmd', 'say "Samba Server Starter"'
397call lineout samba.!bin'\smbstarter.cmd', 'address cmd "@echo off"'
398call lineout samba.!bin'\smbstarter.cmd', 'home:'
399call lineout samba.!bin'\smbstarter.cmd', 'select'
400call lineout samba.!bin'\smbstarter.cmd', 'when VRFileExists("smbstart") then do'
401call lineout samba.!bin'\smbstarter.cmd', 'say "Start"'
402call lineout samba.!bin'\smbstarter.cmd', 'address cmd "call 'samba.!bin'\smb.cmd start"'
403call lineout samba.!bin'\smbstarter.cmd', 'ok = SysFileDelete("smbstart")'
404call lineout samba.!bin'\smbstarter.cmd', 'end'
405call lineout samba.!bin'\smbstarter.cmd', 'when VRFileExists("smbstop") then do'
406call lineout samba.!bin'\smbstarter.cmd', 'say "Stop"'
407call lineout samba.!bin'\smbstarter.cmd', 'address cmd "call 'samba.!bin'\smb.cmd stop"'
408call lineout samba.!bin'\smbstarter.cmd', 'ok = SysFileDelete("smbstop")'
409call lineout samba.!bin'\smbstarter.cmd', 'end'
410call lineout samba.!bin'\smbstarter.cmd', 'when VRFileExists("restart") then do'
411call lineout samba.!bin'\smbstarter.cmd', 'say "Restart"'
412call lineout samba.!bin'\smbstarter.cmd', 'address cmd "call 'samba.!bin'\smb.cmd restart"'
413call lineout samba.!bin'\smbstarter.cmd', 'ok = SysFileDelete("restart")'
414call lineout samba.!bin'\smbstarter.cmd', 'end'
415call lineout samba.!bin'\smbstarter.cmd', 'when VRFileExists("reload") then do'
416call lineout samba.!bin'\smbstarter.cmd', 'say "Reload"'
417call lineout samba.!bin'\smbstarter.cmd', 'address cmd "call 'samba.!bin'\smb.cmd reload"'
418call lineout samba.!bin'\smbstarter.cmd', 'ok = SysFileDelete("reload")'
419call lineout samba.!bin'\smbstarter.cmd', 'end'
420call lineout samba.!bin'\smbstarter.cmd', 'when VRFileExists("quit") then do'
421call lineout samba.!bin'\smbstarter.cmd', 'say "Quit"'
422call lineout samba.!bin'\smbstarter.cmd', 'ok = SysFileDelete("quit")'
423call lineout samba.!bin'\smbstarter.cmd', 'signal cleanup'
424call lineout samba.!bin'\smbstarter.cmd', 'end'
425call lineout samba.!bin'\smbstarter.cmd', 'otherwise nop'
426call lineout samba.!bin'\smbstarter.cmd', 'end'
427call lineout samba.!bin'\smbstarter.cmd', 'ok = SysSleep(1)'
428call lineout samba.!bin'\smbstarter.cmd', 'signal home'
429call lineout samba.!bin'\smbstarter.cmd', 'cleanup:'
430call lineout samba.!bin'\smbstarter.cmd', 'say "Aborting..."'
431call lineout samba.!bin'\smbstarter.cmd', 'exit'
432ok = stream(samba.!bin'\smbstarter.cmd','c','close')
433
434Setup = 'NOPRINT=YES;DEFAULTVIEW=RUNNING;'||,
435 'EXENAME='samba.!bin'\smbstarter.cmd;'||,
436 'STARTUPDIR='samba.!bin';'||,
437 'TITLE=;'||,
438 'PROGTYPE=WINDOWABLEVIO;'||,
439 'MINIMIZED=YES;'||,
440 'VISIBLE=NO;'||,
441 'NOAUTOCLOSE=NO;'||,
442 'OBJECTID=<smbstarter>'
443
444rc = SysCreateObject('WPProgram', 'SMBSTARTER', '<WP_NOWHERE>', Setup, 'UPDATE' )
445If rc <> 1 Then Say ' > failed to create SMBSTARTER Object'
446else ok = SysOpenObject('<smbstarter>', 'DEFAULT', 1)
447
448
449return
450
451/*:VRX _GuessIcon
452*/
453_GuessIcon: procedure
454 text = arg(1)
455 select /* Printer guessing */
456 when pos('LJ',text) > 0 then res = '#65:PMWP.DLL'
457 when pos('LASER',text) > 0 then res = '#65:PMWP.DLL'
458 when pos('EPSON',text) > 0 then res = '#65:PMWP.DLL'
459 when pos('PRINT',text) > 0 then res = '#65:PMWP.DLL'
460 when pos('PRT',text) > 0 then res = '#65:PMWP.DLL'
461 when pos('CANON',text) > 0 then res = '#65:PMWP.DLL'
462 when pos('MINOLTA',text) > 0 then res = '#65:PMWP.DLL'
463 when pos('FAX',text) > 0 then res = '#65:PMWP.DLL'
464 when pos('LEXMARK',text) > 0 then res = '#65:PMWP.DLL'
465 when pos('IPC$',text) > 0 then res = '#59:PMWP.DLL'
466 otherwise res = "#34:PMWP.DLL"
467 end
468return res
469
470/*:VRX _GUIInit
471*/
472_GUIInit:
473 IF options.!debug == 1 then say time()' _GUIInit() started'
474
475 if datatype(Top) = 'NUM' then do
476 ok = VRset("Main","Top",Top)
477 ok = VRset("Main","Left",Left)
478 ok = VRset("Main","Width",Width)
479 ok = VRset("Main","Height",Height)
480 end
481
482 ok = VRSet("Main", "Font", Font.!Main)
483 ok = VRSet("DT_StatusBar","Font", Font.!Status)
484 ok = VRSet("SW_Users", "Font", Font.!Users)
485 ok = VRSet("SW_Files", "Font", Font.!Files)
486 ok = VRSet("SW_Service", "Font", Font.!Service)
487 ok = VRSet("SW_Daemons", "Font", Font.!Daemons)
488 ok = VRSet("SW_SMBTree", "Font", Font.!SMBTree)
489 ok = VRSet("SW_Settings", "Font", Font.!Settings)
490
491 ok = VRSet("CN_Users", "Font", Font.!Users)
492 ok = VRSet("CN_Files", "Font", Font.!Files)
493 ok = VRSet("CN_Service", "Font", Font.!Service)
494 ok = VRSet("CN_Daemons", "Font", Font.!Daemons)
495 ok = VRSet("CN_SMBTREE", "Font", Font.!SMBTree)
496
497 CALL NLVSetText 'DT_Refresh', 'Caption', 25
498 CALL NLVSetText 'DT_RefreshMin', 'Caption', 25
499 CALL NLVSetText 'DT_Intervall', 'Caption', 26
500 ok = VRSet("DT_IntervallMin", "Caption", NLVGetMessage(26)' 'NLVGetMessage(28))
501 CALL NLVSetText 'CB_NoMsgBox', 'Caption', 27
502 CALL NLVSetText 'CB_WPSSTARTSTOP', 'Caption', 29
503 CALL NLVSetText 'CB_DetectZombies','Caption', 30
504
505 CALL NLVSetText 'ContextMenu_Daemons_Sort', 'Caption', 35
506 CALL NLVSetText 'ContextMenu_Daemons_Ping', 'Caption', 32
507 CALL NLVSetText 'ContextMenu_Daemons_Details','Caption', 118
508 CALL NLVSetText 'ContextMenu_Daemons_Tree', 'Caption', 120
509
510 CALL NLVSetText 'ContextMenu_Files_Sort', 'Caption', 35
511
512 CALL NLVSetText 'ContextMenu_Service_Sort', 'Caption', 35
513 CALL NLVSetText 'ContextMenu_Service_CloseSHare', 'Caption', 70
514
515 CALL NLVSetText 'ContextMenu_Users_SendMsg', 'Caption', 80
516 CALL NLVSetText 'ContextMenu_Users_Sort', 'Caption', 35
517
518 CALL NLVSetText 'ContextMenu_Tree_SendMsg', 'Caption', 80
519 CALL NLVSetText 'ContextMenu_Tree_Sort', 'Caption', 35
520 CALL NLVSetText 'ContextMenu_Tree_Tree', 'Caption', 120
521 CALL NLVSetText 'ContextMenu_Tree_Details', 'Caption', 118
522
523 Buttonwidth = VRMethod( "Screen", "PixelsToTwips", 32 )
524
525 ok = VRSet("SPIN_Intervall", "Value", Intervall)
526 ok = VRSet("SPIN_IntervallMin","Value", IntervallMin)
527 ok = VRSet("TM_Refresh","Delay", Intervall * 1000)
528
529 ok = VRSet("ICB_START", "Enabled", VRFileExists(samba.!smbcmd))
530 ok = VRSet("ICB_REstart","Enabled", VRFileExists(samba.!smbcmd))
531 ok = VRSet("ICB_REload", "Enabled", VRFileExists(samba.!smbcmd))
532
533 ok = VRSet("CN_Daemons", "View", DaemonView)
534 ok = VRSet("CN_SMBTREE", "View", TreeView)
535 ok = VRSet("CB_NoMsgBox", "Set", NoMsgBox)
536 ok = VRSet("CB_WPSStartStop", "Set", WPSStartStop)
537 ok = VRSet("CB_DetectZombies","Set", DetectZombies)
538
539 call _INILayoutRead "CN_Users"
540 call _INILayoutRead "CN_Files"
541 call _INILayoutRead "CN_Service"
542 call _INILayoutRead "CN_Daemons"
543 call _INILayoutRead "CN_SMBTREE"
544
545 ok = VRset("CN_DAEMONS", "MiniIcons", \advanced.!bigicons)
546 ok = VRset("CN_SMBTREE", "MiniIcons", \advanced.!bigicons)
547 ok = VRset("ContextMenu_Tree_MiniIcons", "Checked", \advanced.!bigicons)
548 ok = VRset("ContextMenu_Daemons_MiniIcons", "Checked", \advanced.!bigicons)
549 ok = VRSet("CB_Debug","set",options.!Debug)
550
551 if _ChkTempFreeSpace() < 262144 then do
552 Msg.Type = "W"
553 Msg.Text = NLVGetMessage(116, TempDir)
554 call _ShowMsg
555 end
556
557 /* Common margin around controls */
558 margin = ((VRGet("Main", "InteriorLeft") / 3) * 2) + 2
559
560 /* Statusbar */
561 ok = VRSet("DT_STATUSBAR","Caption", " "||VRGet("Main", "HintText"))
562
563 call Main_Resize
564
565
566 ok = VRSet("Main", "Visible", 1)
567 IF options.!debug == 1 then say time()' _GUIInit() done'
568return
569
570/*:VRX _INILayoutRead
571*/
572_INILayoutRead:
573 Container = arg(1)
574 ok = VRMethod(Container, "GetFieldList", "Fields." )
575 Layout = VRGetIni( "Layout", Container, OurINI )
576 if Layout = "" then return
577 do I = 1 to Fields.0
578 ok = VRMethod(Container, "SetFieldAttr", fields.I,"Visible", substr(Layout,I,1))
579 end
580return
581
582/*:VRX _INILayoutWrite
583*/
584_INILayoutWrite:
585 Container = arg(1)
586 ok = VRMethod(Container, "GetFieldList", "Fields." )
587 Layout = ""
588 do I = 1 to fields.0
589 Layout = Layout||VRMethod(Container, "GetFieldAttr", fields.I, "Visible" )
590 end
591 ok = VRSetIni( "Layout", Container , Layout, OurINI, 'NoClose' )
592return
593
594/*:VRX _INIRead
595*/
596_INIRead:
597 IF options.!debug == 1 then say time()' _INIRead() started'
598
599 OurINI = strip(VRParseFileName(VRget("Application","Program"),'DP')'\SMBSTATUS.INI',,'\')
600 ok = SysFileTree(OurINI, INIFound.,'FO')
601 if INIFound.0 = 1 then OurINI = VRParseFileName(INIFound.1,'DPNE')
602 IF options.!debug == 1 then say ' OurINI='OurINI
603
604 Top = VRGetIni( "Pos", "Top", OurINI , 'NoClose')
605 Left = VRGetIni( "Pos", "Left", OurINI , 'NoClose')
606 Width = VRGetIni( "Pos", "Width", OurINI , 'NoClose')
607 Height= VRGetIni( "Pos", "Height", OurINI , 'NoClose')
608
609 Font.!Users = VRGetIni( "Fonts", "SW_USERS", OurINI , 'NoClose' )
610 Font.!Files = VRGetIni( "Fonts", "SW_FILES", OurINI , 'NoClose' )
611 Font.!Service = VRGetIni( "Fonts", "SW_SERVICE", OurINI , 'NoClose' )
612 Font.!Daemons = VRGetIni( "Fonts", "SW_DAEMONS", OurINI , 'NoClose' )
613 Font.!SMBTree = VRGetIni( "Fonts", "SW_SMBTREE", OurINI , 'NoClose' )
614 Font.!Settings= VRGetIni( "Fonts", "SW_SETTINGS", OurINI , 'NoClose' )
615 Font.!Main = VRGetIni( "Fonts", "Main", OurINI , 'NoClose' )
616 Font.!Status = VRGetIni( "Fonts", "Statusfont", OurINI , 'NoClose' )
617
618 if Font.!Users = "" then Font.!Users = "9.WarpSans"
619 if Font.!Files = "" then Font.!Files = "9.WarpSans"
620 if Font.!Service = "" then Font.!Service = "9.WarpSans"
621 if Font.!Daemons = "" then Font.!Daemons = "9.WarpSans"
622 if Font.!SMBTree = "" then Font.!SMBTree = "9.WarpSans"
623 if Font.!Settings = "" then Font.!Settings = "9.WarpSans"
624 if Font.!Main = "" then Font.!Main = "9.WarpSans"
625 if Font.!Status = "" then Font.!Status = "9.WarpSans"
626
627 Intervall = VRGetIni( "Settings", "Intervall", OurINI,'NoClose')
628 if Intervall = "" then Intervall = 60
629
630 IntervallMin = VRGetIni( "Settings", "IntervallMin", OurINI,'NoClose')
631 if IntervallMin = "" then IntervallMin = 180
632
633 CurrentPageNr = VRGetIni( "Settings", "CurrentPageNr", OurINI,'NoClose')
634 if CurrentPageNr = "" then CurrentPageNr = 4
635
636 DaemonView = VRGetIni( "Settings", "DaemonView", OurINI,'NoClose')
637 if DaemonView = "" then DaemonView = "IconTree"
638
639 TreeView = VRGetIni( "Settings", "TreeView", OurINI,'NoClose')
640 if TreeView = "" then TreeView = "IconTree"
641
642 NoMsgBox = VRGetIni( "Settings", "NoMsgBox", OurINI,'NoClose')
643 if NoMsgBox = "" then NoMsgBox = 1
644
645 WPSStartStop = VRGetIni( "Settings", "WPSStartStop", OurINI,'NoClose')
646 if WPSStartStop = "" then WPSStartStop = 1
647
648 DetectZombies = VRGetIni( "Settings", "DetectZombies", OurINI,'NoClose')
649 if DetectZombies = "" then DetectZombies = 0
650
651 options.!debug = VRGetIni( "Options", "Debug", OurINI)
652 if options.!debug = "" then options.!debug = 0
653
654 if options.!Debug then ok = VRRedirectStdIO("ON")
655 else ok = VRRedirectStdIO("OFF")
656 options.!storecreds = VRGetIni('Settings', 'StoreCreds', OurINI, 'NoClose')
657say "options.!storecreds = "options.!storecreds
658 IF options.!storecreds == '' then options.!storecreds = 1
659say "options.!storecreds = "options.!storecreds
660 IF _ucChkObj() = 0 then options.!storecreds = 0
661say "options.!storecreds = "options.!storecreds
662
663
664 advanced.!bigicons = VRGetIni( "Settings", "BigIcons", OurINI)
665 if advanced.!bigicons = "" then advanced.!bigicons = 1
666
667 advanced.!smbconfchanged = 0
668
669 /* For Browse page */
670 FirstRun = 1
671 /* For Users page in case connections.tdb is not initialised */
672 IgnoreSmbNoInit = 1
673
674 /* For Refresh tree display code */
675 RefreshMode =""
676
677 call _BrowseIconsInit
678
679 smbdpidhandle.0 = 0
680 nmbdpidhandle.0 = 0
681 winbpidhandle.0 = 0
682
683 prevsmbdct = 0
684 prevnmbdct = 0
685 prevwinbct = 0
686
687 smbdoutput = TempDir'smbd.out'
688 IF options.!debug == 1 then say time()' _INIRead() done'
689return
690
691/*:VRX _INIWrite
692*/
693_INIWrite:
694 IF options.!debug == 1 then say time()' _INIWrite() started'
695 ok = VRSetIni( "Pos", "Top", VRGet("Main","Top"), OurINI, 'NoClose' )
696 ok = VRSetIni( "Pos", "Left", VRGet("Main","Left"), OurINI, 'NoClose' )
697 ok = VRSetIni( "Pos", "Width", VRGet("Main","Width"), OurINI, 'NoClose' )
698 ok = VRSetIni( "Pos", "Height", VRGet("Main","Height"), OurINI, 'NoClose' )
699
700 ok = VRSetIni( "Settings", "Intervall", VRGet("SPIN_Intervall","Value"),OurINI,'NoClose')
701 ok = VRSetIni( "Settings", "IntervallMin", VRGet("SPIN_IntervallMin","Value"),OurINI,'NoClose')
702 ok = VRSetIni( "Settings", "CurrentPageNr",CurrentPageNr, OurINI,'NoClose')
703 ok = VRSetIni( "Settings", "DaemonView", VRGet("CN_Daemons","View"), OurINI,'NoClose')
704 ok = VRSetIni( "Settings", "TreeView", VRGet("CN_SMBTREE","View"), OurINI,'NoClose')
705 ok = VRSetIni( "Settings", "NoMsgBox", NoMsgBox, OurINI,'NoClose')
706 ok = VRSetIni( "Settings", "WPSStartStop", WPSStartStop, OurINI,'NoClose')
707 ok = VRSetIni( "Settings", "BigIcons", \VRGet("CN_SMBTREE", "MiniIcons"),OurINI,'NoClose')
708 ok = VRSetIni( "Settings", "DetectZombies",DetectZombies, OurINI,'NoClose')
709 call VRSetIni 'Settings', 'StoreCreds', options.!storecreds , OurINI, 'NoClose'
710
711 ok = VRSetIni( "Options", "Debug", options.!debug, OurINI, 'NoClose' )
712
713 call _INILayoutWrite "CN_Users"
714 call _INILayoutWrite "CN_Files"
715 call _INILayoutWrite "CN_Service"
716 call _INILayoutWrite "CN_Daemons"
717 call _INILayoutWrite "CN_SMBTREE"
718
719 if VRGet("CN_USERS", "Font") <> "<default>" then ok = VRSet("SW_USERS", "Font", VRGet("CN_USERS", "Font"))
720 if VRGet("CN_FILES", "Font") <> "<default>" then ok = VRSet("SW_FILES", "Font", VRGet("CN_FILES", "Font"))
721 if VRGet("CN_SERVICE", "Font") <> "<default>" then ok = VRSet("SW_SERVICE","Font", VRGet("CN_SERVICE","Font"))
722 if VRGet("CN_DAEMONS", "Font") <> "<default>" then ok = VRSet("SW_DAEMONS","Font", VRGet("CN_DAEMONS","Font"))
723 if VRGet("CN_SMBTREE", "Font") <> "<default>" then ok = VRSet("SW_SMBTREE","Font", VRGet("CN_SMBTREE","Font"))
724
725 ok = VRSetIni( "Fonts", "SW_USERS", VRGet("SW_USERS", "Font"), OurINI, 'NoClose' )
726 ok = VRSetIni( "Fonts", "SW_FILES", VRGet("SW_FILES", "Font"), OurINI, 'NoClose' )
727 ok = VRSetIni( "Fonts", "SW_SERVICE", VRGet("SW_SERVICE", "Font"), OurINI, 'NoClose' )
728 ok = VRSetIni( "Fonts", "SW_DAEMONS", VRGet("SW_DAEMONS", "Font"), OurINI, 'NoClose' )
729 ok = VRSetIni( "Fonts", "SW_SMBTREE", VRGet("SW_SMBTREE", "Font"), OurINI, 'NoClose' )
730 ok = VRSetIni( "Fonts", "SW_SETTINGS",VRGet("SW_SETTINGS","Font"), OurINI, 'NoClose' )
731 ok = VRSetIni( "Fonts", "Statusfont", VRGet("DT_StatusBar","Font"),OurINI, 'NoClose' )
732 ok = VRSetIni( "Fonts", "Main", VRGet("Main","Font"), OurINI )
733 IF options.!debug == 1 then say time()' _INIWrite() done'
734return
735
736/*:VRX _LoadotherFuncs
737*/
738_LoadotherFuncs:
739 IF options.!debug == 1 then say time()' _LoadotherFuncs() started'
740 SIGNAL ON SYNTAX NAME DLLMissing
741
742 call RxFuncAdd 'SysLoadFuncs', 'RexxUtil', 'SysLoadFuncs'
743 call SysLoadFuncs
744
745 call RxFuncAdd 'PRLoadFuncs', 'PR1UTIL', 'PRLoadFuncs'
746 call PRLoadFuncs
747
748 call rxfuncadd 'IniLoadFuncs', 'REXXINI', 'IniLoadFuncs'
749 call IniLoadFuncs
750
751 call RxFuncAdd 'RxDate', 'RexxDate', 'RxDate'
752
753 SIGNAL OFF SYNTAX
754 IF options.!debug == 1 then say time()' _LoadotherFuncs() done'
755return
756
757DLLMissing:
758 Fatal = 1
759 call VRMessage 'Main', 'REXX function library 'strip(translate(word(sourceline(SIGL-1),4),' ',"',"))'.DLL is missing!', "EVFSGUI fatal error", "E"
760signal Quit
761/*:VRX _MsgYesNo
762*/
763_MsgYesNo:
764 say "_MsgYesNo() started"
765 buttons.0 = 2
766 buttons.1 = NLVGetMessage(6)
767 buttons.2 = NLVGetMessage(7)
768 default = 2
769 buttons.default = NLVGetMessage(7)
770 esc = 2
771 buttons.esc = NLVGetMessage(7)
772 RC = VRMessage( VRWindow(), Msg.Text, Msg.Title,"Q","buttons.",default, esc )
773 say "_MsgYesNo() done, answer "RC
774return RC
775
776/*:VRX _NLVSetup
777*/
778_NLVSetup:
779 settings.!messages = 1 /* language files exist(s) */
780 settings.!helpfile = 0 /* helpfiles do not exist */
781 settings.!nlv8dot3 = 0 /* NLV may have long filenames */
782 call NLVSetup
783
784 Msg.Title = NLVGetMessage(1)
785 ok = VRSet("Main","helpFile", settings.!helpfile)
786
787 /* Setup the tabbed dialogue */
788 w = VRLoad( "TDL_1", VRWindowPath(), "SW_DAEMONS" )
789 ok = VRMethod( "TDL_1", "InsertPage", w,"+ "NLVGetMessage(18)" ")
790 w = VRLoad( "TDL_1", VRWindowPath(), "SW_SMBTREE" )
791 ok = VRMethod( "TDL_1", "InsertPage", w,"+ "NLVGetMessage(19)" ")
792 w = VRLoad( "TDL_1", VRWindowPath(), "SW_USERS" )
793 ok = VRMethod( "TDL_1", "InsertPage", w,"+ "NLVGetMessage(15)" ")
794 w = VRLoad( "TDL_1", VRWindowPath(), "SW_FILES" )
795 ok = VRMethod( "TDL_1", "InsertPage", w,"+ "NLVGetMessage(16)" ")
796 w = VRLoad( "TDL_1", VRWindowPath(), "SW_SERVICE" )
797 ok = VRMethod( "TDL_1", "InsertPage", w,"+ "NLVGetMessage(17)" ")
798 w = VRLoad( "TDL_1", VRWindowPath(), "SW_CHKTDB" )
799 ok = VRMethod( "TDL_1", "InsertPage", w,"+ "NLVGetMessage(22)" ")
800 w = VRLoad( "TDL_1", VRWindowPath(), "SW_SETTINGS" )
801 ok = VRMethod( "TDL_1", "InsertPage", w,"+ "NLVGetMessage(24)" ")
802
803 CALL NLVSetText 'ICB_Refresh', 'Caption', 11
804 CALL NLVSetText 'ICB_Apply', 'Caption', 10
805 CALL NLVSetText 'ICB_About', 'Caption', 14
806 CALL NLVSetText 'ICB_EXIT', 'Caption', 12
807
808 CALL NLVSetText 'ICB_Refresh', 'Hinttext', 51
809/* CALL NLVSetText 'ICB_APPLY', 'Hinttext', FIXME */
810 CALL NLVSetText 'ICB_ABOUT', 'Hinttext', 53
811 CALL NLVSetText 'ICB_EXIT', 'Hinttext', 54
812
813 CALL VRMethod 'TT_Main', 'Register', 'ICB_REFRESH', NLVGetMessage(51)
814 CALL VRMethod 'TT_Main', 'Register', 'ICB_APPLY', NLVGetMessage(52) /* FIXME */
815 CALL VRMethod 'TT_Main', 'Register', 'ICB_ABOUT', NLVGetMessage(53)
816 CALL VRMethod 'TT_Main', 'Register', 'ICB_EXIT', NLVGetMessage(54)
817return
818
819/*:VRX _Refresh
820*/
821_Refresh:
822 IF options.!debug == 1 then say time()' _Refresh() started'
823 ok = VRSet("TM_refresh","Enabled", 0)
824 SmbNoInit = 0
825
826 refreshoutput = TempDir'refresh.out'
827 refresherr = TempDir'refresh.err'
828
829 say ' 'samba.!smbd' -V --debuglevel=0 2>'refresherr' 1>'refreshoutput
830 address cmd samba.!smbd' -V --debuglevel=0 2>'refresherr' 1>'refreshoutput
831
832 do while lines(refreshoutput) > 0
833 Hdr = linein(refreshoutput)
834 if pos("Version ",Hdr) > 0 then leave
835 end
836
837 SambaVer = "Samba "||strip(Hdr)
838 say ' smbd.exe: "'SambaVer'"'
839 ok = stream(refreshoutput,'c','close')
840
841 say ' 'samba.!smbstatusexe' smbd 'DebugLevel' 2>'refresherr' 1>'refreshoutput
842 address cmd samba.!smbstatusexe' smbd 'DebugLevel' 2>'refresherr' 1>'refreshoutput
843
844 do while lines(refreshoutput) > 0
845 Hdr = linein(refreshoutput)
846 if pos("Samba version",Hdr) > 0 then leave
847 end
848
849 SambaStVer = strip(Hdr) /* we can detect version mismatches here */
850 say ' smbstatus: "'SambaStVer'"'
851
852 select
853 when pos('not initialised',SambaStVer) > 0 then do
854 SambaVer = SambaVer||" (Init)"
855 SmbNoInit = 1
856 end
857 when translate(SambaStVer) <> translate(SambaVer) then SambaVer = SambaVer||" (Hybrid)"
858 otherwise nop
859 end
860
861 Ok = VRSet("Main", "Caption", SambaVer' - 'NLVGetMessage(146))
862
863 /* Active User */
864 Hdr1 = linein(refreshoutput)
865/* say ' 1:'hdr1 */
866 Hdr2 = linein(refreshoutput)
867/* say ' 2:'hdr2 */
868 Zeile = linein(refreshoutput)
869 say ' 'Zeile
870 if SmbNoInit then do
871 call lineout samba.!msg, SambaStVer
872 call lineout samba.!msg, Hdr1
873 call lineout samba.!msg, Hdr2
874 call lineout samba.!msg, Zeile
875 ok = stream(samba.!msg,'c','close')
876 if IgnoreSmbNoInit then do
877 call _SambaShowMsg
878 IgnoreSmbNoInit = 0
879 end
880 end
881
882 say ' SmbNoInit = 'SmbNoInit
883
884 /* Active users */
885 ok = VRSet("CN_Users","Painting", 0)
886 ok = VRMethod("CN_Users", "RemoveRecord", "ALL")
887 Username.0 = 0
888 IP.0 = 0
889 Group.0 = 0
890 I = 0
891 if \SmbNoInit then do
892 do while Zeile <> ''
893 parse var Zeile UPID Username Group Machine IP
894 I = I + 1
895 UPID.I = UPID
896 Username.I = Username
897 Group.I = Group
898 IP = strip(IP)
899 parse var IP '('IP.I')'
900 RecHandle = VRMethod("CN_Users", "Addrecord")
901 ok = VRMethod("CN_Users", "SetFieldData", RecHandle, UIconH, "$44", UPIDFH, UPID, UsernameFH, Username, GroupFH, Group, UMachineFH, Machine, UIPAdrFH, IP.I)
902 Zeile = linein(refreshoutput)
903 end
904 end
905 Username.0 = I
906 Group.0 = I
907 UPID.0 = I
908 ok = VRSet("CN_Users","Painting", 1)
909
910 /* Active Services */
911 Hdr = linein(refreshoutput)
912 Hdr = linein(refreshoutput)
913 I = 0
914 Zeile = linein(refreshoutput)
915 ok = VRSet("CN_Service","Painting", 0)
916 ok = VRMethod("CN_Service", "RemoveRecord", "ALL")
917 do while Zeile <> ''
918 parse var Zeile Service SPId Machine Connected
919 I = I + 1
920 SPid.I = SPid
921 Machine.I = Machine
922 Service.I = Service
923 Icon = _GuessIcon(Service.I)
924
925 Connected = strip(Connected)
926 T. = ""
927 parse var Connected T.WDay T.Month T.DoM T.TimeoD T.Year
928 Connected = T.TimeoD', 'T.WDay' 'T.DoM' 'T.Month' 'T.Year
929
930 RecHandle = VRMethod("CN_Service", "Addrecord")
931 ok = VRMethod("CN_Service", "SetFieldData", RecHandle, SIconH, Icon, ServiceFH, Service, SPIDFH, SPID, SMachineFH, Machine, ConnectedFH, Connected)
932 Zeile = linein(refreshoutput)
933 end
934 SPid.0 = I
935 Machine.0 = I
936 Service.0 = I
937
938 ok = VRSet("CN_Service","Painting", 1)
939
940 /* Open files */
941 Hdr = linein(refreshoutput)
942 Hdr = linein(refreshoutput)
943 Hdr = linein(refreshoutput)
944
945 Zeile = linein(refreshoutput)
946 ok = VRSet("CN_Files","Painting", 0)
947 ok = VRMethod("CN_Files", "RemoveRecord", "ALL")
948 File.0 = 0
949 FPID.0 = 0
950 do while Zeile <> ''
951 parse var Zeile FPid Uid DenyMode Access RW Oplock Sharepath Rest
952 TimeDate = right(rest,25)
953
954say 'Refreshcrash "'Rest'"'
955say 'Refreshcrash "'max(length(Rest)-25)'"'
956
957 Name = strip(left(Rest,max(length(Rest)-25,1)))
958 I = I + 1
959 sharepath = strip(translate(left(sharepath,1))||translate(substr(SharePath,2),'\','/'),'T','\')
960 Username = UID
961 do J = 1 to UPID.0
962 if FPID = UPID.J then do
963 Username = Username.J
964 leave
965 end
966 end
967 File = SharePath||'\'||translate(Name,'\','/')
968 File.I = File
969 FPID.I = FPID
970 TimeDate = strip(TimeDate)
971 say Timedate
972 T. = ""
973 parse var TimeDate T.WDay T.Month T.DoM T.TimeoD T.Year
974 FileTime = T.TimeoD
975 FileDate = T.WDay' 'T.DoM' 'T.Month' 'T.Year
976 RecHandle = VRMethod("CN_Files", "Addrecord")
977 ok = VRMethod("CN_Files", "SetFieldData", RecHandle, FPidFH, FPid, FileFH, File, FUserFH, Username, UidFH, Uid, DenyModeFH, DenyMode, AccessFH, Access, RWFH, RW)
978 ok = VRMethod("CN_Files", "SetFieldData", RecHandle, FIconH, "$45", TimeFH, FileTime, DateFH, FileDate, OplockFH, Oplock, SharePathFH, Sharepath, NameFH, Name)
979 Zeile = linein(refreshoutput)
980 end
981 File.0 = I
982 FPID.0 = I
983
984 ok = stream(refreshoutput, 'c','close')
985 ok = SysFileDelete(refreshoutput)
986 ok = stream(refresherr, 'c','close')
987 ok = SysFileDelete(refreshouterr)
988 if VRFileExists( samba.!bin"\smbsched.cmd" ) then do
989 address cmd samba.!bin"\smbsched.cmd"
990 end
991
992 call _RefreshDaemons
993 ok = VRSet("CN_Files","Painting", 1)
994 if VRGet("Main", "WindowState") = "Minimized" then do
995 ok = VRSet("TM_Refresh","Delay", IntervallMin * 1000)
996 end
997 else do
998 ok = VRSet("TM_Refresh","Delay", Intervall * 1000)
999 end
1000 ok = VRSet("TM_refresh","Enabled", 1)
1001
1002 IF options.!debug == 1 then say time()' _Refresh() done'
1003return
1004/*:VRX _RefreshDaemons
1005*/
1006_RefreshDaemons:
1007 IF options.!debug == 1 then say time()' _RefreshDaemons() started'
1008 ok = VRSet("TM_RefreshDaemons","Delay",3000)
1009
1010 ok = VRSet("CN_Daemons","Painting", 0 )
1011 call VRSet VRWindow(), 'Pointer', 'Wait'
1012
1013 do I = 1 to smbdpidhandle.0
1014 ok = VRMethod("CN_Daemons", "RemoveRecord", smbdpidhandle.I )
1015 end
1016
1017 do I = 1 to nmbdpidhandle.0
1018 ok = VRMethod("CN_Daemons", "RemoveRecord", nmbdpidhandle.I )
1019 end
1020
1021 do I = 1 to winbpidhandle.0
1022 ok = VRMethod("CN_Daemons", "RemoveRecord", winbpidhandle.I )
1023 end
1024
1025 Running = _SambaRunning()
1026
1027 call VRSet VRWindow(), 'Pointer', '<default>'
1028
1029 smbdpids = pids.!smbd
1030 nmbdpids = pids.!nmbd
1031 winbpids = pids.!nmbd
1032
1033 smbdRunning = running.!smbd
1034 nmbdRunning = running.!nmbd
1035 winbRunning = running.!winb
1036
1037 if smbdRunning then do
1038 ok = VRMethod("CN_Daemons", "SetFieldData", smbdHandle, DStatusFH, NLVGetMessage(40), DPidsFH, smbdpids)
1039 ok = VRMethod("CN_Daemons", "SetRecordAttr", smbdHandle, "Icon", "$46")
1040 smbdpidhandle.0 = words(smbdpids)
1041 if options.!debug = 1 then do
1042 if smbdpidhandle.0 > prevsmbdct then do
1043 prevsmbdct = smbdpidhandle.0
1044 call beep 880*1, 10
1045 call beep 880*2, 10
1046 call beep 880*4, 10
1047 end
1048 if smbdpidhandle.0 < prevsmbdct then do
1049 prevsmbdct = smbdpidhandle.0
1050 call beep 880*4, 10
1051 call beep 880*2, 10
1052 call beep 880*1, 10
1053 end
1054 end
1055
1056 do I = 1 to words(smbdpids)
1057 Username = ""
1058 do J = 1 to UPID.0
1059 if UPID.J = word(smbdpids,I) then do
1060 Username = ' 'Username.J
1061 leave
1062 end
1063 end
1064 smbdpidhandle.I = VRMethod( "CN_Daemons", "AddRecord", smbdhandle, , NLVGetMessage(130)' 'word(smbdpids,I)' ('d2x(word(smbdpids,I))'x)', "$48")
1065 /* we ping all smbd.exe except the first one */
1066 if DetectZombies = 1 & I > 1 then do
1067 ok = VRSet("Main", 'Pointer', 'Wait' )
1068 address cmd samba.!smbcontrolexe' 'word(smbdpids,I)' ping --timeout=2 --debuglevel=0 2>'samba.!error' 1>'samba.!msg
1069 ok = VRSet("Main", 'Pointer', '<default>' )
1070 response = linein(samba.!msg)
1071 ok = stream(samba.!msg,'c','close')
1072 if pos('PONG', response) = 0 then do /* we have a zombie */
1073 ok = VRMethod( "CN_Daemons", "SetRecordAttr", smbdpidhandle.I,"Icon", "$49")
1074 say " Found Zombie "word(smbdpids,I)
1075 end
1076 end
1077 if Username <> "" then do
1078 smbdpidhandle.I.user = VRMethod( "CN_Daemons", "AddRecord", smbdpidhandle.I, , Username, "$44")
1079 do J = 1 to FPID.0
1080 if FPID.J = word(smbdpids,I) then do
1081 dummyHandle = VRMethod( "CN_Daemons", "AddRecord", smbdpidhandle.I.user, , File.J, "$45")
1082 end
1083 end
1084 end
1085 end
1086 end
1087 else do
1088 ok = VRMethod("CN_Daemons", "SetFieldData", smbdHandle, DStatusFH, NLVGetMessage(41), DPidsFH, "")
1089 ok = VRMethod("CN_Daemons", "SetRecordAttr", smbdHandle, "Icon", "$47")
1090 if options.!debug = 1 then do
1091 if prevsmbdct > 0 then do
1092 prevsmbdct = 0
1093 call beep 880*4, 10
1094 call beep 880*2, 10
1095 call beep 880*1, 10
1096 end
1097 end
1098 end
1099
1100 if nmbdRunning then do
1101 ok = VRMethod("CN_Daemons", "SetFieldData", nmbdHandle, DStatusFH, NLVGetMessage(40), DPidsFH, nmbdpids)
1102 ok = VRMethod("CN_Daemons", "SetRecordAttr", nmbdHandle, "Icon", "$46")
1103 nmbdpidhandle.0 = words(nmbdpids)
1104 do I = 1 to words(nmbdpids)
1105 nmbdpidhandle.I = VRMethod( "CN_Daemons", "AddRecord", nmbdhandle, , NLVGetMessage(130)' 'word(nmbdpids,I)' ('d2x(word(nmbdpids,I))'x)', "$48")
1106 end
1107 end
1108 else do
1109 ok = VRMethod("CN_Daemons", "SetFieldData", nmbdHandle, DStatusFH, NLVGetMessage(41), DPidsFH, "")
1110 ok = VRMethod("CN_Daemons", "SetRecordAttr", nmbdHandle, "Icon", "$47")
1111 end
1112
1113 if winbRunning then do
1114 ok = VRMethod("CN_Daemons", "SetFieldData", winbHandle, DStatusFH, NLVGetMessage(40), DPidsFH, winbpids)
1115 ok = VRMethod("CN_Daemons", "SetRecordAttr", winbHandle, "Icon", "$46")
1116 winbpidhandle.0 = words(winbpids)
1117 do I = 1 to words(winbpids)
1118 winbpidhandle.I = VRMethod( "CN_Daemons", "AddRecord", winbhandle, , NLVGetMessage(130)' 'word(winbpids,I)' ('d2x(word(winbpids,I))'x)', "$48")
1119 end
1120 end
1121 else do
1122 ok = VRMethod("CN_Daemons", "SetFieldData", winbHandle, DStatusFH, NLVGetMessage(41), DPidsFH, "")
1123 ok = VRMethod("CN_Daemons", "SetRecordAttr", winbHandle, "Icon", "$47")
1124 end
1125
1126 if \(smbdrunning|nmbdrunning|winbrunning) then do
1127 ok = VRSet("ICB_START", "Enabled", 1)
1128 ok = VRSet("ICB_STOP", "Enabled", 0)
1129 ok = VRSet("ICB_REStart","Enabled", 0)
1130 ok = VRSet("ICB_RELoad", "Enabled", 0)
1131 end
1132 else do
1133 ok = VRSet("ICB_START", "Enabled", 0)
1134 ok = VRSet("ICB_STOP", "Enabled", 1)
1135 ok = VRSet("ICB_REStart","Enabled", 1)
1136 ok = VRSet("ICB_RELoad", "Enabled", 1)
1137 end
1138
1139 ok = (stream(samba.!bin'\winbindd.exe','c','query exists') <> "")
1140 ok = VRMethod("CN_Daemons", "SetRecordAttr", winbHandle, "Visible", ok)
1141 ok = VRSet("CN_Daemons","Painting", 1 )
1142 if Running then call _SambaUptime
1143
1144 IF options.!debug == 1 then say time()' _RefreshDaemons() done'
1145return
1146
1147/*
1148_pids: procedure
1149 pongfile = arg(1)
1150 pids = ''
1151 do until lines(pongfile) = 0
1152 pongline = linein(pongfile)
1153 if word(Pongline,1) = 'PONG' then do
1154 parse var pongline pong from tpid pid
1155 pids = pids||pid', '
1156 end
1157 else pids = pids||pongline
1158 end
1159 pids = strip(strip(pids),,',')
1160 ok = stream(pongfile,'c','close')
1161 ok = SysFileDelete(pongfile)
1162return pids
1163 */
1164
1165/* pingout = 'ping.out'
1166 '@smbcontrol -t 2 smbd ping -d 0 1>'pingout
1167 if rc = 0 then smbdRunning = 1
1168 ok = VRMethod("CN_Daemons", "SetFieldData", smbdHandle, DPidsFH, _pids(pingout))
1169
1170 '@smbcontrol -t 2 nmbd ping -d 0 1>'pingout
1171 if rc = 0 then nmbdRunning = 1
1172 ok = VRMethod("CN_Daemons", "SetFieldData", nmbdHandle, DPidsFH, _pids(pingout))
1173
1174 '@smbcontrol -t 1 winbindd ping -d 0 1>'pingout
1175 if rc = 0 then winbRunning = 1
1176 ok = VRMethod("CN_Daemons", "SetFieldData", winbHandle, DPidsFH, _pids(pingout))
1177
1178 ok = SysFileDelete(PingOut)
1179*/
1180/*:VRX _RefreshDaemonsDelay
1181*/
1182_RefreshDaemonsDelay:
1183 IF options.!debug == 1 then say time()' _RefreshDaemonsDelay() started'
1184 IF options.!debug == 1 then say " Old intervall = "VRGet("TM_RefreshDaemons","Delay")
1185 ok = VRSet("TM_RefreshDaemons","Delay", 60000)
1186 IF options.!debug == 1 then say " New Intervall = "VRGet("TM_RefreshDaemons","Delay")
1187 IF options.!debug == 1 then say time()' _RefreshDaemonsDelay() done'
1188return
1189
1190/*:VRX _SambaFindPIDfile
1191*/
1192_SambaFindPIDfile:
1193 IF options.!debug == 1 then say time()' _SambaFindPIDfile() started'
1194
1195 ok = SysFileTree(ETC'\samba\pid\nmbd*pid',nmbdpid.,'FO')
1196 if nmbdpid.0 = 1
1197 then nmbdpidfile = nmbdpid.1;
1198 else nmbdpidfile = ""
1199
1200 IF options.!debug == 1 then say " nmbdpidfile = "nmbdpidfile
1201
1202 IF options.!debug == 1 then say time()' _SambaFindPIDfile() done'
1203return
1204
1205/*:VRX _SambaShowError
1206*/
1207_SambaShowError: procedure expose samba. settings. options.
1208 I = 0
1209 do while lines(samba.!error) <> 0
1210 I = I + 1
1211 smberr.I = linein(samba.!error)
1212 end
1213 ok = stream(Samba.!error,"c","close")
1214 smberr.0 = I
1215 Buttons.1 = "OK" /* NLVGetMessage(2) */
1216 Buttons.0 = 1
1217 id = VRMessageStem( VRWindow(), "smberr.", VRGet("Main", "Caption") , "Error", "Buttons.", buttons.1, buttons.1 )
1218 ok = SysFileDelete(Samba.!error)
1219return
1220
1221/*:VRX _SambaShowMsg
1222*/
1223_SambaShowMsg: procedure expose samba. settings. options.
1224 say "SambaShowMsg started"
1225 skipWords = arg(1)
1226 skip.0 = words(skipWords)
1227 do J = 1 to skip.0
1228 skip.J = translate(word(skipWords,J))
1229 end
1230 I = 0
1231 do while lines(samba.!msg) <> 0
1232 msgline = linein(samba.!msg)
1233 SkipIt = 0
1234 do J = 1 to skip.0
1235 if pos(skip.J,translate(msgline)) > 0 then do
1236 skipit = 1
1237 leave
1238 end
1239 end
1240 if \SkipIt then do
1241 I = I + 1
1242 smbmsg.I = strip(MsgLine)
1243 end
1244 end
1245 ok = stream(Samba.!msg,"c","close")
1246 say " stream close "Samba.!msg" = "ok
1247 smbmsg.0 = I
1248 if smbmsg.0 > 0 then do
1249 Buttons.1 = "OK" /* NLVGetMessage(2) */
1250 Buttons.0 = 1
1251 id = VRMessageStem( VRWindow(), "smbmsg.", VRGet("Main", "Caption") , "I", "Buttons.", buttons.1, buttons.1 )
1252 end
1253 ok = SysFileDelete(Samba.!msg)
1254 say " Delete "Samba.!msg" = "ok
1255 say "SambaShowMsg done"
1256return
1257/*:VRX _SambaUptime
1258*/
1259_SambaUptime:
1260 IF options.!debug == 1 then say time()' _SambaUptime() started'
1261 call _SambaFindPIDfile
1262 if nmbdpidfile = "" then do
1263 ok = VRset("CN_Daemons", "Caption", NLVGetMessage(42)||" "||NLVGetMessage(41))
1264 return
1265 end
1266
1267 StartTime = SysGetFileDateTime(nmbdpidfile)
1268 if StartTime = -1 then return
1269
1270 NowTime = substr(date('S'),1,4)'-'substr(date('S'),5,2)'-'substr(date('S'),7,2)' 'time()
1271
1272 /* StartTime = "2007-12-31 00:00:00"
1273 NowTime = "2008-03-05 08:59:50" */
1274
1275 IF options.!debug == 1 then do
1276 say " Start Time ='"StartTime"'"
1277 say " Now Time ='"NowTime"'"
1278 end
1279
1280 doM.0 = 12
1281 doM.1 = 31; doM.2 = 28; doM.3 = 31; doM.4 = 30; doM.5 = 31; doM.6 = 30;
1282 doM.7 = 31; doM.8 = 31; doM.9 = 30; doM.10= 31; doM.11= 30; doM.12= 31
1283
1284 parse var StartTime sY'-'sM'-'sD' 'sH':'sMi':'sS
1285 parse var NowTime nY'-'nM'-'nD' 'nH':'nMi':'nS
1286
1287 if nY//4 = 0 & nY//400 <> 0 then doM.2 = 29
1288
1289 /* say doM.2 */
1290
1291 uY =nY-sY
1292 uM =nM-sM
1293 uD =nD-sD
1294 uH =nH-sH
1295 uMi=nMi-sMi
1296 uS =nS-sS
1297
1298
1299
1300 if uS < 0 then do; uMi= uMi- 1; uS = uS + 60; end
1301 if uMi< 0 then do; uH = uH - 1; uMi= uMi+ 60; end
1302 if uH < 0 then do; uD = uD - 1; uH = uH + 24; end
1303 if uD < 0 then do;
1304 /* uM = uM - 1; */
1305 if uM < 0 then uMx = uM + 12; else uMx = uM
1306 uD = uD + doM.uMx - 1;
1307 end
1308 if uM < 0 then do; uY = uY - 1; uM = uM + 12; end
1309
1310 /* say uY uM uD uH uMi uS */
1311
1312 UpTimeStr = ' 'NlvGetMessage(43)':'
1313 if uY <> 0 then UpTimeStr = UpTimeStr' 'uY' 'NlvGetMessage(44)
1314 if uM <> 0 then UpTimeStr = UpTimeStr' 'uM' 'NlvGetMessage(45)
1315 if uD <> 0 then UpTimeStr = UpTimeStr' 'uD' 'NlvGetMessage(46)
1316 if uH <> 0 then UpTimeStr = UpTimeStr' 'uH' 'NlvGetMessage(47)
1317 if uMi<> 0 then UpTimeStr = UpTimeStr' 'uMi' 'NlvGetMessage(48)
1318 if uS <> 0 | UpTimeStr = ' 'NlvGetMessage(43)':' then UpTimeStr = UpTimeStr' 'uS' 'NlvGetMessage(49)
1319
1320 loggingfreespace = word(sysdriveinfo(left(samba.!logdir,2)),2)%1024%1024
1321 ok = VRSet("DT_FREESPACE", "Caption", loggingfreespace' MB')
1322 ok = VRset("CN_Daemons", "Caption", UpTimeStr)
1323
1324 select
1325 when loggingfreespace < 50 then ok = VRDeleteFile(samba.!logdir'\log.*')
1326 when loggingfreespace < 100 then ok = VRset("CN_Daemons","BackColor","Red")
1327 when loggingfreespace < 200 then ok = VRset("CN_Daemons","BackColor","Yellow")
1328 otherwise ok = VRset("CN_Daemons","BackColor","SystemWindow")
1329 end
1330
1331 IF options.!debug == 1 then say time()' _SambaUptime() done'
1332return
1333
1334/*:VRX _SendMsg
1335*/
1336_SendMsg:
1337 Buttons.1 = NLVGetMessage( 2 )
1338 Buttons.2 = NLVGetMessage( 3 )
1339 Buttons.0 = 2
1340 Message = "Blurp!"
1341 id = VRPrompt( VRWindow(), NLVGetMessage( 85 , CurMachine), "Message", NLVGetMessage( 80 ), "Buttons.", buttons.1, buttons.2 )
1342
1343 MsgFile = SysTempFileName(TempDir'\smbmsg.'??? )
1344 call lineout MsgFile, Message
1345 ok = stream(MsgFile,'c','close')
1346say Message
1347 address cmd samba.!smbclientexe' --message='CurMachine' 'DebugLevel' <'MsgFile' 2>&1>'samba.!msg
1348 /* if rc <> 0 then call _SambaShowError; else */
1349 call _SambaShowMsg
1350 ok = SysFileDelete(MsgFile)
1351return
1352
1353/*:VRX _ShowMsg
1354*/
1355_ShowMsg:
1356 Buttons.1 = NLVGetMessage(2)
1357 Buttons.0 = 1
1358 id = VRMessage( VRWindow(), Msg.Text, Msg.Title, Msg.Type, "Buttons.", buttons.1, buttons.1 )
1359return
1360
1361/*:VRX _SmbConfCreateShadowCopy
1362*/
1363_SmbConfCreateShadowCopy:
1364 if options.!debug == 1 then say time()' _SmbConfCreateShadowCopy started'
1365 /* we create a complete version of smb.conf in temporary directory for reading purposes */
1366 /* as we can only determine a default value from this complete version of the file */
1367 /* however it is not desirable to always have a complete copy normally */
1368 ok = SysFileDelete(samba.!shadowsmbconf)
1369 if dataype(log_Level) <> "NUM" then log_level = 2
1370 say ' 'samba.!testparmexe' -v -s -d='log_level' 1>'samba.!shadowsmbconf' 2>'TempDir'testparm.stderr'
1371 address cmd samba.!testparmexe' -v -s -d='log_level' 1>'samba.!shadowsmbconf' 2>'TempDir'testparm.stderr'
1372 if options.!debug == 1 then say time()' _SmbConfCreateShadowCopy done'
1373return
1374
1375/*:VRX _UserCredUpdate
1376*/
1377_UserCredUpdate:
1378 if options.!debug == 1 then say time()' _UserCredUpdate started'
1379 credentials.!username = VRGet("EF_USER1","Value")
1380 credentials.!password = VRGet("EF_PASSWORD1","Value")
1381
1382 if pos("4OS2", value("COMSPEC",,"OS2ENVIRONMENT")) = 1 | pos(left(credentials.!password,1),'01234567890') > 0
1383 then UserCred = '--user='Credentials.!username'%%'Credentials.!password
1384 else UserCred = '--user='Credentials.!username'%'Credentials.!password
1385
1386 if options.!storecreds = 1 & \(UserCred = 'USERCRED' | UserCred = '' | UserCred = '--user=%' | UserCred = '--user=%%' | UserCred = '-N') then do
1387 ok = _ucSetUc()
1388/* ok = VRSet("Pict_PWINMEM","PicturePath","#36") */
1389 if options.!debug == 1 then call beep 2400, 10
1390 end
1391 else do
1392 if options.!debug == 1 then call beep 200, 20
1393/* ok = VRSet("Pict_PWINMEM","PicturePath","#37") */
1394 end
1395 if options.!debug == 1 then say time()' _UserCredUpdate done'
1396return
1397/*:VRX About_Close
1398*/
1399About_Close:
1400 call About_Fini
1401return
1402
1403/*:VRX About_Create
1404*/
1405About_Create:
1406 call About_Init
1407 ok = VRSet("About","Caption", NLVGetMessage(20))
1408 ok = VRSet("PB_AboutOK1","Caption", NLVGetMessage(2))
1409 SambaTeam.0 = 11
1410 SambaTeam.1 = 'Silvan Scherrer'
1411 SambaTeam.2 = 'Herwig Bauernfeind'
1412 SambaTeam.3 = 'Dmitrij Kuminov'
1413 SambaTeam.4 = 'Vitali Pelenyov'
1414 SambaTeam.5 = 'Paul Smedley'
1415 SambaTeam.6 = 'Yuri Dario'
1416 SambaTeam.7 = 'Alex Taylor'
1417 SambaTeam.8 = 'Nikolay Kolosov'
1418 SambaTeam.9 = 'All the Samba people'
1419 SambaTeam.10= 'All the ArcaNoae people'
1420 SambaTeam.11= 'All the netlabs people'
1421 ok = VRSet("About","Font", VRGet("SW_SETTINGS","Font"))
1422 ok = VRMethod("LB_SambaTeam","AddStringList", "SambaTeam." )
1423 ok = VRSet("DT_SambaTeam","Caption", NLVGetMessage(21))
1424 ok = VRSet("MLE_Version","Value", NLVGetMessage(1)||'0D0A'x||VRGet("Main", "Hinttext")||'0D0A'x||'0D0A'x||SambaVer)
1425return
1426
1427/*:VRX About_Fini
1428*/
1429About_Fini:
1430 window = VRInfo( "Window" )
1431 call VRDestroy window
1432 drop window
1433return
1434/*:VRX About_Init
1435*/
1436About_Init:
1437 window = VRInfo( "Object" )
1438 if( \VRIsChildOf( window, "Notebook" ) ) then do
1439 call VRMethod window, "CenterWindow"
1440 call VRSet window, "Visible", 1
1441 call VRMethod window, "Activate"
1442 end
1443 drop window
1444return
1445
1446/*:VRX Activate
1447*/
1448Activate:
1449 parse arg Nr
1450 /* call PushbackAll */
1451 CurrentPageNr = Nr
1452 /* ok = VRSet("PB_"Nr,"Font","9.WarpSans Bold") */
1453/* ok = VRSet("TAB_"Nr,"Top", TabTop-8)
1454 ok = VRSet("TAB_"Nr,"Left",TabWidth*(Nr-1)+PageLeft)
1455 ok = VRSet("TAB_"Nr,"PicturePath", "#1"||Nr||";#1"||Nr)
1456 ok = VRset("DT_PageName", "Caption", VRGet("TAB_"Nr, "UserData"))
1457 ok = VRSet("Page_"Nr,"Visible", 1)
1458 select
1459 when Nr = 1 then ok = VRSet("IPB_paper","PicturePath","#4;#4")
1460 when Nr = Pages then ok = VRSet("IPB_paper","PicturePath","#6;#6")
1461 otherwise ok = VRSet("IPB_paper","PicturePath","#5;#5")
1462 end */
1463return
1464
1465/*:VRX CN_CHKTDB_ContextMenu
1466*/
1467CN_CHKTDB_ContextMenu:
1468 if VRInfo("Top") < 400 & VRGet("CN_Files", "View") = "Detail" then call _ColumnsMenu "CN_Files"
1469 else do
1470 RH = VRInfo("Record")
1471 OH = VRInfo("Object")
1472 if RH <> "" then do
1473 ok = VRMethod( "Contextmenu_Files", "Popup", , , "", "PositionOnItem" )
1474 end
1475 end
1476return
1477
1478/*:VRX CN_Daemons_Click
1479*/
1480CN_Daemons_Click:
1481 IF options.!debug == 1 then say time()' CN_Daemons_Click() started'
1482 NowClickedRecord = VRInfo("Record")
1483 say " NowRecord = '"NowClickedRecord"'"
1484 say " LastRecord = '"LastClickedRecord"'"
1485 if NowClickedRecord <> LastClickedRecord then call _RefreshDaemonsDelay
1486 LastClickedRecord = NowClickedRecord
1487 IF options.!debug == 1 then say time()' CN_Daemons_Click() done'
1488return
1489
1490/*:VRX CN_Daemons_ContextMenu
1491*/
1492CN_Daemons_ContextMenu:
1493 IF options.!debug == 1 THEN SAY time()' CN_Daemons_ContextMenu() started'
1494 if VRInfo("Top") < 400 & VRGet("CN_Daemons", "View") = "Detail" then do
1495 say " Going for column modification..."
1496 call _ColumnsMenu "CN_Daemons"
1497 end
1498 else do
1499 say " Going for context menu, record = '"VRInfo("Record")"'"
1500
1501 call _RefreshDaemonsDelay
1502 DRH = VRInfo("Record")
1503 DaemonName = ""
1504
1505 OH = VRInfo("Object")
1506 ok = VRset("ContextMenu_Daemons_Details", "Visible", 1 )
1507 ok = VRset("ContextMenu_Daemons_Tree", "Visible", 1 )
1508 ok = VRset("MItem_9", "Visible", 1 )
1509 ok = VRset("ContextMenu_Daemons_Sort", "Visible", 1 )
1510 ok = VRset("ContextMenu_Daemons_MiniIcons", "Visible", 1 )
1511 ok = VRset("MItem_13", "Visible", 1 )
1512 ok = VRset("ContextMenu_Daemons_Ping", "Visible", 1 )
1513 ok = VRset("ContextMenu_Daemons_KillPID", "Visible", 1 )
1514 ok = VRset("ContextMenu_Daemons_Start", "Visible", 1 )
1515 ok = VRset("ContextMenu_Daemons_Shutdown", "Visible", 1 )
1516
1517 if DRH <> "" then do
1518 DaemonName = VRMethod("CN_Daemons", "GetRecordAttr", DRH, "Caption")
1519 ok = VRset("ContextMenu_Daemons_Ping","Visible", 1 )
1520 end
1521
1522 select
1523 when Words(DaemonName) = 3 & pos("PID ",DaemonName) > 0 then do /* a child process with PID in name */
1524 DaemonName = word(DaemonName,2)
1525 ok = VRSet("ContextMenu_Daemons_KillPID", "Caption", NLVGetMessage( 38, DaemonName))
1526 ok = VRset("ContextMenu_Daemons_Start", "Visible", 0 )
1527 end
1528 when Words(DaemonName) = 1 & (pos("mbd.exe",Daemonname) > 0 | pos("winbindd.exe",Daemonname) > 0) then do /* on root process */
1529 parse var DaemonName DaemonName'.exe'
1530 if strip(VRMethod("CN_Daemons", "GetFieldData", DRH, DPidsFH)) <> "" then do
1531 ok = VRSet("ContextMenu_Daemons_Shutdown", "Caption", NLVGetMessage( 33, DaemonName))
1532 ok = VRset("ContextMenu_Daemons_KillPID", "Visible", 0 )
1533 ok = VRset("ContextMenu_Daemons_Start", "Visible", 0 )
1534 end
1535 end
1536 when pos("\", DaemonName) > 0 then do /* we are on a file */
1537 ok = VRset("MItem_13", "Visible", 0 )
1538 ok = VRset("ContextMenu_Daemons_Ping", "Visible", 0 )
1539 ok = VRset("ContextMenu_Daemons_KillPID", "Visible", 0 )
1540 ok = VRset("ContextMenu_Daemons_Start", "Visible", 0 )
1541 ok = VRset("ContextMenu_Daemons_Shutdown", "Visible", 0 )
1542 end
1543 otherwise do /* we are on a user */
1544 ok = VRset("MItem_13", "Visible", 0 )
1545 ok = VRset("ContextMenu_Daemons_Ping", "Visible", 0 )
1546 ok = VRset("ContextMenu_Daemons_KillPID", "Visible", 0 )
1547 ok = VRset("ContextMenu_Daemons_Start", "Visible", 0 )
1548 ok = VRset("ContextMenu_Daemons_Shutdown", "Visible", 0 )
1549 end
1550 end
1551 say ' Daemon is "'DaemonName'"'
1552 say ' DaemonView = "'DaemonView'"'
1553 if VRGet("CN_Daemons","View") = "Detail" then do
1554 ok = VRSet("ContextMenu_Daemons_Details", "Enabled", 0)
1555 ok = VRSet("ContextMenu_Daemons_Tree", "Enabled", 1)
1556 end
1557 else do
1558 ok = VRSet("ContextMenu_Daemons_Details", "Enabled", 1)
1559 ok = VRSet("ContextMenu_Daemons_Tree", "Enabled", 0)
1560 end
1561 DaemonView = VRGet("CN_Daemons","View")
1562
1563 ok = VRMethod( "ContextMenu_Daemons", "Popup", , , "", "" )
1564 end
1565 IF options.!debug == 1 THEN SAY time()' CN_Daemons_ContextMenu() done'
1566return
1567
1568/*:VRX CN_Files_ContextMenu
1569*/
1570CN_Files_ContextMenu:
1571 if VRInfo("Top") < 400 & VRGet("CN_Files", "View") = "Detail" then call _ColumnsMenu "CN_Files"
1572 else do
1573 RH = VRInfo("Record")
1574 OH = VRInfo("Object")
1575 if RH <> "" then do
1576 ok = VRMethod( "Contextmenu_Files", "Popup", , , "", "PositionOnItem" )
1577 end
1578 end
1579return
1580
1581/*:VRX CN_Service_ContextMenu
1582*/
1583CN_Service_ContextMenu:
1584 if VRInfo("Top") < 400 & VRGet("CN_Service", "View") = "Detail" then call _ColumnsMenu "CN_Service"
1585 else do
1586 ok = VRSet("TM_refresh","Enabled", 0)
1587 SRH = VRInfo("Record")
1588 OH = VRInfo("Object")
1589 if SRH <> "" then do
1590 Service = VRMethod("CN_Service", "GetFieldData", SRH, ServiceFH)
1591 say ' Service is "'Service'"'
1592 ok = VRMethod( "ContextMenu_Service", "Popup", , , "", "" )
1593 end
1594 end
1595return
1596
1597/*:VRX CN_SMBTREE_Click
1598*/
1599CN_SMBTREE_Click:
1600 rh = VRInfo('Record')
1601 if VRMethod( 'CN_SMBTREE', "ValidateRecord", rh) <> 1 then return
1602 userdata = VRMethod('CN_SMBTREE', 'GetRecordAttr', rh, 'UserData')
1603 parse var userdata . '|' userdata
1604 ok = VRset("Main","StatusText", userdata)
1605
1606
1607return
1608
1609/*:VRX CN_SMBTREE_ContextMenu
1610*/
1611CN_SMBTREE_ContextMenu:
1612 if options.!debug == 1 then say time()' CN_SMBTREE_ContextMenu started'
1613 if VRInfo("Top") < 400 & VRGet("CN_SMBTREE", "View") = "Detail" then call _ColumnsMenu "CN_SMBTREE"
1614 else do
1615 call _dropdeprecated
1616 RH = VRInfo("Record")
1617 if RH <> "" then do
1618 call _GetSmbObjectProperties RH
1619 call _ContextMenuSelectedSet
1620 if SMBobj.udatatype <> "WORKGROUP" then do
1621 BrowsePath = _browsebuildpath(SMBObj.rh)
1622 parse var browsepath '\\'machine'\'sharename '\' browsepath
1623 end
1624
1625 /* call _BrowseResetObject(SmbObj.rh) */
1626
1627 CurMachine = SMBObj.Resname
1628 ok = VRMethod( "Contextmenu_Tree", "Popup", , , "", "PositionOnItem" )
1629 end
1630 else do
1631 say "nix '"RH"'"
1632 drop SMBObj. /* it is invalid */
1633 call _ContextMenuSelectedSet
1634 end
1635 end
1636 if options.!debug == 1 then say time()' CN_SMBTREE_ContextMenu done'
1637return
1638
1639/*:VRX CN_SMBTREE_DoubleClick
1640*/
1641CN_SMBTREE_DoubleClick:
1642 if options.!debug == 1 then say time()' CN_SMBTREE_DoubleClick started'
1643
1644 call _dropdeprecated
1645 call _GetSmbObjectProperties VRInfo('Record')
1646
1647/* if options.!debug == 1 then say time()' CN_SMBTREE_DoubleClick done'
1648return */
1649 /* Enable last 2 lines for 2.0.x (to disable on the fly browsing) */
1650
1651 if options.!debug == 1 then say ' Browsing "'SMBObj.udatatype'"'
1652
1653 If SMBObj.udatatype = "DIRECTORY" then do
1654 BrowsePath = _browsebuildpath(SMBObj.rh)
1655
1656 call _BrowseResetObject(SmbObj.rh)
1657
1658 parse var browsepath '\\'machine'\'sharename '\' browsepath
1659 browsepath = browsepath'\*'
1660
1661 call _BrowseDirectory
1662 end
1663
1664 If SMBObj.udatatype = "FILE" then do
1665 BrowsePath = _browsebuildpath(SMBObj.rh)
1666 call _BrowseResetObject(SmbObj.rh)
1667
1668 parse var browsepath '\\'machine'\'sharename '\' browsepath
1669
1670 OpenOk = _browseobjectopen(machine,sharename,browsepath)
1671
1672 if \OpenOK then do
1673 say " Not connected - trying to connect"
1674 ok = VRMethod( "CN_SMBTREE", "SetRecordAttr", sharerh, "Selected", 1)
1675 OpenOk = 0
1676 if VRIsValidObject("PB_SMBTREE_CONNECT") then do
1677 call PB_SMBTREE_CONNECT_Click
1678 ok = VRMethod( "CN_SMBTREE", "SetRecordAttr", SMBObj.rh, "Selected", 1)
1679 OpenOk = _browseobjectopen(machine,sharename,browsepath)
1680 end
1681 if \OpenOk then do
1682 Msg.Text = "Not connected - cannot open - aborting!"
1683 Msg.Type = "E"
1684 call _ShowMsg
1685 end
1686 end
1687 end
1688
1689 if SMBObj.udatatype = "DISK" then do
1690 machine = VRMethod("CN_SMBTREE","GetRecordAttr",SMBObj.parentrh,"Caption")
1691 parse var machine machine '0D0A'x .
1692 machine = strip(machine)
1693
1694 call _BrowseResetObject(SmbObj.rh)
1695
1696 sharename = SMBObj.resname
1697 BrowsePath = ""
1698
1699 call _BrowseDirectory
1700 end
1701 if options.!debug == 1 then say time()' CN_SMBTREE_DoubleClick done'
1702return
1703/*:VRX CN_Users_ContextMenu
1704*/
1705CN_Users_ContextMenu:
1706 if VRInfo("Top") < 400 & VRGet("CN_users", "View") = "Detail" then call _ColumnsMenu "CN_users"
1707 else do
1708 RH = VRInfo("Record")
1709 OH = VRInfo("Object")
1710 if RH <> "" then do
1711 CurMachine = VRMethod( "CN_users", "GetFieldData", RH, UMachineFH )
1712 ok = VRMethod( "Contextmenu_Users", "Popup", , , "", "PositionOnItem" )
1713 end
1714 end
1715return
1716
1717/*:VRX Columns_01_Click
1718*/
1719Columns_01_Click:
1720 call _ColumnShow
1721return
1722
1723/*:VRX Columns_02_Click
1724*/
1725Columns_02_Click:
1726 call _ColumnShow
1727return
1728
1729/*:VRX Columns_03_Click
1730*/
1731Columns_03_Click:
1732 call _ColumnShow
1733return
1734
1735/*:VRX Columns_04_Click
1736*/
1737Columns_04_Click:
1738 call _ColumnShow
1739return
1740
1741/*:VRX Columns_05_Click
1742*/
1743Columns_05_Click:
1744 call _ColumnShow
1745return
1746
1747/*:VRX Columns_06_Click
1748*/
1749Columns_06_Click:
1750 call _ColumnShow
1751return
1752
1753/*:VRX Columns_07_Click
1754*/
1755Columns_07_Click:
1756 call _ColumnShow
1757return
1758
1759/*:VRX Columns_08_Click
1760*/
1761Columns_08_Click:
1762 call _ColumnShow
1763return
1764
1765/*:VRX Columns_09_Click
1766*/
1767Columns_09_Click:
1768 call _ColumnShow
1769return
1770
1771/*:VRX Columns_10_Click
1772*/
1773Columns_10_Click:
1774 call _ColumnShow
1775return
1776
1777/*:VRX Columns_11_Click
1778*/
1779Columns_11_Click:
1780 call _ColumnShow
1781return
1782
1783/*:VRX Columns_12_Click
1784*/
1785Columns_12_Click:
1786 call _ColumnShow
1787return
1788
1789/*:VRX Columns_13_Click
1790*/
1791Columns_13_Click:
1792 call _ColumnShow
1793return
1794
1795/*:VRX Columns_14_Click
1796*/
1797Columns_14_Click:
1798 call _ColumnShow
1799return
1800
1801/*:VRX ContextMenu_Daemons_Details_Click
1802*/
1803ContextMenu_Daemons_Details_Click:
1804 IF options.!debug == 1 THEN SAY time()' ContextMenu_Daemons_Tree_Click() started'
1805 ok = VRset("CN_Daemons","View","Detail")
1806 ok = VRset("ContextMenu_Daemons_Tree","Enabled",1)
1807 ok = VRset("ContextMenu_Daemons_Details","Enabled",0)
1808 ok = VRSet("TM_refresh","Enabled", 1)
1809 IF options.!debug == 1 THEN SAY time()' ContextMenu_Daemons_Tree_Click() done'
1810return
1811
1812/*:VRX ContextMenu_Daemons_KillPID_Click
1813*/
1814ContextMenu_Daemons_KillPID_Click:
1815 Msg.Text = NLVGetMessage(39, DaemonName)
1816 Msg.Type = 'Q'
1817 if _MsgYesNo() = 1 then do
1818 ok = PRKillProcess("1",DaemonName )
1819 if ok = 0 then say ", success!"; else say ", error "ok
1820
1821/* say 'kill -9 'DaemonName
1822 address cmd 'kill -9 'DaemonName */
1823 end
1824 ok = VRSet("TM_Refresh","Enabled", 1)
1825return
1826
1827/*:VRX ContextMenu_Daemons_MiniIcons_Click
1828*/
1829ContextMenu_Daemons_MiniIcons_Click:
1830 advanced.!bigicons = \advanced.!bigicons
1831 ok = VRset("CN_DAEMONS", "MiniIcons", \advanced.!bigicons)
1832 ok = VRset("CN_SMBTREE", "MiniIcons", \advanced.!bigicons)
1833 ok = VRset("ContextMenu_Tree_MiniIcons", "Checked", \advanced.!bigicons)
1834 ok = VRset("ContextMenu_Daemons_MiniIcons", "Checked", \advanced.!bigicons)
1835return
1836
1837/*:VRX ContextMenu_Daemons_Ping_Click
1838*/
1839ContextMenu_Daemons_Ping_Click:
1840 ok = VRSet("Main", 'Pointer', 'Wait' )
1841 address cmd samba.!smbcontrolexe' 'DaemonName' ping --timeout=3 --debuglevel=0 2>'samba.!error' 1>'samba.!msg
1842 call _SambaShowMsg "section table registered"
1843
1844 ok = VRSet("Main", 'Pointer', '<default>' )
1845 ok = VRSet("TM_refresh","Enabled", 1)
1846return
1847
1848/*:VRX ContextMenu_Daemons_Shutdown_Click
1849*/
1850ContextMenu_Daemons_Shutdown_Click:
1851 Msg.Text = NLVGetMessage(34, DaemonName)
1852 Msg.Type = 'Q'
1853 if _MsgYesNo() = 1 then do
1854 address cmd samba.!smbcontrolexe' 'DaemonName' shutdown 2>'samba.!error' 1>'samba.!msg
1855 call _SambaShowMsg "section table registered tdb"
1856 end
1857 ok = VRSet("TM_Refresh","Enabled", 1)
1858return
1859
1860/*:VRX ContextMenu_Daemons_Sort_Click
1861*/
1862ContextMenu_Daemons_Sort_Click:
1863 window = VRLoadSecondary( "SW_SORT", "W" )
1864return
1865
1866/*:VRX ContextMenu_Daemons_Start_Click
1867*/
1868ContextMenu_Daemons_Start_Click:
1869 Msg.Text = NLVGetMessage(37, DaemonName)
1870 Msg.Type = 'Q'
1871 if _MsgYesNo() = 1 then do
1872 say samba.!smbcmd' start 'DaemonName
1873 address cmd samba.!smbcmd' start 'DaemonName
1874 end
1875 ok = VRSet("TM_Refresh","Enabled", 1)
1876return
1877
1878/*:VRX ContextMenu_Daemons_Tree_Click
1879*/
1880ContextMenu_Daemons_Tree_Click:
1881 IF options.!debug == 1 THEN SAY time()' ContextMenu_Daemons_Tree_Click() started'
1882 ok = VRset("CN_Daemons","View","IconTree")
1883 ok = VRset("ContextMenu_Daemons_Tree","Enabled",0)
1884 ok = VRset("ContextMenu_Daemons_Details","Enabled",1)
1885 ok = VRSet("TM_refresh","Enabled", 1)
1886 IF options.!debug == 1 THEN SAY time()' ContextMenu_Daemons_Tree_Click() done'
1887return
1888
1889/*:VRX ContextMenu_Files_Sort_Click
1890*/
1891ContextMenu_Files_Sort_Click:
1892 window = VRLoadSecondary( "SW_SORT", "W" )
1893return
1894
1895/*:VRX ContextMenu_Service_CloseShare_Click
1896*/
1897ContextMenu_Service_CloseShare_Click:
1898 Msg.Text = NLVGetMessage(75, Service)
1899 Msg.Type = 'Q'
1900 if _MsgYesNo() = 1 then do
1901 address cmd samba.!smbcontrolexe' smbd close-share 'Service' --debuglevel=0' /* ' 2>'samba.!error' 1>'samba.!msg */
1902 /* No usable output from Samba here ! */
1903 /* call _SambaShowMsg */
1904 Msg.Text = NLVGetMessage(76, Service)
1905 Msg.Type = 'I'
1906 call _ShowMsg
1907 end
1908 ok = VRSet("TM_refresh","Enabled", 1)
1909return
1910
1911/*:VRX ContextMenu_Service_Sort_Click
1912*/
1913ContextMenu_Service_Sort_Click:
1914 window = VRLoadSecondary( "SW_SORT", "W" )
1915return
1916
1917/*:VRX ContextMenu_Tree_ACLS_Click
1918*/
1919ContextMenu_Tree_ACLS_Click:
1920 if options.!debug == 1 then say ' List ACLS for "'SMBObj.udatatype'"'
1921 window = VRLoadSecondary( "SW_ACLS", "W" )
1922return
1923
1924/*:VRX ContextMenu_Tree_Details_Click
1925*/
1926ContextMenu_Tree_Details_Click:
1927 ok = VRset("CN_SMBTREE","View","Detail")
1928 ok = VRset("ContextMenu_Tree_Tree","Enabled",1)
1929 ok = VRset("ContextMenu_Tree_Details","Enabled",0)
1930 ok = VRset("ContextMenu_Tree_Icons","Enabled",1)
1931 ok = VRset("TM_Throbber", "Enabled", 1)
1932 ok = VRset("Pict_Throbber", "Visible", 0)
1933 call _RefreshTree
1934return
1935
1936/*:VRX ContextMenu_Tree_Icons_Click
1937*/
1938ContextMenu_Tree_Icons_Click:
1939 ok = VRset("CN_SMBTREE","View","Icon")
1940 ok = VRset("ContextMenu_Tree_Icons","Enabled",0)
1941 ok = VRset("ContextMenu_Tree_Tree","Enabled",1)
1942 ok = VRset("ContextMenu_Tree_Details","Enabled",1)
1943 ok = VRset("TM_Throbber", "Enabled", 1)
1944 ok = VRset("Pict_Throbber", "Visible", 1)
1945 call _RefreshTree
1946return
1947
1948/*:VRX ContextMenu_Tree_LOGIN_Click
1949*/
1950ContextMenu_Tree_LOGIN_Click:
1951 window = VRLoadSecondary( "SW_LOGIN", "W" )
1952
1953 /* call _UserCredUpdate */
1954
1955return
1956
1957/*:VRX ContextMenu_Tree_LOGOFF_Click
1958*/
1959ContextMenu_Tree_LOGOFF_Click:
1960 UserCred = '-N'
1961return
1962
1963/*:VRX ContextMenu_Tree_MiniIcons_Click
1964*/
1965ContextMenu_Tree_MiniIcons_Click:
1966 advanced.!bigicons = \advanced.!bigicons
1967 ok = VRset("CN_DAEMONS", "MiniIcons", \advanced.!bigicons)
1968 ok = VRset("CN_SMBTREE", "MiniIcons", \advanced.!bigicons)
1969 ok = VRset("ContextMenu_Tree_MiniIcons", "Checked", \advanced.!bigicons)
1970 ok = VRset("ContextMenu_Daemons_MiniIcons", "Checked", \advanced.!bigicons)
1971return
1972
1973/*:VRX ContextMenu_Tree_SendMsg_Click
1974*/
1975ContextMenu_Tree_SendMsg_Click:
1976 call _SendMsg
1977return
1978
1979/*:VRX ContextMenu_Tree_Sort_Click
1980*/
1981ContextMenu_Tree_Sort_Click:
1982 window = VRLoadSecondary( "SW_SORT", "W" )
1983return
1984
1985/*:VRX ContextMenu_Tree_Tree_Click
1986*/
1987ContextMenu_Tree_Tree_Click:
1988 ok = VRset("CN_SMBTREE","View","IconTree")
1989 ok = VRset("ContextMenu_Tree_Tree","Enabled",0)
1990 ok = VRset("ContextMenu_Tree_Details","Enabled",1)
1991 ok = VRset("ContextMenu_Tree_Icons","Enabled",1)
1992 ok = VRset("TM_Throbber", "Enabled", 1)
1993 ok = VRset("Pict_Throbber", "Visible", 1)
1994 call _RefreshTree
1995return
1996
1997/*:VRX ContextMenu_Users_SendMsg_Click
1998*/
1999ContextMenu_Users_SendMsg_Click:
2000 call _SendMsg
2001return
2002
2003/*:VRX ContextMenu_Users_Sort_Click
2004*/
2005ContextMenu_Users_Sort_Click:
2006 window = VRLoadSecondary( "SW_SORT", "W" )
2007return
2008
2009/*:VRX DT_STATUSBAR_ContextMenu
2010*/
2011DT_STATUSBAR_ContextMenu:
2012 ok = VRSet("DT_STATUSBAR","Caption", VRGet("Main", "HintText"))
2013return
2014
2015/*:VRX EF_log_file_Change
2016*/
2017EF_log_file_Change:
2018 advanced.!smbconfchanged = 1
2019return
2020
2021/*:VRX Fini
2022*/
2023Fini:
2024 window = VRWindow()
2025 call VRSet window, "Visible", 0
2026 drop window
2027return 0
2028
2029/*:VRX GetBootDrive
2030*/
2031GetBootDrive:
2032/* Use SysBootDrive if possible */
2033If Rxfuncadd('SysBootDrive', 'RexxUtil', 'SysBootDrive') Then
2034 Return Left(Value('RUNWORKPLACE',,'OS2ENVIRONMENT'),2)
2035Else
2036 Return SysBootDrive()
2037
2038
2039/*:VRX Halt
2040*/
2041Halt:
2042 signal _VREHalt
2043return
2044
2045/*:VRX ICB_ABOUT_Click
2046*/
2047ICB_ABOUT_Click:
2048 window = VRLoadSecondary( "About", "W" )
2049return
2050
2051/*:VRX ICB_APPLY_Click
2052*/
2053ICB_APPLY_Click:
2054 IF options.!debug == 1 then say time()' PB_Apply_Click() started'
2055 options.!Debug = VRGet("CB_Debug","set")
2056 if options.!Debug then ok = VRREdirectStdIO("ON")
2057 else ok = VRREdirectStdIO("OFF")
2058 Intervall = VRGet("SPIN_Intervall","Value")
2059 ok = VRSet("TM_Refresh","Delay", Intervall * 1000)
2060 IntervallMin = VRGet("SPIN_IntervallMin","Value")
2061
2062 NoMsgBox = VRGet("CB_NoMsgBox","set")
2063 say 'NoMsgBox = "'NoMsgBox'"'
2064
2065 WPSStartStop = VRGet("CB_WPSStartStop","set")
2066 say 'WPSStartStop = "'WPSStartStop'"'
2067
2068 DetectZombies = VRGet("CB_DetectZombies","set")
2069 say 'DetectZombies = "'DetectZombies'"'
2070
2071 options.!storecreds = VRGet("CB_STORECREDS","Set")
2072 say "options.!storecreds = "options.!storecreds
2073
2074 if advanced.!smbconfchanged = 1 then do
2075 log_level = VRGet("SPIN_log_level","Value")
2076 log_file = VRGet("EF_log_file","Value")
2077 max_protocol = VRGet("SPIN_max_protocol","Value")
2078
2079 handle = IniOpen('global', samba.!smbconf)
2080
2081 ok = IniSet('log level', log_level, handle)
2082 ok = IniSet('log file', log_file, handle)
2083 ok = IniSet('max protocol', max_protocol, handle)
2084
2085 ok = IniSave(handle)
2086 ok = IniClose(handle)
2087 advanced.!smbconfchanged = 0
2088 end
2089 IF options.!debug == 1 then say time()' PB_Apply_Click() done'
2090return
2091
2092/*:VRX ICB_EXIT_Click
2093*/
2094ICB_EXIT_Click:
2095 say 'start ICB_EXIT_Click'
2096 Call Quit
2097 say 'done ICB_EXIT_Click'
2098return
2099
2100/*:VRX ICB_LOGIN_CANCEL_Click
2101*/
2102ICB_LOGIN_CANCEL_Click:
2103/* ok = VRSet("EF_USER","Value",VRGet("EF_USER1","Value"))
2104 ok = VRSet("EF_PASSWORD","Value",VRGet("EF_PASSWORD1","Value")) */
2105 options.!storecreds = VRGet("CB_STORECREDS1","Set")
2106 credentials.!entered = 1
2107 p_server = SMBObj.resname
2108 if p_server <> "" then do
2109 ok = _rpcqueryuser(p_server, VRGet("EF_USER1","Value"), VRGet("EF_PASSWORD1","Value"), VRGet("EF_USER1","Value"))
2110
2111 if word(ok,1) = "1" then do
2112 call _StatusBarWrapper NLVGetMessage(107, rpc.queryuser.FULL_NAME)
2113 say 'rpc.queryuser.DIR_DRIVE = "'rpc.queryuser.DIR_DRIVE'"'
2114 say 'rpc.queryuser.LOGON_SCRIPT = "'rpc.queryuser.LOGON_SCRIPT'"'
2115 call _UserCredUpdate
2116 end
2117 else do
2118 call _StatusBarWrapper VRGet("EF_USER1","Value")" \\"p_server": "rpc.queryuser.LOGONSTATUS
2119 end
2120 end
2121
2122 call SW_LOGIN_Close
2123return
2124
2125/*:VRX ICB_LOGIN_OK_Click
2126*/
2127ICB_LOGIN_OK_Click:
2128/* ok = VRSet("EF_USER","Value",VRGet("EF_USER1","Value"))
2129 ok = VRSet("EF_PASSWORD","Value",VRGet("EF_PASSWORD1","Value")) */
2130 options.!storecreds = VRGet("CB_STORECREDS1","Set")
2131 credentials.!entered = 1
2132 p_server = SMBObj.resname
2133 if p_server <> "" then do
2134 ok = _rpcqueryuser(p_server, VRGet("EF_USER1","Value"), VRGet("EF_PASSWORD1","Value"), VRGet("EF_USER1","Value"))
2135
2136 if word(ok,1) = "1" then do
2137 call _StatusBarWrapper NLVGetMessage(107, rpc.queryuser.FULL_NAME)
2138 say 'rpc.queryuser.DIR_DRIVE = "'rpc.queryuser.DIR_DRIVE'"'
2139 say 'rpc.queryuser.LOGON_SCRIPT = "'rpc.queryuser.LOGON_SCRIPT'"'
2140 call _UserCredUpdate
2141 end
2142 else do
2143 call _StatusBarWrapper VRGet("EF_USER1","Value")" \\"p_server": "rpc.queryuser.LOGONSTATUS
2144 end
2145 end
2146
2147 call SW_LOGIN_Close
2148return
2149
2150/*:VRX ICB_REFRESH_Click
2151*/
2152ICB_REFRESH_Click:
2153 IF options.!debug == 1 then say time()' ICB_REFRESH_Click() started'
2154 ok = SysSleep(0.3)
2155
2156 say " CurrentPageNr = "CurrentPageNr
2157 select
2158 when CurrentPageNr = 2 then do
2159 ok = VRset("Pict_Throbber", "Visible", 1)
2160 ok = VRset("TM_Throbber", "Enabled", 1)
2161 call _RefreshTree
2162 end
2163 when CurrentPageNr = 6 then do
2164 call _ChkTDB
2165 end
2166 otherwise call _Refresh
2167 end
2168 IF options.!debug == 1 then say time()' ICB_REFRESH_Click() done'
2169return
2170
2171/*:VRX ICB_RELOAD_Click
2172*/
2173ICB_RELOAD_Click:
2174 call VRSet VRWindow(), 'Pointer', 'Wait'
2175 if WPSStartStop then do
2176 ok = SysOpenObject('<smb_reload>', 'DEFAULT', 1)
2177 end
2178 else do
2179 call lineout samba.!bin"\smbstart", "reload"
2180 ok = stream(samba.!bin"\reload","c","close")
2181 end
2182 ok = VRSet("TM_Refresh","Delay", 2000)
2183 call VRSet VRWindow(), 'Pointer', '<default>'
2184return
2185
2186/*:VRX ICB_RESTART_Click
2187*/
2188ICB_RESTART_Click:
2189 call VRSet VRWindow(), 'Pointer', 'Wait'
2190 if WPSStartStop then do
2191 ok = SysOpenObject('<smb_restart>', 'DEFAULT', 1)
2192 end
2193 else do
2194 call lineout samba.!bin"\restart", "restart"
2195 ok = stream(samba.!bin"\restart","c","close")
2196 end
2197 ok = VRSet("TM_Refresh","Delay", 2000)
2198 call VRSet VRWindow(), 'Pointer', '<default>'
2199return
2200
2201/*:VRX ICB_START_Click
2202*/
2203ICB_START_Click:
2204 say "IPB_Start_Click started"
2205 call VRSet VRWindow(), 'Pointer', 'Wait'
2206 if WPSStartStop then do
2207 ok = SysOpenObject('<smb_start>', 'DEFAULT', 1)
2208 end
2209 else do
2210 call lineout samba.!bin"\smbstart", "smbstart"
2211 ok = stream(samba.!bin"\smbstart","c","close")
2212 end
2213 ok = VRSet("TM_Refresh","Delay", 2000)
2214 call VRSet VRWindow(), 'Pointer', '<default>'
2215 say "IPB_Start_Click done"
2216return
2217
2218/*:VRX ICB_STOP_Click
2219*/
2220ICB_STOP_Click:
2221 say "IPB_Stop_Click started"
2222 call VRSet VRWindow(), 'Pointer', 'Wait'
2223 if WPSStartStop then do
2224 ok = SysOpenObject('<smb_stop>', 'DEFAULT', 1)
2225 end
2226 else do
2227 call lineout samba.!bin"\smbstop", "smbstop"
2228 ok = stream(samba.!bin"\smbstop","c","close")
2229 end
2230 ok = VRSet("TM_Refresh","Delay", 2000)
2231 call VRSet VRWindow(), 'Pointer', '<default>'
2232 say "IPB_Stop_Click done"
2233return
2234
2235/*:VRX Init
2236*/
2237Init:
2238window = VRWindow()
2239call VRMethod window, "CenterWindow"
2240call VRSet window, "Visible", 0
2241call VRMethod window, "Activate"
2242drop window
2243return
2244
2245/*:VRX LB_SortFields_Click
2246*/
2247LB_SortFields_Click:
2248 call _ContainerSort
2249return
2250
2251/*:VRX Main_Activate
2252*/
2253Main_Activate:
2254 call TM_Refresh_Trigger
2255 ok = VRset("TM_Refresh", "Enabled", 1)
2256return
2257
2258/*:VRX Main_Close
2259*/
2260Main_Close:
2261 call Quit
2262return
2263
2264/*:VRX Main_Create
2265*/
2266Main_Create:
2267 options.!debug = 0
2268 if options.!debug == 1 then do
2269 ok = VRRedirectStdIO("ON")
2270 say time()' Main_Create started'
2271 end
2272 else ok = VRRedirectStdIO("OFF")
2273
2274 call _LoadOtherFuncs
2275 call _InitTempDir
2276
2277 call _IniRead
2278 call _NLVSetup
2279
2280 call _SambaInit
2281 if \WPSStartStop then call _CreateSmbStarter
2282 if _SambaRunning() then call _SambaFindPIDfile
2283 call _ContainerInit
2284 call _GUIInit
2285
2286 ok = VRMethod("ICB_Refresh","SetFocus")
2287
2288 if options.!debug == 1 then say time()' Main_Create done'
2289return
2290/*:VRX Main_Deactivate
2291*/
2292Main_Deactivate:
2293 ok = VRset("TM_Refresh", "Enabled", 0)
2294return
2295
2296/*:VRX Main_Resize
2297*/
2298Main_Resize:
2299 IF options.!debug == 1 THEN SAY time()' Main_Resize started'
2300 ok = VRSet("Main","Painting", 0)
2301
2302 /* Basic measurements */
2303 main_iwidth = VRGet("Main","InteriorWidth") /* Width of window client-area */
2304 main_iheight = VRGet("Main","InteriorHeight") /* Height of window client-area */
2305
2306 /* if main_iheight < 5500 then ok = VRSet("Main","Height",6200) */
2307 sbar_height = margin * 8 /* Height of status-bar */
2308 marginx2 = margin * 2 /* Common margin around controls */
2309 marginx4 = margin * 4
2310
2311 pbtn_width = 1200
2312 pbtn_dist = 80 + pbtn_width
2313 pbtn_nr = 4
2314 pbtn_pos = max((main_iwidth - pbtn_Dist * pbtn_Nr)%2, 0)+ margin
2315 pbtn_height = 460 /* Height of the panels' internal button areas */
2316
2317
2318 pane_height = main_iheight- sbar_height - pbtn_height - margin * 7 /* Height of notebook */
2319 pane_width = main_iwidth - marginx2 /* Width of the notebook panel */
2320
2321 /* Tabbed Dialog */
2322 ok = VRset("TDL_1", "Top", marginx2 )
2323 ok = VRset("TDL_1", "Left", margin )
2324 ok = VRset("TDL_1", "Width", pane_width )
2325 ok = VRset("TDL_1", "Height", pane_height )
2326
2327 /* Statusbar */
2328 ok = VRSet("GB_STATUSBAR", "Left", margin )
2329 ok = VRSet("GB_STATUSBAR", "Top", main_iheight - sbar_height - margin )
2330 ok = VRSet("GB_STATUSBAR", "Height",sbar_height )
2331 ok = VRSet("GB_STATUSBAR", "Width", pane_width )
2332
2333 ok = VRSet("DT_STATUSBAR", "Top", 12 )
2334 ok = VRSet("DT_STATUSBAR", "Left", 12 )
2335 ok = VRSet("DT_STATUSBAR", "Height",sbar_height- 24)
2336 ok = VRSet("DT_STATUSBAR", "Width", pane_width - 24)
2337
2338 ok = VRSet("ICB_REFRESH","top", pane_height + marginx4 )
2339 ok = VRSet("ICB_EXIT", "top", pane_height + marginx4 )
2340 ok = VRSet("ICB_Apply", "top", pane_height + marginx4 )
2341 ok = VRSet("ICB_About", "top", pane_height + marginx4 )
2342
2343 ok = VRSet("ICB_REFRESH","Width", pbtn_width )
2344 ok = VRSet("ICB_EXIT", "Width", pbtn_width )
2345 ok = VRSet("ICB_Apply", "Width", pbtn_width )
2346 ok = VRSet("ICB_About", "Width", pbtn_width )
2347
2348 ok = VRSet("ICB_REFRESH","Height", pbtn_Height )
2349 ok = VRSet("ICB_EXIT", "Height", pbtn_Height )
2350 ok = VRSet("ICB_Apply", "Height", pbtn_Height )
2351 ok = VRSet("ICB_About", "Height", pbtn_Height )
2352
2353
2354 ok = VRSet("ICB_REFRESH","left",pbtn_pos + pbtn_dist * (pbtn_nr - 4))
2355 ok = VRSet("ICB_Apply", "left",pbtn_pos + pbtn_dist * (pbtn_nr - 3))
2356 ok = VRSet("ICB_About", "left",pbtn_pos + pbtn_dist * (pbtn_nr - 2))
2357 ok = VRSet("ICB_EXIT", "left",pbtn_pos + pbtn_dist * (pbtn_nr - 1))
2358
2359 ok = VRset("GB_CHKTDB","Top", margin )
2360 ok = VRset("GB_CHKTDB","Left", marginx2)
2361 ok = VRset("GB_CHKTDB","Width", pane_width - 760)
2362 ok = VRset("GB_CHKTDB","Height", pane_height- 1020)
2363 ok = VRset("CN_CHKTDB","Top", margin)
2364 ok = VRset("CN_CHKTDB","Left", margin)
2365 ok = VRset("CN_CHKTDB","Width", pane_width - 760 - marginx2 )
2366 ok = VRset("CN_CHKTDB","Height", pane_height- 1020- marginx2 )
2367
2368 ok = VRset("GB_USERS","Top", margin )
2369 ok = VRset("GB_USERS","Left", marginx2)
2370 ok = VRset("GB_USERS","Width", pane_width - 760)
2371 ok = VRset("GB_USERS","Height", pane_height- 1020)
2372 ok = VRset("CN_USERS","Top", margin)
2373 ok = VRset("CN_USERS","Left", margin)
2374 ok = VRset("CN_USERS","Width", pane_width - 760 - marginx2 )
2375 ok = VRset("CN_USERS","Height", pane_height- 1020- marginx2 )
2376
2377 ok = VRset("GB_FILES","Top", margin )
2378 ok = VRset("GB_FILES","Left", marginx2)
2379 ok = VRset("GB_FILES","Width", pane_width - 760)
2380 ok = VRset("GB_FILES","Height", pane_height- 1020)
2381 ok = VRset("CN_FILES","Top", margin)
2382 ok = VRset("CN_FILES","Left", margin)
2383 ok = VRset("CN_FILES","Width", pane_width - 760 - marginx2 )
2384 ok = VRset("CN_FILES","Height", pane_height- 1020- marginx2 )
2385
2386 ok = VRset("GB_SERVICE","Top", margin )
2387 ok = VRset("GB_SERVICE","Left", marginx2)
2388 ok = VRset("GB_SERVICE","Width", pane_width - 760)
2389 ok = VRset("GB_SERVICE","Height", pane_height- 1020)
2390 ok = VRset("CN_SERVICE","Top", margin)
2391 ok = VRset("CN_SERVICE","Left", margin)
2392 ok = VRset("CN_SERVICE","Width", pane_width - 760 - marginx2 )
2393 ok = VRset("CN_SERVICE","Height", pane_height- 1020- marginx2 )
2394
2395 ok = VRset("GB_DAEMONS","Top", margin )
2396 ok = VRset("GB_DAEMONS","Left", marginx2)
2397 ok = VRset("GB_DAEMONS","Width", pane_width - 760)
2398 ok = VRset("GB_DAEMONS","Height", pane_height- 1020)
2399 ok = VRset("CN_DAEMONS","Top", margin)
2400 ok = VRset("CN_DAEMONS","Left", margin)
2401 ok = VRset("CN_DAEMONS","Width", pane_width - 760 - margin*4 - pbtn_width)
2402 ok = VRset("CN_DAEMONS","Height", pane_height- 1020 - marginx2 )
2403
2404 ok = VRSet("ICB_START", "Top", pbtn_height*2 - marginx2)
2405 ok = VRSet("ICB_STOP", "Top", pbtn_height*3 - marginx2)
2406 ok = VRSet("ICB_Restart","Top", pbtn_height*4 - marginx2)
2407 ok = VRSet("ICB_REload", "Top", pbtn_height*5 - marginx2)
2408
2409 ok = VRSet("ICB_START", "Left", pane_width - 760 - marginx2 - pbtn_width)
2410 ok = VRSet("ICB_STOP", "Left", pane_width - 760 - marginx2 - pbtn_width)
2411 ok = VRSet("ICB_Restart","Left", pane_width - 760 - marginx2 - pbtn_width)
2412 ok = VRSet("ICB_REload", "Left", pane_width - 760 - marginx2 - pbtn_width)
2413
2414 ok = VRSet("ICB_START", "Width", pbtn_width)
2415 ok = VRSet("ICB_STOP", "Width", pbtn_width)
2416 ok = VRSet("ICB_Restart","Width", pbtn_width)
2417 ok = VRSet("ICB_Reload", "Width", pbtn_width)
2418
2419 ok = VRSet("ICB_START", "Height", pbtn_Height)
2420 ok = VRSet("ICB_STOP", "Height", pbtn_Height)
2421 ok = VRSet("ICB_Restart","Height", pbtn_Height)
2422 ok = VRSet("ICB_Reload", "Height", pbtn_Height)
2423
2424
2425 ok = VRset("GB_SMBTREE","Top", margin )
2426 ok = VRset("GB_SMBTREE","Left", marginx2)
2427 ok = VRset("GB_SMBTREE","Width", pane_width - 760)
2428 ok = VRset("GB_SMBTREE","Height", pane_height- 1020)
2429 ok = VRset("CN_SMBTREE","Top", margin)
2430 ok = VRset("CN_SMBTREE","Left", margin)
2431 ok = VRset("CN_SMBTREE","Width", pane_width - 760 - marginx2 )
2432 ok = VRset("CN_SMBTREE","Height", pane_height- 1020- marginx2 )
2433
2434 ok = VRset("PICT_THROBBER", "Top", VRGet("CN_SMBTREE","Height") % 2 - 100 )
2435 ok = VRset("PICT_THROBBER", "Left", VRGet("CN_SMBTREE","Width") % 2 - 200 )
2436
2437 ok = VRset("GB_SETTINGS","Top", margin )
2438 ok = VRset("GB_SETTINGS","Left", marginx2)
2439 ok = VRset("GB_SETTINGS","Width", pane_width - 760)
2440 ok = VRset("GB_SETTINGS","Height", pane_height- 1020- marginx2)
2441
2442
2443 /* check and empty event queue, trash spurious resize events */
2444 EventString = ''
2445 TrashedResize = 0
2446 do until EventString = 'nop'
2447 EventString = VREvent('N')
2448 if EventString <> 'nop' then do
2449 if EventString = 'CALL Main_Resize' then TrashedResize = 1
2450 else interpret eventString
2451 end
2452 end
2453 if TrashedResize then CALL Main_Resize
2454 ok = VRSet("Main", "Painting", 1)
2455
2456 IF options.!debug == 1 THEN SAY time()' Main_Resize done'
2457return
2458
2459/*:VRX Page1_Create
2460*/
2461Page1_Create:
2462
2463Return
2464
2465/*:VRX Page1_Init
2466*/
2467Page1_Init:
2468 call _ContainerInit
2469return
2470
2471/*:VRX Page2_Create
2472*/
2473Page2_create:
2474
2475Return
2476/*:VRX Page2_init
2477*/
2478Page2_init:
2479
2480return
2481
2482/*:VRX Page3_Create
2483*/
2484Page3_create:
2485
2486Return
2487/*:VRX Page3_Init
2488*/
2489Page3_Init:
2490
2491return
2492
2493/*:VRX Page4_Create
2494*/
2495Page4_Create:
2496
2497Return
2498/*:VRX Page4_init
2499*/
2500Page4_init:
2501
2502return
2503
2504/*:VRX Page5_Create
2505*/
2506Page5_Create:
2507
2508return
2509
2510/*:VRX Page5_Init
2511*/
2512Page5_Init:
2513
2514return
2515
2516/*:VRX Paper_Init
2517*/
2518Paper_Init:
2519 ok = VRSet("IPB_Paper","Width" ,VRMethod( "Screen", "PixelsToTwips", 32 ))
2520 ok = VRSet("IPB_Paper","Height",VRMethod( "Screen", "PixelsToTwips", 32 ))
2521 ok = VRset("IPB_Paper","Left",VRget("GB_Main2","width")-420)
2522return
2523
2524/*:VRX PB_AboutOK1_Click
2525*/
2526PB_AboutOK1_Click:
2527 call About_Close
2528return
2529
2530/*:VRX PB_AboutOK_Click
2531*/
2532PB_AboutOK_Click:
2533 call About_Close
2534return
2535
2536/*:VRX PB_ACLS_OK_Click
2537*/
2538PB_ACLS_OK_Click:
2539 call SW_ACLS_close
2540return
2541
2542/*:VRX PB_DELLOGS_Click
2543*/
2544PB_DELLOGS_Click:
2545 call VRSet VRWindow(), 'Pointer', 'Wait'
2546say VRGet("EF_LOG_FILE","Value")
2547say translate(VRGet("EF_LOG_FILE","Value"),'\','/')
2548 samba.!logdir = VRParseFileName(translate(VRGet("EF_LOG_FILE","Value"),'\','/'),"DP")
2549say samba.!logdir
2550
2551 loggingfreespace = word(sysdriveinfo(left(samba.!logdir,2)),2)%1024%1024
2552 ok = VRSet("DT_FREESPACE", "Caption", loggingfreespace' MB')
2553
2554
2555 ok = SysFileTree(samba.!logdir'\log.*', logs.,'FO')
2556 do I = 1 to logs.0
2557 ok = VRMethod( "CN_Daemons", "GetRecordList", "All", "handle." )
2558 KeepLog = 0
2559 do J = 1 to handle.0
2560 CurPID = VRMethod("CN_Daemons", "GetFieldData", handle.J, DPidsFH)
2561 if pos(CurPID,logs.I) > 0 then KeepLog = 1
2562 end
2563 if KeepLog = 0 then do
2564 say "Delete "logs.I
2565 ok = SysFileDelete(logs.I)
2566 end
2567 end
2568
2569 loggingfreespace = word(sysdriveinfo(left(samba.!logdir,2)),2)%1024%1024
2570 ok = VRSet("DT_FREESPACE", "Caption", loggingfreespace' MB')
2571
2572 call VRSet VRWindow(), 'Pointer', '<default>'
2573return
2574
2575/*:VRX PB_Help_Click
2576*/
2577PB_Help_Click:
2578 ok = VRMethod("Main", "InvokeHelp" )
2579return
2580
2581/*:VRX PB_Sort_Cancel_Click
2582*/
2583PB_Sort_Cancel_Click:
2584 ok = VRset( Container, "DetailSort", Old.SortField )
2585 ok = VRSet( Container, "Sort", Old.SortOrder )
2586 ok = VRMethod( Container, "SortRecords" )
2587 drop Old.
2588 call SW_SORT_Close
2589return
2590
2591/*:VRX PB_Sort_OK_Click
2592*/
2593PB_Sort_OK_Click:
2594 drop Old.
2595 call SW_SORT_Close
2596return
2597
2598/*:VRX PushbackAll
2599*/
2600PushbackAll:
2601 Pages = 6
2602 /* Tab distance from top */
2603 TabTop = 20
2604 TabWidth = VRMethod( "Screen", "PixelsToTwips", 78 )
2605 TabHeight= VRMethod( "Screen", "PixelsToTwips", 24 )
2606
2607 /* Page Position */
2608 PageLeft = 120
2609 PageTop = PageLeft + TabTop + 330
2610
2611 /* Page size */
2612 PageHeight = 3000
2613 PageWidth = 3000
2614 call beep 880, 20
2615/* ok = VRset("DT_PageName", "Caption", "")
2616 ok = VRSet("GB_Main","Left", 0)
2617 ok = VRSet("GB_Main","Top", TabTop+230)
2618 do I = 1 to Pages
2619 ok = VRSet("TAB_"I,"Top", TabTop)
2620 ok = VRSet("TAB_"I,"PicturePath","#2"||I||";#2"||I)
2621 ok = VRSet("TAB_"I,"Left",TabWidth*(I-1)+PageLeft)
2622 ok = VRSet("TAB_"I,"Width",TabWidth)
2623 ok = VRSet("TAB_"I,"Height",TabHeight)
2624 ok = VRSet("Page_"I,"Height", max(PageHeight,VRget("GB_Main2","Height")-600))
2625 ok = VRSet("Page_"I,"Width", max(PageWidth,VRget("GB_Main2","Width")-450))
2626 ok = VRSet("Page_"I,"Left", PageLeft)
2627 ok = VRSet("Page_"I,"Top", PageTop)
2628 ok = VRSet("Page_"I,"Visible", 0)
2629 ok = VRSet("Page_"I,"BackColor", "<default>")
2630 end */
2631return
2632
2633/*:VRX Quit
2634*/
2635Quit:
2636 call VRSet VRWindow(), 'Pointer', 'Wait'
2637 call _IniWrite
2638 ok = VRRedirectStdIO("OFF")
2639 call _SambaFinish
2640
2641 ok = SysFileDelete(smbdoutput)
2642
2643 call lineout samba.!bin"\quit", "quit"
2644 ok = stream(samba.!bin"\quit","c","close")
2645 ok = SysSleep(1)
2646 ok = SysDestroyObject('<smbstarter>')
2647 ok = SysFileDelete(samba.!bin'\smbstarter.cmd')
2648 ok = SysFileDelete(samba.!bin'\quit')
2649 call VRSet VRWindow(), 'Pointer', '<default>'
2650
2651 window = VRWindow()
2652 call VRSet window, "Shutdown", 1
2653 drop window
2654return
2655
2656/*:VRX RB_ACLS_NUMERIC_Click
2657*/
2658RB_ACLS_NUMERIC_Click:
2659 aclsnumeric = '--numeric'
2660 ok = VRSet("DT_REV_CONT","Caption","")
2661 ok = VRMethod("CN_ACLS","RemoveRecord","ALL")
2662 ok = VRMethod("CN_ACLS","SetFieldAttr", ACL.userFH, "Visible", 0 )
2663 call _ACLSBrowse
2664return
2665
2666/*:VRX RB_ACLS_TEXT_Click
2667*/
2668RB_ACLS_TEXT_Click:
2669 aclsnumeric = ''
2670 ok = VRSet("DT_REV_CONT","Caption","")
2671 ok = VRMethod("CN_ACLS","RemoveRecord","ALL")
2672 ok = VRMethod("CN_ACLS","SetFieldAttr", ACL.userFH, "Visible", 1 )
2673 call _ACLSBrowse
2674return
2675
2676/*:VRX RB_Sort_Ascending_Click
2677*/
2678RB_Sort_Ascending_Click:
2679 SortOrder = "Ascending"
2680 call _ContainerSort
2681return
2682
2683/*:VRX RB_Sort_Descending_Click
2684*/
2685RB_Sort_Descending_Click:
2686 SortOrder = "Descending"
2687 call _ContainerSort
2688return
2689
2690/*:VRX RB_Sort_None_Click
2691*/
2692RB_Sort_None_Click:
2693 SortOrder = "None"
2694 call _ContainerSort
2695return
2696
2697/*:VRX SPIN_Intervall_Change
2698*/
2699SPIN_Intervall_Change:
2700return
2701
2702/*:VRX SPIN_IntervallMin_Change
2703*/
2704SPIN_IntervallMin_Change:
2705return
2706
2707/*:VRX SPIN_log_level_Change
2708*/
2709SPIN_log_level_Change:
2710 advanced.!smbconfchanged = 1
2711return
2712
2713/*:VRX SPIN_max_protocol_Change
2714*/
2715SPIN_max_protocol_Change:
2716 advanced.!smbconfchanged = 1
2717return
2718
2719/*:VRX SW_ACLS_Close
2720*/
2721SW_ACLS_Close:
2722 call SW_ACLS_Fini
2723return
2724
2725/*:VRX SW_ACLS_Create
2726*/
2727SW_ACLS_Create:
2728 call SW_ACLS_Init
2729 ACL.typeFH = VRMethod( "CN_ACLS", "AddField", "String", "Type" )
2730 ACL.groupFH = VRMethod( "CN_ACLS", "AddField", "String", "Group" )
2731 ACL.userFH = VRMethod( "CN_ACLS", "AddField", "String", "User" )
2732 ACL.ADFH = VRMethod( "CN_ACLS", "AddField", "String", "A/D" )
2733 ACL.flagsFH = VRMethod( "CN_ACLS", "AddField", "String", "Flags" )
2734 ACL.accessFH = VRMethod( "CN_ACLS", "AddField", "String", "Access" )
2735 ok = VRMethod( "CN_ACLS", "RemoveRecord", "ALL")
2736 aclsnumeric = ''
2737 call _ACLSBrowse
2738return
2739/*:VRX SW_ACLS_Fini
2740*/
2741SW_ACLS_Fini:
2742 window = VRInfo( "Window" )
2743 call VRDestroy window
2744 drop window
2745return
2746/*:VRX SW_ACLS_Init
2747*/
2748SW_ACLS_Init:
2749 window = VRInfo( "Object" )
2750 if( \VRIsChildOf( window, "Notebook" ) ) then do
2751 call VRMethod window, "CenterWindow"
2752 call VRSet window, "Visible", 1
2753 call VRMethod window, "Activate"
2754 end
2755 drop window
2756return
2757
2758/*:VRX SW_CHKTDB_Close
2759*/
2760SW_CHKTDB_Close:
2761 call SW_CHKTDB_Fini
2762return
2763
2764/*:VRX SW_CHKTDB_Create
2765*/
2766SW_CHKTDB_Create:
2767 call SW_CHKTDB_Init
2768return
2769
2770/*:VRX SW_CHKTDB_Fini
2771*/
2772SW_CHKTDB_Fini:
2773 window = VRInfo( "Window" )
2774 call VRDestroy window
2775 drop window
2776return
2777/*:VRX SW_CHKTDB_Init
2778*/
2779SW_CHKTDB_Init:
2780 window = VRInfo( "Object" )
2781 if( \VRIsChildOf( window, "Notebook" ) ) then do
2782 call VRMethod window, "CenterWindow"
2783 call VRSet window, "Visible", 1
2784 call VRMethod window, "Activate"
2785 end
2786 drop window
2787return
2788
2789/*:VRX SW_DAEMONS_Close
2790*/
2791SW_DAEMONS_Close:
2792 call SW_DAEMONS_Fini
2793return
2794
2795/*:VRX SW_DAEMONS_Create
2796*/
2797SW_DAEMONS_Create:
2798 call SW_DAEMONS_Init
2799
2800 CALL NLVSetText 'CN_DAEMONS', 'Caption', 65
2801
2802 CALL VRMethod 'TT_Main', 'Register', 'ICB_START', NLVGetMessage(61)
2803 CALL VRMethod 'TT_Main', 'Register', 'ICB_STOP', NLVGetMessage(62)
2804 CALL VRMethod 'TT_Main', 'Register', 'ICB_RESTART', NLVGetMessage(63)
2805 CALL VRMethod 'TT_Main', 'Register', 'ICB_RELOAD', NLVGetMessage(64)
2806 CALL VRMethod 'TT_DAEMONS', 'Register', 'CN_DAEMONS', NLVGetMessage(66)
2807return
2808
2809/*:VRX SW_DAEMONS_Fini
2810*/
2811SW_DAEMONS_Fini:
2812 window = VRInfo( "Window" )
2813 call VRDestroy window
2814 drop window
2815return
2816/*:VRX SW_DAEMONS_Init
2817*/
2818SW_DAEMONS_Init:
2819 window = VRInfo( "Object" )
2820 if( \VRIsChildOf( window, "Notebook" ) ) then do
2821 call VRMethod window, "CenterWindow"
2822 call VRSet window, "Visible", 1
2823 call VRMethod window, "Activate"
2824 end
2825 drop window
2826return
2827
2828/*:VRX SW_FILES_Close
2829*/
2830SW_FILES_Close:
2831 call SW_FILES_Fini
2832return
2833
2834/*:VRX SW_FILES_Create
2835*/
2836SW_FILES_Create:
2837 call SW_FILES_Init
2838 CALL VRMethod 'TT_FILES', 'Register', 'CN_FILES', NLVGetMessage(68)
2839return
2840
2841/*:VRX SW_FILES_Fini
2842*/
2843SW_FILES_Fini:
2844 window = VRInfo( "Window" )
2845 call VRDestroy window
2846 drop window
2847return
2848/*:VRX SW_FILES_Init
2849*/
2850SW_FILES_Init:
2851 window = VRInfo( "Object" )
2852 if( \VRIsChildOf( window, "TDL" ) ) then do
2853 call VRMethod window, "CenterWindow"
2854 call VRSet window, "Visible", 1
2855 call VRMethod window, "Activate"
2856 end
2857 drop window
2858return
2859
2860/*:VRX SW_LOGIN_Close
2861*/
2862SW_LOGIN_Close:
2863 call SW_LOGIN_Fini
2864return
2865
2866/*:VRX SW_LOGIN_Create
2867*/
2868SW_LOGIN_Create:
2869 call SW_LOGIN_Init
2870/* ok = VRSet("SW_LOGIN","Caption",NLVGetMessage(136)' 'strip(p_workgroup' \\'p_server'\'p_share,'T','\')) */
2871 CALL NLVSetText 'DT_USER1', "Caption", 131
2872 CALL NLVSetText 'DT_PASSWORD1', "Caption", 23
2873/* CALL NLVSetText 'CB_STORECREDS1', "Caption", 135 */
2874 CALL NLVSetText 'ICB_LOGIN_OK', "Caption", 2
2875 CALL NLVSetText 'ICB_LOGIN_CANCEL',"Caption", 3
2876
2877 if VRIsValidObject(SMBObj.rh) then do
2878 select
2879 when pos("PDC",VRMethod("CN_smbtree", "GetFieldData", SMBObj.rh, MBFH)) > 0 then LoginIcon = "#63:PMWP.DLL" /* icons.!pdc */
2880 when SMBObj.udatatype = "WORKGROUP" then LoginIcon = SMBObj.Icon
2881 when SMBObj.udatatype = "SERVER" then LoginIcon = SMBObj.Icon
2882 when SMBObj.udatatype = "DISK" then do
2883 if pos("PDC",VRMethod("CN_smbtree", "GetFieldData", SMBObj.parentrh, MBFH)) > 0
2884 then LoginIcon = "#63:PMWP.DLL" /* icons.!pdc */
2885 else LoginIcon = "#35:PMWP.DLL" /* icons.!pdc */
2886 end
2887 otherwise LoginIcon = "#35:PMWP.DLL" /* icons.!machine_awake */
2888 end
2889 say loginicon
2890 ok = VRSet("Pict_Login","PicturePath", LoginIcon)
2891 end
2892/* ok = VRSet("EF_USER1","Value",VRGet("EF_USER","Value"))
2893 ok = VRSet("EF_PASSWORD1","Value",VRGet("EF_PASSWORD","Value")) */
2894say options.!storecreds
2895 ok = VRSet("CB_STORECREDS1","Set",options.!storecreds)
2896return
2897
2898/*:VRX SW_LOGIN_Fini
2899*/
2900SW_LOGIN_Fini:
2901 window = VRInfo( "Window" )
2902 call VRDestroy window
2903 drop window
2904return
2905/*:VRX SW_LOGIN_Init
2906*/
2907SW_LOGIN_Init:
2908 window = VRInfo( "Object" )
2909 if( \VRIsChildOf( window, "Notebook" ) ) then do
2910 call VRMethod window, "CenterWindow"
2911 call VRSet window, "Visible", 1
2912 call VRMethod window, "Activate"
2913 end
2914 drop window
2915return
2916
2917/*:VRX SW_SERVICE_Close
2918*/
2919SW_SERVICE_Close:
2920 call SW_SERVICE_Fini
2921return
2922
2923/*:VRX SW_SERVICE_Create
2924*/
2925SW_SERVICE_Create:
2926 call SW_SERVICE_Init
2927 CALL VRMethod 'TT_SERVICE', 'Register', 'CN_SERVICE', NLVGetMessage(69)
2928return
2929
2930/*:VRX SW_SERVICE_Fini
2931*/
2932SW_SERVICE_Fini:
2933 window = VRInfo( "Window" )
2934 call VRDestroy window
2935 drop window
2936return
2937/*:VRX SW_SERVICE_Init
2938*/
2939SW_SERVICE_Init:
2940 window = VRInfo( "Object" )
2941 if( \VRIsChildOf( window, "TDL" ) ) then do
2942 call VRMethod window, "CenterWindow"
2943 call VRSet window, "Visible", 1
2944 call VRMethod window, "Activate"
2945 end
2946 drop window
2947return
2948
2949/*:VRX SW_SETTINGS_Close
2950*/
2951SW_SETTINGS_Close:
2952 call SW_SETTINGS_Fini
2953return
2954
2955/*:VRX SW_SETTINGS_Create
2956*/
2957SW_SETTINGS_Create:
2958 call SW_SETTINGS_Init
2959
2960 call SW_SETTINGS_Init_Content
2961
2962say VRGet("EF_LOG_FILE","Value")
2963say translate(VRGet("EF_LOG_FILE","Value"),'\','/')
2964 samba.!logdir = VRParseFileName(translate(VRGet("EF_LOG_FILE","Value"),'\','/'),"DP")
2965say samba.!logdir
2966 CALL VRMethod 'TT_SETTINGS', 'Register', 'DT_FREESPACE', samba.!logdir' blums'
2967return
2968
2969/*:VRX SW_SETTINGS_Fini
2970*/
2971SW_SETTINGS_Fini:
2972 window = VRInfo( "Window" )
2973 call VRDestroy window
2974 drop window
2975return
2976/*:VRX SW_SETTINGS_Init
2977*/
2978SW_SETTINGS_Init:
2979 window = VRInfo( "Object" )
2980 if( \VRIsChildOf( window, "TDL" ) ) then do
2981 call VRMethod window, "CenterWindow"
2982 call VRSet window, "Visible", 1
2983 call VRMethod window, "Activate"
2984 end
2985 drop window
2986return
2987
2988/*:VRX SW_SETTINGS_Init_Content
2989*/
2990SW_SETTINGS_Init_Content:
2991
2992 log_level = IniGet('log level', 'global', samba.!smbconf)
2993 log_file = IniGet('log file', 'global', samba.!smbconf)
2994 max_protocol = IniGet('max_protocol', 'global', samba.!smbconf)
2995
2996 if log_level = "" then log_level = 2
2997 if max_protocol = "" then max_protocol = "NT1"
2998
2999 ok = VRSet("SPIN_LOG_LEVEL","Value",log_level)
3000 ok = VRSet("EF_LOG_FILE","Value",log_file)
3001return
3002
3003/*:VRX SW_SMBTREE_Close
3004*/
3005SW_SMBTREE_Close:
3006 call SW_SMBTREE_Fini
3007return
3008
3009/*:VRX SW_SMBTREE_Create
3010*/
3011SW_SMBTREE_Create:
3012 call SW_SMBTREE_Init
3013return
3014
3015/*:VRX SW_SMBTREE_Fini
3016*/
3017SW_SMBTREE_Fini:
3018 window = VRInfo( "Window" )
3019 call VRDestroy window
3020 drop window
3021return
3022/*:VRX SW_SMBTREE_Init
3023*/
3024SW_SMBTREE_Init:
3025 window = VRInfo( "Object" )
3026 if( \VRIsChildOf( window, "TDL" ) ) then do
3027 call VRMethod window, "CenterWindow"
3028 call VRSet window, "Visible", 1
3029 call VRMethod window, "Activate"
3030 end
3031 drop window
3032return
3033
3034/*:VRX SW_SMBTREE_Init_Content
3035*/
3036SW_SMBTREE_Init_Content:
3037 ok = VRset("Pict_Throbber", "Visible", 1)
3038 ok = VRset("TM_Throbber", "Enabled", 1)
3039 call _RefreshTree
3040return
3041
3042/*:VRX SW_SORT_Close
3043*/
3044SW_SORT_Close:
3045 call SW_SORT_Fini
3046return
3047
3048/*:VRX SW_SORT_Create
3049*/
3050SW_SORT_Create:
3051 call SW_SORT_Init
3052
3053 CALL NLVSetText 'SW_SORT', 'Caption', 35
3054 CALL NLVSetText 'PB_Sort_OK', 'Caption', 2
3055 CALL NLVSetText 'PB_Sort_Cancel', 'Caption', 3
3056
3057 CALL NLVSetText 'RB_Sort_Ascending', 'Caption', 90
3058 CALL NLVSetText 'RB_Sort_Descending', 'Caption', 91
3059 CALL NLVSetText 'RB_Sort_None', 'Caption', 92
3060
3061 Container = OH
3062say OH
3063say Container
3064 ok = VRMethod(Container, "GetFieldList", "Fields." )
3065
3066 SortOrder = "None"
3067
3068 do I = 1 to Fields.0
3069 ok = VRMethod("LB_SortFields","AddString", VRMethod(Container, "GetFieldAttr", fields.I, "Title" ))
3070 end
3071 Old.SortField = VRGet( Container, "DetailSort" )
3072 Old.SortOrder = VRGet( Container, "Sort" )
3073say Old.SortField
3074say Old.SortOrder
3075return
3076
3077/*:VRX SW_SORT_Fini
3078*/
3079SW_SORT_Fini:
3080 window = VRInfo( "Window" )
3081 call VRDestroy window
3082 drop window
3083return
3084/*:VRX SW_SORT_Init
3085*/
3086SW_SORT_Init:
3087 window = VRInfo( "Object" )
3088 if( \VRIsChildOf( window, "Notebook" ) ) then do
3089 call VRMethod window, "CenterWindow"
3090 call VRSet window, "Visible", 1
3091 call VRMethod window, "Activate"
3092 end
3093 drop window
3094return
3095
3096/*:VRX SW_USERS_Close
3097*/
3098SW_USERS_Close:
3099 call SW_USERS_Fini
3100return
3101
3102/*:VRX SW_USERS_Create
3103*/
3104SW_USERS_Create:
3105 call SW_USERS_Init
3106 CALL VRMethod 'TT_USERS', 'Register', 'CN_USERS', NLVGetMessage(67)
3107return
3108
3109/*:VRX SW_USERS_Fini
3110*/
3111SW_USERS_Fini:
3112 window = VRInfo( "Window" )
3113 call VRDestroy window
3114 drop window
3115return
3116/*:VRX SW_USERS_Init
3117*/
3118SW_USERS_Init:
3119 window = VRInfo( "Object" )
3120 if( \VRIsChildOf( window, "Notebook" ) ) then do
3121 call VRMethod window, "CenterWindow"
3122 call VRSet window, "Visible", 1
3123 call VRMethod window, "Activate"
3124 end
3125 drop window
3126return
3127
3128/*:VRX TDL_1_PageSelected
3129*/
3130TDL_1_PageSelected:
3131 page = VRInfo("Page")
3132 CurrentPageNr = page
3133 ok = VRSet("TM_RefreshDaemons","Enabled", 0)
3134 ok = VRSet("DT_STATUSBAR","Caption", VRGet("Main", "HintText"))
3135 ok = VRSet("CN_DAEMONS","Visible", 0)
3136 ok = VRSet("CN_SMBTREE","Visible", 0)
3137 ok = VRSet("CN_USERS", "Visible", 0)
3138 ok = VRSet("CN_FILES", "Visible", 0)
3139 ok = VRSet("CN_SERVICE","Visible", 0)
3140 ok = VRSet("CN_CHKTDB", "Visible", 0)
3141 ok = VRSet("GB_SETTINGS","Visible", 0)
3142
3143 select
3144 when page = 1 then do /* daemons */
3145 ok = VRSet("CN_DAEMONS","Visible", 1)
3146 ok = VRSet("Main","WindowIcon","$46")
3147 ok = VRSet("TM_RefreshDaemons","Enabled", 1)
3148 ok = VRSet("TM_RefreshDaemons","Delay", 3000)
3149 end
3150 when page = 2 then do /* smbtree */
3151 ok = VRSet("CN_SMBTREE","Visible", 1)
3152 ok = VRSet("Main","WindowIcon","$1")
3153 ok = VRMethod( "CN_SMBTREE", "GetRecordList", "All", "handle." )
3154 /* if the page is empty, populate it */
3155 if handle.0 = 0 then call ICB_REFRESH_Click
3156 end
3157 when page = 3 then do /* Users */
3158 ok = VRSet("CN_USERS","Visible", 1)
3159 ok = VRSet("Main","WindowIcon","$44")
3160 end
3161 when page = 4 then do /* files */
3162 ok = VRSet("CN_FILES", "Visible", 1)
3163 ok = VRSet("Main","WindowIcon","$1")
3164 end
3165 when page = 5 then do /* service */
3166 ok = VRSet("CN_SERVICE","Visible", 1)
3167 ok = VRSet("Main","WindowIcon","$52")
3168 end
3169 when page = 6 then do /* chkTDB */
3170 ok = VRSet("CN_CHKTDB", "Visible", 1)
3171 ok = VRSet("Main","WindowIcon","$53")
3172 say "ChkTDB"
3173 call _ChkTDB
3174 end
3175 when page = 7 then do /* Settings */
3176 ok = VRSet("GB_SETTINGS","Visible", 1)
3177 ok = VRSet("Main","WindowIcon","$53")
3178 call SW_SETTINGS_Init_Content
3179 end
3180 otherwise nop
3181 end
3182return
3183
3184/*:VRX TM_Refresh_Trigger
3185*/
3186TM_Refresh_Trigger:
3187/* call beep 1200, 20 */
3188 ok = VRSet("TM_Refresh","Delay", Intervall * 1000)
3189 call _Refresh
3190return
3191
3192/*:VRX TM_RefreshDaemons_Trigger
3193*/
3194TM_RefreshDaemons_Trigger:
3195 ok = VRSet("TM_RefreshDaemons","Delay", 3000)
3196 call _RefreshDaemons
3197 call _AddSharesDisplay
3198return
3199
3200/*:VRX TM_RefreshTreeDisplay_Trigger
3201*/
3202TM_RefreshTreeDisplay_Trigger:
3203 select
3204 when RefreshMode = "TREE" then do
3205 call _RefreshTreeDisplay
3206 end
3207 when RefreshMode = "SHARE" then do
3208 call _AddSharesDisplay
3209 end
3210 otherwise say "RefreshMode = "RefreshMode
3211 end
3212return
3213
3214/*:VRX TM_STATUSBAR_Trigger
3215*/
3216TM_STATUSBAR_Trigger:
3217 call _StatusBarReset
3218return
3219
3220/*:VRX TM_Throbber_Trigger
3221*/
3222TM_Throbber_Trigger:
3223 pIdx = VRGet("Pict_Throbber","PicturePath")
3224 parse var pIdx '#' pidx
3225 pidx = pidx + 1
3226 if pidx = 122 then pidx = 111
3227 ok = VRSet("Pict_Throbber","PicturePath","#"pidx)
3228return
3229
Note: See TracBrowser for help on using the repository browser.