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


PHP check_permission函数代码示例

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


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

示例1: updatecontentobj

function updatecontentobj(&$contentobj, $preview = false, $params = null)
{
    if ($params == null) {
        $params = $_POST;
    }
    $userid = get_userid();
    $adminaccess = check_ownership($userid, $contentobj->Id()) || check_permission($userid, 'Modify Any Page');
    #Fill contentobj with parameters
    $contentobj->FillParams($params);
    if ($preview) {
        $error = $contentobj->ValidateData();
    }
    if (isset($params["ownerid"])) {
        $contentobj->SetOwner($params["ownerid"]);
    }
    $contentobj->SetLastModifiedBy($userid);
    // 	#Fill Additional Editors (kind of kludgy)
    // 	if (isset($params["additional_editors"]))
    // 	{
    // 		$addtarray = array();
    // 		foreach ($params["additional_editors"] as $addt_user_id)
    // 		{
    // 			$addtarray[] = $addt_user_id;
    // 		}
    // 		$contentobj->SetAdditionalEditors($addtarray);
    // 	}
    // 	else if ($adminaccess)
    // 	{
    // 		$contentobj->SetAdditionalEditors(array());
    // 	}
}
开发者ID:rasomu,项目名称:chuza,代码行数:31,代码来源:editcontent_extra.php

示例2: TabNames

 function TabNames()
 {
     $res = array(lang('main'));
     if (check_permission(get_userid(), 'Manage All Content')) {
         $res[] = lang('options');
     }
     return $res;
 }
开发者ID:aldrymaulana,项目名称:cmsdepdagri,代码行数:8,代码来源:SectionHeader.inc.php

示例3: __construct

 function __construct()
 {
     parent::__construct();
     $this->page = "AssignProject";
     if (check_permission("UserManagement", "n")) {
         $this->goFailPage();
     }
 }
开发者ID:ammalesy,项目名称:SurveyBackend,代码行数:8,代码来源:AssignProject.php

示例4: __construct

 function __construct()
 {
     parent::__construct();
     $this->page = "RoleManagement";
     if (check_permission($this->page, "n")) {
         $this->goFailPage();
     }
 }
开发者ID:ammalesy,项目名称:SurveyBackend,代码行数:8,代码来源:RoleManagement.php

示例5: __construct

 function __construct()
 {
     parent::__construct();
     $this->page = "QuestionManagement";
     if (check_permission($this->page, "n")) {
         $this->goFailPage();
     }
     if ($this->isSelectedProject() == FALSE) {
         redirect("PreviewSurvey");
     }
 }
开发者ID:ammalesy,项目名称:SurveyBackend,代码行数:11,代码来源:AnswerStyleManagement.php

示例6: _init

 private static function _init()
 {
     $AC =& ac_utils::get_module('AdvancedContent');
     self::$_tabs = array('main' => array('tab_id' => 'main', 'tab_name' => lang('main'), 'block_tabs' => array(), 'block_groups' => array(), 'content_blocks' => array()));
     if (check_permission(get_userid(), 'Manage All Content')) {
         self::$_tabs['options'] = array('tab_id' => 'options', 'tab_name' => lang('options'), 'block_tabs' => array(), 'block_groups' => array(), 'content_blocks' => array());
     }
     if (check_permission(get_userid(), 'Manage AdvancedContent Options') && $AC->GetPreference('use_advanced_pageoptions', 0)) {
         self::$_tabs['AdvancedContent'] = array('tab_id' => 'AdvancedContent', 'tab_name' => $AC->lang('advancedcontent_tabname'), 'block_tabs' => array(), 'block_groups' => array(), 'content_blocks' => array());
     }
     self::$_init = true;
 }
开发者ID:rainbow-studio,项目名称:cmsms,代码行数:12,代码来源:class.acTabManager.php

示例7: get_delete_list

function get_delete_list($sel_nodes, &$parent, &$final_result, $depth = 0)
{
    // get the list of items we should delete
    $userid = get_userid();
    if (!check_permission($userid, 'Remove Pages')) {
        return FALSE;
    }
    global $mypages;
    $status = TRUE;
    foreach ($sel_nodes as $node) {
        if (check_ownership($userid, $node->getTag()) || quick_check_authorship($node->getTag(), $mypages)) {
            $content = $node->GetContent(false, false, true);
            if (!is_object($content)) {
                continue;
            }
            $children =& $node->getChildren(false, true);
            $child_status = array();
            if (isset($children) && count($children)) {
                // we have children.. but we may not have access to
                // any or all of them.
                $tmp = array();
                $child_status = get_delete_list($children, $node, $tmp, $depth + 1);
                if ($child_status === FALSE || count($tmp) == 0) {
                    // there are children, but for one reason or another
                    // we can't delete em. which means we can't delete this
                    // parent either, or any of its parents.
                    $status = FALSE;
                } else {
                    if (!isset($final_result[$content->Id()])) {
                        $final_result[$content->Id()] = $content;
                    }
                }
                if (count($tmp)) {
                    // there are children se can delete.
                    foreach ($tmp as $content_id => $one) {
                        if (!isset($final_result[$content_id])) {
                            $final_result[$content_id] = $one;
                        }
                    }
                }
            } else {
                // no children
                if (!isset($final_result[$content->Id()])) {
                    $final_result[$content->Id()] = $content;
                }
            }
        } else {
            $status = FALSE;
        }
    }
    return $status;
}
开发者ID:RTR-ITF,项目名称:usse-cms,代码行数:52,代码来源:multicontent.php

示例8: __construct

 function __construct()
 {
     parent::__construct();
     $this->load->helper('admin/admin_menu');
     $this->template->set_theme('admin');
     $perm = check_permission();
     if ($perm === FALSE) {
         $this->session->set_flashdata('redirect', $this->uri->uri_string());
         redirect('user/login');
     } elseif ($perm === NULL) {
         show_error('Yetkiniz yok.');
     }
 }
开发者ID:navruzm,项目名称:navruz.net,代码行数:13,代码来源:Admin_Controller.php

示例9: check_permission

 function check_permission($dir)
 {
     $d = opendir($dir);
     while ($file = readdir($d)) {
         if ($file == '.' || $file == '..') {
             continue;
         }
         $file = $dir . '/' . $file;
         if (!is_readable($file) || !is_writeable($file) || is_dir($file) && (!is_executable($file) || check_permission($file))) {
             return TRUE;
         }
     }
     return FALSE;
 }
开发者ID:cinno,项目名称:sptoolkit,代码行数:14,代码来源:install.php

示例10: __construct

 public function __construct()
 {
     $this->ci = get_instance();
     $this->ci->load->library('asset');
     $this->ci->load->helper('template');
     if (get_option('debug') == 1 && check_permission('dummy')) {
         $this->ci->output->enable_profiler(TRUE);
         $this->debug = TRUE;
         error_reporting(E_ALL);
     }
     if (get_option('theme')) {
         $this->theme = get_option('theme');
     }
 }
开发者ID:navruzm,项目名称:navruz.net,代码行数:14,代码来源:Template.php

示例11: smarty_cms_function_edit

function smarty_cms_function_edit($params, &$smarty)
{
    global $gCms;
    if (!check_permission(get_userid(false), 'Modify Any Page') && !quick_check_authorship($gCms->variables['content_id'], author_pages(get_userid(false)))) {
        return;
    }
    $urlext = '?' . CMS_SECURE_PARAM_NAME . '=' . $_SESSION[CMS_USER_KEY];
    $text = isset($params['text']) ? $params['text'] : 'Edit This Page';
    if (isset($params["showbutton"])) {
        return '<a href="' . $gCms->config['root_url'] . '/' . $gCms->config['admin_dir'] . '/editcontent.php' . $urlext . '&amp;content_id=' . $gCms->variables['content_id'] . '"><img src="' . $gCms->config['root_url'] . '/images/cms/editbutton.png" alt="' . $text . '"/></a>';
    } else {
        return '<a href="' . $gCms->config['root_url'] . '/' . $gCms->config['admin_dir'] . '/editcontent.php' . $urlext . '&amp;content_id=' . $gCms->variables['content_id'] . '">' . $text . '</a>';
    }
    /*
    global $gCms;
    	
    $userid = get_userid(false);
    if(!$userid) return;
    
    $access = check_permission($userid, 'Modify Any Page');
    if (!$access) return;
    
    $text = 'Edit This Page';
    
    if (!empty($params['text']))
    {
    	$text = $params['text'];
    }
    
    //will this work if using htaccess? (Yes! -Wishy)
    if (isset($params["showbutton"]))
    {
    	return '<a href="'.$gCms->config['root_url'].'/'.$gCms->config['admin_dir'].'/editcontent.php?content_id='.$gCms->variables['content_id'].'"><img src="'.$gCms->config['root_url'].'/images/cms/editbutton.png" alt="'.$text.'"/></a>';
    }
    else
    {
    	return '<a href="'.$gCms->config['root_url'].'/'.$gCms->config['admin_dir'].'/editcontent.php?content_id='.$gCms->variables['content_id'].'">'.$text.'</a>';
    }
    */
}
开发者ID:rasomu,项目名称:chuza,代码行数:40,代码来源:function.edit.php

