• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

PHP user_has_permission函数代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

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



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

示例1: login_as_button

 function login_as_button($uid, $upassword, $text = '', $attr = 'class="awesome small grey"')
 {
     if (user_has_permission('admin.accounts.can_login_as')) {
         $text = !$text ? lang('admin_login_as') : $text;
         return anchor(login_as_url($uid, $upassword), $text, $attr);
     } else {
         return '';
     }
 }
开发者ID:nailsapp,项目名称:module-admin,代码行数:9,代码来源:admin_helper.php


示例2: __construct

 function __construct()
 {
     parent::__construct();
     $this->load->library('session');
     $this->config->load('permissions', TRUE);
     $this->config->load('validations', TRUE);
     if (!$this->session->userdata('loggedin')) {
         redirect('sessions/login');
     }
     if (!user_has_permission($this->session->userdata('loggedin_user'), $this->router->class, $this->router->method)) {
         redirect('/');
         // show_error('Nu poti accesa pagina');
     }
     $this->current_user = $this->session->userdata('loggedin_user');
 }
开发者ID:kingareka,项目名称:testproject,代码行数:15,代码来源:MY_controller.php


示例3: _groups_set_default

 protected function _groups_set_default()
 {
     if (!user_has_permission('admin.accounts.can_set_default_group')) {
         show_404();
     }
     // --------------------------------------------------------------------------
     if ($this->user_group_model->set_as_default($this->uri->segment(5))) {
         $this->session->set_flashdata('success', '<strong>Success!</strong> Group set as default successfully.');
     } else {
         $this->session->set_flashdata('error', '<strong>Sorry,</strong> I could not set that group as the default user group. ' . $this->user_group_model->last_error());
     }
     redirect('admin/accounts/groups');
 }
开发者ID:nailsapp,项目名称:module-admin,代码行数:13,代码来源:accounts.php


示例4: number_format

        ?>
							</td>
							<td class="uses"><?php 
        echo number_format($voucher->use_count);
        ?>
</td>
							<td class="actions">
								<?php 
        $_buttons = array();
        // --------------------------------------------------------------------------
        if ($voucher->is_active) {
            if (user_has_permission('admin.shop.vouchers_deactivate')) {
                $_buttons[] = anchor('admin/shop/vouchers/deactivate/' . $voucher->id, 'Suspend', 'class="awesome small red confirm"');
            }
        } else {
            if (user_has_permission('admin.shop.vouchers_activate')) {
                $_buttons[] = anchor('admin/shop/vouchers/activate/' . $voucher->id, 'Activate', 'class="awesome small green"');
            }
        }
        // --------------------------------------------------------------------------
        if ($_buttons) {
            foreach ($_buttons as $button) {
                echo $button;
            }
        } else {
            echo '<span class="blank">There are no actions you can do on this item.</span>';
        }
        ?>
							</td>
						</tr>
						<?php 
开发者ID:nailsapp,项目名称:module-admin,代码行数:31,代码来源:index.php


示例5: anchor

        echo '</td>';
    } else {
        echo '<td class="default error">';
        echo '<span class="ion-close-circled"></span>';
        echo '</td>';
    }
    ?>
				<td class="actions">
				<?php 
    if (user_has_permission('admin.accounts.can_edit_group')) {
        echo anchor('admin/accounts/groups/edit/' . $group->id, lang('action_edit'), 'class="awesome small"');
    }
    if (user_has_permission('admin.accounts.can_delete_group')) {
        echo anchor('admin/accounts/groups/delete/' . $group->id, lang('action_delete'), 'class="awesome small red confirm" data-body="This action is also not undoable." data-title="Confirm Delete"');
    }
    if (user_has_permission('admin.accounts.can_set_default_group') && !$group->is_default) {
        echo anchor('admin/accounts/groups/set_default/' . $group->id, lang('accounts_groups_index_action_set_default'), 'class="awesome green small"');
    }
    ?>
				</td>
			</tr>

		<?php 
}
?>

		</tbody>

	</table>

</div>
开发者ID:nailsapp,项目名称:module-admin,代码行数:31,代码来源:index.php


示例6: lang

        if ($order->fulfilment_status == 'FULFILLED') {
            echo '<td class="fulfilment yes">' . lang('yes') . '</td>';
        } else {
            echo '<td class="fulfilment no">' . lang('no') . '</td>';
        }
        ?>
							<td class="actions">
								<?php 
        //	Render buttons
        $_buttons = array();
        // --------------------------------------------------------------------------
        if (user_has_permission('admin.shop.orders_view')) {
            $_buttons[] = anchor('admin/shop/orders/view/' . $order->id, lang('action_view'), 'class="awesome small fancybox" data-fancybox-type="iframe"');
        }
        // --------------------------------------------------------------------------
        if (user_has_permission('admin.shop.orders_reprocess')) {
            $_buttons[] = anchor('admin/shop/orders/reprocess/' . $order->id, 'Process', 'class="awesome small confirm" data-title="Are you sure?" data-body="Processing the order again may result in multiple dispatch of items."');
        }
        // --------------------------------------------------------------------------
        if ($_buttons) {
            foreach ($_buttons as $button) {
                echo $button;
            }
        } else {
            echo '<span class="blank">There are no actions you can perform on this item.</span>';
        }
        ?>
							</td>
						</tr>
						<?php 
    }
开发者ID:nailsapp,项目名称:module-admin,代码行数:31,代码来源:index.php


示例7: url

				retVal += charset.charAt(Math.floor(Math.random() * n));
			}
			return retVal;
		}
	</script>
</head>

<body>
	<div id="header">
		<div class="title"><a href="<?php 
echo url('/');
?>
">WebMUM - Web Mailserver User Manager</a></div>
		<div class="header-menu">
			<?php 
if (user_has_permission("admin")) {
    ?>
				<div class="header-button">
					<a href="<?php 
    echo url('admin');
    ?>
">[Admin Dashboard]</a>
				</div>
				<div class="header-button">
					<a href="<?php 
    echo url('private');
    ?>
">[Personal Dashboard]</a>
				</div>
			<?php 
}
开发者ID:ohartl,项目名称:webmum,代码行数:31,代码来源:header.php


