PDA

View Full Version : Allow users to delete themselves


Admin
04-05-2002, 10:00 PM
This one was requested by Webhost. Personally I can't see the use for this, but a hacker's gotta do what a hacker's gotta do. ;)

Anyway, this one is really simple.

First, create a new template named "deleteself" with this:
<center>Are you sure you want to delete your user account from this message board?<br>
All of your current posts will be set to "Guest".
<b>This is not revertible!</b>

<form action="member2.php" method="post">
<input type="hidden" name="s" value="$session[sessionhash]">
<input type="hidden" name="action" value="killme">
<input type="submit" value=" Yes " class="bginput">
</form></center>
Now open the attached text file, and add the code from it to member2.php right after this code:
eval("dooutput(\"".gettemplate("subscribe")."\");");
}
That's it. :) Now people can go to member2.php?s=&action=deleteme, and if they click Yes there their profile (and the rest of the data associated with that user) will be deleted.

I put in a nice 'done' message, I'll post a screen shot in a minute. ;)

Admin
04-06-2002, 01:18 PM
;)

el3m3nt
04-06-2002, 01:20 PM
hehe. GJ and nice screenshot, FireFly :).

webhost
04-06-2002, 02:40 PM
Thanks Chen He will appreciate it.

Joey

Overgrow
04-06-2002, 02:51 PM
Actually that's pretty frickin swift Chen! I get at least 4 or 5 "delete me" messages a week. Thanks man, going to install it now.

I think I may add a mod that either allows them to prune all of their posts at the same time or set the username of those posts to "Unregistered."

Overgrow
04-06-2002, 03:09 PM
Sweet, thanks! Will save me some time.. I have it setting all the posts/threads to Unregistered instead of their username since that seems a little more like deletion.

If you have my Karma, add in:

$DB_site->query("DELETE FROM karma WHERE userid=$bbuserinfo[userid] or whoadded=$bbuserinfo[userid]");

Smellycat
04-06-2002, 04:24 PM
Originally posted by FireFly
[B Now people can go to member2.php?s=&action=deleteme, and if they click Yes there their profile (and the rest of the data associated with that user) will be deleted.
[/B]


how would i put a link to that in the control panel?

Smellycat
04-06-2002, 04:32 PM
Its ok i went brain dead there for a moment, found the template

Tech_Koss
04-06-2002, 05:00 PM
haha....love the picture :)

Xelation
04-06-2002, 05:57 PM
kool hack, I will be sure to add this. :)

Psychdrone
04-06-2002, 06:02 PM
evil!

but nice:)

MrBojangle1
04-06-2002, 08:50 PM
lol, funny but nice :)

Nebula
04-06-2002, 10:58 PM
not sure about this one.

on my website, if someone hacked into someone else's account, and had this feature, they'd delete everyone :-P

but that's my two cents ;) vBulletin is probably pretty hard to hack too ;)

Matt
04-07-2002, 01:00 AM
I was about to say the same, I am not gonna install it myself and its down to the individual if they wish to install it but it does prove as a problem for those who do manage to hack into peoples accounts. It happens frequently on boards I use and the option to delete yourself would be so attractive to hackers, some might even start hacking simply to delete a user they dislike :(

Velocd
04-07-2002, 03:43 AM
Why not create a hack that back's up users and all their info?
...wait, already created just use the backup--d'oh

But still, if you made something that allowed users maybe in their profile to select an option that allowed, incase anything happened to their account, it could be backed up. Then there could be some nifty interface in the admin area that contains all users who were deleted and who choosed to have a backup, and all their backups are located there. Where the admin can choose to backup/restore a user to the point before deletion, or just delete / mass purge back ups. In order for it to be a recent backup, all that would need to be done is right before the user deletes themself or admin deletes user, a backup is created (if the user choosed to have a backup). The difference from this and the regular backup Sql dump, is that its easier (with an interface), and that not everything is needed to be backed up (although I'm aware the other way you can do the same, but this is more organized..i think)
YOU know what I mean?!?

Damn..I'm getting way into this, and it probably wouldn't even work...but, maybe If it did, I just created a hack I could possible do?!? .....nah, I'm not that great at php/mysql yet to accomplish such a huge task. *eagerly awaits response by Firefly* :p

Birdie501
04-07-2002, 08:30 AM
Hi firefly,

what about doing it that way?

if the user confirm his deletion, this action will be queued for at least one week before the user will be deleted. If it was a hacker attack and a user uses his account within this period the deletion will be automatically cancelled.

or another possibilty:

Just do it like the registration way. The user will get an email where he has to confirm the deletion! That would also help if the user account has been hacked.

anyway again a great job you did, thanks.

Regards
Birdie501 :classic:

Floris
04-07-2002, 08:41 AM
I agree with Birdie501!

When the user selects to delete his account, he will get an E-mail, etc, like with registration. I like that!

Also, what I wanted to ask! Can you make an additional field where users can give a reason? (or select one from drop down list) - Or both! - so we know why they suddenly want to cancell their account?

Additional question: Spoil us! Will this be a feature in vB3? (or similar)

Love to hear your comments firefly! And would love to see an updated file! - vbHacker ready! -

Admin
04-07-2002, 11:17 AM
I'm not going to build on this hack, I don't find it very useful and don't think it's worth it (I'm glad Overgrow and Webhost like it tho :)).

xiphoid: no this won't be a feature in vB3 (and please stop asking me that question, I'm really not in a position to say that -- simply because I have no idea!).

Velocd
04-07-2002, 02:08 PM
The email idea is great, and I'm sure another hacker could figure out that one other than FireFly. Somebody?

kreftt
04-07-2002, 02:49 PM
oh firefly this hack is very useful,

in fact every install of the vbulletin software on a german server breaks the law as the privacy laws in this country here say that everyone who offers a registration must allow the user to end his/her subscription, followed by the complete deletion of any data collected from that user (like his email and location).

so i would be very thankful if you could add that email feature into this hack.

tia

kreftt

webhost
04-07-2002, 02:53 PM
Thanks again Chen, what we did was a long time back we installed this hack by Chris https://vborg.vbsupport.ru/showthread.php?s=&threadid=18718
Which is for a user to subscribe to a forum in return they receive a email when there is a new thread made. We have a forum where we post all important network and site information that we subscribed everyone to.
We wanted this option where we could add it to the email to give a user not only the option to unsubscribe to the forum but also delete their selve if they so desire. So this works great for that.

Smellycat
04-07-2002, 02:55 PM
See what you started now Chen, you cant let them all down can you! ;)

Admin
04-07-2002, 03:22 PM
Originally posted by Smellycat
See what you started now Chen, you cant let them all down can you! ;)
Watch me. ;)

Velocd
04-07-2002, 11:07 PM
For somebody like you it would take no time at all to make. I think users should have the option to delete themselves if they no longer want to be registered, but there needs to be extra security to prevent hackers. Please :p

If you don't want to do it for us, do it for Germany! ;)

Admin
04-08-2002, 12:50 PM
Heh, sorry but no. If people want feel free to take this hack and add stuff to it, I really don't mind.

Matt
04-08-2002, 04:13 PM
It should be pretty straight forward in theory, why not just have it so that they are all moved into a "deleted" usergroup which you clear out every so often?

Velocd
04-08-2002, 07:44 PM
The email verification is probably the easiest way of all. I just don't have the time to code it.

Somebody please? :p

Floris
04-10-2002, 05:22 AM
Originally posted by FireFly
I'm not going to build on this hack, I don't find it very useful and don't think it's worth it (I'm glad Overgrow and Webhost like it tho :)).

xiphoid: no this won't be a feature in vB3 (and please stop asking me that question, I'm really not in a position to say that -- simply because I have no idea!).

Thank you for replying, and sorry for asking ( .. if you guys just know how vB3 is eating us up!!! - but sorry, I will)


[update]
I was not able to let a user enter a reason yet, but I was able to code an extra line that will give the webmaster an Email which user with userid unregistered. Making it work with vB now .. and will post soon.

Floris
04-10-2002, 06:21 AM
This will NOT E-mail the user who unregisters, but it will E-mail the webmaster that the user unregistered. And gives the username and userid.

After applying Firefly's hack, open member2.php and search for:


$DB_site->query("DELETE FROM session WHERE userid=$bbuserinfo[userid]");

eval("standarderror(\"<br><br>You've just been erased.<br><br>\");");


And replace that with:


$DB_site->query("DELETE FROM session WHERE userid=$bbuserinfo[userid]");
mail("$webmasteremail", "User $bbuserinfo[username] Unregistered", "Username $bbuserinfo[username] \n UserID $bbuserinfo[userid] \n Unregistered", "From: $webmasteremail\r\n");
eval("standarderror(\"<br><br>You've just been deleted.<br><br>\");");


You will get an E-mail to/from webmaster email with msg

username: <the user>
userid: <the userid>
unregistered!

I tested it on my board (2.2.5) and it works. But I used username "tester". I am not sure how to handle (and if it is needed) usernames with weird characters. Maybe somebody can test?

And maybe now someone can make addition so user can give up a reason, and the webmaster will also get: reason: <reason>

Admin
04-10-2002, 10:11 AM
I believe you need to unhtmlspecialchars() the username before sending it.

Floris
04-10-2002, 04:08 PM
Uhm .. I tried a few things, but only ended up with errors. grr.. I wish I knew more about PHP

Smellycat
04-10-2002, 05:51 PM
Originally posted by xiphoid
Uhm .. I tried a few things, but only ended up with errors. grr.. I wish I knew more about PHP

maybe if you offer Firefly, a free holiday he might come and teach you some more of his leet php skills?

*Grin*

Floris
05-05-2002, 04:42 PM
If you don't hear from FireFly for a while .. :P
mail("$webmasteremail", "User $bbuserinfo[username] Unregistered", "Username ".unhtmlspecialchars($bbuserinfo['username'])." \n UserID $bbuserinfo[userid] \n Unregistered", "From: $webmasteremail\r\n");
eval("standarderror(\"<br><br>You've just been erased from our database, you are now browsing the forum as Guest.<br><br>\");");
should do the trick. I tried with username ^test*^'\er and that worked just fine.

Now.. all I need is an input field where users can give a quick reason why they no longer wish to be a registered member.

Derek
08-07-2002, 09:35 AM
I'm hoping this "bump" will be able to give someone the opprotunity to add the "email confirmation to user" feature.

wolfman
09-11-2002, 04:18 PM
Ok I have it installed I just have no idea where to find this new option at nor do I know how to add it in someplace so the user can find it.

Thanks in advance.

Floris
09-11-2002, 04:49 PM
Time to re-read the thread is all I can advice.

wolfman
09-12-2002, 01:40 AM
Uh thanks, I think.

I have read and re-read this thread I am seeing bits and pieces of it but how to put these pieces together is just not falling together in my head.

wolfman
09-12-2002, 02:10 AM
For anyone that cares I added this to the usercpnav template under User Control Panel Templates this gives the users a button within the user cp. I am sure someone will do it on accident as many do not seem to read anything, but hey they will learn when they make this big of a mistake. I have this installed in vbb 2.2.7 and I have tested it and it does work.


<td bgcolor="$cpnav[7]"><smallfont><b><a href="member2.php?s=&action=deleteme">Delete me</a></b></smallfont></td>




Edited the code in here as I posted the wrong one in there this can be pasted in the usercpnav after the last line like this one.

Floris
09-12-2002, 09:31 AM
Originally posted by wolfman
Ok I have it installed I just have no idea where to find this new option

.. from the first post in this thread:
That's it. Now people can go to member2.php?s=&action=deleteme, and if they click Yes there their profile (and the rest of the data associated with that user) will be deleted.

You can put it anywhere you want.

You can make a link in any template like
<a href="member2.php?s=&action=deleteme">Delete me</a>

As suggested above, you can do this in the usercp, where someone might suspect it. I made a unregister.mysite.com link, so when they go there, they can unregister. You could add it in your footer < contact us - register - unregister - yoursite.com >

wolfman
09-13-2002, 02:15 AM
Thanks so much I do appreciate the help :)

QiQme
11-18-2003, 04:47 PM
How can i prevent that the posts of a deleted user turns on "ignore list" ?

If a user deletes himself all his posts turn on my "Ingore list"

I want posts of deleted users to act as normal posts

Fargo
01-31-2004, 09:48 PM
I know this hack isnt really supported, but could someone help me out just a hair?

I've got everything done as needed, however, I would like to include the link in the users cp on "My vBHome". I've created a template for that block, however, Im unsure how to call it. I know it would be placed after $threadslist in the usercp template. My question here is, what is necessary to define the "$<name>" style variable? If I wanted to call it $deleteacct, where would I define it so it knows to insert my usercp_deleteacct template?

I realize that I could easily insert the full code in the usercp template, but I don't learn anything that way :)

Fargo
02-01-2004, 10:24 AM
scratch that request - I found my answer here:
https://vborg.vbsupport.ru/showthread.php?t=60964

discore
05-07-2004, 07:49 PM
If anybody cares, I modded this a bit to confirm password before deleting...

In the attached text file from 1st post add this after include('./global.php');

$password = $HTTP_POST_VARS['password'];
$dbpassword = $DB_site->query_first("SELECT password FROM user WHERE userid='".addslashes(htmlspecialchars($bbuserinfo['userid']))."'");

if($dbpassword[0] != md5($password)) {
show_nopermission();
}


And in the deleteself template add this after <form action="member2.php" method="post">

Enter Password: <input type="password" name="password" size="20"><br><br>

That's all!

Bryan Ex
07-20-2004, 05:43 AM
Has anyone bothered to update this to work with vB3 at all? I've been searching for this exact hack since RC4. :ermm: