Announcement

Collapse
No announcement yet.

User change your password

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • User change your password

    Hello, I have a question. Is there any access for the user to change his password, without help from the system administrator?

    Given the internal laws in the country, I need something similar.
    Any way to get it done?

  • #2
    We don't provide such a page but you can write it by yourself. The core code would be like,

    Code:
    <%@include file="include/lib.jsp"%>
    <%
    UserDao dao = new UserDao();
    UserData data = dao.selectOneByName("selmo");
    
    // Set new password.
    data.passwd = "passw0rd4selmo";
    
    // Update it.
    dao.update(data);
    %>
    You have to add 'noacl,' prefix to your JSP page for your users to bypass GUI access restriction like 'noacl,chgpasswd.jsp'.
    Last edited by support200; 12-15-2022, 02:00 AM.

    Comment


    • #3
      This file has to be included in which directory? I'll try to customize this code with the fields on the screen. Thank you for your help.

      Comment


      • #4
        JSP files are in /nxfilter/guipack/sandwatch if you use SandWatch GUI. If it's for older versions, /nxfilter/webapps directory.

        Comment


        • #5
          Changed the code to be simpler. When you use the param value form GET request, use 'paramString()' function.

          Code:
          <%@include file="include/lib.jsp"%>
          <%
          UserDao dao = new UserDao();
          UserData data = dao.selectOneByName("selmo");
          
          // Set new password.
          data.passwd = paramString("newPw");
          
          // Update it.
          dao.update(data);
          %>

          Comment


          • #6
            With v4.6.4.5, there's a password change for the users created on NxFilter GUI. You can link it as http://your-server-ip/block,password.jsp or http://your-server-ip/password.

            Comment

            Working...
            X