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

PHP print_cp_no_permission函数代码示例

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

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



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

示例1: importAdminCP

 public function importAdminCP($parsedXML, $startat = 0, $perpage = 1, $overwrite = false, $styleid = -1, $anyversion = false, $extra = array())
 {
     /*
      *	Since this function allows passing in a string rather than pulling a file from the filesystem, we should
      *	be more careful about who can call it
      *	This check is based on the admincp/template.php script @ if ($_REQUEST['do'] == 'upload'). We should keep them in line.
      */
     if (!vB::getUserContext()->hasAdminPermission('canadmintemplates') or !vB::getUserContext()->hasAdminPermission('canadminstyles')) {
         require_once DIR . '/includes/adminfunctions.php';
         print_cp_no_permission();
     }
     if (empty($parsedXML['guid'])) {
         // todo: some error handling here if basic xml file validation isn't okay.
     }
     $this->parsedXML['theme'] = $parsedXML;
     // make sure we have the theme parent, as any imported themes will be its children
     if (empty(self::$themeParent['guid'])) {
         $this->getDefaultParentTheme();
     }
     /*
      *	drop any unexpected extra variables.
      *	Let's also clean them, since there might be someway a user w/ the right permissions
      *	hits this function directly. So here we have an issue. If coming through the adminCP page,
      *	things will already be cleaned, so STRINGS will already be escaped. However, I don't think
      *	the title should contain any special HTML characters, so I think we don't have to worry about
      *	double escaping here. If we do end up having to worry about double escaping, we need to remove
      *	the cleaning here, and just rely on the adminCP page's cleaning, then make sure NOTHING HERE
      *	GOES STRAIGHT TO DB without going through the assertor in adminfunctions_template.php
      */
     $unclean = $extra;
     $extra = array();
     $cleanMap = array('title' => vB_Cleaner::TYPE_STR, 'parentid' => vB_Cleaner::TYPE_INT, 'displayorder' => vB_Cleaner::TYPE_INT, 'userselect' => vB_Cleaner::TYPE_BOOL);
     foreach ($unclean as $key => $value) {
         if (isset($cleanMap[$key])) {
             $extra[$key] = vB::getCleaner()->clean($value, $cleanMap[$key]);
         }
     }
     return $this->import($startat, $perpage, $overwrite, $styleid, $anyversion, $extra);
 }
开发者ID:cedwards-reisys,项目名称:nexus-web,代码行数:39,代码来源:theme.php


示例2: error_reporting

// ######################## SET PHP ENVIRONMENT ###########################
error_reporting(E_ALL & ~E_NOTICE & ~8192);
// ##################### DEFINE IMPORTANT CONSTANTS #######################
define('CVS_REVISION', '$RCSfile$ - $Revision: 39862 $');
// #################### PRE-CACHE TEMPLATES AND DATA ######################
$phrasegroups = array();
$specialtemplates = array('bookmarksitecache');
// ########################## REQUIRE BACK-END ############################
require_once './global.php';
require_once DIR . '/includes/adminfunctions_bookmarksite.php';
// ############################# LOG ACTION ###############################
$vbulletin->input->clean_array_gpc('r', array('bookmarksiteid' => TYPE_INT));
log_admin_action($vbulletin->GPC['bookmarksiteid'] != 0 ? "bookmark site id = " . $vbulletin->GPC['bookmarksiteid'] : '');
// ######################## CHECK ADMIN PERMISSIONS #######################
if (!can_administer('canadminsettings')) {
    print_cp_no_permission();
}
// ########################################################################
// ######################### START MAIN SCRIPT ############################
// ########################################################################
print_cp_header($vbphrase['social_bookmarking_manager']);
// default action
if (empty($_REQUEST['do'])) {
    $_REQUEST['do'] = 'modify';
}
// ########################################################################
// when we want to add a new site from the site list page we need change the action before the main 'socialbookmarks_setpost' handler
// we came here if somebody press the add button in the sitelist edit/save form
if ($_POST['do'] == 'socialbookmarks_setpost' and $vbulletin->GPC['add']) {
    $_POST['do'] = 'add';
}
开发者ID:benyamin20,项目名称:vbregistration,代码行数:31,代码来源:bookmarksite.php


