Using the Automated Tool
We've provided an automated FoxPro script - UserSecurityManager_AddToProject.prg
- that can be used to update an existing Web Connection 7.0+ project by adding the necessary dependencies to integrate the User Security Manager.
If you have older, pre 7.x projects, you can use the manual steps and explicitly hook up the User Security Manager settings. At minimum a Web Connection 6.x application is required.
Before Running this Tool
Please make sure you create a backup of your existing project. Either commit to source control or otherwise make a back up of your existing project. This tool will make changes to your existing project's code, and the changes are one-way and cannot be rolled back.
Backup first, ask questions later.
Run this Tool only once
Make sure you don't run this tool multiple times. If you need to re-run this tool, first revert back to a backup or previous source control state, then re-run. Running the tool multiple times will result in duplication injected code.
Running the Automated Tool
To run the configuration tool open the UserSecurity Manager and make sure the project works and runs (DO UserSecurityManagerMain.prg
). Specifically make sure that all the paths are set properly so that Web Connection support files can be found.
For demonstration purposes I'll use SecurityTest and SecureProcess as the project and process class names of the project to integrate into
- Open the UserSecurityManager Project
- Make sure you are running in the UserSecurityManager's
Deploy
folder - Make sure all paths are set (run
DO SETPATHS
or open with shortcut/config.fpw settings) - Check with
? SET("PATH")
and make sure\wconnect\classes
and\wconnect
(WWWC install folder) are included - Make sure the project runs (
DO UserSecurityMain
and check requests)
Once the project runs properly run the integration tool UserSecurityManager_AddToProject.prg
that adds the User Security Manager to an existing Web Connection 7.x+ project.
DO UserSecurityManager_AddToProject
When you run this it will prompt you for:
- The Project's Main start up file:
SecurityTestMain.prg
- The Project's Process class:
SecureProcess.prg
- The Project script map extension
st
Alternately you can also pass three parameters for these values:
DO UserSecurityManager_AddToProject WITH
"c:\webconnectionProjects\SecurityTest\deploy\SecurityTestmain.prg",
"c:\webconnectionProjects\SecurityTest\deploy\SecureProcess.prg",
"st"
This tool will run very quickly and display a wait window when it's done.
The tool does the following:
- Creates a
UserSecurityManager
folder in your project's Deploy folder - Copies
UserSecurityManagerProcess
andAppUserSecurity
classes - Add an
AppUserSecurity.dbf
user file with sample data to start with - Copies Web folder files (
usermanager
folder and_login.wcs
in `Views) - Creates a scriptmap for
.usm
in your web.config - Hooks up the
usm
scriptmap in your main prg'sProcess()
method - Hooks up
UserSecurityManagerProcess
in your main prg - Configures your Process class to use the new Auth code in
OnProcessInit()
- Adds Sign in Widget into
_layoutpage.wcs
(if it can find a banner menu bar) - Creates a
default.st
home page from default.htm if it doesn't exist
Once complete your application can now Login.usm
, Logout.usm
and Profile.usm
to access the most common sign in features and the authentication form automatically routes to these requests. There's also an admin link for usermanager/admin/UserList.usm
for user administration.
Sign In Widget only used on Content Scripts and Templates
Remember that the default Signin Widget only shows up on Script and Template pages that use a _layout page. Any coded pages, or script pages that don't use the _layout page will need to explicitly add the sign in display in some other way. If you're using scripts you can explicit
<%= RenderPartial("~/usermanager/LoginMenu_Partial.usm) %>
.
© West Wind Technologies, 1996-2020 • Updated: 05/08/20
Comment or report problem with topic