No way to reset/change agent's passwords.

Last post 03-20-2008, 11:27 AM by Adam. 1 replies.
Sort Posts: Previous Next
  •  03-19-2008, 4:36 PM 38163

    No way to reset/change agent's passwords.

    Is deleting the operator the only way to change a password once it has been assigned?
     
    The problem with this is that the server seems to be caching the table SampleUser.
     
    I think that's what's happening anyway.
     
    I can't re-create a profile with the same user name once I've deleted it. There is no error message, it simply refuses to do anything with the username. Profiler sees the application polling this table, but the user isn't in it any longer.
     
    Any ideas?
     
     
     
     
  •  03-20-2008, 11:27 AM 38198 in reply to 38163

    Re: No way to reset/change agent's passwords.

    Mike,
     
    It's a bug. Thanks for pointing it out.
     
    You can fix it by following the steps below:
     
    Open Global.asax file and find the following code:
     

    public static void DeleteUser(string loginName)
     {
      using(IDbConnection conn=Instance.CreateConnection())
      {
       conn.Open();

       using(IDbCommand cmd=conn.CreateCommand())
       {
        cmd.CommandText="DELETE FROM SampleUsers WHERE "+LowerLoginName+"="+SqlEncode(loginName.ToLower());

        cmd.ExecuteNonQuery();
       }
      }
     }
     
    Change to:
     

    public static void DeleteUser(string loginName)
     {
      using(IDbConnection conn=Instance.CreateConnection())
      {
       conn.Open();

       using(IDbCommand cmd=conn.CreateCommand())
       {
        cmd.CommandText="DELETE FROM SampleUsers WHERE "+LowerLoginName+"="+SqlEncode(loginName.ToLower());

        cmd.ExecuteNonQuery();
       }
      }
      loginName=loginName.ToLower();
      System.Web.HttpRuntime.Cache.Remove("UserInfo:"+loginName);

     }


    asp.net Chat http://cutesoft.net/ASP.NET+Chat/default.aspx
    Web Messenger: http://cutesoft.net/Web-Messenger/default.aspx
    asp.net wysiwyg editor: http://cutesoft.net/ASP.NET+WYSIWYG+Editor/default.aspx
    asp wysiwyg html editor: http://cutesoft.net/ASP
    asp.net Image Gallery: http://cutesoft.net/ASP.NET+Image+Gallery/default.aspx
    Live Support: http://cutesoft.net/live-support/default.aspx

View as RSS news feed in XML