当前位置: 首页>>代码示例>>PHP>>正文


PHP log_ip函数代码示例

本文整理汇总了PHP中log_ip函数的典型用法代码示例。如果您正苦于以下问题:PHP log_ip函数的具体用法?PHP log_ip怎么用?PHP log_ip使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。


在下文中一共展示了log_ip函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: ban_ip

function ban_ip()
{
    // Add the IP address to the blacklist file
    $bfh = fopen(SANDTRAP_BLACKLIST, "at");
    fwrite($bfh, $_SERVER['REMOTE_ADDR'] . "\n");
    fclose($bfh);
    log_ip();
    show_banned_message();
    halt();
}
开发者ID:highestgoodlikewater,项目名称:SandTrap,代码行数:10,代码来源:sandtrap.php

示例2: activate

                if ($fresh_system === FALSE) {
                    // Stop all other script activity until the user actually starts the system.
                    // This is useful when recoving from an unknown error or crash.
                    activate(TIMEKOINSYSTEM, 0);
                }
                // All match, set login variable and store username in cookie
                $_SESSION["login_username"] = $http_username;
                $_SESSION["valid_login"] = TRUE;
                header("Location: index.php?menu=home");
                exit;
            }
        }
        // Log invalid attempts
        write_log("Invalid Login from IP: " . $_SERVER['REMOTE_ADDR'] . " trying Username:[" . $http_username . "] with Password:[" . $http_password . "]", "GU");
    }
    log_ip("GU", scale_trigger(3));
    // Avoid flood-brute password guessing
    sleep(1);
    // One second delay to help prevent brute force attack
    login_screen("Login Failed");
    exit;
}
if ($_SESSION["valid_login"] == TRUE) {
    //****************************************************************************
    if (mysql_connect(MYSQL_IP, MYSQL_USERNAME, MYSQL_PASSWORD) == FALSE) {
        home_screen('ERROR', '<font color="red"><strong>Could Not Connect To Database</strong></font>', '', '');
        exit;
    }
    if (mysql_select_db(MYSQL_DATABASE) == FALSE) {
        home_screen('ERROR', '<font color="red"><strong>Could Not Select Database</strong></font>', '', '');
        exit;
开发者ID:LoveLeAnon,项目名称:timekoin,代码行数:31,代码来源:index.php

示例3: mysql_connect

//***********************************************************************************
//***********************************************************************************
if (TREASURER_DISABLED == TRUE || TIMEKOIN_DISABLED == TRUE) {
    // This has been disabled
    exit;
}
//***********************************************************************************
//***********************************************************************************
mysql_connect(MYSQL_IP, MYSQL_USERNAME, MYSQL_PASSWORD);
mysql_select_db(MYSQL_DATABASE);
// Check for banned IP address
if (ip_banned($_SERVER['REMOTE_ADDR']) == TRUE) {
    // Sorry, your IP address has been banned :(
    exit("Your IP Has Been Banned");
}
log_ip("TR", 100);
while (1) {
    set_time_limit(99);
    //***********************************************************************************
    $loop_active = mysql_result(mysql_query("SELECT * FROM `main_loop_status` WHERE `field_name` = 'treasurer_heartbeat_active' LIMIT 1"), 0, "field_data");
    // Check script status
    if ($loop_active === FALSE) {
        // Time to exit
        mysql_query("UPDATE `main_loop_status` SET `field_data` = '0' WHERE `main_loop_status`.`field_name` = 'balance_heartbeat_active' LIMIT 1");
        exit;
    } else {
        if ($loop_active == 0) {
            // Set the working status of 1
            mysql_query("UPDATE `main_loop_status` SET `field_data` = '1' WHERE `main_loop_status`.`field_name` = 'treasurer_heartbeat_active' LIMIT 1");
        } else {
            if ($loop_active == 2) {
开发者ID:LoveLeAnon,项目名称:timekoin,代码行数:31,代码来源:treasurer.php

示例4: mysql_connect

//***********************************************************************************
//***********************************************************************************
// Open persistent connection to database
mysql_connect(MYSQL_IP, MYSQL_USERNAME, MYSQL_PASSWORD);
mysql_select_db(MYSQL_DATABASE);
// Check for banned IP address
if (ip_banned($_SERVER['REMOTE_ADDR']) == TRUE) {
    // Sorry, your IP address has been banned :(
    exit;
}
//***********************************************************************************
//***********************************************************************************
// Answer public key balance request that match our hash code
if ($_GET["action"] == "key_balance") {
    $hash_code = substr($_GET["hash"], 0, 256);
    $server_hash_code = mysql_result(mysql_query("SELECT * FROM `options` WHERE `field_name` = 'server_hash_code' LIMIT 1"), 0, "field_data");
    if ($hash_code == $server_hash_code && $server_hash_code != "0") {
        // Grab balance for public key and return back
        $public_key = substr($_POST["public_key"], 0, 500);
        $public_key = filter_sql(base64_decode($public_key));
        echo check_crypt_balance($public_key);
    }
    // Log inbound IP activity
    log_ip("AP");
    exit;
}
//***********************************************************************************
//***********************************************************************************
// Log IP even when not using any functions
log_ip("AP");
开发者ID:LoveLeAnon,项目名称:timekoin,代码行数:30,代码来源:api.php

示例5: mysql_real_escape_string

        if (!isset($_POST['email']) || !isset($_POST['pass'])) {
            $err_msg = '你在搞什么?';
            break;
        }
        $email = mysql_real_escape_string(strtolower($_POST['email']));
        $pass = mysql_real_escape_string($_POST['pass']);
        //检查是密码正确性
        $sql = "SELECT id FROM `user` WHERE `email` = '{$email}' AND `pass` = '{$pass}'";
        $result = mysql_query($sql);
        if (mysql_num_rows($result) == 0) {
            $err_msg = '你输入的密码有误!';
            break;
        }
        if ($row = mysql_fetch_array($result)) {
            //IP
            log_ip($row['id']);
            //密码正确保存cookie
            makecookie($row['id'], isset($_POST['remember']));
            //做跳转
            header('Location: ' . get_protocol_prefix() . "{$BASEURL}/pannel.php");
        } else {
            $err_msg = '抱歉!发生了我们认为不可能发生的错误,请与客服联系!';
            break;
        }
    } while (false);
} else {
    if (checklogin(False) == True) {
        header('Location: ' . get_protocol_prefix() . "{$BASEURL}/pannel.php");
    }
}
?>
开发者ID:hzqim,项目名称:MakeDieSS,代码行数:31,代码来源:login.php

示例6: mysql_connect

        exit;
    }
}
$mysql_link = mysql_connect(MYSQL_IP, MYSQL_USERNAME, MYSQL_PASSWORD);
mysql_select_db(MYSQL_DATABASE);
$context = stream_context_create(array('http' => array('header' => 'Connection: close')));
// Force close socket after complete
ini_set('user_agent', 'Timekoin Server (Main) v' . TIMEKOIN_VERSION);
ini_set('default_socket_timeout', 3);
// Timeout for request in seconds
// Check for banned IP address
if (ip_banned($_SERVER['REMOTE_ADDR']) == TRUE) {
    // Sorry, your IP address has been banned :(
    exit("Your IP Has Been Banned");
}
log_ip("MA", 100);
while (1) {
    // Set timeout
    set_time_limit(99);
    // Are we to remain active?
    $loop_active = mysql_result(mysql_query("SELECT * FROM `main_loop_status` WHERE `field_name` = 'main_heartbeat_active' LIMIT 1"), 0, "field_data");
    if ($loop_active === FALSE) {
        // Database Error, try to re-establish a connection after 5 seconds
        mysql_close($mysql_link);
        sleep(5);
        $mysql_link = mysql_connect(MYSQL_IP, MYSQL_USERNAME, MYSQL_PASSWORD);
        mysql_select_db(MYSQL_DATABASE);
        // Keep track of errors in case this can't be recovered from
        $datbase_error = TRUE;
        $database_error_counter++;
    } else {
开发者ID:LoveLeAnon,项目名称:timekoin,代码行数:31,代码来源:main.php

示例7: mysql_connect

// Open connection to database
mysql_connect(MYSQL_IP, MYSQL_USERNAME, MYSQL_PASSWORD);
mysql_select_db(MYSQL_DATABASE);
// Check for banned IP address
if (ip_banned($_SERVER['REMOTE_ADDR']) == TRUE) {
    // Sorry, your IP address has been banned :(
    exit;
}
//***********************************************************************************
//***********************************************************************************
// Answer block hash poll
if ($_GET["action"] == "block_hash" && $_GET["block_number"] >= 0) {
    $block_number = intval($_GET["block_number"]);
    echo mysql_result(mysql_query("SELECT hash FROM `transaction_foundation` WHERE `block` = {$block_number} LIMIT 1"), 0, 0);
    // Log inbound IP activity
    log_ip("FO");
    exit;
}
//***********************************************************************************
while (1) {
    set_time_limit(99);
    //***********************************************************************************
    $loop_active = mysql_result(mysql_query("SELECT * FROM `main_loop_status` WHERE `field_name` = 'foundation_heartbeat_active' LIMIT 1"), 0, "field_data");
    // Check script status
    if ($loop_active === FALSE) {
        // Time to exit
        exit;
    } else {
        if ($loop_active == 0) {
            // Set the working status of 1
            mysql_query("UPDATE `main_loop_status` SET `field_data` = '1' WHERE `main_loop_status`.`field_name` = 'foundation_heartbeat_active' LIMIT 1");
开发者ID:LoveLeAnon,项目名称:timekoin,代码行数:31,代码来源:foundation.php

示例8: mysql_result

        }
        $username_hash = mysql_result(mysql_query("SELECT * FROM `options` WHERE `field_name` = 'username' LIMIT 1"), 0, "field_data");
        $password_hash = mysql_result(mysql_query("SELECT * FROM `options` WHERE `field_name` = 'password' LIMIT 1"), 0, "field_data");
        if (hash('sha256', $http_username) == $username_hash) {
            //Username match, check password
            if (hash('sha256', $http_password) == $password_hash) {
                // All match, set login variable and store username in cookie
                $_SESSION["login_username"] = $http_username;
                $_SESSION["valid_login"] = TRUE;
                header("Location: index.php?menu=home");
                exit;
            }
        }
        // Log invalid attempts
        write_log("Invalid Login from IP: " . $_SERVER['REMOTE_ADDR'] . " trying Username:[" . filter_sql($http_username) . "] with Password:[" . filter_sql($http_password) . "]", "GU");
        log_ip("GU", 50);
    }
    sleep(1);
    // One second delay to help prevent brute force attack
    login_screen("Login Failed");
    exit;
}
if ($_SESSION["valid_login"] == TRUE) {
    //****************************************************************************
    if (mysql_connect(MYSQL_IP, MYSQL_USERNAME, MYSQL_PASSWORD) == FALSE) {
        home_screen('ERROR', '<font color="red"><strong>Could Not Connect To Database</strong></font>', '', '');
        exit;
    }
    if (mysql_select_db(MYSQL_DATABASE) == FALSE) {
        home_screen('ERROR', '<font color="red"><strong>Could Not Select Database</strong></font>', '', '');
        exit;
开发者ID:LoveLeAnon,项目名称:timekoin,代码行数:31,代码来源:index.php

示例9: log_ip

                echo "-----status=OK-----domain={$my_server_domain}-----subfolder={$my_server_subfolder}-----port_number={$my_server_port_number}-----";
            }
        } else {
            // Peer not allowed to connect (invalid type)
            echo "-----status=FAILED-----domain";
        }
    }
    // Full Server Check
    // Log inbound IP activity
    log_ip("PL", scale_trigger(200));
    exit;
}
//***********************************************************************************
//***********************************************************************************
// External Flood Protection
log_ip("PL", scale_trigger(4));
//***********************************************************************************
// First time run check
$loop_active = mysql_result(mysql_query("SELECT field_data FROM `main_loop_status` WHERE `field_name` = 'peerlist_heartbeat_active' LIMIT 1"), 0, 0);
$last_heartbeat = mysql_result(mysql_query("SELECT field_data FROM `main_loop_status` WHERE `field_name` = 'peerlist_last_heartbeat' LIMIT 1"), 0, 0);
if ($loop_active === FALSE && $last_heartbeat == 1) {
    // Create record to begin loop
    mysql_query("INSERT INTO `main_loop_status` (`field_name` ,`field_data`)VALUES ('peerlist_heartbeat_active', '0')");
    // Update timestamp for starting
    mysql_query("UPDATE `main_loop_status` SET `field_data` = '" . time() . "' WHERE `main_loop_status`.`field_name` = 'peerlist_last_heartbeat' LIMIT 1");
} else {
    // Record already exist, called while another process of this script
    // was already running.
    exit;
}
ini_set('user_agent', 'Timekoin Server (Peerlist) v' . TIMEKOIN_VERSION);
开发者ID:LoveLeAnon,项目名称:timekoin,代码行数:31,代码来源:peerlist.php

示例10: intval

    exit;
}
//***********************************************************************************
//***********************************************************************************
// Answer block hash poll
if ($_GET["action"] == "block_hash" && $_GET["block_number"] >= 0) {
    $block_number = intval($_GET["block_number"]);
    echo mysql_result(mysql_query("SELECT hash FROM `transaction_foundation` WHERE `block` = {$block_number} LIMIT 1"), 0, 0);
    // Log inbound IP activity
    log_ip("FO", 1);
    exit;
}
//***********************************************************************************
//***********************************************************************************
// External Flood Protection
log_ip("FO", scale_trigger(4));
//***********************************************************************************
// First time run check
$loop_active = mysql_result(mysql_query("SELECT field_data FROM `main_loop_status` WHERE `field_name` = 'foundation_heartbeat_active' LIMIT 1"), 0, 0);
$last_heartbeat = mysql_result(mysql_query("SELECT field_data FROM `main_loop_status` WHERE `field_name` = 'foundation_last_heartbeat' LIMIT 1"), 0, 0);
if ($loop_active === FALSE && $last_heartbeat == 1) {
    // Create record to begin loop
    mysql_query("INSERT INTO `main_loop_status` (`field_name` ,`field_data`)VALUES ('foundation_heartbeat_active', '0')");
    // Update timestamp for starting
    mysql_query("UPDATE `main_loop_status` SET `field_data` = '" . time() . "' WHERE `main_loop_status`.`field_name` = 'foundation_last_heartbeat' LIMIT 1");
} else {
    // Record already exist, called while another process of this script
    // was already running.
    exit;
}
ini_set('default_socket_timeout', 3);
开发者ID:LoveLeAnon,项目名称:timekoin,代码行数:31,代码来源:foundation.php

示例11: ls

echo "</div>";
echo "<div id=\"left_side\">";
$vettore = ls("*", "./db/", false);
$lungh_array = count($vettore);
$text = "";
$trovati = array();
$cercato = htmlspecialchars($_GET['cer']);
$xss = false;
//controlli sulla stringa cercata:
if (strlen($cercato) <= 3) {
    log_ip("searched tiny=> {$cercato}");
    $cercato = "";
}
if (stristr($cercato, "&lt;")) {
    $xss = true;
    log_ip("***XSStry=> {$cercato}");
    $cercato = "";
}
if (is_numeric($cercato)) {
    $cercato = "";
}
if (!($cercato == "")) {
    for ($i = 0; $i < $lungh_array; ++$i) {
        //$i=1;
        $f = fopen("./db/" . $vettore[$i], "r");
        $text .= fgets($f);
        fclose($f);
        //regexp per pulire il testo dai tag
        $text = preg_replace('/<(.+?)>/', " ", $text);
        if (stristr($text, $cercato)) {
            array_push($trovati, $i);
开发者ID:vikkio88,项目名称:virublog,代码行数:31,代码来源:cerca.php

示例12: call_script

        call_script("watchdog.php", 0);
        header("Location: index.php?menu=system&code=2");
        exit;
    } else {
        header("Location: index.php?menu=system&code=89");
        exit;
    }
}
$mysql_link = mysql_connect(MYSQL_IP, MYSQL_USERNAME, MYSQL_PASSWORD);
mysql_select_db(MYSQL_DATABASE);
// Check for banned IP address
if (ip_banned($_SERVER['REMOTE_ADDR']) == TRUE) {
    // Sorry, your IP address has been banned :(
    exit("Your IP Has Been Banned");
}
log_ip("WA", 25);
// Avoid flood loading system process
while (1) {
    // Set timeout
    set_time_limit(300);
    // Are we to remain active?
    $loop_active = mysql_result(mysql_query("SELECT field_data FROM `main_loop_status` WHERE `field_name` = 'watchdog_heartbeat_active' LIMIT 1"), 0, 0);
    if ($loop_active === FALSE) {
        // Database Error, try to re-establish a connection after 5 seconds
        mysql_close($mysql_link);
        sleep(5);
        $mysql_link = mysql_connect(MYSQL_IP, MYSQL_USERNAME, MYSQL_PASSWORD);
        mysql_select_db(MYSQL_DATABASE);
        // Keep track of errors in case this can't be recovered from
        $datbase_error = TRUE;
        $database_error_counter++;
开发者ID:LoveLeAnon,项目名称:timekoin,代码行数:31,代码来源:watchdog.php

示例13: write_log

                    }
                } else {
                    write_log("More Than 100 Transactions Trying to Queue from IP: " . $_SERVER['REMOTE_ADDR'] . " for Public Key: " . base64_encode($transaction_public_key), "QC");
                }
            } else {
                write_log("Invalid Transaction Queue Data Discarded from IP: " . $_SERVER['REMOTE_ADDR'] . " for Public Key: " . base64_encode($transaction_public_key), "QC");
            }
        } else {
            // Respond that the transaction is already in the queue
            echo "DUP";
        }
    }
    // End time allowed check
    //Direct Input Transaction get a 2x count boost
    //to help prevent direct Transaction spamming
    log_ip("QU", 2);
    exit;
}
//***********************************************************************************
while (1) {
    set_time_limit(99);
    //***********************************************************************************
    $loop_active = mysql_result(mysql_query("SELECT * FROM `main_loop_status` WHERE `field_name` = 'queueclerk_heartbeat_active' LIMIT 1"), 0, "field_data");
    // Check script status
    if ($loop_active === FALSE) {
        // Time to exit
        exit;
    } else {
        if ($loop_active == 0) {
            // Set the working status of 1
            mysql_query("UPDATE `main_loop_status` SET `field_data` = '1' WHERE `main_loop_status`.`field_name` = 'queueclerk_heartbeat_active' LIMIT 1");
开发者ID:LoveLeAnon,项目名称:timekoin,代码行数:31,代码来源:queueclerk.php

示例14: mysql_connect

if (BALANCE_DISABLED == TRUE || TIMEKOIN_DISABLED == TRUE) {
    // This has been disabled
    exit;
}
//***********************************************************************************
//***********************************************************************************
mysql_connect(MYSQL_IP, MYSQL_USERNAME, MYSQL_PASSWORD);
mysql_select_db(MYSQL_DATABASE);
// Check for banned IP address
if (ip_banned($_SERVER['REMOTE_ADDR']) == TRUE) {
    // Sorry, your IP address has been banned :(
    exit("Your IP Has Been Banned");
}
//***********************************************************************************
// External Flood Protection
log_ip("BA", scale_trigger(4));
//***********************************************************************************
// First time run check
$loop_active = mysql_result(mysql_query("SELECT field_data FROM `main_loop_status` WHERE `field_name` = 'balance_heartbeat_active' LIMIT 1"), 0, 0);
$last_heartbeat = mysql_result(mysql_query("SELECT field_data FROM `main_loop_status` WHERE `field_name` = 'balance_last_heartbeat' LIMIT 1"), 0, 0);
if ($loop_active === FALSE && $last_heartbeat == 1) {
    // Create record to begin loop
    mysql_query("INSERT INTO `main_loop_status` (`field_name` ,`field_data`)VALUES ('balance_heartbeat_active', '0')");
    // Update timestamp for starting
    mysql_query("UPDATE `main_loop_status` SET `field_data` = '" . time() . "' WHERE `main_loop_status`.`field_name` = 'balance_last_heartbeat' LIMIT 1");
} else {
    // Record already exist, called while another process of this script
    // was already running.
    exit;
}
while (1) {
开发者ID:LoveLeAnon,项目名称:timekoin,代码行数:31,代码来源:balance.php

示例15: log_ip

    //Direct Input Transaction get a count boost
    //to help prevent direct Transaction spamming
    if ($transaction_attribute == "T") {
        log_ip("QU", scale_trigger(100));
    } else {
        if ($transaction_attribute == "G") {
            log_ip("QU", scale_trigger(3));
        } else {
            log_ip("QU", scale_trigger(25));
        }
    }
    exit;
}
//***********************************************************************************
// External Flood Protection
log_ip("QU", scale_trigger(10));
//***********************************************************************************
// First time run check
$loop_active = mysql_result(mysql_query("SELECT field_data FROM `main_loop_status` WHERE `field_name` = 'queueclerk_heartbeat_active' LIMIT 1"), 0, 0);
$last_heartbeat = mysql_result(mysql_query("SELECT field_data FROM `main_loop_status` WHERE `field_name` = 'queueclerk_last_heartbeat' LIMIT 1"), 0, 0);
$clone_id = $_GET["clone_id"];
if ($loop_active === FALSE && $last_heartbeat == 1) {
    // Create record to begin loop
    mysql_query("INSERT INTO `main_loop_status` (`field_name` ,`field_data`)VALUES ('queueclerk_heartbeat_active', '0')");
    // Update timestamp for starting
    mysql_query("UPDATE `main_loop_status` SET `field_data` = '" . time() . "' WHERE `main_loop_status`.`field_name` = 'queueclerk_last_heartbeat' LIMIT 1");
} else {
    if (empty($clone_id) == TRUE) {
        // Record already exist, called while another process of this script
        // was already running.
        exit;
开发者ID:LoveLeAnon,项目名称:timekoin,代码行数:31,代码来源:queueclerk.php


注:本文中的log_ip函数示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。