-
Notifications
You must be signed in to change notification settings - Fork 12
Getting Logged User Details
You can get the logged in user details by filtering the user table, by the logged user ID. First you need to create a new server action:
We call it userDetails:
Right click steps:
Select Database Actions:
And add a Database Connection:
Load your database connection:
Then right click database connection step and open Security Provider:
Add security provider:
And load the security provider instance, which you are using for your site:
Right click the security provider step and open security provider:
Then add security restrict. This is to protect our data from unauthorized access:
Now as the protection is set up, let's add a database query. Right click the security restrict step:
Open Database Actions:
And add database query:
Then click the query builder button:
And add the table storing your users details:
Open the conditions tab:
And select the user ID column:
Select equal:
And select the dynamic data picker button, to select a dynamic value:
This dynamic value must be the identity returned by the security provider:
Click select:
And click ok in order to apply query settings:
Save your server action:
Now on your page, in app connect panel add new component:
Open Data:
And select Server Connect:
We call it userdetails (1) and then click the server action button (2):
Select the userDetails server action, and click Select:
Then, on the page - double click where you need to populate some of the users data and select the dynamic data picker:
Under the userdetails server connect, select the data you want to bind and click the select button:
Do the same for every binding you need to insert on the page:
Then, when the user logs in he will see his details:
© Wappler 2018
- Home
- Getting Started
- How-to Guides
- Project Manager
- Bootstrap 4 Visual Designer
- Image Galleries & Animations
-
Server-side Components
- Connecting to a Database
- Creating Database Queries
- Binding Data on the Page
- Formatting Dynamic Data
- Filter Data with Text Input
- Filter Data with URL Param
- Dynamic Select Menu
- Dynamic Sortable Table
- Dynamic Paging
- Server Side Includes (SSI)
- Insert Database Record
- Get Inserted Record ID
- Delete Database Record
- JSON Data Sources
- Send Form to Email
- Debugging Problems
- Security & Login
- Form & Data Validation
- Notifications & Alerts
- Mobile Apps