Exemple #1
0
function antibruteforce_core_after_route(OW_Event $event)
{
    if (OW::getUser()->isAuthenticated()) {
        return;
    }
    $classDir = OW::getPluginManager()->getPlugin('antibruteforce')->getClassesDir();
    $handler = OW::getRequestHandler()->getHandlerAttributes();
    if (OW::getConfig()->getValue('antibruteforce', 'authentication')) {
        include_once $classDir . 'sign_in.php';
        include_once $classDir . 'auth_result.php';
    }
    if (OW::getConfig()->getValue('antibruteforce', 'registration')) {
        if ($handler[OW_RequestHandler::ATTRS_KEY_CTRL] == 'BASE_CTRL_Join' && $handler[OW_RequestHandler::ATTRS_KEY_ACTION] == 'index') {
            OW::getEventManager()->bind(OW_EventManager::ON_FINALIZE, 'antibruteforce_core_finalize');
        } else {
            if ($handler[OW_RequestHandler::ATTRS_KEY_CTRL] == 'BASE_CTRL_Captcha' && $handler[OW_RequestHandler::ATTRS_KEY_ACTION] == 'ajaxResponder') {
                include_once $classDir . 'captcha.php';
            }
        }
    }
    if ($handler[OW_RequestHandler::ATTRS_KEY_CTRL] != 'ANTIBRUTEFORCE_CTRL_Antibruteforce') {
        if (ANTIBRUTEFORCE_BOL_Service::getInstance()->isLocked()) {
            ANTIBRUTEFORCE_BOL_Service::getInstance()->redirect();
        }
    }
}
Exemple #2
0
 public static function getInstance()
 {
     if (self::$classInstance === null) {
         self::$classInstance = new self();
     }
     return self::$classInstance;
 }
Exemple #3
0
 public function deleteBlockIp()
 {
     ANTIBRUTEFORCE_BOL_Service::getInstance()->deleteBlockIp();
 }
Exemple #4
0
 public function __construct()
 {
     parent::__construct();
     $this->service = ANTIBRUTEFORCE_BOL_Service::getInstance();
 }