Extern Userdatabase

Questions around the TYPO3 integration and plugins
Forum rules
Always add your TYPO3, Aimeos and PHP version as well as your environment (Linux/Mac/Win)
Spam and unrelated posts will be removed immediately!
Shopmister
Posts: 92
Joined: 15 Jan 2021, 11:02

Extern Userdatabase

Post by Shopmister » 15 Jun 2021, 05:34

Hey,
TYPO3 Version 10.4.13
Webserver Apache
PHP Version 7.3.27-1~deb10u1
Database (Default) MySQL 5.5.5-10.3.27-MariaDB-0+deb10u1
Application Context Production
Operating System Linux 4.19.0-9-amd64
Last Scheduler run 24-05-21 at 15:36, Duration 0 min, (started automatically)
aimeos 21.4.2

I want to use the databasetables for fe_users and groups from extern. The Problems now:
- How its possible to configure the userfolder then? I have to configure the folder where the registerred Users where stored normally.
- And do you have an idea how to replace the Register during checkout with something like an link to the logininstallationpage. Okay, a link i would be can do for my self, i think. But exist a better idea for use the extern installation for login and register too?
Ps. Are something more complications on my way?


Thank you :)

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

Re: Extern Userdatabase

Post by aimeos » 16 Jun 2021, 08:58

Do you want to move the fe_users table into a separate database or use an external authentication mechanism?
Professional support and custom implementation are available at Aimeos.com
If you like Aimeos, Image give us a star

Shopmister
Posts: 92
Joined: 15 Jan 2021, 11:02

Re: Extern Userdatabase

Post by Shopmister » 16 Jun 2021, 12:36

Do you want to move the fe_users table into a separate database or use an external authentication mechanism?
The second i tryed, but i think im not good anough and will use , first only fe_users and fe_groups in external database. In an own typo3installation with fe_managerextension to register, edit, and login users :).

I need to use later things from aimeos like: if user buyed product xy, he become group xy for frontendaccess for another site :)

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

Re: Extern Userdatabase

Post by aimeos » 18 Jun 2021, 05:45

Shopmister wrote: 16 Jun 2021, 12:36 The second i tryed, but i think im not good anough and will use , first only fe_users and fe_groups in external database. In an own typo3installation with fe_managerextension to register, edit, and login users :).
From the Aimeos point of view it's described here:
https://aimeos.org/docs/latest/infrastr ... -databases

For TYPO3 you have to adapt the TableMapping in LocalConfiguration.php:
https://aimeos.org/docs/latest/typo3/op ... #databases
Shopmister wrote: 16 Jun 2021, 12:36 I need to use later things from aimeos like: if user buyed product xy, he become group xy for frontendaccess for another site :)
The Email subscription processor is able to do that if you create a product with a (long) subscription period:
https://aimeos.org/docs/latest/cronjobs ... rocessors/
Professional support and custom implementation are available at Aimeos.com
If you like Aimeos, Image give us a star

Shopmister
Posts: 92
Joined: 15 Jan 2021, 11:02

Re: Extern Userdatabase

Post by Shopmister » 05 Jul 2021, 06:34

I think i did it like you said for some days. But now it have this error if the file only exist the resource.php file in config folder:
Return value of Aimeos\MW\Config\Base::includeFile() must be of the type array, int returned
in /home/users/username/www/Typo3_10/Firsttest_july/typo3conf/ext/aimeos/Resources/Libraries/aimeos/aimeos-core/lib/mwlib/src/MW/Config/Base.php line 38

if( !isset( $this->includeCache[$file] ) ) {
$this->includeCache[$file] = include $file;
}

return $this->includeCache[$file];
}
}

at Aimeos\MW\Config\Base->includeFile('/home/users/username/www/Typo3_10/Firsttest_july/typo3conf/ext/ai_overwrite/Resources/Private/Extensions/ai_overwrite/config/resource.php')

And if i have this in:
<?php

'db-customer' => [
'adapter' => 'mysql',
'host' => '127.0.0.1',
'port' => '3306',
'database' => 'database',
'username' => 'database',
'password' => 'pw',
'stmt' => ["SET SESSION sort_buffer_size=2097144; SET NAMES 'utf8mb4'; SET SESSION sql_mode='ANSI'; SET SESSION TRANSACTION ISOLATION LEVEL READ COMMITTED"],
'limit' => 2,
'opt-persistent' => 0
],

I became tat error:
syntax error, unexpected '=>' (T_DOUBLE_ARROW)
in /home/users/username/www/Typo3_10/Firsttest_july/typo3conf/ext/ai_overwrite/Resources/Private/Extensions/ai_overwrite/config/resource.php line 3

<?php

