Restricting Users from Signing Up Across Multiple Stores

How to configure and adapt Aimeos based shops as developer
Forum rules
Always add your Aimeos and PHP version as well as your environment (Linux/Mac/Win)
Spam and unrelated posts will be removed immediately!
alababdiy
Posts: 40
Joined: 30 Apr 2023, 12:46

Restricting Users from Signing Up Across Multiple Stores

Post by alababdiy » 11 Feb 2024, 10:32

I'm currently working with Aimeos and facing an issue regarding user signups across multiple stores. The requirement is to ensure that a user cannot sign up for multiple stores since there is a single siteid field in user schema.

While I can make the siteid field empty to address the signup issue, this introduces a problem. When administrators navigate to their dashboard's at /admin/{siteCode}/jqadm/search/customer, they can view user data even before the user has completed the signup process.

I'm looking for a solution that prevents users from signing up across multiple stores without compromising the security of user data in the admin dashboard. Any suggestions or insights into how to achieve this balance would be greatly appreciated!

User avatar
aimeos
Administrator
Posts: 7895
Joined: 01 Jan 1970, 00:00

Re: Restricting Users from Signing Up Across Multiple Stores

Post by aimeos » 15 Feb 2024, 08:18

Just to get it right: Users should be able to buy from all stores but the vendors should not see the users in the Customer panel?
Professional support and custom implementation are available at Aimeos.com
If you like Aimeos, Image give us a star

alababdiy
Posts: 40
Joined: 30 Apr 2023, 12:46

Re: Restricting Users from Signing Up Across Multiple Stores

Post by alababdiy » 15 Feb 2024, 17:36

Users should be able to buy from all stores
Yes
vendors should not see the users in the Customer panel
Each vendor ( site admins ) should still see his customers ( customers they already sign in / sign up on his store "only" )

User avatar
aimeos
Administrator
Posts: 7895
Joined: 01 Jan 1970, 00:00

Re: Restricting Users from Signing Up Across Multiple Stores

Post by aimeos » 16 Feb 2024, 17:26

The records in the user table are shared across all stores and there's no property that states that the user has "signed in/up" to the vendor site. You may add another table where you store such information, e.g. the vendor site ID the user should be available for. Then, you can adapt the class for the customer panel of the admin backend to use that information to show the appropriate user records only.
Professional support and custom implementation are available at Aimeos.com
If you like Aimeos, Image give us a star

alababdiy
Posts: 40
Joined: 30 Apr 2023, 12:46

Re: Restricting Users from Signing Up Across Multiple Stores

Post by alababdiy » 17 Feb 2024, 08:28

What is an easy way to perform an inner join between the Customer and CustomerSide (New Table) here?

If I create the CustomerSite Table:

Code: Select all

return array(
    'table' => array(
        '' => function (\Aimeos\Upscheme\Schema\Table $table) {
            $table->engine = 'InnoDB';
            $table->int('customerid');
            $table->string('siteid');

            $table->index(['label', 'siteid'], ...etc);

            $table->foreign('siteid', .... etc);
        },
    ),
);
In `./src/Admin/JQAdm/Customer/Standard.php`:

Code: Select all

public function search(): ?string {
     ....
    // "What is an easy way to inner join between Customer and CustomerSide (New Table) here?"
    $view->items = $manager->search($search, $this->getDomains(), $total);
     .....
}

User avatar
aimeos
Administrator
Posts: 7895
Joined: 01 Jan 1970, 00:00

Re: Restricting Users from Signing Up Across Multiple Stores

Post by aimeos » 19 Feb 2024, 07:51

Yes, if you add an "internaldeps" property to the search definition of "id" like here:
https://github.com/aimeos/aimeos-core/b ... rd.php#L30
Professional support and custom implementation are available at Aimeos.com
If you like Aimeos, Image give us a star

alababdiy
Posts: 40
Joined: 30 Apr 2023, 12:46

Re: Restricting Users from Signing Up Across Multiple Stores

Post by alababdiy » 20 Feb 2024, 10:43

Thanks !

Post Reply