Getestet mit und ohne htaccess, mit und ohne aktive CSRF. Das Ergebnis bleibt dasselbe: “Unauthorized”.
Eigenltich ist das Entwicklungssystem noch hinter einem htaccess, nur vorsichtshalber mal ohne getestet.
Folgender Controller:
use Shopware\Components\CSRFWhitelistAware;
class Shopware_Controllers_Backend_DetailDescriptionImage extends Shopware_Controllers_Backend_ExtJs implements CSRFWhitelistAware{
public function getWhitelistedCSRFActions()
{
return [
'getListQuery',
'addVorteile',
'indexAction',
];
}
public function indexAction(){
die("test");
}
public function addVorteileAction(){
$title = $this->Request()->getParam('title');
$vorteil = $this->Request()->getParam('vorteil');
error_log($title);
error_log($vorteil);
$this->View()->assign([
'success' => true,
]);
}
public function getVorteileAction(){
$articleID = $this->Request()->getParam('articleID');
error_log("getVorteile: ".$articleID);
die("ok");
}
public function removeVorteileAction(){
$articleID = $this->Request()->getParam('articleID');
die("ok");
}
public function getListQueryAction(){
error_log("getListQuery");
die("ok");
}
}
Folgende Meldung wirft Shopware auf die Anfrage:
Ups! Ein Fehler ist aufgetreten!
Die nachfolgenden Hinweise sollten Ihnen weiterhelfen.
Unauthorized in engine/Shopware/Plugins/Default/Backend/Auth/Bootstrap.php on line 208
Stack trace:
#0 engine/Library/Enlight/Event/Handler/Plugin.php(149): Shopware_Plugins_Backend_Auth_Bootstrap->onPreDispatchBackend(Object(Enlight_Controller_ActionEventArgs))
#1 custom/plugins/FroshProfiler/Components/Event/EventManager.php(296): Enlight_Event_Handler_Plugin->execute(Object(Enlight_Controller_ActionEventArgs))
#2 custom/plugins/FroshProfiler/Components/Event/EventManager.php(84): FroshProfiler\Components\Event\EventManager->parentNotify('Enlight_Control...', Object(Enlight_Controller_ActionEventArgs))
#3 engine/Library/Enlight/Controller/Action.php(171): FroshProfiler\Components\Event\EventManager->notify('Enlight_Control...', Object(Enlight_Controller_ActionEventArgs))
#4 engine/Library/Enlight/Controller/Dispatcher/Default.php(549): Enlight_Controller_Action->dispatch('addVorteileActi...')
#5 engine/Library/Enlight/Controller/Front.php(222): Enlight_Controller_Dispatcher_Default->dispatch(Object(Enlight_Controller_Request_RequestHttp), Object(Enlight_Controller_Response_ResponseHttp))
#6 engine/Shopware/Kernel.php(202): Enlight_Controller_Front->dispatch()
#7 vendor/symfony/http-kernel/HttpCache/SubRequestHandler.php(102): Shopware\Kernel->handle(Object(Symfony\Component\HttpFoundation\Request), 1, true)
#8 vendor/symfony/http-kernel/HttpCache/HttpCache.php(448): Symfony\Component\HttpKernel\HttpCache\SubRequestHandler::handle(Object(Shopware\Kernel), Object(Symfony\Component\HttpFoundation\Request), 1, true)
#9 engine/Shopware/Components/HttpCache/AppCache.php(268): Symfony\Component\HttpKernel\HttpCache\HttpCache->forward(Object(Symfony\Component\HttpFoundation\Request), true, NULL)
#10 vendor/symfony/http-kernel/HttpCache/HttpCache.php(238): Shopware\Components\HttpCache\AppCache->forward(Object(Symfony\Component\HttpFoundation\Request), true)
#11 vendor/symfony/http-kernel/HttpCache/HttpCache.php(255): Symfony\Component\HttpKernel\HttpCache\HttpCache->pass(Object(Symfony\Component\HttpFoundation\Request), true)
#12 engine/Shopware/Components/HttpCache/AppCache.php(143): Symfony\Component\HttpKernel\HttpCache\HttpCache->invalidate(Object(Symfony\Component\HttpFoundation\Request), true)
#13 vendor/symfony/http-kernel/HttpCache/HttpCache.php(181): Shopware\Components\HttpCache\AppCache->invalidate(Object(Symfony\Component\HttpFoundation\Request), true)
#14 engine/Shopware/Components/HttpCache/AppCache.php(116): Symfony\Component\HttpKernel\HttpCache\HttpCache->handle(Object(Symfony\Component\HttpFoundation\Request), 1, true)
#15 shopware.php(122): Shopware\Components\HttpCache\AppCache->handle(Object(Symfony\Component\HttpFoundation\Request))
#16 {main}
Shopware Core Log:
[2019-01-29 15:44:29] core.CRITICAL: Unauthorized {“uid”:“22f3d28”}
[2019-01-29 15:44:29] core.CRITICAL: Unauthorized {“uid”:“22f3d28”}
[2019-01-29 15:44:29] core.ERROR: Enlight_Controller_Exception: Unauthorized in /var/www/shopware/ …