|
| 1 | +<?php |
| 2 | + |
| 3 | +namespace Detain\MyAdminAuthorizeNet; |
| 4 | + |
| 5 | +use Symfony\Component\EventDispatcher\GenericEvent; |
| 6 | + |
| 7 | +class Plugin { |
| 8 | + |
| 9 | + public static $name = 'AuthorizeNet Plugin'; |
| 10 | + public static $description = 'Allows handling of AuthorizeNet emails and honeypots'; |
| 11 | + public static $help = ''; |
| 12 | + public static $type = 'plugin'; |
| 13 | + |
| 14 | + |
| 15 | + public function __construct() { |
| 16 | + } |
| 17 | + |
| 18 | + public static function getHooks() { |
| 19 | + return [ |
| 20 | + 'system.settings' => [__CLASS__, 'getSettings'], |
| 21 | + 'ui.menu' => [__CLASS__, 'getMenu'], |
| 22 | + ]; |
| 23 | + } |
| 24 | + |
| 25 | + public static function getMenu(GenericEvent $event) { |
| 26 | + $menu = $event->getSubject(); |
| 27 | + if ($GLOBALS['tf']->ima == 'admin') { |
| 28 | + function_requirements('has_acl'); |
| 29 | + if (has_acl('client_billing')) |
| 30 | + $menu->add_link('admin', 'choice=none.abuse_admin', '//my.interserver.net/bower_components/webhostinghub-glyphs-icons/icons/development-16/Black/icon-spam.png', 'AuthorizeNet'); |
| 31 | + } |
| 32 | + } |
| 33 | + |
| 34 | + public static function getRequirements(GenericEvent $event) { |
| 35 | + $loader = $event->getSubject(); |
| 36 | + $loader->add_requirement('class.AuthorizeNet', '/../vendor/detain/myadmin-authorizenet-payments/src/AuthorizeNet.php'); |
| 37 | + $loader->add_requirement('deactivate_kcare', '/../vendor/detain/myadmin-authorizenet-payments/src/abuse.inc.php'); |
| 38 | + $loader->add_requirement('deactivate_abuse', '/../vendor/detain/myadmin-authorizenet-payments/src/abuse.inc.php'); |
| 39 | + $loader->add_requirement('get_abuse_licenses', '/../vendor/detain/myadmin-authorizenet-payments/src/abuse.inc.php'); |
| 40 | + } |
| 41 | + |
| 42 | + public static function getSettings(GenericEvent $event) { |
| 43 | + $settings = $event->getSubject(); |
| 44 | + $settings->add_text_setting('General', 'AuthorizeNet', 'abuse_imap_user', 'AuthorizeNet IMAP User:', 'AuthorizeNet IMAP Username', ABUSE_IMAP_USER); |
| 45 | + $settings->add_text_setting('General', 'AuthorizeNet', 'abuse_imap_pass', 'AuthorizeNet IMAP Pass:', 'AuthorizeNet IMAP Password', ABUSE_IMAP_PASS); |
| 46 | + } |
| 47 | + |
| 48 | +} |
0 commit comments