示例#1
0
    protected static $pconfig = array();
    //平台配置
    /**
	 * @return WatchDog 
	 */
    public static function factory($api = 106)
    {
        if (!isset(self::$_instance['WatchDog']) || !is_object(self::$_instance['WatchDog'])) {
            self::$_instance['WatchDog'] = new WatchDog();
        }
        //参数配置
        self::$api = $api;
示例#2
0
<?php

if (cfr('WATCHDOG')) {
    $altercfg = rcms_parse_ini_file(CONFIG_PATH . "alter.ini");
    if ($altercfg['WATCHDOG_ENABLED']) {
        $interface = new WatchDogInterface();
        $interface->loadAllTasks();
        $interface->loadSettings();
        //manual run of existing tasks
        if (wf_CheckGet(array('manual'))) {
            $watchdog = new WatchDog();
            $watchdog->processTask();
            rcms_redirect("?module=watchdog");
        }
        //deleting existing task
        if (wf_CheckGet(array('delete'))) {
            $interface->deleteTask($_GET['delete']);
            rcms_redirect("?module=watchdog");
        }
        //adding new task
        if (wf_CheckPost(array('newname', 'newchecktype', 'newparam', 'newoperator'))) {
            if (isset($_POST['newactive'])) {
                $newActivity = 1;
            } else {
                $newActivity = 0;
            }
            $interface->createTask($_POST['newname'], $_POST['newchecktype'], $_POST['newparam'], $_POST['newoperator'], $_POST['newcondition'], $_POST['newaction'], $newActivity);
            rcms_redirect("?module=watchdog");
        }
        //changing task
        if (wf_CheckPost(array('editname'))) {
示例#3
0
Description: A plugin for helping secure wordpress against attacks.
Author: Eoin Murphy
Version: 0.1
Author URI: http://eoinmurphy.ie
*/
require 'Class/Interfaces/LoggerInterface.php';
require 'Class/FileLogger.php';
require 'Class/Watchdog.php';
require 'Class/Metapod.php';
require 'Class/HtaccessProtect.php';
require 'Lib/Install.php';
//require('Lib/Pluggable.php');
define('METAPOD_DIRECTORY', plugin_dir_path(__FILE__));
define('DS', DIRECTORY_SEPARATOR);
$logger = new FileLogger();
$watchDog = new WatchDog($logger);
$watchDog->watchFiles();
$watchDog->watchLogin();
function metapod_install()
{
    //metapod_create_tables();
    if (strpos($_SERVER['SERVER_SOFTWARE'], 'Apache') !== FALSE) {
        $HtaccessProtect = new HtaccessProtect();
    }
}
add_action('init', 'metapod_init');
function metapod_init()
{
    //$HtaccessProtect = new HtaccessProtect();
}
register_activation_hook(__FILE__, 'metapod_install');
示例#4
0
             }
             log_register('AUTOFREEZE DONE COUNT `' . $freezeCount . '`');
             die('OK:AUTOFREEZE');
         } else {
             die('OK:NO_USERS_TO_AUTOFREEZE');
         }
     } else {
         die('ERROR:NO_AUTOFREEZE_CASH_LIMIT');
     }
 }
 /*
  * Watchdog tasks processing
  */
 if ($_GET['action'] == 'watchdog') {
     if ($alterconf['WATCHDOG_ENABLED']) {
         $runWatchDog = new WatchDog();
         $runWatchDog->processTask();
         die('OK:WATCHDOG');
     } else {
         die('ERROR:NO_WATCHDOG_ENABLED');
     }
 }
 /*
  * UKV charge fee processing
  */
 if ($_GET['action'] == 'ukvfeeprocessing') {
     if ($alterconf['UKV_ENABLED']) {
         $ukvApiRun = new UkvSystem();
         $ukvFee = $ukvApiRun->feeChargeAll();
         die('OK:UKVFEEPROCESSING:' . $ukvFee);
     } else {