Figure 9   Check Available Apps


 ' Make sure we need to look up an application
 If appname <> "none" then
 
 'Check the User object to see if the available applications are set for the user
 On error resume next
 apps = objAUO.GetEx("AvailableApps")
 
 'State variable for checking application lookup 0 = not found, 1 = found
 ' rights = 0
 
 If Err.number <> 0 then
     Err.Clear()
 
     ' Set the Group Container path
     Set objGroups = GetObject("LDAP://localhost:1002/o=intranet/ou=groups")
     
     'Available applications not found for user so look in the user's group
 
     'Look in all groups that the member belongs to
     For nLoop = LBound(groups) to UBound(groups)
 
         'Strip out extraneous path information in front of actual group name
         groupname = Left(groups(nLoop),InStr(1,groups(nLoop),",")-1)
 
         ' Get each group using the Group Container path
         Set objIADs = objGroups.GetObject("groups", groupname)
         apps = objIADs.GetEx("AvailableApps")
 
         'Check the available applications (Application Objects) found to see if 
         ' our application is listed among them
 
         For nLoop2 = LBound(apps) to UBound(apps)
            If apps(nloop2) = "\Applications\" & appname then rights = 1 End If
         Next
     Next
 
 Else
     ' Check the available applications (User Object) found to see if application 
     ' is listed among them
 
     On Error Resume Next
     For nLoop = LBound(apps) to UBound(apps)
         If apps(nloop) = "\Applications\" & appname then rights = 1 End If
     Next
     On Error goto 0
     Err.Clear()
 
 
 End If
 On Error goto 0
 
 If rights = 0 then
     Response.redirect(noaccess)
 End If

Figure 12   Looking Up Properties


 'Look up the path to applications settings objects
 On error resume Next
 Set objApps = GetObject("LDAP://localhost:1002/o=intranet/ou=applications")
 Set objApp = objApps.GetObject("application","appName=" & appname)
 PrefPath = objApp.get("AppSettingsPath")
 On error goto 0
 If Err.number <> 0 then
     Response.Redirect(errorpage)
 End If
 
 'Establish the object using the path settings
 Set objPath = GetObject("LDAP://localhost:1002/o=intranet")
 Set objSettLoc = objPath.GetObject("organizationalunit",prefpath)
 
 'Look for the preference settings under the user object first,
 'then the group object, then the application object
 On Error Resume Next
 
 'Looking for user preferences
 Set objSettings = objSettLoc.GetObject(appname & "Preferences","cn=" & username)
 validObject = objSettings.get("cn")
 If Err.number <> 0 then
 
     'Looking for group preferences
     Err.Clear()
     For nLoop = LBound(groups) to UBound(groups)    
     groupname = Left(groups(0),InStr(1,groups(0),",")-1)
     Set objSettings = objSettLoc.GetObject(appname & "Preferences", groupname)
     validObject = objSettings.get("cn")
     If Err.number = 0 then nLoop = UBound(groups)
     Next
     If Err.number <> 0 then
 
         'Getting application default preferences
         Err.Clear()
         Set objSettings = objSettLoc.GetObject(appname &  
             "Preferences","cn=defaultpreferences")
         validObject = objSettings.get("cn")
         If Err.number <> 0 then
             Response.Redirect(errorpage)
         End If
     End If
 End If
 On error goto 0
 
 'Application Preferences Extraction section
 'Extract any preference settings here
 
 'Sample - 
 'securitycode = objSettings.get("accesstype")