portapipe / Login-GroceryCrud

A Login/Logout system for GroceryCrud (codeigniter).
32 stars 26 forks source link

store user / group #6

Closed ghost closed 7 years ago

ghost commented 7 years ago

Hello.

In order to keep track of what a user do, the author field needs to be added to the table (for example articles table). If the user is logged, is there a easy way to store the user in the register in a transparent way ?

As a member belongs to a group, How store the group in the record ?

     Miquel.
portapipe commented 7 years ago

Dude your needs are so heavy ⚓️ but a MUST for your needs. I'll try to help you with that, even in it's a very unique request and I don't think I'm gonna add it to the scripts (99.9% of users don't need it, and if I'm wrong I'll add it as soon as I can ;) ) So. The user data are in the database, and you can get the current logged user data with: getField($field) It will return any field of the current logged user. An example? If you have a group field and the group 0 is the admin group: if(getField('group')==0) echo "You are an administrator!"; If you have a publicName field: echo "Hi ".getField('publicName')."! How are you today?"; So any column you're going to add do the crud_users table, you can get it via this cool function. When you have it you can log it where you need, in a .log file or in a database, as you wish.

ghost commented 7 years ago

Perfect !! Thanks a lot.

portapipe commented 7 years ago

You're welcome 👍🏻😊