Show error notice when email is sent from unauthorized email

[MAILPOET-1787]
This commit is contained in:
Ján Mikláš
2019-02-19 16:45:47 +01:00
committed by M. Shull
parent 79bd178123
commit f5feb032fe
8 changed files with 56 additions and 10 deletions

View File

@@ -73,6 +73,7 @@ class Menu {
$this->subscribers_over_limit = $subscribers_feature->check();
$this->checkMailPoetAPIKey();
$this->checkPremiumKey();
$this->checkFromEmailAuthorization();
add_action(
'admin_menu',
@@ -836,6 +837,13 @@ class Menu {
$this->premium_key_valid = $checker->isPremiumKeyValid($show_notices);
}
function checkFromEmailAuthorization(ServicesChecker $checker = null) {
if (self::isOnMailPoetAdminPage()) {
$checker = $checker ?: new ServicesChecker();
$checker->isFromEmailAuthorized(true);
}
}
function getLimitPerPage($model = null) {
if ($model === null) {
return Listing\Handler::DEFAULT_LIMIT_PER_PAGE;