membership users

Got something cool to share with AppGini users? Feel free to post it here!
Post Reply
chrisblessing
Posts: 2
Joined: 2013-08-21 00:42

membership users

Post by chrisblessing » 2015-11-17 01:55

In the AppGini application I created a table called "staff_names". Into this table I imported a list of over 100 teachers. After generating the PHP it occurred to me that perhaps I ought to have imported those users into one of the default tables (eg. membership_users). What I am after is to have a group called "Staff", with all those teachers as members. What would be the recommended means of getting the teachers I imported into "staff_names" to show as users in a group I created called "Staff"?

Thank you.

Chris

User avatar
a.gneady
Site Admin
Posts: 1281
Joined: 2012-09-27 14:46
Contact:

Re: membership users

Post by a.gneady » 2015-11-17 20:21

You can define the group "Staff" through the admin area. Then get its ID; you can get the group ID if you open the group page in the admin area -- in the URL, you should see something like groupID=4 at the end of the URL .. 4 is the group ID in this case.

Next, to add users, you should insert them into the membership_users as follows:
memberID: the username
passMD5: the user password, hashed as MD5
email: the email address of the user
groupID: the group ID you obtained above
isBanned: set to 0
isApproved: set to 1

You can ignore the other fields .. or you could optionally populate fields custom1 to custom4 with staff data.
:idea: AppGini plugins to add more power to your apps:
  • DataTalk is an innovative AppGini plugin based on ChatGPT that allows you to interact with your AppGini database using natural language questions, without writing any SQL. Check the demo video
  • Mass Update plugin: Update multiple records at once and improve your workflow efficiency.
  • Check our other plugins and get a generous discount of up to 30% when buying 2 or more plugins.

chrisblessing
Posts: 2
Joined: 2013-08-21 00:42

Re: membership users

Post by chrisblessing » 2015-11-19 03:37

Thank you. That did the trick.

Cheers,

Chris

Post Reply