示例8: anchor

 if ($member->id == active_user('id') || user_has_permission('admin.accounts.can_edit_others')) {
     $_buttons[] = anchor('admin/accounts/edit/' . $member->id . $_return, lang('action_edit'), 'data-fancybox-type="iframe" class="edit fancybox-max awesome small grey"');
 }
 // --------------------------------------------------------------------------
 //	Suspend user
 if ($member->is_suspended) {
     if (user_has_permission('admin.accounts.unsuspend')) {
         $_buttons[] = anchor('admin/accounts/unsuspend/' . $member->id . $_return, lang('action_unsuspend'), 'class="awesome small green"');
     }
 } else {
     if (user_has_permission('admin.accounts.suspend')) {
         $_buttons[] = anchor('admin/accounts/suspend/' . $member->id . $_return, lang('action_suspend'), 'class="awesome small red"');
     }
 }
 // --------------------------------------------------------------------------
 if (user_has_permission('admin.accounts.delete') && $member->id != active_user('id') && $member->group_id != 1) {
     $_buttons[] = anchor('admin/accounts/delete/' . $member->id . $_return, lang('action_delete'), 'class="confirm awesome small red" data-title="Delete user &quot;' . $member->first_name . ' ' . $member->last_name . '&quot?" data-body="' . lang('admin_confirm_delete') . '"');
 }
 // --------------------------------------------------------------------------
 //	These buttons are variable between views
 foreach ($actions as $button) {
     $_buttons[] = anchor($button['url'] . $_return, $button['label'], 'class="awesome small ' . $button['class'] . '"');
 }
 // --------------------------------------------------------------------------
 //	Render all the buttons, if any
 if ($_buttons) {
     foreach ($_buttons as $button) {
         echo $button;
     }
 } else {
     echo '<span class="not-editable">' . lang('accounts_index_noactions') . '</span>';
开发者ID:nailsapp,项目名称:module-admin,代码行数:31,代码来源:user_row.php


示例9: login_as_button

if ($user_edit->id != active_user('id') && user_has_permission('admin.accounts.can_login_as')) {
    $_buttons[] = login_as_button($user_edit->id, $user_edit->password, lang('admin_login_as') . ' ' . $user_edit->first_name, 'class="awesome" target="_parent"');
}
// --------------------------------------------------------------------------
//	Edit
if ($user_edit->id != active_user('id') && user_has_permission('admin.accounts.delete')) {
    $_buttons[] = anchor('admin/accounts/delete/' . $user_edit->id . '?return_to=' . urlencode('admin/accounts'), lang('action_delete'), 'class="awesome red confirm" data-title="' . lang('admin_confirm_delete_title') . '" data-body="' . lang('admin_confirm_delete_body') . '"');
}
// --------------------------------------------------------------------------
//	Suspend
if ($user_edit->is_suspended) {
    if (active_user('id') != $user_edit->id && user_has_permission('admin.accounts.unsuspend')) {
        $_buttons[] = anchor('admin/accounts/unsuspend/' . $user_edit->id . $return_string, lang('action_unsuspend'), 'class="awesome"');
    }
} else {
    if (active_user('id') != $user_edit->id && user_has_permission('admin.accounts.suspend')) {
        $_buttons[] = anchor('admin/accounts/suspend/' . $user_edit->id . $return_string, lang('action_suspend'), 'class="awesome red"');
    }
}
?>

<?php 
if ($_buttons) {
    ?>
<fieldset id="edit-user-actions">
	<legend><?php 
    echo lang('accounts_edit_actions_legend');
    ?>
</legend>
	<p>
	<?php 
开发者ID:nailsapp,项目名称:module-admin,代码行数:31,代码来源:inc-actions.php


示例10: foreach

if ($attributes) {
    foreach ($attributes as $attribute) {
        echo '<tr>';
        echo '<td class="label">';
        echo $attribute->label;
        echo $attribute->description ? '<small>' . character_limiter(strip_tags($attribute->description), 225) . '</small>' : '<small>No Description</small>';
        echo '</td>';
        echo '<td class="count">';
        echo !isset($attribute->product_count) ? 'Unknown' : $attribute->product_count;
        echo '</td>';
        echo $this->load->view('_utilities/table-cell-datetime', array('datetime' => $attribute->modified), TRUE);
        echo '<td class="actions">';
        if (user_has_permission('admin.shop.attribute_edit')) {
            echo anchor('admin/shop/manage/attribute/edit/' . $attribute->id . $is_fancybox, lang('action_edit'), 'class="awesome small"');
        }
        if (user_has_permission('admin.shop.attribute_delete')) {
            echo anchor('admin/shop/manage/attribute/delete/' . $attribute->id . $is_fancybox, lang('action_delete'), 'class="awesome small red confirm" data-title="Are you sure?" data-body="This action cannot be undone."');
        }
        echo '</td>';
        echo '</tr>';
    }
} else {
    echo '<tr>';
    echo '<td colspan="4" class="no-data">';
    echo 'No Attributes, add one!';
    echo '</td>';
    echo '</tr>';
}
?>
				</tbody>
			</table>
开发者ID:nailsapp,项目名称:module-admin,代码行数:31,代码来源:index.php


示例11: check_logged

<?php

require_once 'lib/header.php';
require_once 'lib/lib_ne.php';
require_once 'lib/lib_users.php';
// TODO: permissions?
check_logged();
$action = isset($_GET['act']) ? $_GET['act'] : '';
$tagset_id = get_current_tagset();
switch ($action) {
    case 'manual':
        $smarty->assign('content', get_wiki_page("nermanual/" . (int) $_GET['id']));
        $smarty->display('static/doc/annotation.tpl');
        break;
    default:
        $is_ner_mod = user_has_permission(PERM_NE_MODER);
        $smarty->assign('possible_guidelines', array(1 => "Default (2014)", 2 => "Dialogue Eval (2016)"));
        // TODO read from db
        $smarty->assign('is_ner_mod', $is_ner_mod);
        $smarty->assign('current_guideline', $tagset_id);
        $smarty->assign('page', get_books_with_NE($tagset_id, !$is_ner_mod));
        $smarty->display($is_ner_mod ? 'ner/main-moderator.tpl' : 'ner/main.tpl');
}
log_timing();
开发者ID:ayunah,项目名称:opencorpora,代码行数:24,代码来源:ner.php


示例12: array

        echo '</td>';
        echo '<td class="max-po">';
        echo $product_type->max_per_order ? $product_type->max_per_order : 'Unlimited';
        echo '</td>';
        echo '<td class="max-v">';
        echo $product_type->max_variations ? $product_type->max_variations : 'Unlimited';
        echo '</td>';
        echo '<td class="count">';
        echo !isset($product_type->product_count) ? 'Unknown' : $product_type->product_count;
        echo '</td>';
        echo $this->load->view('_utilities/table-cell-datetime', array('datetime' => $product_type->modified), TRUE);
        echo '<td class="actions">';
        if (user_has_permission('admin.shop.product_type_edit')) {
            echo anchor('admin/shop/manage/product_type/edit/' . $product_type->id . $is_fancybox, lang('action_edit'), 'class="awesome small"');
        }
        if (user_has_permission('admin.shop.product_type_delete')) {
            echo anchor('admin/shop/manage/product_type/delete/' . $product_type->id . $is_fancybox, lang('action_delete'), 'class="awesome small red confirm" data-title="Are you sure?" data-body="This action cannot be undone."');
        }
        echo '</td>';
        echo '</tr>';
    }
} else {
    echo '<tr>';
    echo '<td colspan="4" class="no-data">';
    echo 'No Product_types, add one!';
    echo '</td>';
    echo '</tr>';
}
?>
				</tbody>
			</table>
开发者ID:nailsapp,项目名称:module-admin,代码行数:31,代码来源:index.php


示例13: is_permitted

    function is_permitted($type='activity') {
		return user_has_permission($this->id, $type);    
    }
开发者ID:niamherinoc,项目名称:rctractors,代码行数:3,代码来源:class.wps_user.php


示例14: foreach

		<tbody>
		<?php 
if ($menus) {
    foreach ($menus as $menu) {
        echo '<tr class="menu" data-label="' . $menu->label . '">';
        echo '<td class="label">';
        echo $menu->label;
        echo $menu->description ? '<small>' . $menu->description . '</small>' : '';
        echo '</td>';
        $this->load->view('admin/_utilities/table-cell-user', $menu->modified_by);
        $this->load->view('admin/_utilities/table-cell-datetime', array('datetime' => $menu->modified));
        echo '<td class="actions">';
        if (user_has_permission('admin.cms.can_edit_menu')) {
            echo anchor('admin/cms/menus/edit/' . $menu->id, lang('action_edit'), 'class="awesome small"');
        }
        if (user_has_permission('admin.cms.can_delete_menu')) {
            echo anchor('admin/cms/menus/delete/' . $menu->id, lang('action_delete'), 'data-title="Are you sure?" data-body="This will remove the menu from the site. This action cannot be undone." class="confirm awesome small red"');
        }
        echo '</td>';
        echo '</tr>';
    }
} else {
    echo '<tr>';
    echo '<td colspan="4" class="no-data">';
    echo 'No editable menus found';
    echo '</td>';
    echo '</tr>';
}
?>
		</tbody>
	</table>
开发者ID:nailsapp,项目名称:module-admin,代码行数:31,代码来源:index.php


示例15: get_book_page

function get_book_page($book_id, $full = false, $override_hidden = false)
{
    if (!$override_hidden) {
        check_book_hidden($book_id);
    }
    $res = sql_pe("SELECT * FROM `books` WHERE `book_id`=? LIMIT 1", array($book_id));
    if (!sizeof($res)) {
        throw new UnexpectedValueException();
    }
    $out = array('id' => $book_id, 'title' => $res[0]['book_name'], 'select' => get_books_for_select(), 'is_wikinews' => $res[0]['parent_id'] == 56, 'is_chaskor_news' => $res[0]['parent_id'] == 226);
    get_book_tags($book_id, $out);
    //sub-books
    foreach (sql_pe("SELECT book_id, book_name FROM books WHERE parent_id=? ORDER BY book_name", array($book_id)) as $r) {
        $out['children'][] = array('id' => $r['book_id'], 'title' => $r['book_name']);
    }
    //parents
    $out['parents'] = array_reverse(get_book_parents($book_id));
    //sentences
    if ($full) {
        $q = "SELECT p.`pos` ppos, par_id, s.sent_id, s.`pos` spos";
        if (user_has_permission(PERM_ADDER)) {
            $q .= ", ss.status";
        }
        $q .= "\nFROM paragraphs p\n            LEFT JOIN sentences s\n            USING (par_id)\n";
        if (user_has_permission(PERM_ADDER)) {
            $q .= "LEFT JOIN sentence_check ss ON (s.sent_id = ss.sent_id AND ss.status=1 AND ss.user_id=" . $_SESSION['user_id'] . ")\n";
        }
        $q .= "WHERE p.book_id = ?\n            ORDER BY p.`pos`, s.`pos`";
        $res = sql_pe($q, array($book_id));
        $res1 = sql_prepare("SELECT tf_id, tf_text FROM tokens WHERE sent_id=? ORDER BY pos");
        foreach ($res as $r) {
            sql_execute($res1, array($r['sent_id']));
            $tokens = array();
            while ($r1 = sql_fetch_array($res1)) {
                $tokens[] = array('text' => $r1['tf_text'], 'id' => $r1['tf_id']);
            }
            $new_a = array('id' => $r['sent_id'], 'pos' => $r['spos'], 'tokens' => $tokens);
            if (user_has_permission(PERM_ADDER)) {
                $new_a['checked'] = $r['status'];
            }
            $out['paragraphs'][$r['ppos']]['sentences'][] = $new_a;
            $out['paragraphs'][$r['ppos']]['id'] = $r['par_id'];
        }
    } else {
        $res = sql_pe("SELECT p.`pos` ppos, s.sent_id, s.`pos` spos FROM paragraphs p LEFT JOIN sentences s ON (p.par_id = s.par_id) WHERE p.book_id = ? ORDER BY p.`pos`, s.`pos`", array($book_id));
        foreach ($res as $r) {
            $r1 = sql_fetch_array(sql_query("SELECT source, SUBSTRING_INDEX(source, ' ', 6) AS `cnt` FROM sentences WHERE sent_id=" . $r['sent_id'] . " LIMIT 1"));
            if ($r1['source'] === $r1['cnt']) {
                $out['paragraphs'][$r['ppos']]['sentences'][] = array('pos' => $r['spos'], 'id' => $r['sent_id'], 'snippet' => $r1['source']);
                continue;
            }
            $snippet = '';
            $r1 = sql_fetch_array(sql_query("SELECT SUBSTRING_INDEX(source, ' ', 3) AS `start` FROM sentences WHERE sent_id=" . $r['sent_id'] . " LIMIT 1"));
            $snippet = $r1['start'];
            if ($snippet) {
                $snippet .= '... ';
            }
            $r1 = sql_fetch_array(sql_query("SELECT SUBSTRING_INDEX(source, ' ', -3) AS `end` FROM sentences WHERE sent_id=" . $r['sent_id'] . " LIMIT 1"));
            $snippet .= $r1['end'];
            $out['paragraphs'][$r['ppos']]['sentences'][] = array('pos' => $r['spos'], 'id' => $r['sent_id'], 'snippet' => $snippet);
        }
    }
    return $out;
}
开发者ID:gisly,项目名称:opencorpora,代码行数:64,代码来源:lib_books.php


示例16: check_moderator_right

function check_moderator_right($user_id, $pool_id, $make_owner = false)
{
    // the pool must have status=5 (under moderation) AND either:
    // - have no moderator
    // - or have this user as moderator
    // - or this user must be a supermoderator
    $res = sql_pe("SELECT `status`, moderator_id FROM morph_annot_pools WHERE pool_id = ? LIMIT 1", array($pool_id));
    if ($res[0]['status'] != MA_POOLS_STATUS_MODERATION) {
        return false;
    }
    if ($res[0]['moderator_id'] == 0) {
        if ($make_owner) {
            sql_pe("UPDATE morph_annot_pools SET moderator_id=? WHERE pool_id=? LIMIT 1", array($user_id, $pool_id));
        }
    } elseif ($res[0]['moderator_id'] != $user_id && !user_has_permission(PERM_MORPH_SUPERMODER)) {
        return false;
    }
    return true;
}
开发者ID:ayunah,项目名称:opencorpora,代码行数:19,代码来源:lib_morph_pools.php


示例17: get_dict_errata

    case 'errata':
        $smarty->assign('errata', get_dict_errata(isset($_GET['all']), isset($_GET['rand'])));
        $smarty->display('dict/errata.tpl');
        break;
    case 'pending':
        $skip = isset($_GET['skip']) ? $_GET['skip'] : 0;
        $smarty->assign('data', get_pending_updates($skip));
        $smarty->display('dict/pending.tpl');
        break;
    case 'reannot':
        update_pending_tokens($_POST['rev_id'], isset($_POST['smart_mode']) && $_POST['smart_mode'] == 'on');
        header("Location:dict.php?act=pending");
        break;
    case 'absent':
        $smarty->setCaching(Smarty::CACHING_LIFETIME_SAVED);
        $smarty->setCacheLifetime(3600);
        if (!is_cached('dict/absent.tpl')) {
            $smarty->assign('words', get_top_absent_words());
        }
        $smarty->display('dict/absent.tpl');
        break;
    default:
        $smarty->setCaching(Smarty::CACHING_LIFETIME_SAVED);
        $smarty->setCacheLifetime(600);
        if (!is_cached('dict/main.tpl', (int) user_has_permission(PERM_DICT))) {
            $smarty->assign('stats', get_dict_stats());
            $smarty->assign('dl', get_downloads_info());
        }
        $smarty->display('dict/main.tpl', (int) user_has_permission(PERM_DICT));
}
log_timing();
开发者ID:ayunah,项目名称:opencorpora,代码行数:31,代码来源:dict.php


示例18: if

          <div class="<? if($page=='compose_email') echo "subMenuTabSelected"; else echo "subMenuTab"; ?>">Compose Email</div>
        </a></td>
         <td valign="top" class="subMenuTabWidth"><a href="<?php 
echo PAGE_COMMUNICATION;
?>
?section=lists" class="h1">
          <div class="<? if($page=='lists') echo "subMenuTabSelected"; else echo "subMenuTab"; ?>">Manage Lists</div>
        </a></td>
         <td valign="top" class="subMenuTabWidth"><a href="<?php 
echo PAGE_COMMUNICATION;
?>
?section=subscribers" class="h1">
          <div class="<? if($page=='subscribers') echo "subMenuTabSelected"; else echo "subMenuTab"; ?>">Contacts</div>
        </a></td>
        <!--
        <? if(user_has_permission(18)) { ?>
        <td valign="top" class="subMenuTabWidth"><a href="<?php 
echo PAGE_COMMUNICATION;
?>
?section=compose_sms" class="h1">
          <div class="<? if($page=='compose_sms') echo "subMenuTabSelected"; else echo "subMenuTab"; ?>"> Send SMS</div>
        </a></td>
       <? } ?>
        -->
       <td valign="top" class="subMenuTabWidth"><a href="<?php 
echo PAGE_COMMUNICATION;
?>
?section=import" class="h1">
          <div class="<? if($page=='import') echo "subMenuTabSelected"; else echo "subMenuTab"; ?>">Import Subscribers</div>
        </a></td>
         <td valign="top" class="subMenuTabWidth"><a href="<?php 
开发者ID:sherdog,项目名称:cvsi,代码行数:31,代码来源:communication_sub_menu.php


示例19: get_morph_samples_page

     if (isset($_GET['tabs'])) {
         $smarty->assign('pool', get_morph_samples_page($_GET['pool_id'], true, 100));
         header("Content-type: application/csv; charset=utf-8");
         header("Content-disposition: attachment; filename=pool_" . (int) $_GET['pool_id'] . ".tab");
         $smarty->display('qa/pool_tabs.tpl');
     } else {
         $filter = isset($_GET['filter']) ? $_GET['filter'] : false;
         $matches = NULL;
         if ($filter && !user_has_permission(PERM_MORPH_MODER) && preg_match('/^user:(\\d+)$/', $filter, $matches)) {
             if ($matches[1] != $_SESSION['user_id']) {
                 show_error("Можно просматривать только свои ответы.");
                 return;
             }
         }
         $smarty->assign('sortby', isset($_GET['sortby']) ? $_GET['sortby'] : '');
         $smarty->assign('pool', get_morph_samples_page($_GET['pool_id'], isset($_GET['ext']), $config['misc']['morph_annot_moder_context_size'], isset($_GET['skip']) ? $_GET['skip'] : 0, $filter, !user_has_permission(PERM_MORPH_MODER) || OPTION(OPT_MODER_SPLIT) == 1 ? $config['misc']['morph_annot_moder_page_size'] : 0, isset($_GET['sortby']) ? $_GET['sortby'] : ''));
         $smarty->display('qa/pool.tpl');
     }
     break;
 case 'promote':
     check_permission(PERM_MORPH_MODER);
     promote_samples((int) $_GET['pool_type'], $_POST['type'], (int) $_POST[$_POST['type'] . "_n"], (int) $_POST['pools_num'], $_SESSION['user_id']);
     header("Location:pools.php?type=2");
     break;
 case 'publish':
     publish_pool($_GET['pool_id']);
     header("Location:pools.php?type=2");
     break;
 case 'unpublish':
     unpublish_pool($_GET['pool_id']);
     header("Location:pools.php?act=samples&pool_id=" . $_GET['pool_id']);
开发者ID:gisly,项目名称:opencorpora,代码行数:31,代码来源:pools.php


示例20: check_permission

function check_permission($group)
{
    if (!user_has_permission($group)) {
        throw new PermissionError();
    }
}
开发者ID:OpenCorporaUnit,项目名称:opencorpora,代码行数:6,代码来源:lib_users.php



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


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
PHP user_has_role函数代码示例发布时间:2022-05-23
下一篇:
PHP user_has_access函数代码示例发布时间:2022-05-23
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap