forked from mautic/mautic
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request mautic#7028 from mautic/release-2.15.0
Release 2.15.0
- Loading branch information
Showing
389 changed files
with
13,104 additions
and
3,367 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
57 changes: 57 additions & 0 deletions
57
app/bundles/ApiBundle/EventListener/RateLimitGenerateKeySubscriber.php
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,57 @@ | ||
<?php | ||
|
||
/* | ||
* @copyright 2014 Mautic Contributors. All rights reserved | ||
* @author Mautic | ||
* | ||
* @link http://mautic.org | ||
* | ||
* @license GNU/GPLv3 http://www.gnu.org/licenses/gpl-3.0.html | ||
*/ | ||
|
||
namespace Mautic\ApiBundle\EventListener; | ||
|
||
use Mautic\CoreBundle\EventListener\CommonSubscriber; | ||
use Mautic\CoreBundle\Helper\CoreParametersHelper; | ||
use Noxlogic\RateLimitBundle\Events\GenerateKeyEvent; | ||
use Noxlogic\RateLimitBundle\Events\RateLimitEvents; | ||
|
||
/** | ||
* Class RateLimitGenerateKeySubscriber. | ||
*/ | ||
class RateLimitGenerateKeySubscriber extends CommonSubscriber | ||
{ | ||
/** | ||
* @var CoreParametersHelper | ||
*/ | ||
protected $coreParametersHelper; | ||
|
||
/** | ||
* RateLimitGenerateKeySubscriber constructor. | ||
* | ||
* @param \Mautic\CoreBundle\Helper\CoreParametersHelper $coreParametersHelper | ||
*/ | ||
public function __construct(CoreParametersHelper $coreParametersHelper) | ||
{ | ||
$this->coreParametersHelper = $coreParametersHelper; | ||
} | ||
|
||
/** | ||
* @return array | ||
*/ | ||
public static function getSubscribedEvents() | ||
{ | ||
return [ | ||
RateLimitEvents::GENERATE_KEY => ['onGenerateKey', 0], | ||
]; | ||
} | ||
|
||
/** | ||
* @param \Noxlogic\RateLimitBundle\Events\GenerateKeyEvent $event | ||
*/ | ||
public function onGenerateKey(GenerateKeyEvent $event) | ||
{ | ||
$suffix = $this->coreParametersHelper->getParameter('site_url'); | ||
$event->addToKey($suffix); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.