当前位置: 首页>>代码示例>>PHP>>正文


PHP Permissions::canAdmin方法代码示例

本文整理汇总了PHP中Permissions::canAdmin方法的典型用法代码示例。如果您正苦于以下问题:PHP Permissions::canAdmin方法的具体用法?PHP Permissions::canAdmin怎么用?PHP Permissions::canAdmin使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在Permissions的用法示例。


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

示例1: refresh

 public function refresh($cID = 0, $token)
 {
     if (intval($cID) > 0) {
         if ($this->token->validate('refresh', $token)) {
             Loader::model('single_page');
             $p = SinglePage::getByID($cID);
             $cp = new Permissions($p);
             if ($cp->canAdmin()) {
                 $p->refresh();
                 $this->redirect('/dashboard/pages/single', t('Page Successfully Refreshed.'));
             }
             $this->redirect('/dashboard/pages/single', t('You do not have permissions to refresh this page.'), 1);
         }
         $this->redirect('/dashboard/pages/single', $this->token->getErrorMessage(), 1);
     }
     $this->redirect('/dashboard/pages/single', t('Page Unsuccessfully Refreshed.'), 1);
 }
开发者ID:ricardomccerqueira,项目名称:rcerqueira.portfolio,代码行数:17,代码来源:single.php

示例2: if

						<div class="options"> 
							<? if ($bp->canWrite()) { ?>
							<a href="javascript:void(0)" onclick="GlobalScrapbook.toggleRename(<?=intval($b->bID) ?>)"><?=t('Rename')?></a>
							&nbsp;|&nbsp; 
							<a href="javascript:void(0)" onclick="GlobalScrapbook.editBlockTemplate(<?=intval($b->bID) ?>)" ><?=t('Custom Template')?></a> 
							&nbsp;|&nbsp; 
							<? if (ENABLE_CUSTOM_DESIGN == true) { ?>
							<a href="javascript:void(0)" onclick="GlobalScrapbook.editBlockDesign(<?=intval($b->bID) ?>)" ><?=t('Design')?></a> 
							&nbsp;|&nbsp; 
							<? } ?>
							<a href="javascript:void(0)" onclick="GlobalScrapbook.editBlock(<?=intval($b->bID) ?>,<?=$bt->getBlockTypeInterfaceWidth()?> , <?=$bt->getBlockTypeInterfaceHeight()?> )" ><?=t('Edit')?></a> 
							&nbsp;|&nbsp; 
							
							<? } ?>
							
							<? if (PERMISSIONS_MODEL != 'simple' && $bp->canAdmin()) { ?>
								<a href="javascript:void(0)" onclick="GlobalScrapbook.editBlockPermissions(<?=$b->getBlockID()?>)" ><?=t('Permissions')?></a> 
								<? if ($bp->canDeleteBlock()) { ?>
									&nbsp;|&nbsp;
								<? } ?>
							<? } ?>
							
							<? if ($bp->canDeleteBlock()) { ?>
							<a href="<?php echo $this->action('deleteBlock', Loader::helper('text')->entities($scrapbookName), 0, intval($b->bID), $valt->generate('delete_scrapbook_block'))?>" onclick="return GlobalScrapbook.confirmDelete()">
								<?=t('Delete')?>
							</a> 
							
							<? } ?>
						</div>  
						<div id="ccm-block-type-inner<?=intval($b->bID)?>" class="ccm-block-type-inner">
							<div class="ccm-block-type-inner-icon ccm-scrapbook-item-handle" style="background: url(<?=$btIcon?>) no-repeat center left;">
开发者ID:notzen,项目名称:concrete5,代码行数:31,代码来源:view.php

示例3: t

        ?>
"><?php 
        echo $p->getCollectionName();
        ?>
</a></td>
						<td style="width: 40%"><?php 
        echo $p->getCollectionPath();
        ?>
</td>
						<td style="width: 30%"><?php 
        print $packageName;
        ?>
