Rev 6 | Blame | Compare with Previous | Last modification | View Log | RSS feed
<%'===================================================================' _treeNavigation'===================================================================%><%'------------ VARIABLE DEFINITION -------------Dim arrRootDim arrAppPropertiesDim parTreeDim nLevel'------------ CONSTANTS DECLARATION -----------Const UNDERLINE = "_"Const IMG_INDENT1 = "<img src='images/spacer.gif' width='18' height='5' align='absmiddle' border='0'>"Const IMG_INDENT2 = "<img src='images/spacer.gif' width='36' height='5' align='absmiddle' border='0'>"Const IMG_INDENT3 = "<img src='images/spacer.gif' width='54' height='5' align='absmiddle' border='0'>"Const IMG_APPLICATIONS = "<img src='images/i_application.gif' width='15' height='17' hspace='4' border='0' align='absmiddle'>"Const IMG_DISK = "<img src='images/i_disk.gif' width='16' height='16' hspace='4' border='0' align='absmiddle'>"Const IMG_USER = "<img src='images/i_user.gif' width='16' height='16' hspace='4' border='0' align='absmiddle'>"Const IMG_USER_DISABLED = "<img src='images/i_user_disabled.gif' width='16' height='16' hspace='4' border='0' align='absmiddle'>"Const IMG_ROLE = "<img src='images/i_role.gif' width='16' height='16' hspace='4' border='0' align='absmiddle'>"Const IMG_CONTROL = "<img src='images/i_control.gif' width='16' height='16' hspace='4' border='0' align='absmiddle'>"Const IMG_PAGE = "<img src='images/i_page.gif' width='16' height='16' hspace='4' border='0' align='absmiddle'>"Const IMG_FOLDER = "<img src='images/i_folder.gif' width='16' height='16' hspace='4' border='0' align='absmiddle'>"Const IMG_USER_ACCOUNTS = "<img src='images/i_accounts.gif' width='16' height='14' hspace='4' border='0' align='absmiddle'>"Const IMG_COMPUTERS = "<img src='images/i_computer.gif' width='11' height='16' hspace='6' border='0' align='absmiddle'>"Const IMG_LOGIN = "<img src='images/spacer.gif' width='5' height='16' hspace='1' border='0' align='absmiddle'>"'------------ VARIABLE INIT -------------------parTree = Request("tree")'[1] Name'[2] ID'[3] Link'[4] JavaScript Event e.g. "onClick='...'"'[5] Image Selected'[6] Child SQL statementConst inxTNName = 0Const inxTNid = 1Const inxTNLink = 2Const inxTNEventHandler = 3Const inxTNImage = 4Const inxChildSQL = 5Const nNumberofProperties = 6arrRoot = Array ( "Applications", _"1", _"ApplicationList.asp", _"", _IMG_APPLICATIONS, _"ApplicationsList.sql", _"User Accounts", _"2", _"UserAccounts.asp", _"", _IMG_USER_ACCOUNTS, _NULL, _"Computers", _"3", _"ComputerList.asp", _"", _IMG_COMPUTERS, _NULL, _"Login Trail", _"4", _"LoginTrail.asp", _"", _IMG_LOGIN, _NULL _)arrAppProperties = Array ( "Users", _"1", _"UserList.asp", _"", _IMG_FOLDER, _"AppUserList.sql", _"Roles", _"2", _"RoleList.asp", _"", _IMG_FOLDER, _"AppRoleList.sql", _"Actions", _"3", _"ControlList.asp", _"", _IMG_FOLDER, _"AppControlList.sql" _)', _'"Pages", _'"4", _'"PageList.asp", _'"", _'IMG_FOLDER, _'"AppPageList.sql" _'----------------------------------------------%><%'--------------------------------------------------------------------------------------------------------------------------------Function LoadFromSQL ( sQuery )Dim rsQry, tempArr(), rowCnt, newDimSet rsQry = OraDatabase.DbCreateDynaset( sQuery , ORADYN_DEFAULT )ReDim tempArr( -1 ) ' Default empty arrayrowCnt = 1While ((NOT rsQry.BOF) AND (NOT rsQry.EOF))newDim = nNumberofProperties * rowCntReDim Preserve tempArr( newDim - 1 )tempArr ( inxTNName + newDim - nNumberofProperties ) = rsQry("item_name")tempArr ( inxTNid + newDim - nNumberofProperties ) = rsQry("item_id")tempArr ( inxTNImage + newDim - nNumberofProperties ) = Eval(rsQry("item_image"))tempArr ( inxTNLink + newDim - nNumberofProperties ) = rsQry("file_name") &"?"& rsQry("param")rowCnt = rowCnt + 1rsQry.MoveNextWEndLoadFromSQL = tempArrrsQry.CloseSet rsQry = NothingEnd Function'--------------------------------------------------------------------------------------------------------------------------------Sub RenderSQL ( sQuery, Indent, sParent )Dim rsQrySet rsQry = OraDatabase.DbCreateDynaset( sQuery , ORADYN_DEFAULT )While ((NOT rsQry.BOF) AND (NOT rsQry.EOF))Response.write "<tr>"Response.write " <td nowrap>"& Indent &"<a href='"& SCRIPT_NAME &"?tree="& sParent & UNDERLINE & rsQry("item_id") &"' class='menu_link'><img src='images/i_plus.gif' width='9' height='9' align='absmiddle' border='0'>"& Eval(rsQry("item_image")) & rsQry("item_name") &"</a></td>"Response.write "</tr>"rsQry.MoveNextWEndrsQry.CloseSet rsQry = NothingEnd Sub'--------------------------------------------------------------------------------------------------------------------------------Sub RenderList ( aList )Dim nLastItem, item, inLastItem = Ubound( aList )For item = 0 To nLastItem Step nNumberofProperties' Render ItemResponse.write "<tr>"Response.write " <td nowrap><a href='"& aList( inxTNLink + item ) &"' class='menu_link'>"& aList( inxTNImage + item ) & aList( inxTNName + item ) &"</a></td>"Response.write "</tr>"NextEnd Sub'--------------------------------------------------------------------------------------------------------------------------------Sub NodeRoot ()Dim nLastItem, item, arrTree, aSQL, sqlINX, selectednLastItem = Ubound( arrRoot )For item = 0 To nLastItem Step nNumberofPropertiesselected = FALSEIf parTree = arrRoot( inxTNid + item ) Then selected = TRUE' Render ItemResponse.write "<tr>"Response.write " <td nowrap><a href='"& arrRoot( inxTNLink + item ) &"?tree="& arrRoot( inxTNid + item ) &"' class='manu_link'>"& Expander ( selected ) & arrRoot( inxTNImage + item ) &"<SPAN class='"& SelectorStyle( selected ) &"'>"& arrRoot( inxTNName + item ) &"</SPAN></a></td>"Response.write "</tr>"' Render KidsIf selected AND NOT IsNull( arrRoot( inxChildSQL + item ) ) ThenaSQL = LoadFromSQL ( GetQuery( arrRoot( inxChildSQL + item ) ) )For sqlINX = 0 To Ubound( aSQL ) Step nNumberofPropertiesResponse.write "<tr>"Response.write " <td nowrap><a href='"& aSQL( inxTNLink + sqlINX ) &"&tree="& arrRoot( inxTNid + item ) &"_"& aSQL( inxTNid + sqlINX ) &"' class='menu_link'>"& IMG_INDENT1 & Expander ( FALSE ) & aSQL( inxTNImage + sqlINX ) & aSQL( inxTNName + sqlINX ) &"</a></td>"Response.write "</tr>"NextEnd IfNextEnd Sub'--------------------------------------------------------------------------------------------------------------------------------Sub NodeApplicationProperties ()Dim rootINX, appINX, appPropINX, arrTree, selectedDim aAppListarrTree = Split( parTree, UNDERLINE )aAppList = LoadFromSQL ( GetQuery("ApplicationsList.sql") )For rootINX = 0 To Ubound( arrRoot ) Step nNumberofPropertiesselected = FALSEIf arrTree( 0 ) = arrRoot( inxTNid + rootINX ) Then selected = TRUE' Render ItemResponse.write "<tr>"Response.write " <td nowrap><a href='"& arrRoot( inxTNLink + rootINX ) &"?tree="& arrRoot( inxTNid + rootINX ) &"' class='menu_link'>"& Expander ( selected ) & arrRoot( inxTNImage + rootINX ) & arrRoot( inxTNName + rootINX ) &"</a></td>"Response.write "</tr>"If selected Then' Applications ListFor appINX = 0 To Ubound( aAppList ) Step nNumberofPropertiesselected = FALSEIf arrTree( 1 ) = aAppList( inxTNid + appINX ) Then selected = TRUEResponse.write "<tr>"Response.write " <td nowrap><a href='Application_Default.asp?app_id="& aAppList( inxTNid + appINX ) &"&tree="& arrRoot( inxTNid + rootINX ) &"_"& aAppList( inxTNid + appINX ) &"' class='menu_link'>"& IMG_INDENT1 & Expander ( selected ) & aAppList( inxTNImage + appINX ) &"<SPAN class='"& SelectorStyle( selected ) &"'>"& aAppList( inxTNName + appINX ) &"</SPAN></a></td>"Response.write "</tr>"If selected Then' Application PropertiesFor appPropINX = 0 To Ubound( arrAppProperties ) Step nNumberofPropertiesResponse.write "<tr>"Response.write " <td nowrap><a href='"& arrAppProperties( inxTNLink + appPropINX ) &"?app_id="& aAppList( inxTNid + appINX ) &"&tree="& arrRoot( inxTNid + rootINX ) &"_"& aAppList( inxTNid + appINX ) &"_"& arrAppProperties( inxTNid + appPropINX ) &"' class='menu_link'>"& IMG_INDENT2 & Expander ( FALSE ) & arrAppProperties( inxTNImage + appPropINX ) & arrAppProperties( inxTNName + appPropINX ) &"</a></td>"Response.write "</tr>"NextEnd IfNextEnd IfNextEnd Sub'--------------------------------------------------------------------------------------------------------------------------------Sub NodeApplicationProperty ()Dim rootINX, appINX, appPropINX, arrTree, aSQL, sqlINX, selected, queryDim aAppListarrTree = Split( parTree, UNDERLINE )aAppList = LoadFromSQL ( GetQuery("ApplicationsList.sql") )For rootINX = 0 To Ubound( arrRoot ) Step nNumberofPropertiesselected = FALSEIf arrTree( 0 ) = arrRoot( inxTNid + rootINX ) Then selected = TRUE' Render ItemResponse.write "<tr>"Response.write " <td nowrap><a href='"& arrRoot( inxTNLink + rootINX ) &"?tree="& arrRoot( inxTNid + rootINX ) &"' class='menu_link'>"& Expander ( selected ) & arrRoot( inxTNImage + rootINX ) & arrRoot( inxTNName + rootINX ) &"</a></td>"Response.write "</tr>"If selected Then' Applications ListFor appINX = 0 To Ubound( aAppList ) Step nNumberofPropertiesselected = FALSEIf arrTree( 1 ) = aAppList( inxTNid + appINX ) Then selected = TRUEResponse.write "<tr>"Response.write " <td nowrap><a href='Application_Default.asp?app_id="& aAppList( inxTNid + appINX ) &"&tree="& arrRoot( inxTNid + rootINX ) &"_"& aAppList( inxTNid + appINX ) &"' class='menu_link'>"& IMG_INDENT1 & Expander ( selected ) & aAppList( inxTNImage + appINX ) & aAppList( inxTNName + appINX ) &"</a></td>"Response.write "</tr>"If selected Then' Application PropertiesFor appPropINX = 0 To Ubound( arrAppProperties ) Step nNumberofPropertiesselected = FALSEIf arrTree( 2 ) = arrAppProperties( inxTNid + appPropINX ) Then selected = TRUEResponse.write "<tr>"Response.write " <td nowrap><a href='"& arrAppProperties( inxTNLink + appPropINX ) &"?app_id="& aAppList( inxTNid + appINX ) &"&tree="& arrRoot( inxTNid + rootINX ) &"_"& aAppList( inxTNid + appINX ) &"_"& arrAppProperties( inxTNid + appPropINX ) &"' class='menu_link'>"& IMG_INDENT2 & Expander ( selected ) & arrAppProperties( inxTNImage + appPropINX ) &"<SPAN class='"& SelectorStyle( selected ) &"'>"& arrAppProperties( inxTNName + appPropINX ) &"</SPAN></a></td>"Response.write "</tr>"'If selected Then' query = GetQuery( arrAppProperties( inxChildSQL + appPropINX ) )' query = Replace( query, ":APP_ID", aAppList( inxTNid + appINX ) )'' aSQL = LoadFromSQL ( query )'' If Not IsNull( aSQL ) Then' For sqlINX = 0 To Ubound( aSQL ) Step nNumberofProperties' Response.write "<tr>"' Response.write " <td nowrap><a href='"& aSQL( inxTNLink + sqlINX ) &"&app_id="& aAppList( inxTNid + appINX ) &"&tree="& arrRoot( inxTNid + rootINX ) &"_"& aAppList( inxTNid + appINX ) &"_"& arrAppProperties( inxTNid + appPropINX ) &"_"& aSQL( inxTNid + sqlINX ) &"' class='menu_link'>"& IMG_INDENT3 & Expander ( NULL ) & aSQL( inxTNImage + sqlINX ) & aSQL( inxTNName + sqlINX ) &"</a></td>"' Response.write "</tr>"'' Next' End If''End IfNextEnd IfNextEnd IfNextEnd Sub'--------------------------------------------------------------------------------------------------------------------------------Function SelectorStyle ( bSelected )SelectorStyle = "menu_link"If bSelected ThenSelectorStyle = "menu_linkselect"End IfEnd Function'--------------------------------------------------------------------------------------------------------------------------------'Sub RenderTree ( Node )' Select Case Node' Case "ROOT"' Call NodeRoot ()' Case "APPLICATION_PROPERTIES"' Call NodeApplicationProperties ()' Case "PROPERTY"' Call NodeApplicationProperty ()'' End Select'End Sub'--------------------------------------------------------------------------------------------------------------------------------Sub RenderTree ( sParTree )Select Case UBound( Split( sParTree, "_" ) )Case 1Call NodeApplicationProperties ()Case 2, 3Call NodeApplicationProperty ()Case ElseCall NodeRoot ()End SelectEnd Sub'--------------------------------------------------------------------------------------------------------------------------------%><%'------------ RUN BEFORE CONTROL RENDER -------'----------------------------------------------%><table width="100%" border="0" cellspacing="0" cellpadding="8"><%If LCASE(SCRIPT_NAME) = "userlist.asp" ThenResponse.Write("<form name=""myform"" method=""get"" action="& SCRIPT_NAME &">")ElseResponse.Write("<form name=""myform"" method=""get"" action=""UserAccounts.asp"">")Call objPMod.StoreParameter("tree", "2")End If%><tr><td background="images/bg_drk_bage_pane.gif" nowrap><span class="fav_txt">Find in Access Manager:</span><br><input name="filter" type="text" class="form_iname" size="22" value="<%=Request("filter")%>"><input name="btn" type="submit" class="form_iname" value="Find"></td></tr><%=objPMod.ComposeHiddenTagsWithout("user_id")%></form></table><table width="100%" border="0" cellspacing="5" cellpadding="0"><tr><td><table width="100%" border="0" cellspacing="2" cellpadding="0"><%Call RenderTree ( parTree )%></table></td></tr></table><%'------------ RUN AFTER CONTROL RENDER --------'----------------------------------------------%>