'db-customer' => [
'adapter' => 'mysql',
'host' => '127.0.0.1',
'port' => '3306',
'database' => 'database',

at Aimeos\MW\Config\Base->includeFile('/home/users/username/www/Typo3_10/Firsttest_july/typo3conf/ext/ai_overwrite/Resources/Private/Extensions/ai_overwrite/config/resource.php')


Maybe this thing hang together with the other:
no overwrituingextension of the aimeos 2021 oeverwriting from your website overwrite templates anymore. But if i create in configfolder of overwrite the resource.php file:
Return value of Aimeos\MW\Config\Base::includeFile() must be of the type array, int returned in /home/users/username/www/Typo3_10/firsttestjuly2/typo3conf/ext/aimeos/Resources/Libraries/aimeos/aimeos-core/lib/mwlib/src/MW/Config/Base.php line 38 if( !isset( $this->includeCache[$file] ) ) { $this->includeCache[$file] = include $file; } return $this->includeCache[$file]; }}at Aimeos\MW\Config\Base->includeFile('/home/users/username/www/Typo3_10/firsttestjuly2/typo3conf/ext/shopoverwrite/Resources/Private/Extensions/shopoverwrite/config/resource.php')in /home/users/username/www/Typo3_10/firsttestjuly2/typo3conf/ext/aimeos/Resources/Libraries/aimeos/aimeos-core/lib/mwlib/src/MW/Config/PHPArray.php line 150 if( $entry->isDir() ) { $config[$key] = $this->load( $config[$key], $filepath ); } elseif( $entry->isFile() ) { $config[$key] = array_replace_recursive( $config[$key], $this->includeFile( $filepath ) ); } }   }                                                           

Shopmister
Posts: 92
Joined: 15 Jan 2021, 11:02

Re: Extern Userdatabase

Post by Shopmister » 06 Jan 2022, 09:28

Hey,
Whatts false on my code guys? From 15th July?

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

Re: Extern Userdatabase

Post by aimeos » 06 Jan 2022, 10:22

You've added invalid PHP syntax, it must be:

Code: Select all

<?php
return [
	'db-customer' => [
		'adapter' => 'mysql',
		'host' => '127.0.0.1',
		'port' => '3306',
		'database' => 'database',
	]
];
Most likely, you can't overwrite the resource definition in:
typo3conf/ext/ai_overwrite/Resources/Private/Extensions/ai_overwrite/config/

Add it instead to:
typo3conf/ext/ai_overwrite/Resources/Private/Config/

The configuration in Resources/Private/Config/ has precedence over Resources/Private/Extensions/ai_overwrite/config/ and the resources are originally defined in typo3conf/ext/aimeos/Resources/Private/Config/
Professional support and custom implementation are available at Aimeos.com
If you like Aimeos, Image give us a star

Shopmister
Posts: 92
Joined: 15 Jan 2021, 11:02

Re: Extern Userdatabase

Post by Shopmister » 07 Jan 2022, 13:03

Thanks,

atm its "Error retrieving data" in aimeos customer modul. WHatts are the requrements for using extern frontend Users with typo3 and aimeos? I have now created an user in an folder on the other installation. An folder with an ID that exist too in the shopinstallation. And same with te usergroup named "customer".

I used that code:


<?php
return [
'db-customer' => [
'adapter' => 'mysql',
'host' => '127.0.0.1',
'port' => 'port ...',
'database' => 'database ...',
'username' => 'username ...',
'password' => 'Finkadink_.33',
'stmt' => ["SET SESSION sort_buffer_size=2097144; SET NAMES 'utf8mb4'; SET SESSION sql_mode='ANSI'; SET SESSION TRANSACTION ISOLATION LEVEL READ COMMITTED"],
'limit' => 2,
'opt-persistent' => 0
]
];


?>


Ps. I added btw an "[" to close the "return" because its needed if i wanted to have no error in frontend. Maybe you forgot in your codesnippet :)

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

Re: Extern Userdatabase

Post by aimeos » 09 Jan 2022, 14:18

Thanks, the missing bracket is fixed now in the orignal post.

Besides the "db-customer" configuration in the resource.php, you only need to set up the PID that should be used:
https://aimeos.org/docs/2021.x/config/m ... id-default
Professional support and custom implementation are available at Aimeos.com
If you like Aimeos, Image give us a star

Shopmister
Posts: 92
Joined: 15 Jan 2021, 11:02

Re: Extern Userdatabase

Post by Shopmister » 11 Jan 2022, 08:37

Besides the "db-customer" configuration in the resource.php, you only need to set up the PID that should be used:
https://aimeos.org/docs/2021.x/config/m ... id-default
Thats in the log
SQLSTATE[42S22]: Column not found: 1054 Unknown column 'mcus.siteid' in 'where clause':
SELECT COUNT(*) AS "count"

I think its not anough to write in the resource.php. It seems something different.
Its not needed a siteid that the aimeos extension with checkout etc. works.
But it seems to need the databasefield from extern. Okay that i can try to add. But i hope its not the siteid whattsa missing for system. Than for sure its not possible to add without Registers are about the aimeos checkout at extern database...

Id didf made that i have exactly same databasetbale fe_users in the extern database from typo3. But a different error in log now and same in customer module:
SQLSTATE[42S02]: Base table or view not found: 1146 Table 'databasename_db87.fe_users_address' doesn't exist:
SELECT

But its existing. I checked that. ANd i import the fe_users table from my aimeos installation. Its same now.

Post Reply