Unsubscribe

4 posts by 2 authors in: Forums > CMS Builder: Plugins & Add-ons
Last Post: June 13, 2011   (RSS)

By Toledoh - June 9, 2011

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

// 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 (toledoh.com.au)

Re: [Dave] Unsubscribe

By Toledoh - June 10, 2011

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 (toledoh.com.au)

Re: [Toledoh] Unsubscribe

By Dave - June 13, 2011

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