</td>
						<td style="width: 1">
							<?php 
        if ($cp->canAdmin()) {
            ?>
                                <a href="<?php 
            echo $view->action('refresh', $p->getCollectionID(), $this->controller->token->generate('refresh'));
            ?>
" title="<?php 
            echo t('Refreshes the page, rebuilding its permissions and its name.');
            ?>
" class="icon-link launch-tooltip"><i class="fa fa-refresh"></i></a>
                            <?php 
        }
        ?>
						</td>
					</tr>
				<?php 
    }
开发者ID:meixelsberger,项目名称:concrete5-5.7.0,代码行数:31,代码来源:single.php

示例4: rename_block

	public function rename_block(){
		$valt = Loader::helper('validation/token');
		if(!$valt->validate('rename_scrapbook_block')){
			$this->set('error', array($valt->getErrorMessage()));
			$this->view();
			return;
		}
		$bID=intval($_REQUEST['bID']); 
		$globalScrapbookC=$this->getCollectionObject(); 
		$scrapbookName = $_REQUEST['scrapbookName']; 
		$globalScrapbookArea = Area::getOrCreate( $globalScrapbookC, $scrapbookName );
		$block=Block::getById($bID, $globalScrapbookC, $globalScrapbookArea); 		
		if($block && strlen($_POST['bName']) ){  //&& $block->getAreaHandle()=='Global Scrapbook'		
			//this is needed so the cache clears correctly
			$bp = new Permissions($block);
			if ($bp->canAdmin()) { 
				$block->setBlockAreaObject($globalScrapbookArea);			
				$block->updateBlockName( $_POST['bName'], 1 );
			}
		} 
		header('Location: ' . View::url('/dashboard/scrapbook', 'view') . '?scrapbookName=' . $scrapbookName);
		exit;
	}
开发者ID:notzen,项目名称:concrete5,代码行数:23,代码来源:controller.php

示例5: die

<?php

defined('C5_EXECUTE') or die("Access Denied.");
$u = new User();
$form = Loader::helper('form');
$searchInstance = Loader::helper('text')->entities($_REQUEST['searchInstance']);
$ih = Loader::helper('concrete/interface');
$f = File::getByID($_REQUEST['fID']);
$cp = new Permissions($f);
if (!$cp->canAdmin()) {
    die(t("Access Denied."));
}
$form = Loader::helper('form');
if ($_POST['task'] == 'set_password') {
    $f->setPassword($_POST['fPassword']);
    exit;
}
Loader::model('file_storage_location');
if ($_POST['task'] == 'set_location') {
    if ($_POST['fslID'] == 0) {
        $f->setStorageLocation(0);
    } else {
        $fsl = FileStorageLocation::getByID($_POST['fslID']);
        if (is_object($fsl)) {
            $f->setStorageLocation($fsl);
        }
    }
    exit;
}
?>
开发者ID:ricardomccerqueira,项目名称:rcerqueira.portfolio,代码行数:30,代码来源:permissions.php

示例6: die

<?php 
defined('C5_EXECUTE') or die("Access Denied.");

$u = new User();
$form = Loader::helper('form');


$f = File::getByID($_REQUEST['fID']);
$fp = new Permissions($f);
if (!$fp->canRead()) {
	die(t("Access Denied."));
}

$fv = $f->getApprovedVersion();

$canViewInline = $fv->canView() ? 1 : 0;
$canEdit = $fv->canEdit() ? 1 : 0;
?>

<div class="ccm-file-selected" fID="<?php echo $_REQUEST['fID']?>" ccm-file-manager-field="<?php echo $_REQUEST['ccm_file_selected_field']?>" ccm-file-manager-can-admin="<?php echo ($fp->canAdmin())?>" ccm-file-manager-can-delete="<?php echo $fp->canAdmin()?>" ccm-file-manager-can-view="<?php echo $canViewInline?>" ccm-file-manager-can-replace="<?php echo $fp->canWrite()?>" ccm-file-manager-can-edit="<?php echo $canEdit?>"  >
<div class="ccm-file-selected-thumbnail"><?php echo $fv->getThumbnail(1)?></div>
<div class="ccm-file-selected-data"><div><?php echo $fv->getTitle()?></div><div></div></div>
<div class="ccm-spacer">&nbsp;</div>
</div>
开发者ID:rii-J,项目名称:concrete5-de,代码行数:24,代码来源:selector_data.php

