ClipShare Community Forums  

Go Back   ClipShare Community Forums > ClipShare PRO - Version 4 > Feature Requests
Register FAQ Bug Tracker Members List Calendar Mark Forums Read

Feature Requests Post your wish list for future upcoming ClipShare versions.


Reply
 
Thread Tools Display Modes
Old 08-31-2009, 12:12 AM   #1
Locrian
Member
|Forum Regular|
 
Join Date: Feb 2008
Posts: 112
Locrian is on a distinguished road
Default Users need ability to close account:

Title really says it all. Needs to be an option for people who no longer wish to be a part of your site or to receive emails from it to close their own accounts without contacting you to do it manually.
Locrian is offline   Reply With Quote
Old 08-31-2009, 01:12 AM   #2
dargre
Member
|Forum Guru|
 
dargre's Avatar
 
Join Date: Nov 2007
Posts: 2,501
dargre will become famous soon enough
Default

Yep, that's smart request.
It even happened so one of my site's user asked for it.
That's why some time ago I have added such option to user profile page.

Function must destroy all user activity: videos, profile, pms, comments, buddies list, etc.
In fact - not very complicated thing.
dargre is offline   Reply With Quote
Old 08-31-2009, 01:27 AM   #3
Locrian
Member
|Forum Regular|
 
Join Date: Feb 2008
Posts: 112
Locrian is on a distinguished road
Default

Yeah I noticed your site had a way to do it, but I figured as much.
Locrian is offline   Reply With Quote
Old 08-31-2009, 02:43 AM   #4
dargre
Member
|Forum Guru|
 
dargre's Avatar
 
Join Date: Nov 2007
Posts: 2,501
dargre will become famous soon enough
Default

Ok, let's give a try.

In file "templates/my_profile.tpl" put anywhere in visible place a link to close account:
Code:
<a href="{$baseurl}/my_profile.php?a=close_account" onclick="javascript:return confirm('Are you sure you want to close account?');">Close account</a><br />
By closing account all information, videos, messages, comments will be deleted as well.
Now in file "my_profile.php", somewhere on top you should have:
Code:
chk_member_login();
$uid = mysql_real_escape_string($_SESSION['UID']);
Below you can paste this:
Code:
if(isset($_REQUEST['a'])) {
 if($_REQUEST['a'] == 'close_account') {
 $conn->execute("DELETE FROM video WHERE UID = '".mysql_real_escape_string($_SESSION['UID'])."'");
 $conn->execute("DELETE FROM signup where UID = '".mysql_real_escape_string($_SESSION['UID'])."' LIMIT 1");
 $conn->execute("DELETE FROM buddy_list WHERE username = ".mysql_real_escape_string($_SESSION['USERNAME'])."'");
 $conn->execute("DELETE FROM buddy_list WHERE buddy_name = ".mysql_real_escape_string($_SESSION['USERNAME'])."'");
 $conn->execute("DELETE FROM comments WHERE UID = '".mysql_real_escape_string($_SESSION['UID'])."'");
 $conn->execute("DELETE FROM favourite WHERE UID = '".mysql_real_escape_string($_SESSION['UID'])."'");
 $conn->execute("DELETE FROM friends WHERE UID = '".mysql_real_escape_string($_SESSION['UID'])."'");
 $conn->execute("DELETE FROM friends WHERE FID = '".mysql_real_escape_string($_SESSION['UID'])."'");
 $conn->execute("DELETE FROM group_tps WHERE UID = '".mysql_real_escape_string($_SESSION['UID'])."'");
 $conn->execute("DELETE FROM group_tps_post WHERE UID = '".mysql_real_escape_string($_SESSION['UID'])."'");
 $conn->execute("DELETE FROM last_5users WHERE UID = '".mysql_real_escape_string($_SESSION['UID'])."'");
 $conn->execute("DELETE FROM playlist WHERE UID = '".mysql_real_escape_string($_SESSION['UID'])."'");
 $conn->execute("DELETE FROM pm WHERE UID = '".mysql_real_escape_string($_SESSION['UID'])."'");
 $conn->execute("DELETE FROM subscribe_video WHERE subscribe_to = '".mysql_real_escape_string($_SESSION['USERNAME'])."'");
 $conn->execute("DELETE FROM subscribe_video WHERE subscribe_from = '".mysql_real_escape_string($_SESSION['USERNAME'])."'");
 $conn->execute("DELETE FROM subscriber WHERE UID = '".mysql_real_escape_string($_SESSION['UID'])."'");
 $conn->execute("DELETE FROM users_online WHERE UID = '".mysql_real_escape_string($_SESSION['UID'])."'");
 $conn->execute("DELETE FROM verify WHERE UID = '".mysql_real_escape_string($_SESSION['UID'])."'");

 $_SESSION['UID']="";session_unregister("UID");
 $_SESSION['EMAIL']="";session_unregister("EMAIL");
 $_SESSION['USERNAME']="";session_unregister("USERNAME");
 session_write_close();
 header("location: ".$config['BASE_URL']);
 die();
 }
}
I can't guarantee, so I didn't make a typo, or it will work for all versions.
In case of error, you may always set debug mode to "true" in "include/config.php" and post what error appeared. If there is a line with error - find the line and quote here.

Important: For test create any useless account

Last edited by dargre : 08-31-2009 at 03:24 AM.
dargre is offline   Reply With Quote
Old 08-31-2009, 03:13 AM   #5
Locrian
Member
|Forum Regular|
 
Join Date: Feb 2008
Posts: 112
Locrian is on a distinguished road
Default

Hey thanks for trying even if there is a typo. I just wanted to say thanks before I even try it. I'll let you know, but as always, great having you around these forums.

Best

Quick edit: Just looking at your script, there is no my "my_profile.php" in siteadmin, but people should know what you mean.

Last edited by Locrian : 08-31-2009 at 03:20 AM.
Locrian is offline   Reply With Quote
Old 08-31-2009, 03:21 AM   #6
dargre
Member
|Forum Guru|
 
dargre's Avatar
 
Join Date: Nov 2007
Posts: 2,501
dargre will become famous soon enough
Default

Quote:
Originally Posted by Locrian View Post
Quick edit: Just looking at your script, there is no my "my_profile.php" in siteadmin, but people should know what you mean.
Corrected.Also changed POST to REQUEST as this is link and not a form.

Last edited by dargre : 08-31-2009 at 03:24 AM.
dargre is offline   Reply With Quote
Old 08-31-2009, 04:05 AM   #7
Locrian
Member
|Forum Regular|
 
Join Date: Feb 2008
Posts: 112
Locrian is on a distinguished road
Default

Yes changing from a "POST" to a "REQUEST" worked perfectly and deleted a newly made account along with some test comments.

Again Dargre answers the Clipshare users call.

Can't thank you enough.

Edit: So people know, this was done on 4.1.4 and if you guys do it on other versions please post them so people know.

Last edited by Locrian : 08-31-2009 at 04:28 AM. Reason: version
Locrian is offline   Reply With Quote
Old 10-12-2009, 12:10 AM   #8
opal
Member
|Forum Regular|
 
opal's Avatar
 
Join Date: Jun 2009
Posts: 146
opal is on a distinguished road
Default

thanks, works fine.
opal is offline   Reply With Quote
Old 07-27-2012, 10:34 AM   #9
rmorano123
Member
|Forum Junior|
 
rmorano123's Avatar
 
Join Date: Nov 2011
Location: New York, NY
Posts: 57
rmorano123 is on a distinguished road
Default

Great, thanks!
rmorano123 is offline   Reply With Quote
Reply


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Ability to add users from admin page abelp Feature Requests 0 03-16-2009 08:05 PM
I'm thiiiiis close, just a couple questions. ryno Pre-Sales Questions 5 09-08-2007 09:08 PM



All times are GMT +1. The time now is 04:22 AM.


Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2013, Jelsoft Enterprises Ltd.
Copyright © 2006-2008 Envient. All Rights Reserved.

An Envient product.