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


PHP redirect2page函数代码示例

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


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

示例1: rate_limiter

function rate_limiter(&$log)
{
    $myreturn = false;
    global $dbtable_prefix;
    $where = '';
    if (!empty($log['user_id'])) {
        $where = " AND `fk_user_id`='" . $log['user_id'] . "'";
    } else {
        $where = " AND `ip`='" . $log['ip'] . "' AND `sess`='" . $log['sess'] . "'";
    }
    $query = "SELECT `limit`,`interval`,`punishment`,`fk_lk_id_error_message` FROM `{$dbtable_prefix}rate_limiter` WHERE `level_code`='" . $log['level'] . "' AND `m_value`='" . $log['membership'] . "'";
    if (!($res = @mysql_query($query))) {
        trigger_error(mysql_error(), E_USER_ERROR);
    }
    $punish = array();
    while ($rsrow = mysql_fetch_assoc($res)) {
        $query = "SELECT count(*) FROM `{$dbtable_prefix}site_log` WHERE `level_code`='" . $log['level'] . "' AND `time`>=DATE_SUB('" . gmdate('YmdHis') . "',INTERVAL " . $rsrow['interval'] . " MINUTE) {$where}";
        if (!($res2 = @mysql_query($query))) {
            trigger_error(mysql_error(), E_USER_ERROR);
        }
        if (mysql_result($res2, 0, 0) >= $rsrow['limit']) {
            $punish[$rsrow['punishment']] = $rsrow['fk_lk_id_error_message'];
        }
    }
    if (isset($punish[_PUNISH_BANIP_])) {
        $query = "INSERT IGNORE INTO `{$dbtable_prefix}site_bans` SET `ban_type`=" . _PUNISH_BANIP_ . ",`what`='" . $log['ip'] . "',`reason`='" . $punish[_PUNISH_BANIP_] . "'";
        if (!($res = @mysql_query($query))) {
            trigger_error(mysql_error(), E_USER_ERROR);
        }
        regenerate_ban_array();
    }
    if (isset($punish[_PUNISH_BANUSER_])) {
        $query = "INSERT IGNORE INTO `{$dbtable_prefix}site_bans` SET `ban_type`=" . _PUNISH_BANUSER_ . ",`what`='" . $log['user'] . "',`reason`='" . $punish[_PUNISH_BANUSER_] . "'";
        if (!($res = @mysql_query($query))) {
            trigger_error(mysql_error(), E_USER_ERROR);
        }
        regenerate_ban_array();
    }
    if (isset($punish[_PUNISH_BANEMAIL_])) {
        $query = "INSERT IGNORE INTO `{$dbtable_prefix}site_bans` SET `ban_type`=" . _PUNISH_BANEMAIL_ . ",`what`='" . $log['email'] . "',`reason`='" . $punish[_PUNISH_BANEMAIL_] . "'";
        if (!($res = @mysql_query($query))) {
            trigger_error(mysql_error(), E_USER_ERROR);
        }
        regenerate_ban_array();
    }
    if (isset($punish[_PUNISH_ERROR_])) {
        $topass['message']['type'] = MESSAGE_ERROR;
        $topass['message']['text'] = isset($GLOBALS['_lang'][$punish[_PUNISH_ERROR_]]) ? $GLOBALS['_lang'][$punish[_PUNISH_ERROR_]] : '';
        redirect2page('info.php', $topass);
    } elseif (isset($punish[_PUNISH_UPGRADE_])) {
        $topass['message']['type'] = MESSAGE_ERROR;
        $topass['message']['text'] = isset($GLOBALS['_lang'][$punish[_PUNISH_UPGRADE_]]) ? $GLOBALS['_lang'][$punish[_PUNISH_UPGRADE_]] : '';
        redirect2page(_BASEURL_ . '/info.php?type=access', $topass, '', true);
    }
    return $myreturn;
}
开发者ID:babae,项目名称:etano,代码行数:56,代码来源:logs.inc.php

示例2: mktime

}
$time = mktime(gmdate('H'), gmdate('i'), gmdate('s'), gmdate('m'), gmdate('d'), gmdate('Y'));
if (!empty($_SESSION[_LICENSE_KEY_]['user']['user_id'])) {
    $query = "DELETE FROM `{$dbtable_prefix}online` WHERE `fk_user_id`='" . $_SESSION[_LICENSE_KEY_]['user']['user_id'] . "'";
    if (isset($_on_before_insert)) {
        for ($i = 0; isset($_on_before_insert[$i]); ++$i) {
            call_user_func($_on_before_insert[$i]);
        }
    }
    @mysql_query($query);
    add_member_score($_SESSION[_LICENSE_KEY_]['user']['user_id'], 'login', -1);
    $query = "UPDATE `" . USER_ACCOUNTS_TABLE . "` SET `last_activity`='" . gmdate('YmdHis') . "' WHERE `" . USER_ACCOUNT_ID . "`=" . $_SESSION[_LICENSE_KEY_]['user']['user_id'];
    if (!($res = @mysql_query($query))) {
        trigger_error(mysql_error(), E_USER_ERROR);
    }
    if (isset($_on_after_insert)) {
        for ($i = 0; isset($_on_after_insert[$i]); ++$i) {
            call_user_func($_on_after_insert[$i]);
        }
    }
}
$_SESSION[_LICENSE_KEY_]['user'] = array();
unset($_SESSION[_LICENSE_KEY_]['user']);
$_SESSION[_LICENSE_KEY_]['user']['loginout'] = $time;
header('Expires: Mon,26 Jul 1997 05:00:00 GMT');
header('Last-Modified: ' . gmdate('D,d M Y H:i:s') . ' GMT');
header('Cache-Control: no-store,no-cache,must-revalidate', false);
header('Cache-Control: post-check=0,pre-check=0', false);
header('Pragma: no-cache', false);
redirect2page('index.php');
开发者ID:babae,项目名称:etano,代码行数:30,代码来源:logout.php

示例3: call_user_func

            if (isset($captions_changed[$photo_id])) {
                $query .= ",`caption`='{$caption}'";
                if (!empty($config['manual_photo_approval'])) {
                    $query .= ",`status`=" . STAT_PENDING;
                } else {
                    // leave as it was - whatever it was.
                    //					$query.=",`status`=".STAT_APPROVED;
                }
            }
            $query .= " WHERE `photo_id`={$photo_id} AND `fk_user_id`='" . $_SESSION[_LICENSE_KEY_]['user']['user_id'] . "'";
            if (isset($_on_before_update)) {
                for ($i = 0; isset($_on_before_update[$i]); ++$i) {
                    call_user_func($_on_before_update[$i]);
                }
            }
            if (!($res = @mysql_query($query))) {
                trigger_error(mysql_error(), E_USER_ERROR);
            }
            if (isset($_on_after_update)) {
                for ($i = 0; isset($_on_after_update[$i]); ++$i) {
                    call_user_func($_on_after_update[$i]);
                }
            }
        }
        $topass['message']['type'] = MESSAGE_INFO;
        $topass['message']['text'] = $GLOBALS['_lang'][92];
    }
}
$nextpage = _BASEURL_ . '/' . $nextpage;
redirect2page($nextpage, $topass, '', true);
开发者ID:babae,项目名称:etano,代码行数:30,代码来源:photo_settings.php

示例4: trigger_error

        if (!($res = @mysql_query($query))) {
            trigger_error(mysql_error(), E_USER_ERROR);
        }
        if (mysql_num_rows($res)) {
            $user_ids = mysql_result($res, 0, 0);
            $user_ids = explode(',', $user_ids);
            $key = array_search($uid, $user_ids) + $_GET['go'];
            if (isset($user_ids[$key])) {
                $uid = (int) $user_ids[$key];
            }
        }
    }
} else {
    $topass['message']['type'] = MESSAGE_ERROR;
    $topass['message']['text'] = 'No user selected';
    redirect2page('admin/cpanel.php', $topass);
}
$config = get_site_option(array('datetime_format', 'time_offset'), 'def_user_prefs');
$categs = array();
$account = array();
$query = "SELECT `fk_user_id`,`_photo`,`_user`,`alt_url`,`rad_longitude`,`rad_latitude`,`score`,`status`,`reject_reason`,UNIX_TIMESTAMP(`date_added`) as `date_added`,`del`";
foreach ($_pfields as $field_id => $field) {
    //	if ($field->config['visible']) {
    $query .= ',' . $field->query_select();
    //	}
}
$query .= " FROM `{$dbtable_prefix}user_profiles` WHERE `fk_user_id`={$uid}";
if (!($res = @mysql_query($query))) {
    trigger_error(mysql_error(), E_USER_ERROR);
}
if (mysql_num_rows($res)) {
开发者ID:babae,项目名称:etano,代码行数:31,代码来源:profile.php

示例5: allow_dept

require_once '../../includes/common.inc.php';
require_once '../../includes/admin_functions.inc.php';
allow_dept(DEPT_ADMIN);
$qs = '';
$qs_sep = '';
$topass = array();
$country_id = isset($_GET['country_id']) ? (int) $_GET['country_id'] : 0;
$query = "DELETE FROM `{$dbtable_prefix}loc_cities` WHERE `fk_country_id`={$country_id}";
if (!($res = @mysql_query($query))) {
    trigger_error(mysql_error(), E_USER_ERROR);
}
$query = "DELETE FROM `{$dbtable_prefix}loc_states` WHERE `fk_country_id`={$country_id}";
if (!($res = @mysql_query($query))) {
    trigger_error(mysql_error(), E_USER_ERROR);
}
$query = "DELETE FROM `{$dbtable_prefix}loc_countries` WHERE `country_id`={$country_id}";
if (!($res = @mysql_query($query))) {
    trigger_error(mysql_error(), E_USER_ERROR);
}
$topass['message']['type'] = MESSAGE_INFO;
$topass['message']['text'] = 'Country and all its states and cities deleted.';
if (isset($_GET['o'])) {
    $qs .= $qs_sep . 'o=' . $_GET['o'];
    $qs_sep = '&';
}
if (isset($_GET['r'])) {
    $qs .= $qs_sep . 'r=' . $_GET['r'];
    $qs_sep = '&';
}
redirect2page('admin/loc_countries.php', $topass, $qs);
开发者ID:babae,项目名称:etano,代码行数:30,代码来源:loc_countries_delete.php

示例6: elseif

        } elseif ($rsrow['status'] == STAT_APPROVED) {
            $rsrow['approved'] = true;
        }
        if (empty($rsrow['del'])) {
            unset($rsrow['del']);
        }
        $loop[] = $rsrow;
    }
    $_GET = array('search' => $output['search_md5'], 'sortby' => $sortby);
    $output['pager2'] = pager($totalrows, $o, $r);
    $output['totalrows'] = $totalrows;
}
if (empty($loop)) {
    $topass['message']['type'] = MESSAGE_INFO;
    $topass['message']['text'] = 'No members found meeting your search criteria.';
    redirect2page('admin/member_search.php', $topass);
}
$output['return2me'] = 'member_results.php';
if (!empty($output['search_md5'])) {
    $output['return2me'] .= '?search=' . $output['search_md5'] . "&sortby={$sortby}&o={$o}&r={$r}";
} elseif (!empty($_SERVER['QUERY_STRING'])) {
    $output['return2me'] .= '?' . $_SERVER['QUERY_STRING'];
}
$output['return2me'] = rawurlencode($output['return2me']);
$tpl->set_file('content', 'member_results.html');
$tpl->set_loop('loop', $loop);
$tpl->set_var('output', $output);
$tpl->process('content', 'content', TPL_LOOP | TPL_NOLOOP | TPL_OPTLOOP | TPL_OPTIONAL);
$tpl->drop_loop('loop');
unset($loop);
$tplvars['title'] = 'Search Results';
开发者ID:babae,项目名称:etano,代码行数:31,代码来源:member_results.php

示例7: foreach

                $new_levels[$levels[$l]] += $memberships[$m];
            }
        }
    }
    // save in db
    foreach ($new_levels as $k => $v) {
        $query = "UPDATE `{$dbtable_prefix}access_levels` SET `level`='{$v}' WHERE `level_id`={$k}";
        if (!($res = @mysql_query($query))) {
            trigger_error(mysql_error(), E_USER_ERROR);
        }
    }
    // save in file
    require_once _BASEPATH_ . '/includes/classes/fileop.class.php';
    require_once _BASEPATH_ . '/includes/access_levels.inc.php';
    $query = "SELECT `level_code`,`level` FROM `{$dbtable_prefix}access_levels`";
    if (!($res = @mysql_query($query))) {
        trigger_error(mysql_error(), E_USER_ERROR);
    }
    $towrite = "<?php\n\$GLOBALS['_access_level']=array('auth'=>65534,'all'=>65535";
    while ($rsrow = mysql_fetch_row($res)) {
        $towrite .= ",'" . $rsrow[0] . "'=>" . $rsrow[1];
    }
    $towrite .= ");\n";
    $towrite .= '$GLOBALS[\'_allow_na\']=' . var_export($GLOBALS['_allow_na'], true) . ";\n";
    $fileop = new fileop();
    $fileop->file_put_contents(_BASEPATH_ . '/includes/access_levels.inc.php', $towrite);
    $topass['message']['type'] = MESSAGE_INFO;
    $topass['message']['text'] = 'Access levels changed.';
}
redirect2page('admin/access_levels.php', $topass, $qs);
开发者ID:babae,项目名称:etano,代码行数:30,代码来源:access_levels.php

示例8: elseif

            $val_dif = $max_val - $min_val;
            $yscale = 7;
            for ($i = 4; $i <= 10; ++$i) {
                // find a divisor
                if ($val_dif % $i == 0) {
                    $yscale = $i;
                    break;
                }
            }
            $graph->setProp('scale', 'date');
            $graph->setProp('pointstyle', 7);
            $graph->setColor('pointcolor', -1, 255, 0, 0);
            $graph->setProp('startdate', (int) $min_time);
            $graph->setProp('enddate', (int) $max_time);
            $graph->setProp('xsclpts', 6);
            $graph->setProp('xincpts', 6);
            $graph->setProp('ysclpts', $yscale);
            $graph->setProp('yincpts', $yscale);
            if ($max_time - $min_time <= 365 * 24 * 60 * 60) {
                $graph->setProp('dateformat', 1);
            } elseif ($max_time - $min_time > 365 * 24 * 60 * 60) {
                $graph->setProp('dateformat', 1);
            }
            $graph->setProp('showyear', true);
            $graph->graph();
            $graph->showGraph(_BASEPATH_ . '/tmp/admin/' . $type . $start_date . $end_date . '.png');
            //			$graph->showGraph();
        }
    }
    redirect2page('tmp/admin/' . $type . $start_date . $end_date . '.png');
}
开发者ID:babae,项目名称:etano,代码行数:31,代码来源:graph_dot.php

示例9: rawurlencode

        if (!empty($_SERVER['QUERY_STRING'])) {
            $output['return2me'] .= '?' . $_SERVER['QUERY_STRING'];
        }
        $output['return2me'] = rawurlencode($output['return2me']);
        $tpl->set_file('content', 'message_read.html');
        $tpl->set_var('output', $output);
        $tpl->process('content', 'content', TPL_OPTIONAL);
        if ($output['is_read'] == 0) {
            $query = "UPDATE `{$dbtable_prefix}user_{$mailbox_table}` SET `is_read`=1 WHERE `mail_id`=" . $output['mail_id'] . " AND `fk_user_id`='" . $_SESSION[_LICENSE_KEY_]['user']['user_id'] . "'";
            if (!($res = @mysql_query($query))) {
                trigger_error(mysql_error(), E_USER_ERROR);
            }
        }
    } else {
        $topass['message']['type'] = MESSAGE_ERROR;
        $topass['message']['text'] = $GLOBALS['_lang'][5];
        redirect2page('mailbox.php');
    }
} else {
    $topass['message']['type'] = MESSAGE_ERROR;
    $topass['message']['text'] = $GLOBALS['_lang'][5];
    redirect2page('mailbox.php');
}
$tplvars['title'] = $GLOBALS['_lang'][136];
$tplvars['page_title'] = $GLOBALS['_lang'][136];
$tplvars['page'] = 'message_read';
$tplvars['css'] = 'message_read.css';
if (is_file('message_read_left.php')) {
    include 'message_read_left.php';
}
include 'frame.php';
开发者ID:babae,项目名称:etano,代码行数:31,代码来源:message_read.php

示例10: allow_dept

require_once '../../includes/common.inc.php';
require_once '../../includes/admin_functions.inc.php';
allow_dept(DEPT_ADMIN);
$error = false;
$qs = '';
$qs_sep = '';
$topass = array();
$word_id = isset($_GET['word_id']) ? (int) $_GET['word_id'] : 0;
$query = "DELETE FROM `{$dbtable_prefix}banned_words` WHERE `word_id`={$word_id}";
if (!($res = @mysql_query($query))) {
    trigger_error(mysql_error(), E_USER_ERROR);
}
if (!$error) {
    // save in file
    require_once _BASEPATH_ . '/includes/classes/fileop.class.php';
    $query = "SELECT `word` FROM `{$dbtable_prefix}banned_words`";
    if (!($res = @mysql_query($query))) {
        trigger_error(mysql_error(), E_USER_ERROR);
    }
    $towrite = array();
    for ($i = 0; $i < mysql_num_rows($res); ++$i) {
        $towrite[] = mysql_result($res, $i, 0);
    }
    $towrite = '<?php $_banned_words=' . var_export($towrite, true) . ';';
    $fileop = new fileop();
    $fileop->file_put_contents(_BASEPATH_ . '/includes/banned_words.inc.php', $towrite);
}
$topass['message']['type'] = MESSAGE_INFO;
$topass['message']['text'] = 'Word deleted.';
redirect2page('admin/banned_words.php', $topass, $qs);
开发者ID:babae,项目名称:etano,代码行数:30,代码来源:banned_words_delete.php

示例11: DateMill

Copyright by:               DateMill (http://www.datemill.com)
Support at:                 http://www.datemill.com/forum
*******************************************************************************
* See the "docs/licenses/etano.txt" file for license.                         *
******************************************************************************/
require '../includes/common.inc.php';
require _BASEPATH_ . '/includes/user_functions.inc.php';
require _BASEPATH_ . '/skins_site/' . get_my_skin() . '/lang/join.inc.php';
$qs = 'type=signup';
$qssep = '&';
$uid = sanitize_and_format_gpc($_GET, 'uid', TYPE_INT, 0, 0);
if (!empty($uid)) {
    $query = "SELECT `" . USER_ACCOUNT_ID . "` as `uid`,`email`,`temp_pass` FROM `" . USER_ACCOUNTS_TABLE . "` WHERE `" . USER_ACCOUNT_ID . "`={$uid}";
    if (!($res = @mysql_query($query))) {
        trigger_error(mysql_error(), E_USER_ERROR);
    }
    if (mysql_num_rows($res)) {
        $input = mysql_fetch_assoc($res);
        if (empty($input['temp_pass'])) {
            $input['temp_pass'] = gen_pass(7);
            $query = "UPDATE `" . USER_ACCOUNTS_TABLE . "` SET `temp_pass`='" . $input['temp_pass'] . "' WHERE `" . USER_ACCOUNT_ID . "`={$uid}";
            if (!($res = @mysql_query($query))) {
                trigger_error(mysql_error(), E_USER_ERROR);
            }
        }
        send_template_email($input['email'], sprintf($GLOBALS['_lang'][70], _SITENAME_), 'confirm_reg.html', get_my_skin(), $input);
        $qs .= $qssep . 'email=' . $input['email'];
    }
}
redirect2page('info.php', array(), $qs);
开发者ID:babae,项目名称:etano,代码行数:30,代码来源:resend_activation.php

示例12: DateMill

<?php

/******************************************************************************
Etano
===============================================================================
File:                       admin/processors/admin_accounts_delete.php
$Revision$
Software by:                DateMill (http://www.datemill.com)
Copyright by:               DateMill (http://www.datemill.com)
Support at:                 http://www.datemill.com/forum
*******************************************************************************
* See the "docs/licenses/etano.txt" file for license.                         *
******************************************************************************/
require_once '../../includes/common.inc.php';
require_once '../../includes/admin_functions.inc.php';
allow_dept(DEPT_ADMIN);
$qs = '';
$qs_sep = '';
$topass = array();
$admin_id = isset($_GET['admin_id']) ? (int) $_GET['admin_id'] : 0;
$query = "DELETE FROM `{$dbtable_prefix}admin_accounts` WHERE `admin_id`={$admin_id}";
if (!($res = @mysql_query($query))) {
    trigger_error(mysql_error(), E_USER_ERROR);
}
$topass['message']['type'] = MESSAGE_INFO;
$topass['message']['text'] = 'Account removed successfully.';
redirect2page('admin/admin_accounts.php', $topass, $qs);
开发者ID:babae,项目名称:etano,代码行数:27,代码来源:admin_accounts_delete.php

示例13: elseif

            $rsrow['pending'] = true;
        } elseif ($rsrow['status'] == STAT_EDIT) {
            $rsrow['need_edit'] = true;
        } elseif ($rsrow['status'] == STAT_APPROVED) {
            $rsrow['approved'] = true;
        }
        $loop[] = $rsrow;
    }
    $_GET = array('search' => $output['search_md5']);
    $output['pager2'] = pager($totalrows, $o, $r);
    $output['totalrows'] = $totalrows;
}
if (empty($loop)) {
    $topass['message']['type'] = MESSAGE_INFO;
    $topass['message']['text'] = 'No photos found meeting your search criteria.';
    redirect2page('admin/photo_search.php', $topass);
}
$output['pic_width'] = get_site_option('pic_width', 'core_photo');
$output['return2me'] = 'photo_results.php';
if (!empty($output['search_md5'])) {
    $output['return2me'] .= '?search=' . $output['search_md5'];
} elseif (!empty($_SERVER['QUERY_STRING'])) {
    $output['return2me'] .= '?' . $_SERVER['QUERY_STRING'];
}
$output['return2me'] = rawurlencode($output['return2me']);
$tpl->set_file('content', 'photo_results.html');
$tpl->set_loop('loop', $loop);
$tpl->set_var('output', $output);
$tpl->process('content', 'content', TPL_LOOP | TPL_NOLOOP | TPL_OPTLOOP | TPL_OPTIONAL);
$tpl->drop_loop('loop');
unset($loop);
开发者ID:babae,项目名称:etano,代码行数:31,代码来源:photo_results.php

示例14: check_login_member

function check_login_member($level_code)
{
    // is this user banned?
    global $_bans;
    if (isset($_bans[_PUNISH_BANUSER_]) && in_array($_SESSION[_LICENSE_KEY_]['user']['user'], $_bans[_PUNISH_BANUSER_])) {
        die;
    } elseif (isset($_bans[_PUNISH_BANIP_]) && in_array(sprintf('%u', ip2long($_SERVER['REMOTE_ADDR'])), $_bans[_PUNISH_BANIP_])) {
        die;
    } elseif (isset($_bans[_PUNISH_BANEMAIL_]) && in_array($_SESSION[_LICENSE_KEY_]['user']['email'], $_bans[_PUNISH_BANEMAIL_])) {
        die;
    }
    global $dbtable_prefix;
    if (!isset($GLOBALS['_access_level'][$level_code])) {
        $GLOBALS['_access_level'][$level_code] = 0;
        // no access allowed if level not defined
    }
    // ask visitors to login if they land on a page that doesn't allow guests
    if (!($GLOBALS['_access_level'][$level_code] & 1) && empty($_SESSION[_LICENSE_KEY_]['user']['user_id'])) {
        $_SESSION[_LICENSE_KEY_]['user']['timedout'] = array('url' => (isset($_SERVER['HTTPS']) && $_SERVER['HTTPS'] == 'on' ? 'https://' : 'http://') . $_SERVER['HTTP_HOST'] . $_SERVER['PHP_SELF'], 'method' => $_SERVER['REQUEST_METHOD'], 'qs' => $_SERVER['REQUEST_METHOD'] == 'GET' ? $_GET : $_POST);
        redirect2page('login.php');
    }
    //	unset($_SESSION[_LICENSE_KEY_]['user']['timedout']);
    if (($GLOBALS['_access_level'][$level_code] & $_SESSION[_LICENSE_KEY_]['user']['membership']) != $_SESSION[_LICENSE_KEY_]['user']['membership']) {
        redirect2page('info.php', array(), 'type=access');
        // no access to this feature
    }
    if (!empty($_SESSION[_LICENSE_KEY_]['user']['user_id']) && $_SESSION[_LICENSE_KEY_]['user']['pstat'] < STAT_APPROVED && empty($GLOBALS['_allow_na'][$level_code])) {
        redirect2page('info.php', array(), 'type=profile_na');
        // no access to this feature until the profile gets approved
    }
    $user_id = !empty($_SESSION[_LICENSE_KEY_]['user']['user_id']) ? $_SESSION[_LICENSE_KEY_]['user']['user_id'] : 0;
    if (USE_DB_SESSIONS == 0) {
        $now = gmdate('YmdHis');
        $query = "UPDATE `{$dbtable_prefix}online` SET `last_activity`='{$now}' WHERE `fk_user_id`={$user_id} AND `sess`='" . session_id() . "'";
        if (!($res = @mysql_query($query))) {
            trigger_error(mysql_error(), E_USER_ERROR);
        }
        if (!mysql_affected_rows()) {
            $query = "REPLACE INTO `{$dbtable_prefix}online` SET `fk_user_id`={$user_id},`sess`='" . session_id() . "',`last_activity`='{$now}'";
            if (!($res = @mysql_query($query))) {
                trigger_error(mysql_error(), E_USER_ERROR);
            }
        }
    }
    // log and rate limit
    $log['level'] = $level_code;
    $log['user_id'] = $user_id;
    $log['sess'] = session_id();
    $log['user'] = $_SESSION[_LICENSE_KEY_]['user']['user'];
    $log['membership'] = $_SESSION[_LICENSE_KEY_]['user']['membership'];
    $log['ip'] = sprintf('%u', ip2long($_SERVER['REMOTE_ADDR']));
    if ($level_code != 'all' && $level_code != 'auth') {
        rate_limiter($log);
        log_user_action($log);
    }
}
开发者ID:babae,项目名称:etano,代码行数:56,代码来源:user_functions.inc.php

示例15: DateMill

File:                       admin/processors/error_log_delete.php
$Revision$
Software by:                DateMill (http://www.datemill.com)
Copyright by:               DateMill (http://www.datemill.com)
Support at:                 http://www.datemill.com/forum
*******************************************************************************
* See the "docs/licenses/etano.txt" file for license.                         *
******************************************************************************/
require_once '../../includes/common.inc.php';
require_once '../../includes/admin_functions.inc.php';
allow_dept(DEPT_ADMIN);
$qs = '';
$qs_sep = '';
$topass = array();
$log_id = isset($_GET['log_id']) ? (int) $_GET['log_id'] : 0;
$act = isset($_GET['act']) ? $_GET['act'] : '';
if ($act == 'all') {
    $query = "TRUNCATE TABLE `{$dbtable_prefix}error_log`";
    if (!($res = @mysql_query($query))) {
        trigger_error(mysql_error(), E_USER_ERROR);
    }
} elseif ($act == 'one') {
    $query = "DELETE FROM `{$dbtable_prefix}error_log` WHERE `log_id`={$log_id}";
    if (!($res = @mysql_query($query))) {
        trigger_error(mysql_error(), E_USER_ERROR);
    }
}
$topass['message']['type'] = MESSAGE_INFO;
$topass['message']['text'] = 'Ok';
redirect2page('admin/error_log.php', $topass, $qs);
开发者ID:babae,项目名称:etano,代码行数:30,代码来源:error_log_delete.php


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