本文整理汇总了PHP中Acl::check方法的典型用法代码示例。如果您正苦于以下问题:PHP Acl::check方法的具体用法?PHP Acl::check怎么用?PHP Acl::check使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Acl
的用法示例。
在下文中一共展示了Acl::check方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: CT_Start_Default
function CT_Start_Default($target)
{
importlib("model.blog.attachment");
$context = Model_Context::getInstance();
$blogURL = $context->getProperty('uri.blog');
$blogid = $context->getProperty('blog.id');
$target .= '<ul>';
$target .= '<li><a href="' . $blogURL . '/owner/entry/post">' . _t('새 글을 씁니다') . '</a></li>' . CRLF;
$latestEntryId = Setting::getBlogSettingGlobal('LatestEditedEntry_user' . getUserId(), 0);
if ($latestEntryId !== 0) {
$latestEntry = CT_Start_Default_getEntry($blogid, $latestEntryId);
if ($latestEntry != false) {
$target .= '<li><a href="' . $blogURL . '/owner/entry/edit/' . $latestEntry['id'] . '">' . _f('최근글(%1) 수정', htmlspecialchars(Utils_Unicode::lessenAsEm($latestEntry['title'], 10))) . '</a></li>';
}
}
if (Acl::check('group.administrators')) {
$target .= '<li><a href="' . $blogURL . '/owner/skin">' . _t('스킨을 변경합니다') . '</a></li>' . CRLF;
$target .= '<li><a href="' . $blogURL . '/owner/skin/sidebar">' . _t('사이드바 구성을 변경합니다') . '</a></li>' . CRLF;
$target .= '<li><a href="' . $blogURL . '/owner/skin/setting">' . _t('블로그에 표시되는 값들을 변경합니다') . '</a></li>' . CRLF;
$target .= '<li><a href="' . $blogURL . '/owner/entry/category">' . _t('카테고리를 변경합니다') . '</a></li>' . CRLF;
$target .= '<li><a href="' . $blogURL . '/owner/plugin">' . _t('플러그인을 켜거나 끕니다') . '</a></li>' . CRLF;
}
if ($context->getProperty('service.reader', false) != false) {
$target .= '<li><a href="' . $blogURL . '/owner/network/reader">' . _t('RSS 리더를 봅니다') . '</a></li>' . CRLF;
}
$target .= '</ul>';
return $target;
}
示例2: CT_Start_Default
function CT_Start_Default($target)
{
requireModel("blog.attachment");
requireComponent("Eolin.PHP.Core");
requireComponent("Textcube.Function.misc");
global $blogid, $blogURL, $database, $service;
$target .= '<ul>';
$target .= '<li><a href="' . $blogURL . '/owner/entry/post">' . _t('새 글을 씁니다') . '</a></li>' . CRLF;
$latestEntryId = Setting::getBlogSettingGlobal('LatestEditedEntry_user' . getUserId(), 0);
if ($latestEntryId !== 0) {
$latestEntry = CT_Start_Default_getEntry($blogid, $latestEntryId);
if ($latestEntry != false) {
$target .= '<li><a href="' . $blogURL . '/owner/entry/edit/' . $latestEntry['id'] . '">' . _f('최근글(%1) 수정', htmlspecialchars(Utils_Unicode::lessenAsEm($latestEntry['title'], 10))) . '</a></li>';
}
}
if (Acl::check('group.administrators')) {
$target .= '<li><a href="' . $blogURL . '/owner/skin">' . _t('스킨을 변경합니다') . '</a></li>' . CRLF;
$target .= '<li><a href="' . $blogURL . '/owner/skin/sidebar">' . _t('사이드바 구성을 변경합니다') . '</a></li>' . CRLF;
$target .= '<li><a href="' . $blogURL . '/owner/skin/setting">' . _t('블로그에 표시되는 값들을 변경합니다') . '</a></li>' . CRLF;
$target .= '<li><a href="' . $blogURL . '/owner/entry/category">' . _t('카테고리를 변경합니다') . '</a></li>' . CRLF;
$target .= '<li><a href="' . $blogURL . '/owner/plugin">' . _t('플러그인을 켜거나 끕니다') . '</a></li>' . CRLF;
}
if ($service['reader'] != false) {
$target .= '<li><a href="' . $blogURL . '/owner/network/reader">' . _t('RSS 리더를 봅니다') . '</a></li>' . CRLF;
}
$target .= '</ul>';
return $target;
}
示例3: post_reorder
public function post_reorder()
{
if (!Acl::check('parts.reorder')) {
return;
}
$ids = $this->param('ids', array());
ORM::factory('page_part')->sort($ids);
}
示例4: getEntriesCountByCategory
function getEntriesCountByCategory($blogid, $id)
{
$context = Model_Context::getInstance();
if ($context->getProperty('category.raw') === null) {
getCategories($blogid, 'raw');
}
//To cache category information.
$result = MMCache::queryRow($context->getProperty('category.raw'), 'id', $id);
if ($id === 0 || $result == '' || $id === null) {
return 0;
} else {
if (doesHaveOwnership() && Acl::check('group.editors')) {
return $result['entriesinlogin'];
} else {
return $result['entries'];
}
}
}
示例5: _edit
private function _edit(ORM $role)
{
$data = $this->request->post('role');
$this->auto_render = FALSE;
try {
$role = $role->values($data)->update();
if (Acl::check('roles.change_permissions') and !empty($data['permissions'])) {
$role->set_permissions($data['permissions']);
}
Messages::success(__('Role has been saved!'));
} catch (ORM_Validation_Exception $e) {
Messages::errors($e->errors('validation'));
$this->go_back();
}
if ($this->request->post('commit') !== NULL) {
$this->go();
} else {
$this->go(array('action' => 'edit', 'id' => $role->id));
}
}
示例6: requireOwnership
} else {
if ($blogVisibility == 0) {
requireOwnership();
} else {
if ($blogVisibility == 1) {
requireMembership();
}
}
}
}
if (in_array($context->getProperty('uri.interfaceType'), array('owner', 'reader'))) {
requireOwnership();
// Check access control list
if (!empty($_SESSION['acl'])) {
$requiredPriv = Aco::getRequiredPrivFromUrl($context->getProperty('suri.directive'));
if (!empty($requiredPriv) && !Acl::check($requiredPriv)) {
if (in_array('group.administrators', $requiredPriv)) {
header("location:" . $context->getProperty('uri.blog') . "/owner/center/dashboard");
exit;
} else {
header("location:" . $context->getProperty('uri.blog') . "/owner/entry");
exit;
}
}
}
}
/** INITIALIZE : Cookie prefix
* -----------------------------------
* Determines cookie prefix.
*/
if ($context->getProperty('service.cookie_prefix', '') == '') {
示例7: getRecentComments
function getRecentComments($blogid, $count = false, $isGuestbook = false, $guestShip = false)
{
global $skinSetting, $database;
$comments = array();
if (!$isGuestbook && !Acl::check("group.editors")) {
$userLimit = ' AND e.userid = ' . getUserId();
} else {
$userLimit = '';
}
$sql = doesHaveOwnership() && !$guestShip ? "SELECT r.*, e.title, e.slogan\n\t\tFROM\n\t\t\t{$database['prefix']}Comments r\n\t\t\tINNER JOIN {$database['prefix']}Entries e ON r.blogid = e.blogid AND r.entry = e.id AND e.draft = 0{$userLimit}\n\t\tWHERE\n\t\t\tr.blogid = {$blogid}" . ($isGuestbook != false ? " AND r.entry=0" : " AND r.entry>0") . " AND r.isfiltered = 0\n\t\tORDER BY\n\t\t\tr.written\n\t\tDESC LIMIT " . ($count != false ? $count : $skinSetting['commentsOnRecent']) : "SELECT r.*, e.title, e.slogan\n\t\tFROM\n\t\t\t{$database['prefix']}Comments r\n\t\t\tINNER JOIN {$database['prefix']}Entries e ON r.blogid = e.blogid AND r.entry = e.id AND e.draft = 0\n\t\t\tLEFT OUTER JOIN {$database['prefix']}Categories c ON e.blogid = c.blogid AND e.category = c.id\n\t\tWHERE\n\t\t\tr.blogid = {$blogid} AND e.draft = 0 AND e.visibility >= 2" . getPrivateCategoryExclusionQuery($blogid) . ($isGuestbook != false ? " AND r.entry = 0" : " AND r.entry > 0") . " AND r.isfiltered = 0\n\t\tORDER BY\n\t\t\tr.written\n\t\tDESC LIMIT " . ($count != false ? $count : $skinSetting['commentsOnRecent']);
if ($result = POD::queryAllWithDBCache($sql, 'comment')) {
foreach ($result as $comment) {
if ($comment['secret'] == 1 && !doesHaveOwnership()) {
if (!doesHaveOpenIDPriv($comment)) {
$comment['name'] = _text('비밀방문자');
$comment['homepage'] = '';
$comment['comment'] = _text('관리자만 볼 수 있는 댓글입니다.');
}
}
array_push($comments, $comment);
}
}
return $comments;
}
示例8: getDefaultCenterPanel
//.........这里部分代码省略.........
/owner/entry/post"><span><?php
echo _t('새 글 쓰기');
?>
</span></a></li>
<?php
if ($latestEntryId !== 0) {
$latestEntry = getEntry($blogid, $latestEntryId);
if (!is_null($latestEntry)) {
?>
<li class="modifyPost"><a href="<?php
echo $ctx->getProperty('uri.blog');
?>
/owner/entry/edit/<?php
echo $latestEntry['id'];
?>
"><?php
echo _f('최근글(%1) 수정', htmlspecialchars(Utils_Unicode::lessenAsEm($latestEntry['title'], 10)));
?>
</a></li>
<?php
}
}
if ($ctx->getProperty('service.reader') == true) {
?>
<li class="rssReader"><a href="<?php
echo $ctx->getProperty('uri.blog');
?>
/owner/network/reader"><?php
echo _t('RSS로 등록한 이웃 글 보기');
?>
</a></li>
<?php
}
if (Acl::check("group.administrators")) {
?>
<li class="deleteCache"><a href="<?php
echo $ctx->getProperty('uri.blog');
?>
/owner/center/dashboard/cleanup" onclick="cleanupCache();return false;"><?php
echo _t('캐시 지우기');
?>
</a></li>
<?php
if (Acl::check("group.creators")) {
?>
<li class="optimizeStorage"><a href="<?php
echo $ctx->getProperty('uri.blog');
?>
/owner/data" onclick="optimizeData();return false;"><?php
echo _t('저장소 최적화');
?>
</a></li>
<?php
}
}
?>
<li class="clear"></li>
</ul>
</div>
<div id="total-information">
<h4 class="caption"><span><?php
echo _t('요약');
?>
</span></h4>
示例9: setDefaultBlog
function setDefaultBlog($blogid)
{
if (!Acl::check("group.creators")) {
return false;
}
$result = Setting::setServiceSettingGlobal("defaultBlogId", $_GET['blogid']);
return $result;
}
示例10: array
?>
</div>
<div class="profile-row">
<div class="left-col">
<div class="profile-block">
<div class="panel profile-photo">
<?php
echo HTML::anchor('http://gravatar.com/emails/', $user->gravatar(100, NULL), array('target' => '_blank'));
?>
</div>
<br />
<?php
if (Acl::check('users.edit') or $user->id == Auth::get_id()) {
?>
<?php
echo HTML::anchor(Route::get('backend')->uri(array('controller' => 'users', 'action' => 'edit', 'id' => $user->id)), __('Edit profile'), array('class' => 'btn btn-success btn-sm', 'data-icon' => 'user'));
?>
<?php
}
?>
</div>
</div>
<div class="right-col">
<hr class="profile-content-hr no-grid-gutter-h">
<div class="profile-content tabbable">
<?php
示例11: getEntryWithPagingBySlogan
function getEntryWithPagingBySlogan($blogid, $slogan, $isNotice = false, $categoryId = false)
{
global $database;
global $blogURL;
requireModel('blog.category');
$entries = array();
$paging = $isNotice ? Paging::init("{$blogURL}/notice", '/') : Paging::init("{$blogURL}/entry", '/');
$visibility = doesHaveOwnership() ? '' : 'AND e.visibility > 0';
$visibility .= $isNotice || doesHaveOwnership() ? '' : getPrivateCategoryExclusionQuery($blogid);
$visibility .= doesHaveOwnership() && !Acl::check('group.editors') ? ' AND (e.userid = ' . getUserId() . ' OR e.visibility > 0)' : '';
$category = $isNotice ? 'e.category = -2' : 'e.category >= 0';
if ($categoryId !== false) {
if (!$categoryId == 0) {
// Not a 'total' category.
$childCategories = getChildCategoryId($blogid, $categoryId);
if (!empty($childCategories)) {
$category = 'e.category IN (' . $categoryId . ',' . implode(",", $childCategories) . ')';
} else {
$category = 'e.category = ' . $categoryId;
}
}
}
$currentEntry = POD::queryRow("SELECT e.*, c.label AS categoryLabel \n\t\tFROM {$database['prefix']}Entries e \n\t\tLEFT JOIN {$database['prefix']}Categories c ON e.blogid = c.blogid AND e.category = c.id \n\t\tWHERE e.blogid = {$blogid} \n\t\t\tAND e.slogan = '" . POD::escapeString($slogan) . "' \n\t\t\tAND e.draft = 0 {$visibility} AND {$category}");
$result = POD::query("SELECT e.id, e.slogan \n\t\tFROM {$database['prefix']}Entries e \n\t\tLEFT JOIN {$database['prefix']}Categories c ON e.blogid = c.blogid AND e.category = c.id \n\t\tWHERE e.blogid = {$blogid} \n\t\t\tAND e.draft = 0 {$visibility} AND {$category} \n\t\tORDER BY e.published DESC");
if (!$result || !$currentEntry) {
return array($entries, $paging);
}
if ($categoryId !== false) {
$paging['pages'] = $categoryId == 0 ? getEntriesTotalCount($blogid) : getEntriesCountByCategory($blogid, $categoryId);
$paging['postfix'] = '?category=' . $categoryId;
} else {
$paging['pages'] = $isNotice ? getNoticesTotalCount($blogid) : getEntriesTotalCount($blogid);
}
for ($i = 1; $entry = POD::fetch($result); $i++) {
if ($entry['slogan'] != $slogan) {
if (array_push($paging['before'], $entry['slogan']) > 4) {
if ($i == 5) {
$paging['first'] = array_shift($paging['before']);
} else {
array_shift($paging['before']);
}
}
continue;
}
$paging['page'] = $i;
array_push($entries, $currentEntry);
$paging['after'] = array();
for ($i++; count($paging['after']) < 4 && ($entry = POD::fetch($result)); $i++) {
array_push($paging['after'], $entry['slogan']);
}
if ($i < $paging['pages']) {
while ($entry = POD::fetch($result)) {
$paging['last'] = $entry['slogan'];
}
}
if (count($paging['before']) > 0) {
$paging['prev'] = $paging['before'][count($paging['before']) - 1];
}
if (isset($paging['after'][0])) {
$paging['next'] = $paging['after'][0];
}
return array($entries, $paging);
}
$paging['page'] = $paging['pages'] + 1;
return array($entries, $paging);
}
示例12: getEntriesCountByCategory
function getEntriesCountByCategory($blogid, $id)
{
requireComponent('Needlworks.Cache.PageCache');
global $__gCacheCategoryRaw;
if (empty($__gCacheCategoryRaw)) {
getCategories($blogid, 'raw');
}
//To cache category information.
$result = MMCache::queryRow($__gCacheCategoryRaw, 'id', $id);
if ($id === 0 || $result == '' || $id === null) {
return 0;
} else {
if (doesHaveOwnership() && Acl::check('group.editors')) {
return $result['entriesinlogin'];
} else {
return $result['entries'];
}
}
}
示例13: recurse_pages
function recurse_pages($pages, $spaces = 0, $layouts_blocks = array(), $page_widgets = array(), $pages_widgets = array())
{
$data = '';
foreach ($pages as $page) {
// Блок
$current_block = Arr::path($page_widgets, $page['id'] . '.0');
$current_position = Arr::path($page_widgets, $page['id'] . '.1');
$data .= '<tr data-id="' . $page['id'] . '" data-parent-id="' . $page['parent_id'] . '">';
$data .= '<td>';
if (!empty($page['childs'])) {
$data .= '<div class="input-group">';
}
$data .= Form::hidden('blocks[' . $page['id'] . '][name]', $current_block, array('class' => 'widget-blocks form-control', 'data-layout' => $page['layout_file']));
if (!empty($page['childs'])) {
$data .= "<div class=\"input-group-btn\">" . Form::button(NULL, UI::icon('level-down'), array('class' => 'set_to_inner_pages btn', 'title' => __('Select to child pages'))) . '</div></div>';
}
$data .= '</td><td>';
$data .= Form::input('blocks[' . $page['id'] . '][position]', (int) $current_position, array('maxlength' => 4, 'size' => 4, 'class' => 'form-control text-right widget-position'));
$data .= '</td><td></td>';
if (Acl::check('page.edit')) {
$data .= '<th>' . str_repeat("- ", $spaces) . HTML::anchor(Route::get('backend')->uri(array('controller' => 'page', 'action' => 'edit', 'id' => $page['id'])), $page['title']) . '</th>';
} else {
$data .= '<th>' . str_repeat("- ", $spaces) . $page['title'] . '</th>';
}
$data .= '</tr>';
if (!empty($page['childs'])) {
$data .= recurse_pages($page['childs'], $spaces + 5, $layouts_blocks, $page_widgets, $pages_widgets);
}
}
return $data;
}
示例14: __
?>
</th>
<th><?php
echo __('Actions');
?>
</th>
</tr>
</thead>
<tbody>
<?php
foreach ($roles as $role) {
?>
<tr class="item">
<td class="name">
<?php
if (Acl::check('roles.edit')) {
?>
<?php
echo HTML::anchor(Route::get('backend')->uri(array('controller' => 'roles', 'action' => 'edit', 'id' => $role->id)), $role->name, array('data-icon' => 'unlock'));
?>
<?php
} else {
?>
<?php
echo UI::icon('lock');
?>
<?php
echo $role->name;
?>
<?php
}
示例15: array
<?php
/// Copyright (c) 2004-2012, Needlworks / Tatter Network Foundation
/// All rights reserved. Licensed under the GPL.
/// See the GNU General Public License for more details. (/documents/LICENSE, /documents/COPYRIGHT)
$IV = array('GET' => array('visibility' => array('int', 0, 3, 'default' => 0), 'command' => array('string', 'mandatory' => false)), 'POST' => array('visibility' => array('int', 0, 3, 'default' => 0), 'command' => array('string', 'mandatory' => false)));
require ROOT . '/library/preprocessor.php';
requireModel("blog.entry");
requireStrictRoute();
// TeamBlog ACL check whether or not current user can edit this post.
if (Acl::check('group.writers') === false && !empty($suri['id'])) {
if (getUserIdOfEntry(getBlogId(), $suri['id']) != getUserId()) {
@header("location:" . $context->getProperty('uri.blog') . "/owner/entry");
exit;
}
}
//$isAjaxRequest = checkAjaxRequest();
if (!isset($_GET['command'])) {
$temp = setEntryVisibility($suri['id'], isset($_GET['visibility']) ? $_GET['visibility'] : 0) == true ? 0 : 1;
$countResult = POD::queryExistence("SELECT id \n\t\t\tFROM {$database['prefix']}Entries \n\t\t\tWHERE blogid = " . getBlogId() . " AND visibility = 3");
if ($countResult == false) {
$countResult = 0;
} else {
$countResult = 1;
}
Respond::PrintResult(array('error' => $temp, 'countSyndicated' => $countResult), false);
} else {
switch ($_GET['command']) {
case "protect":
$_GET['command'] = 1;
break;