News:

Wondering if this will always be free?  See why free is better.

Main Menu

Change the user's name and then delete it.

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

Previous topic - Next topic

User2

I forbade users to change the display name on my forum. So for my forum, special characters don't matter.

Arantor

Well, you could have mentioned that beforehand...
Holder of controversial views, all of which my own.



efk

After over a decade on SMF forums, for this specific situation I could not think of a single reason why would anyone delete multiple users like that. Before everything else, to do this thing manually for each user administrator need to invest time on each individual user. There are some valid situations where deletion could be done, but...

Please could you tell me the reason why do you delete users like that? Except deletion after 1 year of inactivity, what benefits you and your forum have from your actions?

Steve

I get the feeling the OP has his reasons and declines sharing them, as is his right. Just a feeling though.

Quote from: Participant on January 03, 2022, 01:34:37 AMQuote:
The biggest question is WHY do you delete users' accounts?

Because that's what I want.
My pet rock is not feeling well. I think it's stoned.

User2

It doesn't matter what I'm doing it for. There is a bug in SMF, and this bug probably needs to be fixed. After all, there is a user deletion in the SMF functionality: I delete users through the forum, and not using add-ons or SQL.

Aleksi "Lex" Kilpinen

Quote from: Participant on January 04, 2022, 01:18:48 AMIt doesn't matter what I'm doing it for. There is a bug in SMF, and this bug probably needs to be fixed.
I don't see the bug.
As Admin you can change any users username and display name as you want.
You can delete any user account you want.
Leaving posts in place, leaves the usernames of deleted members in place.
Which part is the bug?
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

The display name changes after the user is deleted.
For example, the user displayed "Kristina" in the topic, and "Vomit" will be displayed. If a user has registered with the nickname "Vomit", then after deleting this user, this nickname will appear in the topic.

This is written in the first message.

Aleksi "Lex" Kilpinen

Still, it's not necessarily a bug.
It just doesn't retain the display name as you expect,
instead it retains the username, which is usually a constant that doesn't change.

If it used display name, one of two things would have to happen.
1) Every post would need to save the current display name, meaning you would end up with messages using multiple display names should the user ever change their display name.
2) In the even of account deletion, every post they have ever made would need to be updated in the database to keep the current display name.
Neither of these is necessarily something you want.
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

I change both login name and display name on my forum.

Aleksi "Lex" Kilpinen

Yes, I understand that - But the point I was trying to make is that the posts in the database include user info, just so that the post can still be displayed after the associated user account is deleted, and in order to make this both efficient and logical, the retained user info includes the username which usually does not change after registration.

Deleting the user, does practically nothing to the posts anymore. If you want to change the username displayed, you either need to reattribute the posts to another account, or do the change yourself through the database as explained earlier. 
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

Steve

In other words, the software is working as designed and intended.
My pet rock is not feeling well. I think it's stoned.

Kindred

Quote from: Participant on January 04, 2022, 01:18:48 AMIt doesn't matter what I'm doing it for. There is a bug in SMF, and this bug probably needs to be fixed. After all, there is a user deletion in the SMF functionality: I delete users through the forum, and not using add-ons or SQL.

Actually, it *DOES* matter, quite often, since users with the sort of attitude that you are showing assume that they know the "only" way to get to the end goal -- and they are almost always wrong.

but anyway -- as has already been said: this is not a bug.  The software is performing EXACTLY as designed and as intended...   It might not fit YOUR desires, but we are designing the software for the majority use, not the individual exception.

(and, on a personal note, I would be really annoyed if the forums that I joined deleted my account after only a year. There are many forums that I participate in where I only check once a year or less, depending on what the forum subject matter is.)
Сл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."

Arantor

@Kindred obviously you're doing it wrong and you shouldn't question it. Questioning it is rude, remember?
Holder of controversial views, all of which my own.


Kindred

Сл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."

Steve

As the OP has been here since the last post I'm going to assume (yea, I know) that the issue has been answered. Marking solved.
My pet rock is not feeling well. I think it's stoned.

User2

No, the topic is not solved. The forum does not work correctly - after deleting the user, the original login name is returned, about which the forum administrator no longer knows.

The proposed solution is inconvenient and may be regarded as temporary.

This is my opinion. And you with your opinion. Your logic is incomprehensible to me.

Aleksi "Lex" Kilpinen

You do have a solution, you just don't seem to agree with how SMF works.
If you want to change how SMF works, that is a different question completely.
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

OK, so I've sat on the sidelines about this for a while to collect my thoughts. Firstly it's absolutely not a bug - speaking as someone who has been on the dev team, this is very much intentional on the part of the development team to behave the way it does. The rationale is long, complicated and orthagonal to the OP's use case, but it is not a bug as far as I'm concerned and I'd be concerned if it were deemed necessary to change in the 2.0 lifecycle. I don't even think I'd want it to be changed in the 2.1 lifecycle.

That said, there is absolutely a use case for the OP's requirements. The team view that 'the user is wrong' is in this case *incorrect*. It would be nice to understand the OP's rationale, to support whether the behaviour should be changed in future or made configurable (which is why people like me ask such questions normally, despite how many people vocally suggest that all user requests are valid and should just be satisfied upon request... this is not true, it has never been true and the original SMF founders absolutely said no to requests on many occasions)

But anyway. The OP has a valid request - I'd still love to know the reasons for it, but it does come up from time to time. So without further ado, let's help the OP to get what they need.

Edit 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],
)
);
}

Then before it resets all the ids to 0 (and makes them guest posts) it will also reset the name. For technical reasons the two can't be done in the same step.
Holder of controversial views, all of which my own.


Aleksi "Lex" Kilpinen

To be fair, I do not believe anyone said the OP is wrong to want this, but the original question was "Is this how it should be or is it a bug?"

That being said, thank you for sharing a solution for the OP. I can appreciate that.
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

Advertisement: