Title
| Old | New |
|---|
| 1 | Users Users | 1 | Administrators |
|---|
Permalink
| Old | New |
|---|
| 1 | admin/users_users | 1 | administrators |
|---|
Content
| Old | New |
|---|
| 1 | # Admin:users/users | 1 | # Admin Users
|
|---|
| 2 | | 2 |
|
|---|
| 3 | **Users** holds login credentials that allows a person to access | 3 | Admin users, **users**, or administrators as they are called in Litecart 3.x, are a set of credentials that allows you to sign in to the [backend](backend) for controlling the store.
|
|---|
| 4 | the [administration panel](administration_panel). | 4 |
|
|---|
| 5 | | 5 | ## Entity Object
|
|---|
| 6 | The admin panel has dual login protection for the high-risk of exposed | 6 |
|
|---|
| 7 | services on the internet: | 7 | ```php
|
|---|
| 8 | | 8 | $user = new ent_user(); // LiteCart 3.x use ent_administrator()
|
|---|
| 9 | * .htaccess authorization (protection of files and folders) | 9 | $user->data['username'] = '...';
|
|---|
| 10 | * session based protection (logical protection of application features) | 10 | $user->set_password('...');
|
|---|
| | 11 | $user->save();
|
|---|
| | 12 | ```
|
|---|
| | 13 |
|
|---|
| | 14 | ## Reference Model
|
|---|
| | 15 |
|
|---|
| | 16 | Admin users doesn't have a reference object. Instead, values from the entity will be returned.
|
|---|
| | 17 |
|
|---|
| | 18 | ```php
|
|---|
| | 19 | echo reference::user($username)->email;
|
|---|
| | 20 | ```
|
|---|
| | 21 |
|
|---|
| | 22 | ## Database Query
|
|---|
| | 23 |
|
|---|
| | 24 | ```php
|
|---|
| | 25 | $query = database::query(
|
|---|
| | 26 | "select * from ". DB_TABLE_PREFIX ."users
|
|---|
| | 27 | where username = '". database::input($username) ."'
|
|---|
| | 28 | limit 1;"
|
|---|
| | 29 | );
|
|---|
| | 30 |
|
|---|
| | 31 | $user = database::fetch($query);
|
|---|
| | 32 | ``` |
|---|
Edited by tim on Jan 30 2024 at 12:12 AM