本文整理汇总了PHP中session::check_perm方法的典型用法代码示例。如果您正苦于以下问题:PHP session::check_perm方法的具体用法?PHP session::check_perm怎么用?PHP session::check_perm使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类session
的用法示例。
在下文中一共展示了session::check_perm方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: attachments_delete_thumbnail
function attachments_delete_thumbnail($hash)
{
if (!is_md5($hash)) {
return false;
}
if (!($db = db::get())) {
return false;
}
if (!isset($_SESSION['UID']) || !is_numeric($_SESSION['UID'])) {
return false;
}
if (!($attachment_dir = attachments_check_dir())) {
return false;
}
$sql = "SELECT PAF.AID, PAF.UID, PAF.FILENAME, PAI.TID, ";
$sql .= "PAI.PID FROM POST_ATTACHMENT_FILES PAF ";
$sql .= "LEFT JOIN POST_ATTACHMENT_IDS PAI ON (PAI.AID = PAF.AID) ";
$sql .= "WHERE PAF.HASH = '{$hash}'";
if (!($result = $db->query($sql))) {
return false;
}
if ($result->num_rows == 0) {
return false;
}
$attachment_data = $result->fetch_assoc();
if (!isset($attachment_data['FID'])) {
$attachment_data['FID'] = 0;
}
if (!($attachment_data['UID'] == $_SESSION['UID'] || session::check_perm(USER_PERM_FOLDER_MODERATE, $attachment_data['FID']))) {
return false;
}
if (isset($attachment_data['TID']) && isset($attachment_data['PID'])) {
post_add_edit_text($attachment_data['TID'], $attachment_data['PID']);
if (session::check_perm(USER_PERM_FOLDER_MODERATE, $attachment_data['FID']) && $attachment_data['UID'] != $_SESSION['UID']) {
$log_data = array($attachment_data['TID'], $attachment_data['PID'], $attachment_data['FILENAME']);
admin_add_log_entry(ATTACHMENTS_DELETE, $log_data);
}
}
@unlink("{$attachment_dir}/{$hash}.thumb");
return true;
}
示例2: html_guest_error
require_once BH_INCLUDE_PATH . 'header.inc.php';
require_once BH_INCLUDE_PATH . 'html.inc.php';
require_once BH_INCLUDE_PATH . 'lang.inc.php';
require_once BH_INCLUDE_PATH . 'logon.inc.php';
require_once BH_INCLUDE_PATH . 'post.inc.php';
require_once BH_INCLUDE_PATH . 'session.inc.php';
require_once BH_INCLUDE_PATH . 'sphinx.inc.php';
require_once BH_INCLUDE_PATH . 'styles.inc.php';
require_once BH_INCLUDE_PATH . 'text_captcha.inc.php';
require_once BH_INCLUDE_PATH . 'user.inc.php';
// Check we're logged in correctly
if (!session::logged_in()) {
html_guest_error();
}
// Check we have Admin / Moderator access
if (!session::check_perm(USER_PERM_FORUM_TOOLS, 0, 0)) {
html_draw_error(gettext("You do not have permission to use this section."));
}
// Perform additional admin login.
admin_check_credentials();
// Get the user's post page preferences.
$page_prefs = session::get_post_page_prefs();
// Array to hold error messages
$error_msg_array = array();
// Text captcha class
$text_captcha = new captcha(6, 15, 25, 9, 30);
// Array of valid periods for the unread cutoff
$unread_cutoff_periods = array(UNREAD_MESSAGES_DISABLED => gettext("Disable unread messages"), THIRTY_DAYS_IN_SECONDS => gettext("30 Days"), SIXTY_DAYS_IN_SECONDS => gettext("60 Days"), NINETY_DAYS_IN_SECONDS => gettext("90 Days"), HUNDRED_EIGHTY_DAYS_IN_SECONDS => gettext("180 Days"), YEAR_IN_SECONDS => gettext("1 year"));
// Array of valid periods for the sitemap frequency
$sitemap_freq_periods = array(DAY_IN_SECONDS => gettext("Once a day"), WEEK_IN_SECONDS => gettext("Once a Week"));
// Array of valid Google Adsense ad user account types
示例3: trim
$valid = false;
}
if (isset($_POST['title']) && strlen(trim($_POST['title'])) > 0) {
$title = trim($_POST['title']);
} else {
$error_msg_array[] = gettext("You must specify a name!");
$valid = false;
}
if (isset($_POST['description']) && strlen(trim($_POST['description'])) > 0) {
$description = trim($_POST['description']);
} else {
$description = "";
}
if ($valid) {
links_update($lid, $fid, $_SESSION['UID'], $title, $uri, $description);
if (session::check_perm(USER_PERM_FOLDER_MODERATE, 0) && $link['UID'] != $_SESSION['UID']) {
admin_add_log_entry(DELETE_LINK, array($lid));
}
header_redirect("links_detail.php?webtag={$webtag}&lid={$lid}&fid={$fid}");
}
}
if ($user_perm_links_moderate || $link['UID'] == $_SESSION['UID']) {
if (isset($_POST['hide']) && $_POST['hide'] == "confirm") {
links_change_visibility($lid, false);
} else {
if (!isset($_POST['hide']) || isset($_POST['hide']) && $_POST['hide'] != "confirm") {
links_change_visibility($lid, true);
}
}
header_redirect("links_detail.php?webtag={$webtag}&lid={$lid}&fid={$fid}");
}
示例4: html_draw_error
$admin_edit = true;
} else {
html_draw_error(gettext("No user specified."));
}
} else {
$uid = session::get_value('UID');
}
}
if (isset($_POST['cancel'])) {
header_redirect("admin_user.php?webtag={$webtag}&uid={$uid}");
exit;
}
} else {
$uid = session::get_value('UID');
}
if (!session::check_perm(USER_PERM_ADMIN_TOOLS, 0) && $uid != session::get_value('UID')) {
html_draw_error(gettext("You do not have permission to use this section."));
}
// Fetch array of profile items.
$profile_items_array = profile_get_user_values($uid);
// Array to hold error messages
$error_msg_array = array();
// Do updates
if (isset($_POST['save'])) {
$valid = true;
if (isset($_POST['t_entry']) && is_array($_POST['t_entry'])) {
$t_entry_array = $_POST['t_entry'];
$t_entry_cleaned_array = array_map('strip_tags', $t_entry_array);
if (sizeof(array_diff_assoc($t_entry_array, $t_entry_cleaned_array)) > 0) {
$error_msg_array[] = gettext("Profile Entries must not include HTML");
$valid = false;
示例5: thread_merge
function thread_merge($tida, $tidb, $merge_type, &$error_str)
{
if (!($db = db::get())) {
return false;
}
if (!is_numeric($tida)) {
return false;
}
if (!is_numeric($tidb)) {
return false;
}
if (!in_array($merge_type, array(THREAD_MERGE_BY_CREATED, THREAD_MERGE_START, THREAD_MERGE_END))) {
return false;
}
if (!($table_prefix = get_table_prefix())) {
return thread_merge_error(THREAD_MERGE_FORUM_ERROR, $error_str);
}
if (!($forum_fid = get_forum_fid())) {
return thread_merge_error(THREAD_MERGE_FORUM_ERROR, $error_str);
}
// Get Thread A data
if (!($threada = thread_get($tida))) {
return thread_merge_error(THREAD_MERGE_THREAD_ERROR, $error_str);
}
// Get Thread B data
if (!($threadb = thread_get($tidb))) {
return thread_merge_error(THREAD_MERGE_THREAD_ERROR, $error_str);
}
// Check the threads aren't polls.
if ($threada['POLL_FLAG'] == 'Y' || $threadb['POLL_FLAG'] == 'Y') {
return thread_merge_error(THREAD_MERGE_POLL_ERROR, $error_str);
}
// Check thread A permissions
if (!session::check_perm(USER_PERM_FOLDER_MODERATE, $threada['FID'])) {
return thread_merge_error(THREAD_MERGE_PERMS_ERROR, $error_str);
}
// Check thread B permissions
if (!session::check_perm(USER_PERM_FOLDER_MODERATE, $threada['FID'])) {
return thread_merge_error(THREAD_MERGE_PERMS_ERROR, $error_str);
}
// Close thread A
thread_set_closed($tida, true);
// Close thread B
thread_set_closed($tidb, true);
// Create new thread. Mark it as deleted so user's cannot see it.
if (!($new_tid = post_create_thread($threada['FID'], $threada['BY_UID'], $threada['TITLE'], 'N', 'N', true, true))) {
// Unlock the threads if they weren't originally locked.
thread_set_closed($tida, $threada['CLOSED'] > 0);
thread_set_closed($tidb, $threadb['CLOSED'] > 0);
// Return error message.
return thread_merge_error(THREAD_MERGE_CREATE_ERROR, $error_str);
}
// Construct query to correctly sort the posts in the new thread.
switch ($merge_type) {
case THREAD_MERGE_BY_CREATED:
$sql = "INSERT INTO `{$table_prefix}POST` (TID, REPLY_TO_PID, ";
$sql .= "FROM_UID, TO_UID, VIEWED, CREATED, STATUS, APPROVED, APPROVED_BY, ";
$sql .= "EDITED, EDITED_BY, IPADDRESS, MOVED_TID, MOVED_PID) ";
$sql .= "SELECT '{$new_tid}', REPLY_TO_PID, FROM_UID, TO_UID, NULL, NOW(), ";
$sql .= "STATUS, APPROVED, APPROVED_BY, EDITED, EDITED_BY, IPADDRESS, TID, ";
$sql .= "PID FROM `{$table_prefix}POST` WHERE TID IN ('{$tida}', '{$tidb}') ";
$sql .= "ORDER BY CREATED";
break;
case THREAD_MERGE_START:
$sql = "INSERT INTO `{$table_prefix}POST` (TID, REPLY_TO_PID, ";
$sql .= "FROM_UID, TO_UID, VIEWED, CREATED, STATUS, APPROVED, APPROVED_BY, ";
$sql .= "EDITED, EDITED_BY, IPADDRESS, MOVED_TID, MOVED_PID) ";
$sql .= "SELECT '{$new_tid}', REPLY_TO_PID, FROM_UID, TO_UID, NULL, NOW(), ";
$sql .= "STATUS, APPROVED, APPROVED_BY, EDITED, EDITED_BY, IPADDRESS, TID, ";
$sql .= "PID FROM `{$table_prefix}POST` WHERE TID IN ('{$tida}', '{$tidb}') ";
$sql .= "ORDER BY TID = '{$tidb}', CREATED";
break;
case THREAD_MERGE_END:
$sql = "INSERT INTO `{$table_prefix}POST` (TID, REPLY_TO_PID, ";
$sql .= "FROM_UID, TO_UID, VIEWED, CREATED, STATUS, APPROVED, APPROVED_BY, ";
$sql .= "EDITED, EDITED_BY, IPADDRESS, MOVED_TID, MOVED_PID) ";
$sql .= "SELECT '{$new_tid}', REPLY_TO_PID, FROM_UID, TO_UID, NULL, NOW(), ";
$sql .= "STATUS, APPROVED, APPROVED_BY, EDITED, EDITED_BY, IPADDRESS, TID, ";
$sql .= "PID FROM `{$table_prefix}POST` WHERE TID IN ('{$tida}', '{$tidb}') ";
$sql .= "ORDER BY TID = '{$tida}', CREATED";
break;
}
// Execute the query to copy the posts.
if (!$db->query($sql)) {
// Unlock the threads if they weren't originally locked.
thread_set_closed($tida, $threada['CLOSED'] > 0);
thread_set_closed($tidb, $threadb['CLOSED'] > 0);
// Return error message.
return thread_merge_error(THREAD_MERGE_QUERY_ERROR, $error_str);
}
// Copy the post contents to the new thread
$sql = "INSERT INTO `{$table_prefix}POST_CONTENT` (TID, PID, CONTENT) ";
$sql .= "SELECT POST.TID, POST.PID, POST_CONTENT.CONTENT FROM `{$table_prefix}POST` POST ";
$sql .= "LEFT JOIN `{$table_prefix}POST_CONTENT` POST_CONTENT ";
$sql .= "ON (POST_CONTENT.TID = POST.MOVED_TID AND POST_CONTENT.PID = MOVED_PID) ";
$sql .= "WHERE POST.TID = '{$new_tid}'";
if (!$db->query($sql)) {
// Unlock the threads if they weren't originally locked.
thread_set_closed($tida, $threada['CLOSED'] > 0);
thread_set_closed($tidb, $threadb['CLOSED'] > 0);
//.........这里部分代码省略.........
示例6: post_update
function post_update($fid, $tid, $pid, $content)
{
if (!is_numeric($tid)) {
return false;
}
if (!is_numeric($pid)) {
return false;
}
if (!($db = db::get())) {
return false;
}
$content = $db->escape($content);
if (!($table_prefix = get_table_prefix())) {
return false;
}
$sql = "UPDATE LOW_PRIORITY `{$table_prefix}POST_CONTENT` SET CONTENT = '{$content}' ";
$sql .= "WHERE TID = '{$tid}' AND PID = '{$pid}' LIMIT 1";
if (!$db->query($sql)) {
return false;
}
if (session::check_perm(USER_PERM_POST_APPROVAL, $fid) && !session::check_perm(USER_PERM_FOLDER_MODERATE, $fid)) {
$sql = "UPDATE LOW_PRIORITY `{$table_prefix}POST` SET APPROVED = 0, APPROVED_BY = 0 ";
$sql .= "WHERE TID = '{$tid}' AND PID = '{$pid}' LIMIT 1";
if (!$db->query($sql)) {
return false;
}
}
return true;
}
示例7: html_page_links
echo " <td align=\"left\"> </td>\n";
echo " </tr>\n";
echo " <tr>\n";
echo " <td align=\"left\"> </td>\n";
echo " <td class=\"postbody\" align=\"center\" width=\"50%\">", html_page_links("admin_users.php?webtag={$webtag}&sort_by={$sort_by}&sort_dir={$sort_dir}&user_search={$user_search}&filter={$filter}", $page, $admin_user_array['user_count'], 10), "</td>\n";
if (forum_get_setting('require_user_approval', 'Y') && session::check_perm(USER_PERM_ADMIN_TOOLS, 0, 0)) {
echo " <td class=\"postbody\" align=\"right\" width=\"25%\" style=\"white-space: nowrap\">", gettext("User filter"), ": ", form_dropdown_array("filter", array(ADMIN_USER_FILTER_NONE => gettext("All"), ADMIN_USER_FILTER_ONLINE => gettext("Online users"), ADMIN_USER_FILTER_OFFLINE => gettext("Offline users"), ADMIN_USER_FILTER_BANNED => gettext("Banned users"), ADMIN_USER_FILTER_APPROVAL => gettext("Users awaiting approval")), $filter), " ", form_submit("change_filter", gettext("Go")), "</td>\n";
} else {
echo " <td class=\"postbody\" align=\"right\" width=\"25%\" style=\"white-space: nowrap\">", gettext("User filter"), ": ", form_dropdown_array("filter", array(ADMIN_USER_FILTER_NONE => gettext("All"), ADMIN_USER_FILTER_ONLINE => gettext("Online users"), ADMIN_USER_FILTER_OFFLINE => gettext("Offline users"), ADMIN_USER_FILTER_BANNED => gettext("Banned users")), $filter), " ", form_submit("change_filter", gettext("Go")), "</td>\n";
}
echo " </tr>\n";
echo " <tr>\n";
echo " <td align=\"left\"> </td>\n";
echo " </tr>\n";
echo " </table>\n";
if (session::check_perm(USER_PERM_ADMIN_TOOLS, 0, 0) && sizeof($admin_user_array['user_array']) > 0) {
echo " <table cellpadding=\"0\" cellspacing=\"0\" width=\"86%\">\n";
echo " <tr>\n";
echo " <td align=\"left\">\n";
echo " <table class=\"box\" width=\"100%\">\n";
echo " <tr>\n";
echo " <td align=\"left\" class=\"posthead\">\n";
echo " <table width=\"100%\">\n";
echo " <tr>\n";
echo " <td class=\"subhead\" align=\"left\">", gettext("Options"), "</td>\n";
echo " </tr>\n";
echo " <tr>\n";
echo " <td align=\"center\">\n";
echo " <table class=\"posthead\" width=\"95%\">\n";
echo " <tr>\n";
if (forum_get_setting('require_user_approval', 'Y')) {
示例8: light_folder_search_dropdown
function light_folder_search_dropdown($selected_folder)
{
if (!($db = db::get())) {
return false;
}
if (!is_numeric($selected_folder)) {
return false;
}
if (!($table_prefix = get_table_prefix())) {
return false;
}
$available_folders = array();
$access_allowed = USER_PERM_POST_READ;
$sql = "SELECT FID, TITLE FROM `{$table_prefix}FOLDER` ";
$sql .= "ORDER BY FID ";
if (!($result = $db->query($sql))) {
return false;
}
if ($result->num_rows == 0) {
return false;
}
while (($folder_data = $result->fetch_assoc()) !== null) {
if (!session::logged_in()) {
if (session::check_perm(USER_PERM_GUEST_ACCESS, $folder_data['FID'])) {
$available_folders[$folder_data['FID']] = htmlentities_array($folder_data['TITLE']);
}
} else {
if (session::check_perm($access_allowed, $folder_data['FID'])) {
$available_folders[$folder_data['FID']] = htmlentities_array($folder_data['TITLE']);
}
}
}
if (sizeof($available_folders) == 0) {
return false;
}
$available_folders = array(gettext("ALL")) + $available_folders;
return light_form_dropdown_array("fid", $available_folders, $selected_folder);
}
示例9: html_draw_error
// Check links section is enabled
if (!forum_get_setting('show_links', 'Y')) {
html_draw_error(gettext("You may not access this section."));
}
// Array to hold error messages
$error_msg_array = array();
$name = null;
$uri = null;
$description = null;
// User pressed cancel
if (isset($_POST['cancel'])) {
header_redirect("links.php?webtag={$webtag}&fid={$_POST['fid']}");
exit;
}
// Get the Links Folders.
$folders = links_folders_get(!session::check_perm(USER_PERM_LINKS_MODERATE, 0));
// Check the mode.
if (isset($_GET['mode'])) {
if ($_GET['mode'] == LINKS_ADD_LINK) {
$mode = LINKS_ADD_LINK;
} else {
if ($_GET['mode'] == LINKS_ADD_FOLDER) {
$mode = LINKS_ADD_FOLDER;
} else {
$mode = LINKS_ADD_LINK;
}
}
} else {
if (isset($_POST['mode'])) {
if ($_POST['mode'] == LINKS_ADD_LINK) {
$mode = LINKS_ADD_LINK;
示例10: html_display_error_array
if (isset($error_msg_array) && sizeof($error_msg_array) > 0) {
html_display_error_array($error_msg_array, '700', 'left');
} else {
if (isset($_GET['updated'])) {
html_display_success_msg(gettext("Signature Updated"), '700', 'left');
} else {
if (isset($_GET['updated_global'])) {
html_display_success_msg(gettext("Signature Updated For All Forums"), '700', 'left');
}
}
}
echo "<br />\n";
if ($admin_edit === true) {
echo "<div align=\"center\">\n";
}
if (session::check_perm(USER_PERM_ADMIN_TOOLS, 0, 0) && $admin_edit || $sig_uid == $_SESSION['UID'] && $admin_edit === false) {
$show_set_all = forums_get_available_count() > 1;
} else {
$show_set_all = false;
}
echo "<form accept-charset=\"utf-8\" name=\"prefs\" action=\"edit_signature.php\" method=\"post\" target=\"_self\">\n";
echo " ", form_csrf_token_field(), "\n";
echo " ", form_input_hidden('webtag', htmlentities_array($webtag)), "\n";
if ($admin_edit === true) {
echo " ", form_input_hidden('sig_uid', htmlentities_array($sig_uid)), "\n";
}
echo " <table cellpadding=\"0\" cellspacing=\"0\" width=\"700\">\n";
echo " <tr>\n";
echo " <td align=\"left\">\n";
echo " <table class=\"box\" width=\"100%\">\n";
echo " <tr>\n";
示例11: poll_close
function poll_close($tid)
{
if (!($db = db::get())) {
return false;
}
if (!is_numeric($tid)) {
return false;
}
if (!($table_prefix = get_table_prefix())) {
return false;
}
$sql = "SELECT FROM_UID FROM `{$table_prefix}POST` WHERE TID = '{$tid}' AND PID = 1";
if (!($result = $db->query($sql))) {
return false;
}
if (($t_fid = thread_get_folder($tid, 1)) && $result->num_rows > 0) {
$poll_data = $result->fetch_assoc();
if (session::get_value('UID') == $poll_data['FROM_UID'] || session::check_perm(USER_PERM_FOLDER_MODERATE, $t_fid)) {
$closes_datetime = date(MYSQL_DATETIME_MIDNIGHT, time());
$sql = "UPDATE LOW_PRIORITY `{$table_prefix}POLL` SET ";
$sql .= "CLOSES = CAST('{$closes_datetime}' AS DATETIME) ";
$sql .= "WHERE TID = '{$tid}'";
if (!$db->query($sql)) {
return false;
}
}
}
return true;
}
示例12: links_get_in_folder
if ($_GET['sort_dir'] == "DESC") {
$sort_dir = "DESC";
} else {
$sort_dir = "ASC";
}
} else {
if ($viewmode == LINKS_VIEW_HIERARCHICAL) {
$sort_dir = "ASC";
} else {
$sort_dir = "DESC";
}
}
if ($viewmode == LINKS_VIEW_HIERARCHICAL) {
$links = links_get_in_folder($fid, session::check_perm(USER_PERM_LINKS_MODERATE, 0), $sort_by, $sort_dir, $page);
} else {
$links = links_get_all(session::check_perm(USER_PERM_LINKS_MODERATE, 0), $sort_by, $sort_dir, $page);
}
if (sizeof($links['links_array']) < 1) {
html_display_warning_msg(gettext("No links in this folder."), '85%', 'center');
}
echo "<div align=\"center\">\n";
echo " <table cellpadding=\"0\" cellspacing=\"0\" width=\"85%\">\n";
echo " <tr>\n";
echo " <td align=\"left\">\n";
echo " <table class=\"box\" width=\"100%\">\n";
echo " <tr>\n";
echo " <td align=\"left\" class=\"posthead\">\n";
echo " <table width=\"100%\">\n";
echo " <tr>\n";
if ($sort_by == "TITLE" && $sort_dir == "ASC") {
echo " <td align=\"left\" class=\"subhead\"><a href=\"links.php?webtag={$webtag}&fid={$fid}&viewmode={$viewmode}&page={$page}&sort_by=TITLE&sort_dir=DESC\">", gettext("Name"), "</a> </td>\n";
示例13: preg_split
if (isset($_POST['t_to_uid_others']) && strlen(trim($_POST['t_to_uid_others'])) > 0) {
$t_recipient_array = preg_split("/[;|,]/u", trim($_POST['t_to_uid_others']));
$t_new_recipient_array['TO_UID'] = array();
$t_new_recipient_array['LOGON'] = array();
$t_new_recipient_array['NICK'] = array();
foreach ($t_recipient_array as $key => $t_recipient) {
$to_logon = trim($t_recipient);
if ($to_user = user_get_by_logon($to_logon)) {
$peer_relationship = user_get_peer_relationship($to_user['UID'], $uid);
if (!in_array($to_user['UID'], $t_new_recipient_array['TO_UID'])) {
$t_new_recipient_array['TO_UID'][] = $to_user['UID'];
$t_new_recipient_array['LOGON'][] = $to_user['LOGON'];
$t_new_recipient_array['NICK'][] = $to_user['NICKNAME'];
}
if ($to_radio == 'others') {
if ($peer_relationship ^ USER_BLOCK_PM && user_allow_pm($to_user['UID']) || session::check_perm(USER_PERM_FOLDER_MODERATE, 0)) {
pm_user_prune_folders();
if (pm_get_free_space($uid) < sizeof($t_new_recipient_array['TO_UID'])) {
$error_msg_array[] = gettext("You do not have enough free space to send this message.");
$valid = false;
}
} else {
$error_msg_array[] = sprintf(gettext("%s has opted out of receiving personal messages"), $to_logon);
$valid = false;
}
}
} else {
$error_msg_array[] = sprintf(gettext("User %s not found"), $to_logon);
$valid = false;
}
}
示例14: gettext
echo " </table>\n";
}
} else {
if ($folder_info[$folder_number]['INTEREST'] != FOLDER_IGNORED) {
// Only display the additional folder info if the user DOESN'T have the folder on ignore
echo " <table width=\"100%\" border=\"0\" cellpadding=\"0\" cellspacing=\"0\">\n";
echo " <tr>\n";
echo " <td class=\"threads_top_left_bottom\" align=\"left\" valign=\"top\" width=\"50%\" style=\"white-space: nowrap\"><a href=\"thread_list.php?webtag={$webtag}&mode={$mode}&folder={$folder_number}\" class=\"folderinfo\" title=\"", gettext("View messages in this folder only"), "\">";
if (isset($folder_msgs[$folder_number])) {
echo $folder_msgs[$folder_number];
} else {
echo "0";
}
echo " ", gettext("threads"), "</a></td>\n";
echo " <td align=\"left\" class=\"threads_top_right_bottom\" valign=\"top\" width=\"50%\" style=\"white-space: nowrap\">";
if (session::check_perm(USER_PERM_THREAD_CREATE, $folder_number)) {
echo "<a href=\"";
echo $folder_info[$folder_number]['ALLOWED_TYPES'] & FOLDER_ALLOW_NORMAL_THREAD ? "post.php?webtag={$webtag}" : (forum_get_setting('allow_polls', 'Y') ? "create_poll.php?webtag={$webtag}" : "");
echo "&fid={$folder_number}\" target=\"", html_get_frame_name('main'), "\" class=\"folderpostnew\" title=\"", gettext("Create new discussion in this folder"), "\">", gettext("Post New"), "</a>";
} else {
echo " ";
}
echo "</td>\n";
echo " </tr>\n";
echo " </table>\n";
}
}
echo " </td>\n";
echo " </tr>\n";
echo " </table>\n";
echo " </td>\n";
示例15: folder_is_accessible
function folder_is_accessible($fid)
{
if (!is_numeric($fid)) {
return false;
}
return session::check_perm(USER_PERM_POST_READ, $fid);
}