The code below was launched from the Code tab in V8. You need to modify the "fldr" variable to point to the WAS project folder. It will then produce a tidy text file listing the Security Group(s) for each A5W page in your project.
Should work in V9 also, but I did not test it. I bet you would have to deal with full path+file names if you used one Security file for multiple subfolders (which is a feature new to V9).
I needed this to get a better view on paper of how Security Groups were currently applied in preperation for some changes. It's also a good exercise using the StringScanner functions.
Note my caution. I'm not a fan of messing with the websecurity files.
CAUTION: this utility deals with security files. Although it does not modify any files, be sure to backup your existing project.
USE AT YOUR OWN RISK
Should work in V9 also, but I did not test it. I bet you would have to deal with full path+file names if you used one Security file for multiple subfolders (which is a feature new to V9).
I needed this to get a better view on paper of how Security Groups were currently applied in preperation for some changes. It's also a good exercise using the StringScanner functions.
Note my caution. I'm not a fan of messing with the websecurity files.
CAUTION: this utility deals with security files. Although it does not modify any files, be sure to backup your existing project.
USE AT YOUR OWN RISK
Code:
'''''''''''''''''''''' 'Author: Steve Wood, May 2008 'Utility to report Page Security for all A5W pages in your project 'CAUTION: this utility deals with security files. Although it does not modify any files, be sure to backup your existing project. 'USE AT YOUR OWN RISK '''''''''''''''''''''' 'output looks something like this and can be printed as is or imported in to Excel for better formatting ' 'about.a5w,Allow 'company.a5w,Deny 'invoices.a5w,Login,Administrators '''''''''''''''''''''' 'fldr needs to point to the folder where your security files reside. That could be in your development copy, or as published. fldr = "C:\mypath\myproject\myproject.WebProjects\default.WebProject" output = "c:\pagesecurity.txt" cc = file.to_string(fldr + "\pages.SecuritySettings") scanner = stringscanner.create(cc) ff = FILEFIND.GET(fldr+"\*.a5w",0,"N") ff = filter_stringc(ff,"a5wcmp",crlf(),.t.) grouplist = table.external_record_content_get(fldr + "\websecurity_groups.dbf","alltrim(group_guid)+','+alltrim(group_name)") scannergp = stringscanner.create(grouplist) lst = "" for each foo in ff scanner.reset() scannergp.reset() lst = lst + foo + "," p = scanner.skiptostringi(foo.value) if p = .f. lst = lst + "Deny" + crlf() continue else p = scanner.skiptostring("action=") p = scanner.skipover(8) t = scanner.scanover(1) if t = "a" lst = lst + "Allow" else lst = lst + "Login" + "," p = scanner.skiptostring("groups=") p = scanner.skipover(8) g = scanner.scantostring("\">") o = occurs(",",g) if o = 0 p = scannergp.skiptostring(g) p = scannergp.skiptostring(",") p = scannergp.skipover(1) g = scannergp.scantowhitespace() lst = lst + g else for x = 1 to o+1 scannergp.reset() h = word(g,x,",") p = scannergp.skiptostring(h) p = scannergp.skiptostring(",") p = scannergp.skipover(1) h = scannergp.scantowhitespace() if x <> o+1 lst = lst + h + " | " end if next end if end if end if lst = lst + crlf() next save_to_file(lst,output)
Comment