Subversion Repositories DevTools

Rev

Rev 2 | Blame | Compare with Previous | Last modification | View Log | RSS feed

<%@LANGUAGE="VBSCRIPT"%>
<%
'=====================================================
'|                                                   |
'|                                User Privileges                                |
'|                                                   |
'=====================================================
%>
<%
Option explicit
Response.Expires = 0
%>
<!--#include file="common/globals.asp"-->
<!--#include file="common/config.asp"-->
<!--#include file="common/common_subs.asp"-->
<!--#include file="common/_user_common.asp"-->
<%
'------------ ACCESS CONTROL ------------------
%>
<!--#include file="_access_control_general.asp"-->
<%
'------------ VARIABLE DEFINITION -------------
Dim rsQry
Dim ActiveCombo
Dim VisibleCombo
Dim currObj_id
Dim isNewGroup
Dim isVisibleComboDisabled
Dim isActiveComboDisabled
'------------ CONSTANTS DECLARATION -----------
'------------ VARIABLE INIT -------------------
'------------ CONDITIONS ----------------------
'----------------------------------------------
%>
<%
'--------------------------------------------------------------------------------------------------------------------------------------------
Sub SetPermissionCombos ( nObj_id, bNewGroup, cIsRoleVariation, _
                                                  ByRef isVisibleComboDisabled, ByRef isActiveComboDisabled, _
                                                  cVisible, cActive, _
                                                  ByRef outVisibleCombo, ByRef outActiveCombo )
        Dim i, selected
        
        
        ' --- Reset combos "disabled" if necessary ---
        If bNewGroup AND IsNull( cIsRoleVariation ) Then
                isVisibleComboDisabled  = ""
                isActiveComboDisabled = ""
        End If
        
        
        
        ' --- Visible Combo ---
        outVisibleCombo = ""
        outVisibleCombo = outVisibleCombo &"<select name='VIS_"& nObj_id &"' class='form_iname' "& isVisibleComboDisabled &">"
        
        For i = 0 To UBound( arrVisiblePermissions ) Step NumberofPermissionFields
                selected = ""
                If arrVisiblePermissions( INXperm_val + i ) = cVisible Then
                        selected = "selected"
                End If
                
                outVisibleCombo = outVisibleCombo &"<option class='"& arrVisiblePermissions( INXperm_style + i ) &"' "& selected &" value='"& arrVisiblePermissions( INXperm_val + i ) &"'>"& arrVisiblePermissions( INXperm_text + i ) &"</option>"& VBNewLine
        Next
        
        outVisibleCombo = outVisibleCombo &"</select>"
        
        
        
        ' --- Active Combo ---
        outActiveCombo = ""
        outActiveCombo = outActiveCombo &"<select name='ACT_"& nObj_id &"' class='form_iname' "& isActiveComboDisabled &">"
        
        For i = 0 To UBound( arrActivePermissions ) Step NumberofPermissionFields
                selected = ""
                If arrActivePermissions( INXperm_val + i ) = cActive Then
                        selected = "selected"
                End If
                
                outActiveCombo = outActiveCombo &"<option class='"& arrActivePermissions( INXperm_style + i ) &"' "& selected &" value='"& arrActivePermissions( INXperm_val + i ) &"'>"& arrActivePermissions( INXperm_text + i ) &"</option>"& VBNewLine
        Next
        
        outActiveCombo = outActiveCombo &"</select>"
        
        
        
        
        ' --- Set combos "disabled" if role variation is present ---
        If bNewGroup AND NOT IsNull( cIsRoleVariation ) Then
                isVisibleComboDisabled  = "disabled"
                isActiveComboDisabled = "disabled"
        End If
        
End Sub
'--------------------------------------------------------------------------------------------------------------------------------------------
%>
<%
'------------ RUN BEFORE PAGE RENDER ----------
Call GetUserDetails ( parUser_id, objUserCollector )
'----------------------------------------------
%>
<html>
<head>
<title>Access Manager</title>
<meta HTTP-EQUIV="Pragma" CONTENT="no-cache">
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<link href="scripts/access_manager.css" rel="stylesheet" type="text/css">
<script language="JavaScript" src="scripts/common.js"></script>

</head>

<body bgcolor="#FFFFFF" leftmargin="0" topmargin="0">
<!-- HEADER ++++++++++++++++++++++ -->
<!--#include file="_header.asp"-->
<!-- +++++++++++++++++++++++++++++ -->
<table width="100%"  border="0" cellspacing="0" cellpadding="0">
  <tr>
    <td width="1%" valign="top" background="images/bg_bage_pane.gif">
        <!-- TREE NAVIGATOR ++++++++++++++++++++++++++++++++++++++++++++ -->
        <!--#include file="_treeNavigator.asp"-->  
        <!-- +++++++++++++++++++++++++++++++++++++++++++++++++++++++++ -->
        </td>
    <td width="1" background="images/bg_drk_gray_border.gif"><img src="images/spacer.gif" width="1" height="600"></td>
    <td width="100%" valign="top"><table width="100%"  border="0" cellspacing="0" cellpadding="9">
      <tr>
        <td background="images/bg_drk_bage_pane.gif">
                  <table width="100%"  border="0" cellspacing="0" cellpadding="0">
            <tr>
              <td nowrap class="body_txt">
                            <!-- BUTTONS CONTROL +++++++++++++++++++ -->
                                <!-- +++++++++++++++++++++++++++++++++++ -->
                          </td>
              <td align="right" nowrap class="section_ttl"><%=PARENT_TITLE%></td>
            </tr>
          </table>
                </td>
      </tr>
          <tr>
        <td class="menu_crumbttl"><%Call RenderTitle ( objUserCollector )%></td>
      </tr>
      <tr>
        <td>
                 <!-- DETAILS ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ -->
                        <!-- TAB CONTROLS ++++++++++++++++++++++ -->
                        <!--#include file="_tabs_definition.asp"-->
                        <%
                        Set objTabControl = New TabControl
                        objTabControl.TemplateDoc = ReadFile( Server.MapPath("controls/ERGTabStyleMac/mac_style.html") ) ' Supply tab style definition
                        objTabControl.TabStyle = "StyleMac"
                        objTabControl.AddTabDefnition ( arrUserAccount )
                        objTabControl.SelectByName ( "User Permissions" )
                        objTabControl.Render ()
                        %>
                        <!-- END OF TAB CONTROLS +++++++++++++++ -->
                 <table width="100%"  border="0" cellspacing="0" cellpadding="0">
          <tr>
            <td width="1" background="images/bg_gray_border.gif"><img src="images/spacer.gif" width="1" height="500"></td>
            <td width="100%" valign="top">
                          <table width="100%"  border="0" cellspacing="10" cellpadding="0">
                <tr>
                  <td>
                                  <!-- TAB DETAILS +++++++++++++++++++++++++++++ -->
                                    <%Call Messenger ( "Any permission changes will be appled to this user only!", 3, 400 )%><br>
                                        <table width="100%"  border="0" cellspacing="3" cellpadding="0">
                                        <form name="UserPrivileges" action="_SetRoleVariationPermissions.asp" method="post">
                                  <tr>
                                                <td width="1%" background="images/bg_table_col.gif"><img src="images/spacer.gif" width="16" height="16" hspace="2"></td>
                                    <td width="20%" background="images/bg_table_border.gif"><table width="100%"  border="0" cellspacing="1" cellpadding="2">
                                      <tr>
                                        <td align="right" nowrap background="images/bg_table_col.gif" class="body_col">Role Name</td>
                                      </tr>
                                    </table></td>
                                                <td width="20%" align="right" nowrap background="images/bg_table_col.gif" class="body_col">Control Name</td>
                                                <td width="1%" align="right" nowrap background="images/bg_table_col.gif" class="body_col">Permissions</td>
                                                <td width="60%" align="right" background="images/bg_table_col.gif" class="body_col"></td>
                                  </tr>
                                          <%
                                          OraDatabase.Parameters.Add "USER_ID",  parUser_id, ORAPARM_INPUT, ORATYPE_NUMBER 
                                          OraDatabase.Parameters.Add "APP_ID",   parApp_id,      ORAPARM_INPUT, ORATYPE_NUMBER 
                                          
                                          Set rsQry = OraDatabase.DbCreateDynaset( GetQuery ("UserPermissions.sql") , ORADYN_DEFAULT )
                                          currObj_id = -1
                                          isNewGroup = FALSE
                                          isVisibleComboDisabled = ""
                                          isActiveComboDisabled = ""
                                          
                                          While (NOT rsQry.BOF) AND (NOT rsQry.EOF)
                                          %>
                                          
                                          <%If currObj_id <> CInt(rsQry("obj_id")) Then%>
                                          <%isNewGroup = TRUE%>
                                          <tr>
                                                <td nowrap colspan="5" class="body_row" bgcolor="F5F5F5"><%=LIMG_CONTROL  &  rsQry("obj_name")%></td>
                                  </tr>
                                          <%currObj_id = CInt(rsQry("obj_id"))%>
                                          <%End If%>
                                          
                                          <%Call SetPermissionCombos ( rsQry("role_id") &"_"& rsQry("obj_id"), _
                                                                                                   isNewGroup, rsQry("is_role_variation"), _
                                                                                                   isVisibleComboDisabled, isActiveComboDisabled, _
                                                                                                   rsQry("visible_value"), rsQry("active_value"), _
                                                                                                   VisibleCombo, ActiveCombo )%>
                                  <tr>
                                                <td align="center"><img src="images/spacer.gif" width="16" height="16" hspace="2"></td>
                                                <td nowrap class="body_row"><a href="Role_Privileges.asp?role_id=<%=rsQry("role_id")%><%=objPMod.ComposeURLWithout("role_id")%>" title="See this Role Permissions" class="body_link"><%If IsNull( rsQry("is_role_variation") ) Then%><%=LIMG_ROLE%><%Else%><%=LIMG_SPEC_ROLE%><%End If%><%=rsQry("role_name")%></a></td>
                                                <td nowrap class="body_row"><a href="Control_Privileges.asp?obj_id=<%=rsQry("obj_id")%><%=objPMod.ComposeURLWithout("obj_id")%>" title="See this Control Permissions" class="body_link"><%=LIMG_CONTROL  &  rsQry("obj_name")%></a></td>
                                                <td class="body_txt" nowrap background='images/bg_bage_pane.gif'>&nbsp;&nbsp;<%=VisibleCombo%>&nbsp;&nbsp;<%=ActiveCombo%>&nbsp;&nbsp;</td>
                                                <td class="body_rowg"></td>
                                  </tr>
                                          <%
                                          isNewGroup = FALSE
                                          rsQry.MoveNext
                                          %>
                                          
                                  <tr>
                                    <td colspan="5" background="images/bg_table_border.gif"><img src="images/spacer.gif" width="1" height="1"></td>
                                  </tr>
                                          <%
                                          WEnd
                                          
                                          OraDatabase.Parameters.Remove "USER_ID"
                                          OraDatabase.Parameters.Remove "APP_ID"
                                          %>
                                          <tr>
                                                <td class="body_txt"></td>
                                                <td class="body_txt"></td>
                                                <td class="body_txt"></td>
                                                <td align="center" background='images/bg_bage_pane.gif'><input type="submit" name="btn" value="Apply" class="form_btn"></td>
                                                <td class="body_txt"></td>
                                  </tr>
                                  <tr>
                                    <td colspan="5" background="images/bg_table_border.gif">
                                                 <table width="100%"  border="0" cellspacing="1" cellpadding="2">
                                      <tr>
                                        <td nowrap background="images/bg_table_col.gif"><img src="images/spacer.gif" width="1" height="1"></td>
                                      </tr>
                                     </table>
                                                </td>
                                  </tr>
                                         <%=objPMod.ComposeHiddenTags()%>
                                         <input type="hidden" name="rfile" value="<%=SCRIPT_NAME%>">
                                         </form>
                                 </table>
                                         <SPAN class="body_txtg"><b>NOTE:</b> "User Specific" Role (<%=LIMG_SPEC_ROLE%>), will overwrite the permissions given by other roles.</SPAN>
                                  <!-- +++++++++++++++++++++++++++++++++++++++++ -->
                                  </td>
                </tr>
              </table>
                        </td>
            <td width="1" background="images/bg_gray_border.gif"><img src="images/spacer.gif" width="1" height="1"></td>
          </tr>
         </table>
         <table width="100%"  border="0" cellspacing="0" cellpadding="0">
           <tr>
             <td background="images/bg_gray_border.gif"><img src="images/spacer.gif" width="1" height="1"></td>
           </tr>
         </table>
                 <!-- +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ -->
         <br></td>
      </tr>
    </table></td>
  </tr>
</table>
<!-- FOOTER ++++++++++++++++++++++ -->
<!--#include file="_footer.asp"-->
<!-- +++++++++++++++++++++++++++++ -->
</body>
</html>
<%
'------------ RUN AFTER PAGE RENDER -----------
'----------------------------------------------
%>
<!--#include file="common/globals_destructor.asp"-->