Change the user's name and then delete it.

Started by User2, January 02, 2022, 02:10:05 PM

Previous topic - Next topic

Doug Heffernan

Quote from: Arantor on January 08, 2022, 08:16:33 AMThe rationale is long, complicated and orthagonal

What does orthagonal mean? Or did you mean to say orthogonal instead?

Arantor

The argument 'this is not a bug, this is by design' is implicitly asserting the design is correct and challenging the design is the wrong thing to do.

@Doug Heffernan, well, the word is pronounced in my accent with an a, and I forgot that it's not *spelled* with an a. In any case, the meaning should be clear: the reason why it is so is at a very distinctly different angle to the OP's use case.

Doug Heffernan

Quote from: Arantor on January 08, 2022, 08:29:00 AM@Doug Heffernan, well, the word is pronounced in my accent with an a, and I forgot that it's not *spelled* with an a. In any case, the meaning should be clear: the reason why it is so is at a very distinctly different angle to the OP's use case.

Well, the meaning was clear to me as that word is the same in my mother tongue as well. But since english is not my mother tongue, I thought that maybe it meant something else in english and figured I should ask.


User2

Can I change the original login name (which the user specifies during registration) using SQL?
I change login name not only once a year, but also once a week.
Otherwise, I change the login name once a week, and next year, when I delete the user, the login name that the user used during registration will return.

Aleksi "Lex" Kilpinen

Quote from: Participant on January 10, 2022, 11:28:45 PMCan I change the original login name (which the user specifies during registration) using SQL?
Otherwise, I change the login name once a week, and next year, when I delete the user, the login name that the user used during registration will return.
What? Seriously I'm not following and would very much like to understand what you are trying to achieve.
Slava
Ukraini!
"Before you allow people access to your forum, especially in an administrative position, you must be aware that that person can seriously damage your forum. Therefore, you should only allow people that you trust, implicitly, to have such access." -Douglas

How you can help SMF

Arantor

If you change the login name, the user won't be able to login until they reset their password.

User2

Arantor Quote:
If you change the login name, the user won't be able to login until they reset their password.

Yes, I know that. What is the problem? The user will receive an email with a new password. What problem do you see in this? Why are you telling me about this?


Aleksi "Lex" Kilpinen, I am changing user names so that there is no personal information on my forum. The user can use as a user name, for example, a surname or other personal information. I want my forum to not have any personal information about users in explicit or disguised form.

Aleksi "Lex" Kilpinen

Alright, I understand the goal. Thank you for explaining. That's going to be tricky though, in many ways. Depending on the jurisdiction, PII is generally any data that could potentially identify a specific individual. This includes the email address, IP address, hostname, usernames, displaynames, message contents...
Slava
Ukraini!
"Before you allow people access to your forum, especially in an administrative position, you must be aware that that person can seriously damage your forum. Therefore, you should only allow people that you trust, implicitly, to have such access." -Douglas

How you can help SMF

User2

Aleksi "Lex" Kilpinen, In addition, users can give a name in the form of advertising, in the form of bad words (vampire).
I will fix it all, and then a year later, after I delete users, all these original names will appear on my forum.

User2

Arantor, in this post, you provided the code: https://www.simplemachines.org/community/index.php?msg=4107089. In which cases will this code start working? When will I do what, where to click?

Arantor

Quote from: Participant on January 11, 2022, 03:55:06 AMArantor Quote:
If you change the login name, the user won't be able to login until they reset their password.

Yes, I know that. What is the problem? The user will receive an email with a new password. What problem do you see in this? Why are you telling me about this?


If you do it with SQL they won't get a notification. It'll just not work unless you manually tell them.

To answer your last point, it does exactly what you asked for: when you delete a user, it will fix the display name in every post to be what you last changed it to.

I was trying to help you not confuse your users, but like everything else in this thread it feels like a waste of time and energy trying to help you. Have fun.

@rjen

Quote from: Participant on January 11, 2022, 04:10:37 AMArantor, in this post, you provided the code: https://www.simplemachines.org/community/index.php?msg=4107089. In which cases will this code start working? When will I do what, where to click?

If you make those changes you are effectively changing the standard functionality when deleting a user: it will adopt te display name exactly like you want...
Running SMF 2.1 with latest TinyPortal at www.fjr-club.nl

efk

Quote from: Participant on January 11, 2022, 04:08:16 AMAleksi "Lex" Kilpinen, In addition, users can give a name in the form of advertising, in the form of bad words (vampire).
I will fix it all, and then a year later, after I delete users, all these original names will appear on my forum.
This is exactly the reason why you are the only, or like in Matrix movie, you are the ONE who is trying to make from SMF what SMF obviously is not. As everyone already told you before "do not delete your users", so far all your points about deletion are wrong and bad, and idea is bad. The best thing you can do is to go to the member profile:
1. and replace email of target user with anything else (email exist to manipulate with account, without it and without password, user will not be able to restore his account anymore.)
2. change his password
3. set displayed name
4. ban user and set his post count to 0
5. do not delete user, you can optionally do deletion of his posts

Every time you go with deletion you will go deeper in problems, and I believe you won't help yourself later, nor will anyone fix your mess.

User2

efk, SMF has a built-in function for deleting users and this function does not work correctly.
I'm not inventing anything, but only trying to use the built-in SMF function, which works unpredictably for the administrator.

A request to the participants: do not write your wishes, otherwise you make the topic unreadable, because a lot of messages appear in it and then it will be difficult to solve this problem.

Aleksi "Lex" Kilpinen

Quote from: Participant on January 11, 2022, 11:11:31 PMefk, SMF has a built-in function for deleting users and this function does not work correctly.
Yes it does. It works as it is meant to work, even though you do not agree with that.
Quote from: Participant on January 11, 2022, 11:11:31 PMI'm not inventing anything, but only trying to use the built-in SMF function, which works unpredictably for the administrator.
No, it doesn't. Unpredictable means you don't know and can't guess what will happen. You already know exactly what happens, and it works the same way every time, so it is quite predictable.
Quote from: Participant on January 11, 2022, 11:11:31 PMA request to the participants: do not write your wishes, otherwise you make the topic unreadable, because a lot of messages appear in it and then it will be difficult to solve this problem.
Did you try the solution arantor offered?
Slava
Ukraini!
"Before you allow people access to your forum, especially in an administrative position, you must be aware that that person can seriously damage your forum. Therefore, you should only allow people that you trust, implicitly, to have such access." -Douglas

How you can help SMF

User2

Aleksi "Lex" Kilpinen, I already know about this problem, but the other administrator does not know about it yet.

User2

Arantor, after installing the next patch (2.0.20), the file Subs-Members.php can it change? I will need to make changes to the file again Subs-Members.php ?

Aleksi "Lex" Kilpinen

It may change in some patch in the future, but I would say it is fairly unlikely to change in a way that would interfere with this edit.
Slava
Ukraini!
"Before you allow people access to your forum, especially in an administrative position, you must be aware that that person can seriously damage your forum. Therefore, you should only allow people that you trust, implicitly, to have such access." -Douglas

How you can help SMF

User2

To which places of the file Subs-Members.php insert these codes:
// Make these people' posts guest posts
// Reset the names on these posts

Kindred

Quote from: Arantor on January 08, 2022, 08:16:33 AMEdit Sources/Subs-Members.php

Code (find) Select
// Make these peoples' posts guest posts.
$smcFunc['db_query']('', '
UPDATE {db_prefix}messages
SET id_member = {int:guest_id}, poster_email = {string:blank_email}
WHERE id_member IN ({array_int:users})',
array(
'guest_id' => 0,
'blank_email' => '',
'users' => $users,
)
);

Code (BEFORE that, add this) Select
// Reset the names on these posts.
foreach ($user_log_details as $user)
{
$smcFunc['db_query']('', '
UPDATE {db_prefix}messages
SET poster_name = {string:poster_name}
WHERE id_member = {int:id_member}',
array(
'id_member' => $user[0],
'poster_name' => $user[1],
)
);
}


Arantor told you what to find and what to add and where to add it in the original post...
Слaва
Украинi

Please do not PM, IM or Email me with support questions.  You will get better and faster responses in the support boards.  Thank you.

"Loki is not evil, although he is certainly not a force for good. Loki is... complicated."

Advertisement: