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.
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.
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.
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
- Make sure all paths are set (run
DO SETPATHSor open with shortcut/config.fpw settings)
- Check with
? SET("PATH")and make sure
\wconnect(WWWC install folder) are included
- Make sure the project runs (
DO UserSecurityMainand 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.
When you run this it will prompt you for:
- The Project's Main start up file:
- The Project's Process class:
- The Project script map extension
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
UserSecurityManagerfolder in your project's Deploy folder
- Add an
AppUserSecurity.dbfuser file with sample data to start with
- Copies Web folder files (
- Creates a scriptmap for
.usmin your web.config
- Hooks up the
usmscriptmap in your main prg's
- Hooks up
UserSecurityManagerProcessin your main prg
- Configures your Process class to use the new Auth code in
- Adds Sign in Widget into
_layoutpage.wcs(if it can find a banner menu bar)
- Creates a
default.sthome page from default.htm if it doesn't exist
Once complete your application can now
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.
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) %>.
Comment or report problem with topic