If WebObjects 4.5 Update 2 or WebObjects Update 3 is installed, the WOStatsPage is protected by default. This document is only relevant if one of the WebObjects updates is not installed.
By default, the password protection functions of WOStats are disabled. To enable them, you will need to change some of the files in the WOStatsPage project. The exact steps will depend on your operating system. After the function is enabled, it is easy to set a password in your application.
Enabling Password Protection on MacOS X Server
To enable password protection on MacOS X Server, first open the file
System/Library/Frameworks/WOExtensions.framwork/Resources/WOStatsPage.wo
in the WOBuilder application. If you do not have the development tools installed on this system, you will have to edit the files by hand; follow the instructions for Solaris and HP-UX systems, below.
Replace this statement with:
condition=session.allowedToViewStatistics;
Replace this statement with:
condition=session.allowedToViewStatistics;
Password protection is now enabled. Follow the instructions below to set a password for your application.
Enabling Password Protection on Solaris or HP-UX
To enable password protection on a Solaris or HP-UX system, first open this directory under your Apple root directory (usually /Apple or /opt/Apple):
Library/Frameworks/WOExtensions.framwork/Resources/WOStatsPage.wo
This directory will contains two files, WOStatsPage.html and WOStatsPage.wod. Using a text editor, make the following three changes:
Replace this statement with:
condition=session.allowedToViewStatistics;
Replace this statement with:
condition=session.allowedToViewStatistics;
Password protection is now enabled. Follow the instructions below to set a password for your application.
Enabling Password Protection on Windows NT 4.0
To enable password protection on Windows NT, first open this directory under your Apple root directory (usually C:\\Apple):
Library/Frameworks/WOExtensions.framwork/Resources/WOStatsPage.wo/
This directory will contains two files, WOStatsPage.html and WOStatsPage.wod. Using a text editor or WOBuilder, make the following three changes:
The statement should now read:
ALLOWED: WOConditional {
condition=session.allowedToViewStatistics;
//condition=YES;
}
The statement should now read:
REFUSED: WOConditional {
condition=session.allowedToViewStatistics;
//condition=YES;
nagate="1";
}
Password protection is now enabled. Follow the instructions below to set a password for your application.
Using Password Protection
Once password protection is enabled, set the password in your Application.wos file's init method. The syntax is:
[[self statisticsStore] setPassword: @"MyPassword"];