示例7:

if (isset($_REQUEST['fvID'])) {
	$fv = $f->getVersion($_REQUEST['fvID']);
} else {
	$fv = $f->getApprovedVersion();
}

if ($_REQUEST['task'] == 'preview_version') { 
	$previewMode = true;
}

if ($_POST['task'] == 'approve_version' && $fp->canWrite() && (!$previewMode)) {
	$fv->approve();
	exit;
}

if ($_POST['task'] == 'delete_version' && $fp->canAdmin() && (!$previewMode)) {
	$fv->delete();
	exit;
}


if ($_POST['task'] == 'update_core' && $fp->canWrite() && (!$previewMode)) {
	$fv = $f->getVersionToModify();

	switch($_POST['attributeField']) {
		case 'fvTitle':
			$text = $_POST['fvTitle'];
			$fv->updateTitle($text);
			print $text;
			break;
		case 'fvDescription':
开发者ID:notzen,项目名称:concrete5,代码行数:31,代码来源:properties.php

示例8:

	ccm_areaMenuObj<?php 
        echo $a->getAreaID();
        ?>
.canAddBlocks = <?php 
        echo $ap->canAddBlocks();
        ?>
;
	ccm_areaMenuObj<?php 
        echo $a->getAreaID();
        ?>
.canWrite = <?php 
        echo $ap->canWrite();
        ?>
;
	<?php 
        if ($cp->canAdmin() && PERMISSIONS_MODEL != 'simple') {
            ?>
		ccm_areaMenuObj<?php 
            echo $a->getAreaID();
            ?>
.canModifyGroups = true;
	<?php 
        }
        ?>
	<?php 
        if ($ap->canWrite() && ENABLE_AREA_LAYOUTS == true && !$c->isMasterCollection()) {
            ?>
		ccm_areaMenuObj<?php 
            echo $a->getAreaID();
            ?>
.canLayout = true;
开发者ID:VonUniGE,项目名称:concrete5-1,代码行数:31,代码来源:block_area_footer.php

示例9:

}

$fv = $f->getApprovedVersion();

$canViewInline = $fv->canView() ? 1 : 0;
$canEdit = $fv->canEdit() ? 1 : 0;
?>

<div class="ccm-file-selected" fID="<?php 
echo $_REQUEST['fID'];
?>
" ccm-file-manager-field="<?php 
echo $_REQUEST['ccm_file_selected_field'];
?>
" ccm-file-manager-can-admin="<?php 
echo $fp->canAdmin();
?>
" ccm-file-manager-can-delete="<?php 
echo $fp->canAdmin();
?>
" ccm-file-manager-can-view="<?php 
echo $canViewInline;
?>
" ccm-file-manager-can-replace="<?php 
echo $fp->canWrite();
?>
" ccm-file-manager-can-edit="<?php 
echo $canEdit;
?>
"  >
<div class="ccm-file-selected-thumbnail"><?php 
开发者ID:nbourguig,项目名称:concrete5,代码行数:31,代码来源:selector_data.php

示例10: if

	</ol>
	
	
		<?php 
		$v = $entry->getVersionObject();
		
		?>
		
		<?php echo Loader::helper('concrete/interface')->submit(t('Save'), 'save', 'left')?>
		<?php echo Loader::helper('concrete/interface')->submit(t('Discard'), 'discard', 'left', 'ccm-composer-hide-on-approved')?>
		<?php echo Loader::helper('concrete/interface')->button_js(t('Preview'), 'javascript:ccm_composerLaunchPreview()', 'left', 'ccm-composer-hide-on-approved')?>

		<?php  if ($entry->isComposerDraft()) { 
		$pp = new Permissions($entry);
		?>
			<?php  if (PERMISSIONS_MODEL != 'simple' && $pp->canAdmin()) { ?>
				<?php echo Loader::helper('concrete/interface')->button_js(t('Permissions'), 'javascript:ccm_composerLaunchPermissions()', 'left', 'ccm-composer-hide-on-no-target')?>
			<?php  } ?>
			<?php echo Loader::helper('concrete/interface')->submit(t('Publish Page'), 'publish')?>
		<?php  } else { ?>
			<?php echo Loader::helper('concrete/interface')->submit(t('Publish Changes'), 'publish')?>
		<?php  } ?>
		
		<?php echo $form->hidden('entryID', $entry->getCollectionID())?>
		<?php  if ($entry->isComposerDraft()) { ?>
			<input type="hidden" name="cPublishParentID" value="<?php echo $entry->getComposerDraftPublishParentID()?>" />
		<?php  } ?>
		<?php echo $form->hidden('autosave', 0)?>
		<?php echo Loader::helper('validation/token')->output('composer')?>
		<div class="ccm-spacer">&nbsp;</div>
		
开发者ID:rii-J,项目名称:concrete5-de,代码行数:30,代码来源:write.php

示例11: Permissions

		</tr>
	<?php 
		foreach($files as $f) {
			$pf = new Permissions($f);
			if (!isset($striped) || $striped == 'ccm-list-record-alt') {
				$striped = '';
			} else if ($striped == '') { 
				$striped = 'ccm-list-record-alt';
			}
			$star_icon = ($f->isStarred() == 1) ? 'star_yellow.png' : 'star_grey.png';
			$fv = $f->getApprovedVersion(); 
			$canViewInline = $fv->canView() ? 1 : 0;
			$canEdit = ($fv->canEdit() && $pf->canWrite()) ? 1 : 0;
			$pfg = FilePermissions::getGlobal();
			?>
			<tr class="ccm-list-record <?php echo $striped?>" ccm-file-manager-instance="<?php echo $searchInstance?>" ccm-file-manager-can-admin="<?php echo ($pf->canAdmin())?>" ccm-file-manager-can-duplicate="<?php echo ($pfg->canAddFileType($f->getExtension()) && $pf->canWrite())?>" ccm-file-manager-can-delete="<?php echo $pf->canAdmin()?>" ccm-file-manager-can-view="<?php echo $canViewInline?>" ccm-file-manager-can-replace="<?php echo $pf->canWrite()?>" ccm-file-manager-can-edit="<?php echo $canEdit?>" fID="<?php echo $f->getFileID()?>" id="fID<?php echo $f->getFileID()?>">
			<td class="ccm-file-list-cb" style="vertical-align: middle !important"><input type="checkbox" value="<?php echo $f->getFileID()?>" /></td>
			<td>
				<div class="ccm-file-list-thumbnail">
					<div class="ccm-file-list-thumbnail-image" fID="<?php echo $f->getFileID()?>"><table border="0" cellspacing="0" cellpadding="0" height="70" width="100%"><tr><td align="center" fID="<?php echo $f->getFileID()?>" style="padding: 0px"><?php echo $fv->getThumbnail(1)?></td></tr></table></div>
				</div>
		
			<?php  if ($fv->hasThumbnail(2)) { ?>
				<div class="ccm-file-list-thumbnail-hover" id="fID<?php echo $f->getFileID()?>hoverThumbnail"><div><?php echo $fv->getThumbnail(2)?></div></div>
			<?php  } ?>

				</td>
			<td class="ccm-file-list-starred"><img src="<?php echo ASSETS_URL_IMAGES?>/icons/<?php echo $star_icon?>" height="16" width="16" border="0" class="ccm-star" /></td>
			<?php  foreach($columns->getColumns() as $col) { ?>
				<?php  // special one for keywords ?>				
				<?php  if ($col->getColumnKey() == 'fvTitle') { ?>
开发者ID:rii-J,项目名称:concrete5-de,代码行数:31,代码来源:search_results.php

示例12:

		$toolSection = "block_area_layout";
		$canViewPane = $ap->canWrite();
		$args['action'] = $a->getAreaUpdateAction('layout').'&originalLayoutID='.$originalLayoutId.'&cvalID='.intval($_REQUEST['cvalID']);
		break;
	case 'design':
		$toolSection = 'custom_style';
		$args['style'] = $c->getAreaCustomStyleRule($a);
		$args['action'] = $a->getAreaUpdateAction('design');
		$args['refreshAction'] = REL_DIR_FILES_TOOLS_REQUIRED . '/edit_area_popup?atask=design&cID=' . $c->getCollectionID() . '&arHandle=' . $a->getAreaHandle() . '&refresh=1';
		$canViewPane = $ap->canWrite();
		if ($canViewPane) {
			if ($_REQUEST['subtask'] == 'delete_custom_style_preset') {
				$styleToDelete = CustomStylePreset::getByID($_REQUEST['deleteCspID']);
				$styleToDelete->delete(); 
			}
		}		
		break;
	case 'groups':
		$toolSection = "block_area_groups";
		$canViewPane = $cp->canAdmin();
		break;
}

if (!$canViewPane) {
	die(t("Access Denied."));
}

?>

<?php  Loader::element($toolSection, $args);
开发者ID:rii-J,项目名称:concrete5-de,代码行数:30,代码来源:edit_area_popup.php

示例13:

				$striped = 'ccm-list-record-alt';
			}
			$star_icon = ($f->isStarred() == 1) ? 'star_yellow.png' : 'star_grey.png';
			$fv = $f->getApprovedVersion(); 
			$canViewInline = $fv->canView() ? 1 : 0;
			$canEdit = ($fv->canEdit() && $pf->canWrite()) ? 1 : 0;
			$pfg = FilePermissions::getGlobal();
			?>
			<tr class="ccm-list-record <?php 
echo $striped;
?>
" ccm-file-manager-instance="<?php 
echo $searchInstance;
?>
" ccm-file-manager-can-admin="<?php 
echo $pf->canAdmin();
?>
" ccm-file-manager-can-duplicate="<?php 
echo $pfg->canAddFileType($f->getExtension());
?>
" ccm-file-manager-can-delete="<?php 
echo $pf->canAdmin();
?>
" ccm-file-manager-can-view="<?php 
echo $canViewInline;
?>
" ccm-file-manager-can-replace="<?php 
echo $pf->canWrite();
?>
" ccm-file-manager-can-edit="<?php 
echo $canEdit;
开发者ID:remkoj,项目名称:concrete5,代码行数:31,代码来源:search_results.php

示例14: die

if (!$fp->canRead()) {
    die(_("Access Denied."));
}
if (isset($_REQUEST['fvID'])) {
    $fv = $f->getVersion($_REQUEST['fvID']);
} else {
    $fv = $f->getApprovedVersion();
}
if ($_REQUEST['task'] == 'preview_version') {
    $previewMode = true;
}
if ($_POST['task'] == 'approve_version' && $fp->canWrite() && !$previewMode) {
    $fv->approve();
    exit;
}
if ($_POST['task'] == 'delete_version' && $fp->canAdmin() && !$previewMode) {
    $fv->delete();
    exit;
}
if ($_POST['task'] == 'update_core' && $fp->canWrite() && !$previewMode) {
    $fv = $f->getVersionToModify();
    switch ($_POST['attributeField']) {
        case 'fvTitle':
            $text = $_POST['fvTitle'];
            $fv->updateTitle($text);
            print $text;
            break;
        case 'fvDescription':
            $text = $_POST['fvDescription'];
            $fv->updateDescription($text);
            print $text;
开发者ID:homer6,项目名称:concrete5-mirror,代码行数:31,代码来源:properties.php

示例15: foreach

	<form id="ccm-<?php 
    echo $searchInstance;
    ?>
-delete-form" method="post" action="<?php 
    echo REL_DIR_FILES_TOOLS_REQUIRED;
    ?>
/files/delete">
	<?php 
    echo $form->hidden('task', 'delete_files');
    ?>
	<table border="0" cellspacing="0" cellpadding="0" width="100%" class="ccm-results-list">
	
	<?php 
    foreach ($files as $f) {
        $fp = new Permissions($f);
        if ($fp->canAdmin()) {
            $fv = $f->getApprovedVersion();
            if (is_object($fv)) {
                ?>
			
			<?php 
                echo $form->hidden('fID[]', $f->getFileID());
                ?>
		
			
			<tr>
				<td>
				<div class="ccm-file-list-thumbnail">
					<div class="ccm-file-list-thumbnail-image" fID="<?php 
                echo $f->getFileID();
                ?>
开发者ID:homer6,项目名称:concrete5-mirror,代码行数:31,代码来源:delete.php


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