Hallo Zusammen, ich habe aus meinem alten osCommerce Shop meine Kunden importiert und würde gerne, dass die Kunden sich mit dem alten Passwort einloggen können. Die Passwörter sind im osCommerce Shop mit individuellem Salt verschlüsselt, wo der individuelle Salt hinten am Passwort hinter einen Doppelpunkt ( angehängt sind. Ich habe folgenden Passwort-Encoder erstellt. /engine/Shopware/Components/Password/Encoder/Osc.php [code]<?php /**
- Shopware 5
- Copyright © shopware AG
- According to our dual licensing model, this program can be used either
- under the terms of the GNU Affero General Public License, version 3,
- or under a proprietary license.
- The texts of the GNU Affero General Public License with an additional
- permission and of our proprietary license can be found at and
- in the LICENSE file you have received along with this program.
- This program is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- GNU Affero General Public License for more details.
- „Shopware“ is a registered trademark of shopware AG.
- The licensing of the program under the AGPLv3 does not imply a
- trademark license. Therefore any rights, title and interest in
- our trademarks remain entirely with us.
*/
namespace Shopware\Components\Password\Encoder;
/**
-
@category Shopware
-
@package Shopware\Components\Password\Encoder
-
@copyright Copyright © shopware AG (http://www.shopware.de)
*/
class Osc implements PasswordEncoderInterface
{/**
-
@return string
*/
public function getName()
{
return ‚Osc‘;
}
/**
-
@param string $password
-
@param string $hash
-
@return bool
*/
public function isPasswordValid($password, $hash)
{
if (strpos($hash, ‚:‘) === false) {
return $hash == md5($password);
}
list($md5, $salt) = explode(’:’, $hash);return $md5 == md5($salt . $password) . ‚:‘ . $salt;
}
/**
- @param string $password
-
@return string
*/
public function encodePassword($password)
{
return md5($password);
}
/**
- @param string $hash
-
@return bool
*/
public function isReencodeNeeded($hash)
{
return false;
}
}[/code]
-
@return string
In folgender Datei:
/engine/Shopware/Plugins/Default/Core/PasswordEncoder/Bootstrap.php
habe ich folgendes hinzugefügt:
$hashes[] = new Shopware\Components\Password\Encoder\Osc();
Ich habe in der Tabelle: s_user im Feld encoder „osc“ eingetragen.
Wenn ich mich nun einloggen möchte erhalte ich einen Fehler:;
Ups! Ein Fehler ist aufgetreten!
Im Log habe ich folgende Meldung:
[2015-06-09 22:32:13] core.ERROR: exception 'Exception' with message 'Encoder by name osc not found' in /kunden/12345_67890/webseiten/homepage/shop/engine/Shopware/Components/Password/Manager.php:79 Stack trace: #0 /kunden/12345_67890/webseiten/homepage/shop/engine/Shopware/Components/Password/Manager.php(130): Shopware\Components\Password\Manager->getEncoderByName('osc') #1 /kunden/12345\_67890/webseiten/homepage/shop/engine/Shopware/Core/sAdmin.php(1288): Shopware\Components\Password\Manager-\>isPasswordValid('########', '340579492dc838d...', 'osc') #2 /kunden/12345\_67890/webseiten/homepage/shop/engine/Shopware/Controllers/Frontend/Account.php(315): sAdmin-\>sLogin() #3 /kunden/12345\_67890/webseiten/homepage/shop/engine/Library/Enlight/Controller/Action.php(159): Shopware\_Controllers\_Frontend\_Account-\>loginAction() #4 /kunden/12345\_67890/webseiten/homepage/shop/engine/Library/Enlight/Controller/Dispatcher/Default.php(524): Enlight\_Controller\_Action-\>dispatch('loginAction') #5 /kunden/12345\_67890/webseiten/homepage/shop/engine/Library/Enlight/Controller/Front.php(227): Enlight\_Controller\_Dispatcher\_Default-\>dispatch(Object(Enlight\_Controller\_Request\_RequestHttp), Object(Enlight\_Controller\_Response\_ResponseHttp)) #6 /kunden/12345\_67890/webseiten/homepage/shop/engine/Shopware/Kernel.php(143): Enlight\_Controller\_Front-\>dispatch() #7 /kunden/12345\_67890/webseiten/homepage/shop/vendor/symfony/http-kernel/Symfony/Component/HttpKernel/HttpCache/HttpCache.php(490): Shopware\Kernel-\>handle(Object(Symfony\Component\HttpFoundation\Request), 1, true) #8 /kunden/12345\_67890/webseiten/homepage/shop/engine/Shopware/Components/HttpCache/AppCache.php(255): Symfony\Component\HttpKernel\HttpCache\HttpCache-\>forward(Object(Symfony\Component\HttpFoundation\Request), true, NULL) #9 /kunden/12345\_67890/webseiten/homepage/shop/vendor/symfony/http-kernel/Symfony/Component/HttpKernel/HttpCache/HttpCache.php(261): Shopware\Components\HttpCache\AppCache-\>forward(Object(Symfony\Component\HttpFoundation\Request), true) #10 /kunden/12345\_67890/webseiten/homepage/shop/vendor/symfony/http-kernel/Symfony/Component/HttpKernel/HttpCache/HttpCache.php(278): Symfony\Component\HttpKernel\HttpCache\HttpCache-\>pass(Object(Symfony\Component\HttpFoundation\Request), true) #11 /kunden/12345\_67890/webseiten/homepage/shop/engine/Shopware/Components/HttpCache/AppCache.php(133): Symfony\Component\HttpKernel\HttpCache\HttpCache-\>invalidate(Object(Symfony\Component\HttpFoundation\Request), true) #12 /kunden/12345\_67890/webseiten/homepage/shop/vendor/symfony/http-kernel/Symfony/Component/HttpKernel/HttpCache/HttpCache.php(207): Shopware\Components\HttpCache\AppCache-\>invalidate(Object(Symfony\Component\HttpFoundation\Request), true) #13 /kunden/12345\_67890/webseiten/homepage/shop/engine/Shopware/Components/HttpCache/AppCache.php(114): Symfony\Component\HttpKernel\HttpCache\HttpCache-\>handle(Object(Symfony\Component\HttpFoundation\Request), 1, true) #14 /kunden/12345\_67890/webseiten/homepage/shop/shopware.php(101): Shopware\Components\HttpCache\AppCache-\>handle(Object(Symfony\Component\HttpFoundation\Request)) #15 {main} [] {"uid":"2322749"}
Was habe ich vergessen oder falsch gemacht? Ich danke für Eure Hilfe!! Danke & Gruß Daniel