本文整理汇总了PHP中permissions::checkPermissions方法的典型用法代码示例。如果您正苦于以下问题:PHP permissions::checkPermissions方法的具体用法?PHP permissions::checkPermissions怎么用?PHP permissions::checkPermissions使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类permissions
的用法示例。
在下文中一共展示了permissions::checkPermissions方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: smarty_function_get_nodes_by_parent
function smarty_function_get_nodes_by_parent($params, &$smarty)
{
global $node;
$parent = $params['parent'];
$permissions = permissions::checkPermissions($parent);
if (!$permissions['r']) {
$error = $error_messages['READ_PERMISSION_ERROR'];
return false;
}
if ($params['listing_amount'] == 'all') {
$listing_amount = '232323233';
} else {
$listing_amount = $params['listing_amount'];
}
if (empty($params['offset'])) {
$offset = 0;
} else {
$offset = $params['offset'];
}
if ($params['orderby']) {
$orderby = addslashes($params['orderby']);
}
global $db, $node;
$node_id = $node['node_id'];
$user_id = $_SESSION['user_id'];
$q = "select node_content.*,parent.node_name as parent_name,users.*,nodes.*,node_access.node_user_subchild_count from nodes left join nodes as parent on parent.node_id=nodes.node_parent left join node_access on node_access.node_id=nodes.node_id and node_access.user_id='{$user_id}' left join node_content on (node_content.node_id=nodes.node_id) left join users on users.user_id=nodes.node_creator where ";
$q .= " nodes.node_parent='{$parent}' and nodes.node_system_access!='private'";
if ($_POST['template_event'] == 'filter_by') {
if ($_POST['search_type'] == 'content') {
$sql_type .= " and node_content like '%" . addslashes($_POST['node_content']) . "%' ";
} else {
$q2 = "select user_id from users where login='" . $_POST['node_content'] . "'";
$userset = $db->query($q2);
$userset->next();
$id = $userset->getString('user_id');
$sql_type = " and nodes.node_creator='{$id}'";
}
$q .= $sql_type;
}
if ($orderby) {
$q .= " order by {$orderby} ";
} else {
$q .= " order by nodes.node_id desc ";
}
$q .= " LIMIT {$offset},{$listing_amount} ";
$set = $db->query($q);
while ($set->next()) {
$pole[] = $set->getRecord();
}
$smarty->assign('get_nodes_by_parent', $pole);
}
示例2: elseif
} elseif ($_SESSION['user_id']) {
$smarty->assign('node_name', $_GET['node_name']);
$content = $smarty->display("modules/addnode.tpl");
}
}
//modifying node glass pearl
if (is_array($children_types[$node['node_type']])) {
$smarty->assign('children_types', $children_types[$node['node_type']]);
}
$smarty->assign('types', $types);
$node['node_type'] = $types[$node['node_type']];
$node['node_content'] = StripSlashes($node['node_content']);
$node['node_name'] = StripSlashes($node['node_name']);
//checking permissions
require SYSTEM_ROOT . 'inc/permissions.inc';
$permissions = permissions::checkPermissions($node);
$permissions['h'] = permissions::isHierarch($node);
//entering the node
//sventest
if ($permissions['r'] || $event != 'register') {
//performing node_events (based on update/insert/delete db queries)
if ($event) {
require SYSTEM_ROOT . 'inc/eventz.inc';
} elseif ($transaction) {
require SYSTEM_ROOT . 'inc/transaction.inc';
}
//end of performing node events
//sventest
}
if ($permissions['r']) {
log::log('enter', $node['node_id'], 'ok', $node['node_user_subchild_count']);