靠,没有注释,没有说明,大家怎么知道grant.equals("1") 是什么意思?mail_flag.equals("3")又是什么意思?问问题的时候,说明白点,要不然怎么帮你?

解决方案 »

  1.   

    <%
    if(!isgrant.equals("")){
    %>
              <tr bgcolor="#FFFFFF"> 
                <td height="25" width="99">学号:</td>
                <td height="25" colspan="3"><%=stu_studentno%></td>
              </tr>
    <tr bgcolor="#FFFFFF"> 
                <td height="25" width="99">网校Email:</td>
                <td height="25" colspan="3"><%=stu_mail%>@beidabiz.com.cn</td>
              </tr>          <tr bgcolor="#F7F7F7"> 
                <td height="25" width="99">请选择操作类型:</td>
                <td height="25" colspan="3">
                  <select name="grant">
                    <option value="" selected>--请选择--</option>
                    <option value="4">恢复授权</option>
                    <option value="2">撤销授权</option>
                    <option value="3">结业</option>
                  </select>
                </td>
              </tr>
    <%
    }//end if
    %>
              <tr bgcolor="#F6F6F6"> 
                <td height="25" colspan="4" align="center"> 
    <input type="hidden" name="Method" value="2">
    <input type="hidden" name="layer" value="<%=layer%>">
    <input type="hidden" name="userid" value="<%=userid%>">
    <input type="hidden" name="studentid" value="<%=stu_studentid%>">
                  <input type="submit" name="Submit" value="确定">
                </td>
              </tr>
            </table>
          </td>
        </tr>
      </form>
    </table><%
    }//end method=1
    if(Method.equals("2"))
    {
    if(adminid==null)
    adminid = request.getParameter("adminid");
    String stu_userid = request.getParameter("userid");

    String mail_userid = request.getParameter("mail_userid");
    if(mail_userid==null) mail_userid = stu_userid;
    mail_userid = mail_userid.toLowerCase();
    String classid=request.getParameter("classid");
    String type=request.getParameter("type");
    String groupid=request.getParameter("groupid");
    if(classid.equals("") || type.equals("")  || groupid==null )
    throw new Exception("届别,班级,学员类型必须选择!");
    out.println("<BR>type=="+type);

    type=type.trim();
    groupid=groupid.trim();
    String stu_studentid = request.getParameter("studentid")==null?"":request.getParameter("studentid").trim(); String grant=request.getParameter("grant");
    String layer=request.getParameter("layer").trim();
    if(grant==null)grant="1";
    else if(grant.equals(""))
    throw new Exception("请选择操作类型!");
    grant=grant.trim(); if (common.webmail.mailfunc.MailIsExist(mail_userid,Conn)&&(grant.equals("1"))&&(!mail_flag.equals("3"))) 
    {
    xjshare.BKMessage(out,"此邮件已经被人申请,请重新选择","返回","grant_single.jsp?userid="+stu_userid+"&flag=2");
    return;
    //throw new Exception ("此邮件已经被人申请,请重新选择");
    }

    String Passwd = ""; Sql = "select trim(PASSWD) from pub_user where trim(userid)='"+stu_userid.trim()+"'";
    Stmt = Conn.createStatement();
    Resu = Stmt.executeQuery(Sql);
    if(Resu.next())
    {
    Passwd = Resu.getString(1);
    }

    String redirectURL = ""; String mail_url = "userid="+stu_userid+"&classid="+classid+"&type="+type+"&groupid="+groupid+"&studentid="+stu_studentid+"&grant="+grant+"&layer="+layer+"&adminid="+adminid;
    if(grant.equals("1")&&(!mail_flag.equals("3")))
    {
    redirectURL = MAIL_URL+"mangeradduser.php?";
    redirectURL += "pswd="+Passwd+"&mailuserid="+mail_userid+"&"+mail_url;
    //response.sendRedirect(redirectURL);
    //response.flushBuffer();
    }else
    {
    Conn.setAutoCommit(false);
    out.println("grant="+grant+"<BR>userid="+userid+"<BR>stu_studentid="+stu_studentid+"<BR>type="+type+"<BR>layer="+layer+"<BR>classid"+classid+"<BR>groupid"+groupid+"<BR>type=="+type);
    common.admin.mini_mba.grant_manage.User_grant(Conn,grant,userid,stu_studentid,type,Integer.parseInt(layer),Integer.parseInt(classid),groupid);

    if(grant.equals("1"))
    {
    Sql = "update student set MAILACOUNT='"+mail_userid.trim()+"' where trim(userid)='"+userid+"'";
    //Stmt = Conn.createStatement();
    int updcount = Stmt.executeUpdate(Sql);
    //发送邮件

    String useridmail = common.admin.sendmail.getUserMail(userid,Conn);
    String mail_studentno = stid.userid_studentno(userid,Conn); String mail_txt_url = "";
    if(layer.equals("5"))
    mail_txt_url = common.config.SysConfig.DatePath+"/mail/mini_grant_mail.txt";
    if(layer.equals("6"))
    mail_txt_url = common.config.SysConfig.DatePath+"/mail/jr_grant_mail.txt"; common.admin.sendmail.getGrantMailContent(useridmail,userid,mail_studentno,mail_userid,mail_txt_url,"","xxxx","","");

    }

    Conn.commit();
    redirectURL = "grant_single.jsp?userid="+userid;
    }
    //2004-7-29 w.j 判断操作类型 1为授权 0为撤销 在php的服务器上
    String status_php = new String();
    if (grant.equals("1"))
    status_php = "1";
    else if(grant.equals("2"))
    status_php ="0";
    else if(grant.equals("3"))
    status_php="0";
    else if(grant.equals("4"))
    status_php="1"; String php_url = "http://club.beidabiz.com/admin/usergroup.php?uname="+stu_userid+"&mgroup="+layer+"&status="+status_php+"&jspurl=http://www2.beidabiz.com:7001/program/admin/XJManage/grant/common/success.jsp";//if(!grant.equals("5"))
    //response.sendRedirect(php_url);
    //out.println(php_url);
    //2004-7-30
    response.sendRedirect(redirectURL);
    response.flushBuffer(); }
    }//end try
    catch(Exception e){
    try{
    if(Conn!=null){
    Conn.rollback();
    }
    }catch(SQLException esql){
    }
    xjshare.BKMessage(out,e.getMessage(),"返回","");
    }
    finally{
    try{
    if(Resu!=null) Resu.close();
                if(Stmt!=null) Stmt.close();
    if(Conn!=null) Conn.close();
    }
    catch(Exception e){
    }
    }%>
    </body>
    </html>
      

  2.   

    你的要求是什么?注册会员后,不发送email吗?
      

  3.   

    就是不给他一个拥有email得权限.默认是给他注册一个同名email