Good morning,
I'm starting a project and I have a couple of doubts/questions about automatic user creation and changing record owner. My scenario is as follows:
- A guest user creates a record
- She has the option of creating a new user. If so, I want to create a new user (belonging to a certain group, let's name it 'follow_group') and change the owner of the newly created record
I tried with a sql insert in the tablename.php tablename_anfer_insert() but then I found the function set_record_owner. The problem with the sql insert is that I can create the new user in the membership_users table but I can't change the record owner.
Then I tried the solution described in viewtopic.php?f=4&t=4262&p=16953&hilit= ... ner#p16953 but nothing happens.
Can anybody hel me?
Thanks is advance
Create users automatically and change record owner
Re: Create users automatically and change record owner
Hi,
first of all, I don't think your question belongs here (in this sub-forum), because your request has nothing to do with AppGini Helper Javascript Library. So I guess you'd get more experts' attention when asking general questions in one of the general AppGini forums.
Anyway, if I remember right, the owner will be overwritten by AppGini core code AFTER the hook has been executed unless you return FALSE.
Search in TABLENAME_dml.php for function TABLENAME_insert. Almost at the end of that fn you will find set_record_owner call which will be executed if TABLENAME_after_insert not returns FALSE.
In other words: when changing the owner in after_insert hook and returning TRUE, AppGini will overwrite the owner by the currently logged in memberID. Try to return FALSE from after_insert hook.
first of all, I don't think your question belongs here (in this sub-forum), because your request has nothing to do with AppGini Helper Javascript Library. So I guess you'd get more experts' attention when asking general questions in one of the general AppGini forums.
Anyway, if I remember right, the owner will be overwritten by AppGini core code AFTER the hook has been executed unless you return FALSE.
Search in TABLENAME_dml.php for function TABLENAME_insert. Almost at the end of that fn you will find set_record_owner call which will be executed if TABLENAME_after_insert not returns FALSE.
In other words: when changing the owner in after_insert hook and returning TRUE, AppGini will overwrite the owner by the currently logged in memberID. Try to return FALSE from after_insert hook.
Kind regards,
<js />
My AppGini Blog:
https://appgini.bizzworxx.de/blog
You can help us helping you:
Please always put code fragments inside
AppGini 24.10 Revision 1579 + all AppGini Helper tools
<js />
My AppGini Blog:
https://appgini.bizzworxx.de/blog
You can help us helping you:
Please always put code fragments inside
[code]...[/code]
blocks for better readabilityAppGini 24.10 Revision 1579 + all AppGini Helper tools
Re: Create users automatically and change record owner
thanks Jan, and sorry for the inconvenience.
Re: Create users automatically and change record owner
No prob, does it work now?
Kind regards,
<js />
My AppGini Blog:
https://appgini.bizzworxx.de/blog
You can help us helping you:
Please always put code fragments inside
AppGini 24.10 Revision 1579 + all AppGini Helper tools
<js />
My AppGini Blog:
https://appgini.bizzworxx.de/blog
You can help us helping you:
Please always put code fragments inside
[code]...[/code]
blocks for better readabilityAppGini 24.10 Revision 1579 + all AppGini Helper tools