简体   繁体   中英

Change user's salted password from external PHP application in TYPO3 7.6

I've upgraded a TYPO3 site from 6.2 to 7.6 LTS which now runs under a PHP 7.0 installation just fine. I also have a PHP application which I use to change a user's salted password (fe_user). The following code in my application worked fine under the 6.2 installation:

require Yii::app()->params['typo3Path'] . 'typo3/sysext/core/Classes/Core/Bootstrap.php';
define('TYPO3_MODE', 'FE');
\TYPO3\CMS\Core\Core\Bootstrap::getInstance()
    baseSetup('typo3/')
    loadConfigurationAndInitialize();

But now in the 7.6 installation, this code throws an exception:

Class 'TYPO3\CMS\Core\Core\ApplicationContext' not found

Any ideas? Is there an "official" way to change a TYPO3 user's password from an API or something?

  1. There's no official API to change a User's password from outside of Typo3.

  2. If you absolutely must handle user data outside of Typo3, you should probably look into switching to an external authentication mechanism alltogether. There's a bunch of extensions for that in the TER (OpenID, LDAP/Active Directory, SAML come to mind)

  3. If you still want to go the unofficial route, why would you instantiate the whole Typo3 Framework when you already have another framework in place? Just access the database table and change the password. The algorithm used to build the password hash is properly documented. By default Typo3 uses PBKDF2 to generate the hash these days.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM