本文整理汇总了PHP中check_page_auth函数的典型用法代码示例。如果您正苦于以下问题:PHP check_page_auth函数的具体用法?PHP check_page_auth怎么用?PHP check_page_auth使用的例子?那么, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了check_page_auth函数的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: check_page_auth
$user->session_begin(false);
$auth->acl($user->data);
$user->setup();
// End session management
// Force all active content BBCodes OFF!
$config['switch_bbcb_active_content'] = 0;
$cms_page['page_id'] = 'shoutbox';
$cms_page['page_nav'] = (!empty($cms_config_layouts[$cms_page['page_id']]['page_nav']) ? true : false);
$cms_page['global_blocks'] = (!empty($cms_config_layouts[$cms_page['page_id']]['global_blocks']) ? true : false);
// Force to false...
$cms_page['page_nav'] = false;
$cms_page['global_blocks'] = false;
$cms_auth_level = (isset($cms_config_layouts[$cms_page['page_id']]['view']) ? $cms_config_layouts[$cms_page['page_id']]['view'] : AUTH_ALL);
check_page_auth($cms_page['page_id'], $cms_auth_level);
// Start auth check
switch ($user->data['user_level'])
{
case ADMIN :
case MOD : $is_auth['auth_mod'] = 1;
default:
$is_auth['auth_read'] = 1;
$is_auth['auth_view'] = 1;
if ($user->data['user_id'] == ANONYMOUS)
{
$is_auth['auth_delete'] = 0;
$is_auth['auth_post'] = 0;
}
else
示例2: die
die('Hacking attempt');
}
// Usage
/*
// BBCBMG - BEGIN
define('IN_ICYPHOENIX', true);
//$bbcbmg_in_acp = true;
include(IP_ROOT_PATH . 'includes/bbcb_mg.' . PHP_EXT);
$template->assign_var_from_handle('BBCB_MG', 'bbcb_mg');
// BBCBMG - END
*/
setup_extra_lang(array('lang_bbcb_mg'));
// This page is not in layout special...
$cms_page_id_tmp = 'pic_upload';
$cms_auth_level_tmp = isset($config['auth_view_pic_upload']) ? $config['auth_view_pic_upload'] : AUTH_ALL;
$view_pic_upload = check_page_auth($cms_page_id_tmp, $cms_auth_level_tmp, true);
if (defined('BBCB_MG_SMALL')) {
$template->set_filenames(array('bbcb_mg' => 'bbcb_mg_small.tpl'));
} elseif (defined('BBCB_MG_CUSTOM')) {
$template->set_filenames(array('bbcb_mg' => 'bbcb_mg_custom.tpl'));
} else {
$template->set_filenames(array('bbcb_mg' => 'bbcb_mg.tpl'));
}
if (!empty($config['enable_postimage_org'])) {
$template->assign_var('S_POSTIMAGE_ORG', true);
}
if (!empty($config['enable_colorpicker'])) {
$template->assign_var('S_COLORPICKER', true);
}
$allowed_langs = array('dutch', 'german', 'italian', 'spanish');
if (in_array($config['default_lang'], $allowed_langs)) {
示例3: user_get_thanks_received
if ($config['show_thanks_profile'] && empty($config['disable_thanks_topics'])) {
$total_thanks_received = user_get_thanks_received($profiledata['user_id']);
$template->assign_block_vars('show_thanks_profile', array());
}
// Mighty Gorgon - Thanks Received - END
// Mighty Gorgon - HTTP AGENTS - BEGIN
include IP_ROOT_PATH . 'includes/functions_mg_http.' . PHP_EXT;
$user_os = get_user_os($profiledata['user_browser']);
$user_browser = get_user_browser($profiledata['user_browser']);
// Mighty Gorgon - HTTP AGENTS - END
// Mighty Gorgon - Full Album Pack - BEGIN
include IP_ROOT_PATH . 'includes/album_mod/album_functions.' . PHP_EXT;
include IP_ROOT_PATH . 'includes/album_mod/album_hierarchy_functions.' . PHP_EXT;
$cms_page_id_tmp = 'album';
$cms_auth_level_tmp = isset($cms_config_layouts[$cms_page_id_tmp]['view']) ? $cms_config_layouts[$cms_page_id_tmp]['view'] : AUTH_ALL;
$show_latest_pics = check_page_auth($cms_page_id_tmp, $cms_auth_level_tmp, true);
if ($show_latest_pics) {
setup_extra_lang(array('lang_album_main'));
$sql = "SELECT * FROM " . ALBUM_CONFIG_TABLE;
$result = $db->sql_query($sql, 0, 'album_config_');
while ($row = $db->sql_fetchrow($result)) {
$album_config[$row['config_name']] = $row['config_value'];
}
$db->sql_freeresult($result);
$limit_sql = $album_config['img_cols'] * $album_config['img_rows'];
$cols_per_page = $album_config['img_cols'];
if ($user->data['user_level'] == ADMIN) {
$cat_view_level_sql = '';
} elseif (!empty($user->data['session_logged_in'])) {
$cat_view_level_sql = " AND c.cat_view_level <= 1 ";
} else {
示例4: cms_block_album
function cms_block_album()
{
global $db, $cache, $config, $template, $theme, $images, $user, $lang, $table_prefix, $block_id, $cms_config_vars, $cms_config_layouts, $cms_page, $album_config;
$cms_page_id_tmp = 'album';
$cms_auth_level_tmp = isset($cms_config_layouts[$cms_page_id_tmp]['view']) ? $cms_config_layouts[$cms_page_id_tmp]['view'] : AUTH_ALL;
$process_block = check_page_auth($cms_page_id_tmp, $cms_auth_level_tmp, true);
if (!$process_block) {
return;
}
if (!defined('IMG_THUMB')) {
define('IMG_THUMB', true);
}
$template->_tpldata['recent_pics.'] = array();
$template->_tpldata['recent_details.'] = array();
$template->_tpldata['no_pics'] = array();
/*
echo($cms_config_vars['md_pics_all'][$block_id] . '<br />');
echo($cms_config_vars[$block_id . '_' . 'md_pics_all']);
exit;
*/
include_once ALBUM_MOD_PATH . 'album_common.' . PHP_EXT;
global $album_config;
$sql = "SELECT c.*, COUNT(p.pic_id) AS count\n\t\t\t\tFROM " . ALBUM_CAT_TABLE . " AS c\n\t\t\t\t\tLEFT JOIN " . ALBUM_TABLE . " AS p ON c.cat_id = p.pic_cat_id\n\t\t\t\t" . ($cms_config_vars['md_pics_all'][$block_id] == '1' ? '' : 'WHERE cat_user_id = 0') . "\n\t\t\t\tGROUP BY cat_id\n\t\t\t\tORDER BY cat_order ASC";
$result = $db->sql_query($sql);
$catrows = array();
while ($row = $db->sql_fetchrow($result)) {
$album_user_access = album_user_access($row['cat_id'], $row, 1, 0, 0, 0, 0, 0);
// VIEW
if ($album_user_access['view'] == 1) {
$catrows[] = $row;
}
}
$db->sql_freeresult($result);
if ($cms_config_vars['md_pics_all'][$block_id] == '1') {
$allowed_cat = '0';
// For Recent Public Pics below
} else {
$allowed_cat = '';
}
// $catrows now stores all categories which this user can view. Dump them out!
for ($i = 0; $i < sizeof($catrows); $i++) {
// Build allowed category-list (for recent pics after here)
$allowed_cat .= $allowed_cat == '' ? $catrows[$i]['cat_id'] : ',' . $catrows[$i]['cat_id'];
// Get Last Pic of this Category
if ($catrows[$i]['count'] == 0) {
//
// Oh, this category is empty
//
$last_pic_info = $lang['No_Pics'];
$u_last_pic = '';
$last_pic_title = '';
} else {
// Check Pic Approval
if ($catrows[$i]['cat_approval'] == ALBUM_ADMIN || $catrows[$i]['cat_approval'] == ALBUM_MOD) {
$pic_approval_sql = 'AND p.pic_approval = 1';
// Pic Approval ON
} else {
$pic_approval_sql = '';
// Pic Approval OFF
}
}
}
if ($cms_config_vars['md_pics_all'][$block_id] == '1') {
$pics_allowed = '0';
} else {
$pics_allowed = '';
}
$no_pics = false;
if ($allowed_cat != $pics_allowed) {
$category_id = $cms_config_vars['md_cat_id'][$block_id];
if ($cms_config_vars['md_pics_sort'][$block_id] == '1') {
if ($category_id != 0) {
$sql = "SELECT p.*, u.user_id, u.username, u.user_active, u.user_color, r.rate_pic_id, AVG(r.rate_point) AS rating, COUNT(DISTINCT c.comment_id) AS comments\n\t\t\t\t\t\tFROM " . ALBUM_TABLE . " AS p\n\t\t\t\t\t\t\tLEFT JOIN " . USERS_TABLE . " AS u ON p.pic_user_id = u.user_id\n\t\t\t\t\t\t\tLEFT JOIN " . ALBUM_CAT_TABLE . " AS ct ON p.pic_cat_id = ct.cat_id\n\t\t\t\t\t\t\tLEFT JOIN " . ALBUM_RATE_TABLE . " AS r ON p.pic_id = r.rate_pic_id\n\t\t\t\t\t\t\tLEFT JOIN " . ALBUM_COMMENT_TABLE . " AS c ON p.pic_id = c.comment_pic_id\n\t\t\t\t\t\tWHERE p.pic_cat_id IN ({$allowed_cat}) AND (p.pic_approval = 1 OR ct.cat_approval = 0) AND pic_cat_id IN ({$category_id})\n\t\t\t\t\t\tGROUP BY p.pic_id\n\t\t\t\t\t\tORDER BY RAND()\n\t\t\t\t\t\tLIMIT " . $cms_config_vars['md_pics_number'][$block_id];
} else {
$sql = "SELECT p.*, u.user_id, u.username, u.user_active, u.user_color, r.rate_pic_id, AVG(r.rate_point) AS rating, COUNT(DISTINCT c.comment_id) AS comments\n\t\t\t\t\t\tFROM " . ALBUM_TABLE . " AS p\n\t\t\t\t\t\t\tLEFT JOIN " . USERS_TABLE . " AS u ON p.pic_user_id = u.user_id\n\t\t\t\t\t\t\tLEFT JOIN " . ALBUM_CAT_TABLE . " AS ct ON p.pic_cat_id = ct.cat_id\n\t\t\t\t\t\t\tLEFT JOIN " . ALBUM_RATE_TABLE . " AS r ON p.pic_id = r.rate_pic_id\n\t\t\t\t\t\t\tLEFT JOIN " . ALBUM_COMMENT_TABLE . " AS c ON p.pic_id = c.comment_pic_id\n\t\t\t\t\t\tWHERE p.pic_cat_id IN ({$allowed_cat}) AND (p.pic_approval = 1 OR ct.cat_approval = 0)\n\t\t\t\t\t\tGROUP BY p.pic_id\n\t\t\t\t\t\tORDER BY RAND()\n\t\t\t\t\t\tLIMIT " . $cms_config_vars['md_pics_number'][$block_id];
}
} elseif ($cms_config_vars['md_pics_sort'][$block_id] == '0') {
if ($category_id != 0) {
$sql = "SELECT p.*, u.user_id, u.username, u.user_active, u.user_color, r.rate_pic_id, AVG(r.rate_point) AS rating, COUNT(DISTINCT c.comment_id) AS comments\n\t\t\t\t\t\tFROM " . ALBUM_TABLE . " AS p\n\t\t\t\t\t\t\tLEFT JOIN " . USERS_TABLE . " AS u ON p.pic_user_id = u.user_id\n\t\t\t\t\t\t\tLEFT JOIN " . ALBUM_CAT_TABLE . " AS ct ON p.pic_cat_id = ct.cat_id\n\t\t\t\t\t\t\tLEFT JOIN " . ALBUM_RATE_TABLE . " AS r ON p.pic_id = r.rate_pic_id\n\t\t\t\t\t\t\tLEFT JOIN " . ALBUM_COMMENT_TABLE . " AS c ON p.pic_id = c.comment_pic_id\n\t\t\t\t\t\tWHERE p.pic_cat_id IN ({$allowed_cat}) AND (p.pic_approval = 1 OR ct.cat_approval = 0) AND pic_cat_id IN ({$category_id})\n\t\t\t\t\t\tGROUP BY p.pic_id\n\t\t\t\t\t\tORDER BY pic_time DESC\n\t\t\t\t\t\tLIMIT " . $cms_config_vars['md_pics_number'][$block_id];
} else {
$sql = "SELECT p.*, u.user_id, u.username, u.user_active, u.user_color, r.rate_pic_id, AVG(r.rate_point) AS rating, COUNT(DISTINCT c.comment_id) AS comments\n\t\t\t\t\t\tFROM " . ALBUM_TABLE . " AS p\n\t\t\t\t\t\t\tLEFT JOIN " . USERS_TABLE . " AS u ON p.pic_user_id = u.user_id\n\t\t\t\t\t\t\tLEFT JOIN " . ALBUM_CAT_TABLE . " AS ct ON p.pic_cat_id = ct.cat_id\n\t\t\t\t\t\t\tLEFT JOIN " . ALBUM_RATE_TABLE . " AS r ON p.pic_id = r.rate_pic_id\n\t\t\t\t\t\t\tLEFT JOIN " . ALBUM_COMMENT_TABLE . " AS c ON p.pic_id = c.comment_pic_id\n\t\t\t\t\t\tWHERE p.pic_cat_id IN ({$allowed_cat}) AND (p.pic_approval = 1 OR ct.cat_approval = 0)\n\t\t\t\t\t\tGROUP BY p.pic_id\n\t\t\t\t\t\tORDER BY pic_time DESC\n\t\t\t\t\t\tLIMIT " . $cms_config_vars['md_pics_number'][$block_id];
}
}
$result = $db->sql_query($sql);
$recentrow = array();
while ($row = $db->sql_fetchrow($result)) {
$recentrow[] = $row;
}
$db->sql_freeresult($result);
$total_pics = sizeof($recentrow);
if ($total_pics > 0) {
$total_rows = ceil($total_pics / $cms_config_vars['md_pics_rows_number'][$block_id]);
$total_cols = ceil($total_pics / $cms_config_vars['md_pics_cols_number'][$block_id]);
$image_counter = 0;
while ($image_counter < $total_pics) {
for ($i = 0; $i < $cms_config_vars['md_pics_rows_number'][$block_id]; $i++) {
$template->assign_block_vars('recent_pics', array());
for ($j = 0; $j < $cms_config_vars['md_pics_cols_number'][$block_id]; $j++) {
if ($image_counter >= $total_pics) {
$template->assign_block_vars('recent_pics.recent_no_detail', array());
//.........这里部分代码省略.........
示例5: isset
include IP_ROOT_PATH . 'includes/ajax_shoutbox_inc.' . PHP_EXT;
} else {
if (!isset($cms_page['page_id'])) {
$cms_page['page_id'] = 'ajax_chat_archive';
}
// Set as tmp value to not overwrite page id if included as a block...
// Check before the chat link, so we can then use $cms_page_id_tmp for deciding what template to use
$cms_page_id_tmp = 'ajax_chat';
$cms_auth_level_tmp = isset($cms_config_layouts[$cms_page_id_tmp]['view']) ? $cms_config_layouts[$cms_page_id_tmp]['view'] : AUTH_ALL;
$ajax_chat_link = check_page_auth($cms_page_id_tmp, $cms_auth_level_tmp, true);
// Import settings from other vars if set... or force global blocks to off since this may be run as stand alone
$cms_page_id_tmp = 'ajax_chat_archive';
$cms_page['page_nav'] = isset($cms_page['page_nav']) ? $cms_page['page_nav'] : true;
$cms_page['global_blocks'] = isset($cms_page['global_blocks']) ? $cms_page['global_blocks'] : false;
$cms_auth_level_tmp = isset($cms_config_layouts[$cms_page_id_tmp]['view']) ? $cms_config_layouts[$cms_page_id_tmp]['view'] : AUTH_ALL;
check_page_auth($cms_page_id_tmp, $cms_auth_level_tmp);
$breadcrumbs['bottom_right_links'] = ($ajax_chat_link == true ? '<a href="' . append_sid('ajax_chat.' . PHP_EXT) . '">' . $lang['Ajax_Chat'] . '</a> ' . MENU_SEP_CHAR . ' ' : '') . '<a href="' . append_sid('ajax_chat.' . PHP_EXT . '?mode=archive') . '">' . $lang['Ajax_Archive'] . '</a>';
$template_to_parse = 'ajax_chat_archive.tpl';
include_once IP_ROOT_PATH . 'includes/functions_ajax_chat.' . PHP_EXT;
// Include Post functions and BBCodes
include_once IP_ROOT_PATH . 'includes/bbcode.' . PHP_EXT;
include_once IP_ROOT_PATH . 'includes/functions_post.' . PHP_EXT;
// Make Pagination and collect some extra data
$sql = "SELECT COUNT(s.shout_id) as stored_shouts, MAX(s.shout_id) as total_shouts\n\t\t\t\t\tFROM " . AJAX_SHOUTBOX_TABLE . " s " . (!empty($chat_room_all) ? "" : " WHERE " . $chat_room_sql);
$result = $db->sql_query($sql);
$num_items = $db->sql_fetchrow($result);
$start = request_get_var('start', 0);
$start = $start < 0 ? 0 : $start;
$template->assign_vars(array('PAGINATION' => generate_pagination('ajax_chat.' . PHP_EXT . '?mode=archive&chat_room=' . $chat_room, $num_items['stored_shouts'], $config['posts_per_page'], $start)));
// Get my shouts
$sql = "SELECT COUNT(s.shout_id) as count\n\t\t\tFROM " . AJAX_SHOUTBOX_TABLE . " s\n\t\t\tWHERE s.user_id = " . $user->data['user_id'] . (!empty($chat_room_all) ? "" : " AND " . $chat_room_sql);