示例3: array

function get_style_export_xml
(
	$styleid,
	$product,
	$product_version,
	$title,
	$mode
)
{
	//only is the (badly named) list of template groups
	global $vbulletin, $vbphrase, $only;
	if ($styleid == -1)
	{
		// set the style title as 'master style'
		$style = array('title' => $vbphrase['master_style']);
		$sqlcondition = "styleid = -1";
		$parentlist = "-1";
		$is_master = true;
	}
	else
	{
		// query everything from the specified style
		$style = $vbulletin->db->query_first("
			SELECT *
			FROM " . TABLE_PREFIX . "style
			WHERE styleid = " . $styleid
		);

		//export as master -- export a style with all changes as a new master style.
		if ($mode == 2)
		{
			//only allowed in debug mode.
			if (!$vbulletin->debug)
			{
				print_cp_no_permission();
			}

			// get all items from this style and all parent styles
			$sqlcondition = "templateid IN(" . implode(',', unserialize($style['templatelist'])) . ")";
			$sqlcondition .= " AND title NOT LIKE 'vbcms_grid_%'";
			$parentlist = $style['parentlist'];
			$is_master = true;
			$title = $vbphrase['master_style'];
		}

		//export with parent styles
		else if ($mode == 1)
		{
			// get all items from this style and all parent styles (except master)
			$sqlcondition = "styleid <> -1 AND templateid IN(" . implode(',', unserialize($style['templatelist'])) . ")";
			//remove the master style id off the end of the list
			$parentlist = substr(trim($style['parentlist']), 0, -3);
			$is_master = false;
		}

		//this style only
		else
		{
			// get only items customized in THIS style
			$sqlcondition = "styleid = " . $styleid;
			$parentlist = $styleid;
			$is_master = false;
		}
	}

	if ($product == 'vbulletin')
	{
		$sqlcondition .= " AND (product = '" . $vbulletin->db->escape_string($product) . "' OR product = '')";
	}
	else
	{
		$sqlcondition .= " AND product = '" . $vbulletin->db->escape_string($product) . "'";
	}

	// set a default title
	if ($title == '' OR $styleid == -1)
	{
		$title = $style['title'];
	}

	// --------------------------------------------
	// query the templates and put them in an array

	$templates = array();

	$gettemplates = $vbulletin->db->query_read("
		SELECT title, templatetype, username, dateline, version,
		IF(templatetype = 'template', template_un, template) AS template
		FROM " . TABLE_PREFIX . "template
		WHERE $sqlcondition
		ORDER BY title
	");

	while ($gettemplate = $vbulletin->db->fetch_array($gettemplates))
	{
		switch($gettemplate['templatetype'])
		{
			case 'template': // regular template

				// if we have ad template, and we are exporting as master, make sure we do not export the add data
//.........这里部分代码省略.........
开发者ID:hungnv0789,项目名称:vhtm,代码行数:101,代码来源:adminfunctions_template.php


示例4: get_style_export_xml

function get_style_export_xml($styleid, $product, $product_version, $title, $mode)
{
    // $only is the (badly named) list of template groups
    global $vbulletin, $vbphrase, $only;
    /* Load the master 'style' phrases for use in
    	the export, and then rebuild the $only array */
    load_phrases(array('style'), -1);
    build_template_groups($only);
    if ($styleid == -1 or $styleid == -2) {
        // set the style title as 'master style'
        $style = array('title' => $styleid == -1 ? $vbphrase['master_style'] : $vbphrase['mobile_master_style']);
        $sqlcondition = "styleid = {$styleid}";
        $parentlist = $styleid;
        $styletype = $styleid == -1 ? 'master' : 'mobilemaster';
    } else {
        // query everything from the specified style
        $style = $vbulletin->db->query_first("\n\t\t\tSELECT *\n\t\t\tFROM " . TABLE_PREFIX . "style\n\t\t\tWHERE styleid = " . $styleid);
        //export as master -- export a style with all changes as a new master style.
        if ($mode == 2) {
            //only allowed in debug mode.
            if (!$vbulletin->debug) {
                print_cp_no_permission();
            }
            // get all items from this style and all parent styles
            $sqlcondition = "templateid IN(" . implode(',', unserialize($style['templatelist'])) . ")";
            $sqlcondition .= " AND title NOT LIKE 'vbcms_grid_%'";
            $parentlist = $style['parentlist'];
            $styletype = $style['type'] == 'standard' ? 'master' : 'mobilemaster';
            $title = $vbphrase['master_style'];
        } else {
            if ($mode == 1) {
                // get all items from this style and all parent styles (except master)
                $sqlcondition = "styleid <> -1 AND styleid <> -2 AND templateid IN(" . implode(',', unserialize($style['templatelist'])) . ")";
                //remove the master style id off the end of the list
                $parentlist = substr(trim($style['parentlist']), 0, -3);
                $styletype = 'custom';
            } else {
                // get only items customized in THIS style
                $sqlcondition = "styleid = " . $styleid;
                $parentlist = $styleid;
                $styletype = 'custom';
            }
        }
    }
    if ($product == 'vbulletin') {
        $sqlcondition .= " AND (product = '" . $vbulletin->db->escape_string($product) . "' OR product = '')";
    } else {
        $sqlcondition .= " AND product = '" . $vbulletin->db->escape_string($product) . "'";
    }
    // set a default title
    if ($title == '' or $styleid == -1 or $styleid == -2) {
        $title = $style['title'];
    }
    // --------------------------------------------
    // query the templates and put them in an array
    $templates = array();
    $gettemplates = $vbulletin->db->query_read("\n\t\tSELECT title, templatetype, username, dateline, version,\n\t\tIF(templatetype = 'template', template_un, template) AS template\n\t\tFROM " . TABLE_PREFIX . "template\n\t\tWHERE {$sqlcondition}\n\t\tORDER BY title\n\t");
    $ugcount = $ugtemplates = 0;
    while ($gettemplate = $vbulletin->db->fetch_array($gettemplates)) {
        switch ($gettemplate['templatetype']) {
            case 'template':
                // regular template
                // if we have ad template, and we are exporting as master, make sure we do not export the add data
                if (substr($gettemplate['title'], 0, 3) == 'ad_' and $mode == 2) {
                    $gettemplate['template'] = '';
                }
                $isgrouped = false;
                foreach (array_keys($only) as $group) {
                    if (strpos(strtolower(" {$gettemplate['title']}"), $group) == 1) {
                        $templates["{$group}"][] = $gettemplate;
                        $isgrouped = true;
                    }
                }
                if (!$isgrouped) {
                    if ($ugtemplates % 10 == 0) {
                        $ugcount++;
                    }
                    $ugtemplates++;
                    //sort ungrouped templates last.
                    $ugcount_key = 'zzz' . str_pad($ugcount, 5, '0', STR_PAD_LEFT);
                    $templates[$ugcount_key][] = $gettemplate;
                    $only[$ugcount_key] = construct_phrase($vbphrase['ungrouped_templates_x'], $ugcount);
                }
                break;
            case 'stylevar':
                // stylevar
                $templates[$vbphrase['stylevar_special_templates']][] = $gettemplate;
                break;
            case 'css':
                // css
                $templates[$vbphrase['css_special_templates']][] = $gettemplate;
                break;
            case 'replacement':
                // replacement
                $templates[$vbphrase['replacement_var_special_templates']][] = $gettemplate;
                break;
        }
    }
    unset($template);
    $vbulletin->db->free_result($gettemplates);
//.........这里部分代码省略.........
开发者ID:0hyeah,项目名称:yurivn,代码行数:101,代码来源:adminfunctions_template.php



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


鲜花

握手

雷人

路过

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

请发表评论

全部评论

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

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

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

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

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