⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 editendentity.jsp

📁 一套JAVA的CA证书签发系统.
💻 JSP
📖 第 1 页 / 共 4 页
字号:
               int hardtokenissuer = SecConst.NO_HARDTOKENISSUER;               if(tokentype > SecConst.TOKEN_SOFT){                 value = request.getParameter(SELECT_HARDTOKENISSUER);                 hardtokenissuer = Integer.parseInt(value);                 }               newuser.setHardTokenIssuerId(hardtokenissuer);                   if(request.getParameter(SELECT_CHANGE_STATUS)!=null){                int newstatus = Integer.parseInt(request.getParameter(SELECT_CHANGE_STATUS));                if(newstatus == UserDataRemote.STATUS_NEW || newstatus == UserDataRemote.STATUS_GENERATED || newstatus == UserDataRemote.STATUS_HISTORICAL )                  newuser.setStatus(newstatus);               }               // Send changes to database.               rabean.changeUserData(newuser);               endentitysaved = true;               userdata = newuser;               }          }        }      }    } catch(AuthorizationDeniedException e){    }    nouserparameter = false;  }      String[] tokentexts = RAInterfaceBean.tokentexts;   int[] tokenids = RAInterfaceBean.tokenids;   String[] availabletokens = null;   String[] availablehardtokenissuers = null;   ArrayList[] tokenissuers = null;   if( userdata != null && profile != null){     if(globalconfiguration.getIssueHardwareTokens() ){        TreeMap hardtokenprofiles = ejbcawebbean.getInformationMemory().getHardTokenProfiles();        tokentexts = new String[RAInterfaceBean.tokentexts.length + hardtokenprofiles.keySet().size()];        tokenids   = new int[tokentexts.length];        for(int i=0; i < RAInterfaceBean.tokentexts.length; i++){          tokentexts[i]= RAInterfaceBean.tokentexts[i];          tokenids[i] = RAInterfaceBean.tokenids[i];        }        Iterator iter = hardtokenprofiles.keySet().iterator();        int index=0;        while(iter.hasNext()){                 String name = (String) iter.next();          tokentexts[index+RAInterfaceBean.tokentexts.length]= name;          tokenids[index+RAInterfaceBean.tokentexts.length] = ((Integer) hardtokenprofiles.get(name)).intValue();          index++;        }     }      availabletokens = profile.getValue(EndEntityProfile.AVAILKEYSTORE, 0).split(EndEntityProfile.SPLITCHAR);      availablehardtokenissuers = profile.getValue(EndEntityProfile.AVAILTOKENISSUER, 0).split(EndEntityProfile.SPLITCHAR);      usekeyrecovery = globalconfiguration.getEnableKeyRecovery() && profile.getUse(EndEntityProfile.KEYRECOVERABLE,0);      usehardtokenissuers = globalconfiguration.getIssueHardwareTokens() && profile.getUse(EndEntityProfile.AVAILTOKENISSUER,0);      if(usehardtokenissuers){                tokenissuers = new ArrayList[availabletokens.length];         for(int i=0;i < availabletokens.length;i++){           if(Integer.parseInt(availabletokens[i]) > SecConst.TOKEN_SOFT){              tokenissuers[i] = new ArrayList();              for(int j=0; j < availablehardtokenissuers.length; j++){                HardTokenIssuerData issuerdata = tokenbean.getHardTokenIssuerData(Integer.parseInt(availablehardtokenissuers[j]));                if(issuerdata !=null){                  Iterator iter = issuerdata.getHardTokenIssuer().getAvailableHardTokenProfiles().iterator();                  while(iter.hasNext()){                    if(Integer.parseInt(availabletokens[i]) == ((Integer) iter.next()).intValue())                      tokenissuers[i].add(new Integer(availablehardtokenissuers[j]));                  }                }              }            }            }       }    }    HashMap availablecas = null;    Collection authcas = null;    if(issuperadministrator)      if(profileid == SecConst.EMPTY_ENDENTITYPROFILE)        authcas = ejbcawebbean.getAuthorizedCAIds();      else        authcas = profile.getAvailableCAs();    else      availablecas = ejbcawebbean.getInformationMemory().getEndEntityAvailableCAs(profileid);    int row = 0;    int tabindex = 1;%><head>  <title><%= globalconfiguration.getEjbcaTitle() %></title>  <base href="<%= ejbcawebbean.getBaseUrl() %>">  <link rel=STYLESHEET href="<%= ejbcawebbean.getCssFile() %>">  <script language=javascript>   <!--<% if(profile != null && userdata != null){ %>      var TRUE  = "<%= EndEntityProfile.TRUE %>";      var FALSE = "<%= EndEntityProfile.FALSE %>";   <% if(usehardtokenissuers){ %>       var TOKENID         = 0;       var NUMBEROFISSUERS = 1;       var ISSUERIDS       = 2;       var ISSUERNAMES     = 3;       var tokenissuers = new Array(<%=availabletokens.length%>);       <% for(int i=0; i < availabletokens.length; i++){            int numberofissuers = 0;            if (Integer.parseInt(availabletokens[i]) > SecConst.TOKEN_SOFT) numberofissuers=tokenissuers[i].size();                      %>         tokenissuers[<%=i%>] = new Array(4);         tokenissuers[<%=i%>][TOKENID] = <%= availabletokens[i] %>;         tokenissuers[<%=i%>][NUMBEROFISSUERS] = <%= numberofissuers %>;         tokenissuers[<%=i%>][ISSUERIDS] = new Array(<%= numberofissuers %>);         tokenissuers[<%=i%>][ISSUERNAMES] = new Array(<%= numberofissuers %>);             <%  for(int j=0; j < numberofissuers; j++){ %>         tokenissuers[<%=i%>][ISSUERIDS][<%=j%>]= <%= ((Integer) tokenissuers[i].get(j)).intValue() %>;         tokenissuers[<%=i%>][ISSUERNAMES][<%=j%>]= "<%= tokenbean.getHardTokenIssuerAlias(((Integer) tokenissuers[i].get(j)).intValue())%>";         <%  }           } %>       function setAvailableHardTokenIssuers(){    var seltoken = document.edituser.<%=SELECT_TOKEN%>.options.selectedIndex;    issuers   =  document.edituser.<%=SELECT_HARDTOKENISSUER%>;    numofissuers = issuers.length;    for( i=numofissuers-1; i >= 0; i-- ){       issuers.options[i]=null;    }        issuers.disabled=true;    if( seltoken > -1){      var token = document.edituser.<%=SELECT_TOKEN%>.options[seltoken].value;      if(token > <%= SecConst.TOKEN_SOFT%>){        issuers.disabled=false;        var tokenindex = 0;          for( i=0; i < tokenissuers.length; i++){          if(tokenissuers[i][TOKENID] == token)            tokenindex = i;        }        for( i=0; i < tokenissuers[tokenindex][NUMBEROFISSUERS] ; i++){          issuers.options[i]=new Option(tokenissuers[tokenindex][ISSUERNAMES][i],tokenissuers[tokenindex][ISSUERIDS][i]);          if(tokenissuers[tokenindex][ISSUERIDS][i] == <%=userdata.getHardTokenIssuerId()%>)            issuers.options.selectedIndex=i;        }            }    }}   <% }            if(usekeyrecovery){ %>function isKeyRecoveryPossible(){   var seltoken = document.edituser.<%=SELECT_TOKEN%>.options.selectedIndex;    var token = document.edituser.<%=SELECT_TOKEN%>.options[seltoken].value;   if(token == <%=SecConst.TOKEN_SOFT_BROWSERGEN %>){     document.edituser.<%=CHECKBOX_KEYRECOVERABLE%>.checked=false;     document.edituser.<%=CHECKBOX_KEYRECOVERABLE%>.disabled=true;   }else{     <% if(profile.isRequired(EndEntityProfile.KEYRECOVERABLE,0)){ %>       document.edituser.<%=CHECKBOX_KEYRECOVERABLE%>.disabled=true;      <% }else{ %>     document.edituser.<%=CHECKBOX_KEYRECOVERABLE%>.disabled=false;     <%} %>     document.edituser.<%=CHECKBOX_KEYRECOVERABLE%>.checked=<%= userdata.getKeyRecoverable() %>        }}   <% } %>  <% if(issuperadministrator){ %>  var availablecas = new Array(<%= authcas.size()%>);   var CANAME       = 0;  var CAID         = 1;<%      Iterator iter = authcas.iterator();      int i = 0;      while(iter.hasNext()){        Object next = iter.next();        Integer nextca = null;           if(next instanceof String)           nextca =  new Integer((String) next);        else           nextca = (Integer) next;    %>        availablecas[<%=i%>] = new Array(2);    availablecas[<%=i%>][CANAME] = "<%= caidtonamemap.get(nextca) %>";          availablecas[<%=i%>][CAID] = <%= nextca.intValue() %>;       <%   i++;       } %>function fillCAField(){   var caselect   =  document.edituser.<%=SELECT_CA%>;    var numofcas = caselect.length;   for( i=numofcas-1; i >= 0; i-- ){       caselect.options[i]=null;    }      for( i=0; i < availablecas.length; i ++){     caselect.options[i]=new Option(availablecas[i][CANAME],                                     availablecas[i][CAID]);         if(availablecas[i][CAID] == "<%= userdata.getCAId() %>")       caselect.options.selectedIndex=i;   }} <% } else { %>  var certprofileids = new Array(<%= availablecas.keySet().size()%>);  var CERTPROFID   = 0;  var AVAILABLECAS = 1;  var CANAME       = 0;  var CAID         = 1;<%  Iterator iter = availablecas.keySet().iterator();  int i = 0;  while(iter.hasNext()){     Integer next = (Integer) iter.next();    Collection nextcaset = (Collection) availablecas.get(next);  %>    certprofileids[<%=i%>] = new Array(2);    certprofileids[<%=i%>][CERTPROFID] = <%= next.intValue() %> ;    certprofileids[<%=i%>][AVAILABLECAS] = new Array(<%= nextcaset.size() %>);<% Iterator iter2 = nextcaset.iterator();   int j = 0;   while(iter2.hasNext()){     Integer nextca = (Integer) iter2.next(); %>    certprofileids[<%=i%>][AVAILABLECAS][<%=j%>] = new Array(2);    certprofileids[<%=i%>][AVAILABLECAS][<%=j%>][CANAME] = "<%= caidtonamemap.get(nextca) %>";          certprofileids[<%=i%>][AVAILABLECAS][<%=j%>][CAID] = <%= nextca.intValue() %>;  <% j++ ;   }   i++; } %>     function fillCAField(){   var selcertprof = document.edituser.<%=SELECT_CERTIFICATEPROFILE%>.options.selectedIndex;    var certprofid = document.edituser.<%=SELECT_CERTIFICATEPROFILE%>.options[selcertprof].value;    var caselect   =  document.edituser.<%=SELECT_CA%>;    var numofcas = caselect.length;   for( i=numofcas-1; i >= 0; i-- ){       caselect.options[i]=null;    }       if( selcertprof > -1){      for( i=0; i < certprofileids.length; i ++){        if(certprofileids[i][CERTPROFID] == certprofid){          for( j=0; j < certprofileids[i][AVAILABLECAS].length; j++ ){            caselect.options[j]=new Option(certprofileids[i][AVAILABLECAS][j][CANAME],                                           certprofileids[i][AVAILABLECAS][j][CAID]);                if(certprofileids[i][AVAILABLECAS][j][CAID] == "<%= userdata.getCAId() %>")              caselect.options.selectedIndex=j;          }        }      }    }}  <% } %> function checkallfields(){    var illegalfields = 0; <%    for(int i=0; i < profile.getSubjectDNFieldOrderLength(); i++){         fielddata = profile.getSubjectDNFieldsInOrder(i);         if(fielddata[EndEntityProfile.FIELDTYPE] != EndEntityProfile.OLDDNE){           if(profile.isModifyable(fielddata[EndEntityProfile.FIELDTYPE],fielddata[EndEntityProfile.NUMBER])){ %>    if(!checkfieldforlegaldnchars("document.edituser.<%=TEXTFIELD_SUBJECTDN+i%>","<%= ejbcawebbean.getText("ONLYCHARACTERS") + " " + ejbcawebbean.getText(subjectfieldtexts[fielddata[EndEntityProfile.FIELDTYPE]]) %>"))      illegalfields++;    <%     if(profile.isRequired(fielddata[EndEntityProfile.FIELDTYPE],fielddata[EndEntityProfile.NUMBER])){%>    if((document.edituser.<%= TEXTFIELD_SUBJECTDN+i %>.value == "")){      alert("<%= ejbcawebbean.getText("YOUAREREQUIRED") + " " + ejbcawebbean.getText(subjectfieldtexts[fielddata[EndEntityProfile.FIELDTYPE]])%>");      illegalfields++;    }     <%     }          }

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -