Clone functionality in user manager

[expired user #5615]'s profile image [expired user #5615] posted 13 years ago in General Permalink
When I clone a user in user manger (r3914, 5.0.15), I would expect to get a user with all the privileges copied from the currently selected user. What I get is a new user with no privileges, so there seems to be no difference to creating a new user.
Is my expectation wrong?
ansgar's profile image ansgar posted 13 years ago Permalink
Your expectation is right. And I think that was the case at some point, and I broke that in some recent change, accidentally. Will check.
Code modification/commit from ansgar.becker, 13 years ago, revision 6.0.0.3917
Fix non-overtaken grants when user clicks "clone user". See http://www.heidisql.com/forum.php?t=8943
ansgar's profile image ansgar posted 13 years ago Permalink
Fixed in r3917
alfiqmiq's profile image alfiqmiq posted 10 years ago Permalink
In this case... can You also clone password string? MAny times I need to add acces for one user from different locations.
ansgar's profile image ansgar posted 10 years ago Permalink
The "IDENTIFIED BY 'yourpassword'" expects a clear text, non encrypted password. As the hashes are not reversible, it cannot be cloned. Sorry.
alfiqmiq's profile image alfiqmiq posted 10 years ago Permalink
but when You clone user You can copy an encrypted password after user insert (db: mysql, table: user, column: Password) and then run flush privileges. As I think You can do that becouse I do that manually and works fine.

From that point is my suggestion to improve functionality of this function.
ansgar's profile image ansgar posted 10 years ago Permalink
Oh, you're right, you can pass both a plaintext password or a hash:

To avoid specifying the plaintext password if you know its hash value (the value that PASSWORD() would return for the password), specify the hash value preceded by the keyword PASSWORD:

CREATE USER 'jeffrey'@'localhost'
IDENTIFIED BY PASSWORD '*90E462C37378CED12064BB3388827D2BA3A9B689';

alfiqmiq's profile image alfiqmiq posted 10 years ago Permalink
Sol can You add this functionality to clone user in user manager ?
alfiqmiq's profile image alfiqmiq posted 10 years ago Permalink
I think that You can add sth like checkbox "hash/plain text" and depends on it create new account. This would be more universal solution.
ansgar's profile image ansgar posted 10 years ago Permalink
We don't even need a checkbox. Hashes begin with a '*' character and always have the same length of 41 characters. When cloning a user, I can just copy the hash to the new user's password, and disable the password char in the password edit boxes.
Code modification/commit from ansgar.becker, 10 years ago, revision 8.3.0.4747
Overtake username and hashed password from old user when cloning a user. See http://www.heidisql.com/forum.php?t=8943
ansgar's profile image ansgar posted 10 years ago Permalink
r4747 overtakes the old username and hashed password when cloning a user.

Please login to leave a reply, or register at first.