예제 #1
0
파일: ebpls.lib.php 프로젝트: laiello/ebpls
function setCurrentActivityLog($strAction = null)
{
    include 'includes/variables.php';
    global $ThUserData, $HTTP_SERVER_VARS;
    if (getenv('HTTP_X_FORWARDED_FOR')) {
        $remoteip = getenv('HTTP_X_FORWARDED_FOR');
    } else {
        $remoteip = getenv('REMOTE_ADDR');
    }
    if (empty($ThUserData['id'])) {
        $result = FALSE;
    } else {
        $strPostVarData = isset($strPostVarData) ? $strPostVarData : array();
        //2008.05.06 Create array if not defined
        foreach ($GLOBALS['HTTP_POST_VARS'] as $key => $val) {
            $strPostVarData[] = "{$key} = {$val}";
            //$strPostVarData[] = "$key = $val";
        }
        if (is_array($strPostVarData)) {
            $strPostVarData = implode('|-|', $strPostVarData);
        }
        $strUpdatePostVar = $strPostVarData ? "postvarval = '{$strPostVarData}'," : "";
        $intPartId = empty($GLOBALS['part']) ? getCurrFilePartNum() : $GLOBALS['part'];
        $levele = crypt_md5($ThUserData['level'], $decoder);
        //             $strQuqery = mysql_query("INSERT INTO ebpls_activity_log SET
        //                 userid = '" . $ThUserData[id] . "',
        //                 userlevel = '" .$levele . "',
        //                 username = '******',
        //                 part_constant_id = '" . $intPartId . "',
        //                 querystring = '" . $GLOBALS['HTTP_SERVER_VARS']['QUERY_STRING'] . "',
        //                 postvarval = '" . $strUpdatePostVar . "',
        //                 action = '$strAction',
        //                 remoteip = '$remoteip',
        //                 lastupdated = NOW()
        //                 ");
        ActiveLogin($ThUserData['id']);
    }
    if (!isset($result)) {
        $result = 0;
    }
    //2008.04.25
    return $result;
}
예제 #2
0
파일: index.php 프로젝트: laiello/ebpls
}
/*
*/
include_once getFilename($part);
if ($part != 1) {
    require_once "includes/eBPLS_footer.php";
}
if ($GLOBALS['watbrowser'] == 'msie') {
    // log this system activity for ie
    if ($ThUserData[id] != '') {
        foreach ($GLOBALS['HTTP_POST_VARS'] as $key => $val) {
            $strPostVarData[] = "{$key} = {$val}";
        }
        //if (is_array($strPostVarData)) $strPostVarData = implode('|-|', $strPostVarData);
        $strUpdatePostVar = $strPostVarData ? "postvarval = '{$strPostVarData}'," : "";
        $intPartId = empty($GLOBALS['part']) ? getCurrFilePartNum() : $GLOBALS['part'];
        $getun = mysql_query("select * from ebpls_user where id = '{$ThUserData['id']}'");
        $geth = mysql_fetch_assoc($getun);
        $levele = crypt_md5($geth[level], $decoder);
        $username = $geth[username];
        // echo crypt_md5($geth[level],$decoder);
        $be1 = $GLOBALS[HTTP_SERVER_VARS] . $GLOBALS[QUERY_STRING];
        $strQuqery = mysql_query("INSERT INTO ebpls_activity_log SET\n                userid = '{$ThUserData['id']}',\n                userlevel = '{$levele}' ,\n                username = '******'username']}' ,\n                part_constant_id = '{$intPartId} ',\n                querystring = '{$be1}',\n                {$strUpdatePostVar}\n                action = '{$strAction}',\n                remoteip = '{$remoteip}',\n                lastupdated = NOW()\n                ");
    }
} else {
    $thStrLogAction = isset($thStrLogAction) ? $thStrLogAction : '';
    //2008.05.06
    if ($intUserLevel > -1) {
        setCurrentActivityLog($thStrLogAction);
    }
}