User deletes his account - how to?

joit

Active Member
If I user the JUser plugin for a registration form, what would you suggest to do that users are able to delete their accounts?

Thanks
 
edit the jusers plugin and set 'Delete Users' = 'yes'
then give the user a view of the user list prefiltered so that they can only see their own record, but can delete it.
Deleting the fabrik row will then delete their user account

-Rob
 
I set it up but I guess there is something wrong with my query. I attached a screenshot of it. "Anmeldung" is the name of the users table.
 

Attachments

  • Prefilter.PNG
    Prefilter.PNG
    10.4 KB · Views: 338
Your "Anmeldung" table should have an element that stores the user ID and you should then use that element to prefilter the table and display only each user with its own data.
So if this element is called "user_id", your prefilter should read :

WHERE user_id(raw) EQUALS {$my->id} no quotes
 
Sorry this is new to me.
Can't this UserID just be the auto increment ID of the table?
If yes, I still have some problem with the query, please see the screenshot of my current settings.
If I set apply to "Registered" the table shows no data, if I set it to "All" the table shows all data.
 

Attachments

  • Prefilter2.PNG
    Prefilter2.PNG
    9.7 KB · Views: 325
There are two ways to use Fabrik to register users :

  • Either you create a list directly connected to the Joomla #__users table, with optionnaly a joined list to a fabrik created table if you need to record additional data (address, phone, ...). In this case, your userId, as returned by {$my->id} will be the autoincremented id of the table. This is my preferred method.
  • Or, you create a new list in fabrik with all the fields required by the Joomla registration process (name, username, email and password), plus additional fields if necessary. In this case, it si strongly advise to have a "user_id" element that will record the userId recorded into the Joomla #__users table when a new user registers. Without it, it is difficult (impossible?) to maintain a coherence between the two tables. Furthermore, this element will allow you to filter the users so they can only see their own record. And it is safer if this element is not the PK of your table but a distinct one.
 
Thanks a lot! Using method 1 I could display a prefiltered list of the users table and the user can delete his account.
However I was wondering if there is a more user friendly way to delete the account. It would be great to have a button element to do this. Do you have an idea how to do this?
 
I am not sure what you mean. If you have the list display, you have a "delete" button that can do the job.
An alternative would be to have a button somewhere with a JS attached to it that triggers a little script that performs the deletion, but I am not sure why you want to encourage your users to delete their registration?
You could also have an automatic deletion of account if someone does not login during a certain period of time (probably you should warn them first!). You can use a cron plugin to do that.
 
but I am not sure why you want to encourage your users to delete their registration?
I certainly don't want users to encourage to delete their registration but I think it is nessecary by law, isn't it?
How do you usually handle that?
 
Usually, I have

  • a menu link to a registration form (made with fabrik)
  • a menu link for "Editing my registration" - points to the same form but with the option menu -1 set so the form is populated with the connected user's data
  • at the bottom of the form (you can use the "outro" space for that), I have a link to the users list, pre-filter so the user sees only his own record. There is a message saying that if he wants to permenently delete his registrtion he can do so by clicking the delete button.
 
Thanks a bunch for sharing!
One more question to post #6, method 1: Can't I just expand the standard Joomla user table by adding some elements to it?
 
No. You should never alter a table created by Joomla (or an extension other than Fabrik) because this might interfere witht the way this extension work and/or your changes may be erased with an update of the extension (like one column was removed in the #__users table when you updated from J! 2.5 to 3.0).
In regards to this, you should set "Alter element types" to "No" in the advanced setting of your fabrik list connected to the #__users table so you don't change anything in this table when you edit the Fabrik elements.
 
I concur with what JFQ says. Although technically you could extend a J! table without hurting anything, as long as you don't make any changes to existing fields, in practice it is a Bad Idea <tm>.

-- hugh
 
I concur with what JFQ says. Although technically you could extend a J! table without hurting anything, as long as you don't make any changes to existing fields, in practice it is a Bad Idea <tm>.

-- hugh
 
Would you store elements records like "Agree to T&C" and "confirm password" in database or not?
 
agree to t&c - yes as you should have proof they've agreed.
For the confirm password, if you use the password element then it shows a confirm password field but only stores the password itself.
 
OK. I'm struggling with the joined table from post #6 now. Most of it works but I'm not sure about what I did ;-)
I attached a screenshot of how I set up the joined table/list userdetails. I can view data of it in the backend and I see the first 2 colums are id and date/time, the other colums is joomla user stuff.
I created an element for agreeT&C and set its group to UserDetails- [beilad_users], correct? (beilad_users is my joomla user group). In the frontend I can add a new user with agreeT&C and all gets stored in the database.
Now the odd thing. If I view data of the userdetails list and edit an existing user to add his agreement of T&C, nothing gets stored. Instead, a new user is created and he has no records except agreeT&C.
Why is that?
 

Attachments

  • table-list_join.png
    table-list_join.png
    78.4 KB · Views: 307
Your join is not correct: maybe you should read something about the concept of joining table so it will help build many thing in Fabrik afterwards. It's really important to understand how it is working. Have you watched the video tutorial on the Fabrik site?

Now, practically, your join should be between the id of the users table and a user_id element in the userdetails table, not between the two ids.
 
I have the problem that when I add a new record, UserID is not prefilled to the ID of the Joomla users ID (I guess it should be that way)
Have you watched the video tutorial on the Fabrik site?

Do you refer to tutorial 06 - Related data?
 
We are in need of some funding.
More details.

Thank you.

Members online

Back
Top