Welcome to the Question2Answer Q&A. There's also a demo if you just want to try it out.
0 votes
1.8k views
in Q2A Core by
I have one q2a site and I want to reset a users password which I think is a fake user. How can I reset his password while logging in from admin panel, Any help?
Q2A version: 1.7
by
just delete the account

1 Answer

+1 vote
by
selected by
 
Best answer

If you think they are a fake user have you considered sending a PM or posting on their wall? Why exactly do you want to reset their password?

At any rate, this is not possible from the admin panel. You can do it manually in one of two ways:

  1. If you don't need to know the password you reset it to, in the database simply edit the "passcheck" field in the qa_users table for that user.
  2. If you do need to know the password for whatever reason, the passcheck field is calculated in the qa_db_calc_passcheck function in qa-include/db/users.php. It looks like this:
    sha1(substr($salt, 0, 8).$password.substr($salt, 8));
    In other words, take the first 8 characters of the salt, then the password, then the last 8 characters of the salt, and call sha1() on that. Then you would enter that in the passcheck field.

 

by
Thanx Scott, for your quick reply! But I am not a programmer so what do you mean by call sha1() on that?
by
sha1() is a PHP function. You could make a PHP file like this below and run it:

<?php
echo sha1(substr('abcd1234', 0, 8).'thepassword'.substr('5678cdef', 8));

...where 'abcd1234' is the first 8 characters of the passsalt column, and '5678cdef' is the last 8 characters of the passsalt column.
by
thanx Scott!
...