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


PHP cms_utils::get_real_ip方法代码示例

本文整理汇总了PHP中cms_utils::get_real_ip方法的典型用法代码示例。如果您正苦于以下问题:PHP cms_utils::get_real_ip方法的具体用法?PHP cms_utils::get_real_ip怎么用?PHP cms_utils::get_real_ip使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在cms_utils的用法示例。


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

示例1: implode

                $homepage = $tmp[0] . '?' . implode('&', $tmp3);
                // and redirect.
                $homepage = html_entity_decode($homepage);
                redirect($homepage);
            }
        }
        return;
        #redirect("index.php");
    } else {
        if (isset($_POST['loginsubmit'])) {
            //No error if changing languages
            $error .= lang('usernameincorrect');
            debug_buffer("Login failed.  Error is: " . $error);
            Events::SendEvent('Core', 'LoginFailed', array('user' => $_POST['username']));
            // put mention into the admin log
            $ip_login_failed = cms_utils::get_real_ip();
            if ($ip_login_failed) {
                // <- Silently ignore audit if return values is not ture, had admin XSS vulne.
                audit('', '(IP: ' . $ip_login_failed . ') ' . "Admin Username: " . $username, 'Login Failed');
            }
            #Now call the event
            //Events::SendEvent('Core', 'LoginPost', $username);
        } else {
            debug_buffer($_POST["loginsubmit"]);
        }
    }
}
// Language shizzle
cms_admin_sendheaders();
header("Content-Language: " . CmsNlsOperations::get_current_language());
//CHANGED
开发者ID:Alexkuva,项目名称:Beaupotager,代码行数:31,代码来源:login.php

示例2: audit

/**
 * Put an event into the audit (admin) log.  This should be
 * done on most admin events for consistency.
 *
 * @since 0.3
 * @param integer The item id (perhaps a content id, or a record id from a module)
 * @param string  The item name (perhaps Content, or the module name)
 * @param string  The action that needs to be audited
 * @return void
 */
function audit($itemid, $itemname, $action)
{
    $db = cmsms()->GetDb();
    $userid = 0;
    $username = '';
    $ip_addr = '';
    if ($itemid == '') {
        $itemid = -1;
    }
    if (isset($_SESSION["cms_admin_user_id"])) {
        $userid = $_SESSION["cms_admin_user_id"];
        $ip_addr = cms_utils::get_real_ip();
    } else {
        if (isset($_SESSION['login_user_id'])) {
            $userid = $_SESSION['login_user_id'];
            $username = $_SESSION['login_user_username'];
        }
    }
    if (isset($_SESSION["cms_admin_username"])) {
        $username = $_SESSION["cms_admin_username"];
    }
    if (!isset($userid) || $userid == "") {
        $userid = 0;
    }
    $query = "INSERT INTO " . cms_db_prefix() . "adminlog (timestamp, user_id, username, item_id, item_name, action, ip_addr) VALUES (?,?,?,?,?,?,?)";
    $db->Execute($query, array(time(), $userid, $username, $itemid, $itemname, $action, $ip_addr));
}
开发者ID:aldrymaulana,项目名称:cmsdepdagri,代码行数:37,代码来源:page.functions.php


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