示例12: fetchPrefabTemplates

function fetchPrefabTemplates()
{
    global $AVE_Template;
    if (check_permission('template_new')) {
        $verzname = BASE_DIR . '/inc/data/prefabs/templates';
        $dht = opendir($verzname);
        $sel_theme = '';
        while (gettype($theme = readdir($dht)) != @boolean) {
            if (is_file($verzname . '/' . $theme) && $theme != '.' && $theme != '..') {
                $sel_theme .= '<option value="' . $theme . '">' . strtoupper(substr($theme, 0, -4)) . '</option>';
                $theme = '';
            }
        }
        $AVE_Template->assign('sel_theme', $sel_theme);
        if (!empty($_REQUEST['theme_pref'])) {
            ob_start();
            @readfile(BASE_DIR . '/inc/data/prefabs/templates/' . $_REQUEST['theme_pref']);
            $prefab = ob_get_contents();
            ob_end_clean();
            $AVE_Template->assign('prefab', $prefab);
        }
    }
}
开发者ID:RGBvision,项目名称:AVE.cms,代码行数:23,代码来源:templates.php

示例13: base_url

if ($this->session->userdata('id') == 1 or check_permission('staff_list')) {
    ?>
        <li>
            <a href="<?php 
    echo base_url();
    ?>
staff/index" class="waves-effect waves-button">
                <span class="menu-icon fa fa-users fa-flip-horizontal"></span>
                <p>Staff</p>
            </a>
        </li>
        <?php 
}
?>
        <?php 
if ($this->session->userdata('id') == 1 or check_permission('log_menu')) {
    ?>
        <li>
            <a href="<?php 
    echo base_url();
    ?>
kpitb_panel/logs" class="waves-effect waves-button">
                <span class="menu-icon fa fa-lock fa-flip-horizontal"></span>
                <p>Logs</p>
            </a>
        </li>
        <?php 
}
?>

    </ul>
开发者ID:codeforpakistan,项目名称:KPITB-File-Automation,代码行数:31,代码来源:sidemenu.php

示例14: catch

            $contentobj->FillParams($_POST);
        }
    } catch (CmsEditContentException $e) {
        $error = $e->getMessage();
    }
}
if (!$access) {
    echo "<div class=\"pageerrorcontainer pageoverflow\"><p class=\"pageerror\">" . lang('noaccessto', array(lang('addcontent'))) . "</p></div>";
} else {
    $tabnames = $contentobj->TabNames();
    // Get a list of content_types and build the dropdown to select one
    $typesdropdown = '<select name="content_type" onchange="document.Edit_Content.submit()" class="standard">';
    $cur_content_type = '';
    $content_types = $contentops->ListContentTypes(false, true);
    foreach ($content_types as $onetype => $onetypename) {
        if ($onetype == 'errorpage' && !check_permission($userid, 'Manage All Content')) {
            continue;
        }
        $typesdropdown .= '<option value="' . $onetype . '"';
        if ($onetype == $content_type) {
            $typesdropdown .= ' selected="selected" ';
            $cur_content_type = $onetype;
        }
        $typesdropdown .= ">" . $onetypename . "</option>";
    }
    $typesdropdown .= "</select>";
    cms_utils::set_app_data('editing_content', $contentobj);
    if (empty($error) && $contentobj->GetError()) {
        $error = $contentobj->GetError();
    }
    if (FALSE == empty($error)) {
开发者ID:Alexkuva,项目名称:Beaupotager,代码行数:31,代码来源:addcontent.php

示例15:

<?php

global $current_section;
$current_section = 'inventory';
require_once '../../init.php';
// Required files
require_once MAD_PATH . '/www/cp/auth.php';
require_once MAD_PATH . '/functions/adminredirect.php';
require_once MAD_PATH . '/www/cp/restricted.php';
require_once MAD_PATH . '/www/cp/admin_functions.php';
require_once MAD_PATH . '/www/cp/templates/header.tpl.php';
if (!check_permission('inventory', $user_detail['user_id'])) {
    exit;
}
if (check_permission_simple('modify_publications', $user_detail['user_id'])) {
    if (isset($_GET['delete']) && $_GET['delete'] == 1 && is_numeric($_GET['id'])) {
        delete_publication($_GET['id']);
    }
}
?>
    <div id="content">

        <div id="contentHeader">
            <h1>Inventory</h1>
        </div>
        <!-- #contentHeader -->

        <div class="container">

            <div class="grid-24">
开发者ID:aiurlano,项目名称:mAdserve-Fork,代码行数:30,代码来源:view_publications.php


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