Main
Index
Search
Posts
Who's
Online
Log
In

Home: Products: CMS Builder: Plugins & Add-ons:
Unsubscribe

 

 


Toledoh
Enthusiast

Jun 9, 2011, 3:41 PM

Post #1 of 4 (799 views)
Shortcut
Unsubscribe Can't Post

Hi Guys.

I was wondering if there was a way of deleting an account, without being logged into that account.

We have the code of the edit profile page


Code
  // delete account 
if (@$_POST['deleteAccount']) {
if ($CURRENT_USER['isAdmin']) { die("Error: Deleting admin accounts is not permitted!"); }

// delete uploads
$GLOBALS['tableName'] = 'accounts';
eraseRecordsUploads( $CURRENT_USER['num'] );

// delete account
$query = mysql_escapef("DELETE FROM `{$TABLE_PREFIX}accounts` WHERE num = ?", $CURRENT_USER['num']);
mysql_query($query) or die("MySQL Error:<br/>\n". htmlspecialchars(mysql_error()) . "\n");

// redirect to login
websiteLogin_redirectToLogin();
}

...

<form method="post" action="?" onsubmit="return confirm('Are you sure you want to delete your account?')">
<input type="submit" name="deleteAccount" value="Delete Account" />
</form>


But I'd like people to be able to simply put in their email address and hit an "unsubscribe" button.

do-able?
Cheers,

Tim Forrest
Toledoh Enterprises
www.toledoh.com.au


Dave
Staff / Moderator


Jun 10, 2011, 6:31 AM

Post #2 of 4 (784 views)
Shortcut
Re: [Toledoh] Unsubscribe [In reply to] Can't Post

Hi Tim,

Yes, there is, but the only issue is if you know someone's email you could then erase their account. Another idea would be to let them uncheck a checkbox or change a field value but not erase the account.

Let me know what you're trying to do and/or which method you prefer and we'll get you some code.

Dave Edis - Senior Developer
interactivetools.com
 


Toledoh
Enthusiast

Jun 10, 2011, 3:51 PM

Post #3 of 4 (774 views)
Shortcut
Re: [Dave] Unsubscribe [In reply to] Can't Post

Hi Dave,

I was hoping to stop the need for people to "log in" but maybe I do just set up a basic login / edit profile page where they can unsubscribe from certain notifications.... Thinking more about it, I'll need the log in function on the site down the track, so may as well implement it now.

Thanks!
Cheers,

Tim Forrest
Toledoh Enterprises
www.toledoh.com.au


Dave
Staff / Moderator


Jun 13, 2011, 12:14 PM

Post #4 of 4 (751 views)
Shortcut
Re: [Toledoh] Unsubscribe [In reply to] Can't Post

You could also have a look at how the reset password function works. We use a "secret key" to identify the user so they don't need to login but we still know it's them.

Another way is to let the user select their notifications without login and then send them an email to confirm.

In the end, the user experience issues usually end up being more tricky than the programming ones. :)

Dave Edis - Senior Developer
interactivetools.com