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


PHP PMA_isSuperuser函数代码示例

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


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

示例1: PMA_outBufferModeGet

    /**
     * Gets a core script and starts output buffering work
     */
    require_once './libraries/common.lib.php';
    require_once './libraries/ob.lib.php';
    if ($GLOBALS['cfg']['OBGzip']) {
        $GLOBALS['ob_mode'] = PMA_outBufferModeGet();
        if ($GLOBALS['ob_mode']) {
            PMA_outBufferPre($GLOBALS['ob_mode']);
        }
    }
    require_once './libraries/header_http.inc.php';
    require_once './libraries/header_meta_style.inc.php';
    $title = 'Portable phpMyAdmin';
    // here, the function does not exist with this configuration: $cfg['ServerDefault'] = 0;
    $is_superuser = function_exists('PMA_isSuperuser') && PMA_isSuperuser();
    ?>
	<script>
	// <![CDATA[
	<?php 
    // Add some javascript instructions if required
    if (isset($js_to_run) && $js_to_run == 'functions.js') {
        echo "\n";
        ?>
		// js form validation stuff
		var errorMsg0   = '<?php 
        echo str_replace('\'', '\\\'', $GLOBALS['strFormEmpty']);
        ?>
';
		var errorMsg1   = '<?php 
        echo str_replace('\'', '\\\'', $GLOBALS['strNotNumber']);
开发者ID:johangas,项目名称:moped,代码行数:31,代码来源:header.inc.php

示例2: PMA_isSuperuser

<?php

/* vim: set expandtab sw=4 ts=4 sts=4: */
/**
 * Get user's global privileges and some db-specific privileges
 *
 * @package phpMyAdmin
 */
if (!defined('PHPMYADMIN')) {
    exit;
}
/**
 *
 */
$GLOBALS['is_superuser'] = PMA_isSuperuser();
/**
 * sets privilege information extracted from SHOW GRANTS result
 *
 * Detection for some CREATE privilege.
 *
 * Since MySQL 4.1.2, we can easily detect current user's grants using $userlink
 * (no control user needed) and we don't have to try any other method for
 * detection
 *
 * @todo fix to get really all privileges, not only explicitly defined for this user
 * from MySQL manual: (http://dev.mysql.com/doc/refman/5.0/en/show-grants.html)
 * SHOW GRANTS displays only the privileges granted explicitly to the named
 * account. Other privileges might be available to the account, but they are not
 * displayed. For example, if an anonymous account exists, the named account
 * might be able to use its privileges, but SHOW GRANTS will not display them.
 *
开发者ID:dingdong2310,项目名称:g5_theme,代码行数:31,代码来源:check_user_privileges.lib.php

示例3: PMA_generate_common_url

 * Note: this can be called also from the db panel to get the privileges of
 *       a db, in which case we want to keep displaying the tabs of
 *       the Database panel
 */
if (empty($viewing_mode)) {
    $db = $table = '';
}
/**
 * Set parameters for links
 */
$url_query = PMA_generate_common_url($db);
/**
 * Defines the urls to return to in case of error in a sql statement
 */
$err_url = 'main.php' . $url_query;
/**
 * Displays the headers
 */
require_once './libraries/header.inc.php';
/**
 * @global boolean Checks for superuser privileges
 */
$is_superuser = PMA_isSuperuser();
// now, select the mysql db
if ($is_superuser) {
    PMA_DBI_select_db('mysql', $userlink);
}
/**
 * @global array binary log files
 */
$binary_logs = PMA_DBI_fetch_result('SHOW MASTER LOGS', 'Log_name', null, null, PMA_DBI_QUERY_STORE);
开发者ID:fathitarek,项目名称:cop5725-dbms-project,代码行数:31,代码来源:server_common.inc.php

示例4: PMA_fatalError

    $GLOBALS['grid_edit'] = false;
}
if (isset($_REQUEST['GLOBALS']) || isset($_FILES['GLOBALS'])) {
    PMA_fatalError(__("GLOBALS overwrite attempt"));
}
/**
 * protect against possible exploits - there is no need to have so much variables
 */
if (count($_REQUEST) > 1000) {
    PMA_fatalError(__('possible exploit'));
}
/**
 * Check for numeric keys
 * (if register_globals is on, numeric key can be found in $GLOBALS)
 */
foreach ($GLOBALS as $key => $dummy) {
    if (is_numeric($key)) {
        PMA_fatalError(__('numeric key detected'));
    }
}
unset($dummy);
// here, the function does not exist with this configuration:
// $cfg['ServerDefault'] = 0;
$GLOBALS['is_superuser'] = function_exists('PMA_isSuperuser') && PMA_isSuperuser();
if (!empty($__redirect) && in_array($__redirect, $goto_whitelist)) {
    /**
     * include subform target page
     */
    include $__redirect;
    exit;
}
开发者ID:SashiAsakura,项目名称:AWS_QuikID_website,代码行数:31,代码来源:common.inc.php

示例5: _getServerTabs

 /**
  * Returns the server tabs as an array
  *
  * @return array Data for generating server tabs
  */
 private function _getServerTabs()
 {
     $is_superuser = function_exists('PMA_isSuperuser') && PMA_isSuperuser();
     $binary_logs = null;
     if (function_exists('PMA_DBI_fetch_result') && (!defined('PMA_DRIZZLE') || defined('PMA_DRIZZLE') && !PMA_DRIZZLE)) {
         $binary_logs = PMA_DBI_fetch_result('SHOW MASTER LOGS', 'Log_name', null, null, PMA_DBI_QUERY_STORE);
     }
     $tabs = array();
     $tabs['databases']['icon'] = 's_db.png';
     $tabs['databases']['link'] = 'server_databases.php';
     $tabs['databases']['text'] = __('Databases');
     $tabs['sql']['icon'] = 'b_sql.png';
     $tabs['sql']['link'] = 'server_sql.php';
     $tabs['sql']['text'] = __('SQL');
     $tabs['status']['icon'] = 's_status.png';
     $tabs['status']['link'] = 'server_status.php';
     $tabs['status']['text'] = __('Status');
     $tabs['status']['active'] = in_array(basename($GLOBALS['PMA_PHP_SELF']), array('server_status.php', 'server_status_advisor.php', 'server_status_monitor.php', 'server_status_queries.php', 'server_status_variables.php'));
     if ($is_superuser && !PMA_DRIZZLE) {
         $tabs['rights']['icon'] = 's_rights.png';
         $tabs['rights']['link'] = 'server_privileges.php';
         $tabs['rights']['text'] = __('Users');
     }
     $tabs['export']['icon'] = 'b_export.png';
     $tabs['export']['link'] = 'server_export.php';
     $tabs['export']['text'] = __('Export');
     $tabs['import']['icon'] = 'b_import.png';
     $tabs['import']['link'] = 'server_import.php';
     $tabs['import']['text'] = __('Import');
     $tabs['settings']['icon'] = 'b_tblops.png';
     $tabs['settings']['link'] = 'prefs_manage.php';
     $tabs['settings']['text'] = __('Settings');
     $tabs['settings']['active'] = in_array(basename($GLOBALS['PMA_PHP_SELF']), array('prefs_forms.php', 'prefs_manage.php'));
     if (!empty($binary_logs)) {
         $tabs['binlog']['icon'] = 's_tbl.png';
         $tabs['binlog']['link'] = 'server_binlog.php';
         $tabs['binlog']['text'] = __('Binary log');
     }
     if ($is_superuser && !PMA_DRIZZLE) {
         $tabs['replication']['icon'] = 's_replication.png';
         $tabs['replication']['link'] = 'server_replication.php';
         $tabs['replication']['text'] = __('Replication');
     }
     $tabs['vars']['icon'] = 's_vars.png';
     $tabs['vars']['link'] = 'server_variables.php';
     $tabs['vars']['text'] = __('Variables');
     $tabs['charset']['icon'] = 's_asci.png';
     $tabs['charset']['link'] = 'server_collations.php';
     $tabs['charset']['text'] = __('Charsets');
     if (defined('PMA_DRIZZLE') && PMA_DRIZZLE) {
         $tabs['plugins']['icon'] = 'b_engine.png';
         $tabs['plugins']['link'] = 'server_plugins.php';
         $tabs['plugins']['text'] = __('Plugins');
     } else {
         $tabs['engine']['icon'] = 'b_engine.png';
         $tabs['engine']['link'] = 'server_engines.php';
         $tabs['engine']['text'] = __('Engines');
     }
     return $tabs;
 }
开发者ID:mindfeederllc,项目名称:openemr,代码行数:65,代码来源:Menu.class.php

示例6: PMA_AddJSVar

<?php
/* vim: set expandtab sw=4 ts=4 sts=4: */
/**
 *
 * @package PhpMyAdmin
 */

require_once 'libraries/common.inc.php';

$GLOBALS['js_include'][] = 'server_variables.js';

PMA_AddJSVar('pma_token', $_SESSION[' PMA_token ']);
PMA_AddJSVar('url_query', str_replace('&amp;', '&', PMA_generate_common_url($db)));
PMA_AddJSVar('is_superuser', PMA_isSuperuser() ? true : false);


/**
 * Does the common work
 */
require 'libraries/server_common.inc.php';

/**
 * Required to display documentation links
 */
require 'libraries/server_variables_doc.php';

/**
 * Ajax request
 */

if (isset($_REQUEST['ajax_request']) && $_REQUEST['ajax_request'] == true) {
开发者ID:nicokaiser,项目名称:phpmyadmin,代码行数:31,代码来源:server_variables.php

示例7: printServerTraffic

            printServerTraffic();
            exit;
        case 'variables_table':
            // Prints the variables table
            printVariablesTable();
            exit;
        default:
            break;
    }
}
$server_db_isLocal = strtolower($cfg['Server']['host']) == 'localhost' || $cfg['Server']['host'] == '127.0.0.1' || $cfg['Server']['host'] == '::1';
PMA_AddJSVar('pma_token', $_SESSION[' PMA_token ']);
PMA_AddJSVar('url_query', str_replace('&amp;', '&', PMA_generate_common_url($db)));
PMA_AddJSVar('server_time_diff', 'new Date().getTime() - ' . microtime(true) * 1000, false);
PMA_AddJSVar('server_os', PHP_OS);
PMA_AddJSVar('is_superuser', PMA_isSuperuser());
PMA_AddJSVar('server_db_isLocal', $server_db_isLocal);
PMA_AddJSVar('profiling_docu', PMA_showMySQLDocu('general-thread-states', 'general-thread-states'));
PMA_AddJSVar('explain_docu', PMA_showMySQLDocu('explain-output', 'explain-output'));
/**
 * start output
 */
/**
 * Does the common work
 */
require './libraries/server_common.inc.php';
/**
 * Displays the links
 */
require './libraries/server_links.inc.php';
?>
开发者ID:AmberWish,项目名称:laba_web,代码行数:31,代码来源:server_status.php

示例8: PMA_addJSVar

PMA_addJSVar(
    'url_query',
    str_replace('&amp;', '&', PMA_generate_common_url($db))
);
PMA_addJSVar(
    'server_time_diff',
    'new Date().getTime() - ' . (microtime(true) * 1000),
    false
);
PMA_addJSVar(
    'server_os',
    PHP_OS
);
PMA_addJSVar(
    'is_superuser',
    PMA_isSuperuser()
);
PMA_addJSVar(
    'server_db_isLocal',
    $server_db_isLocal
);
PMA_addJSVar(
    'profiling_docu',
    PMA_Util::showMySQLDocu(
        'general-thread-states', 'general-thread-states'
    )
);
PMA_addJSVar(
    'explain_docu',
    PMA_Util::showMySQLDocu('explain-output', 'explain-output')
);
开发者ID:nhodges,项目名称:phpmyadmin,代码行数:31,代码来源:server_status.php

示例9: foreach

$odd_row = true;
foreach ($serverVars as $name => $value) {
    $has_session_value = isset($serverVarsSession[$name]) && $serverVarsSession[$name] != $value;
    $row_class = ($odd_row ? ' odd' : ' even') . ($has_session_value ? ' diffSession' : '');
    $output .= '<div class="var-row' . $row_class . '">' . '<div class="var-name">';
    // To display variable documentation link
    if (isset($VARIABLE_DOC_LINKS[$name])) {
        $output .= '<span title="' . htmlspecialchars(str_replace('_', ' ', $name)) . '">';
        $output .= PMA_Util::showMySQLDocu($VARIABLE_DOC_LINKS[$name][1], $VARIABLE_DOC_LINKS[$name][1], false, $VARIABLE_DOC_LINKS[$name][2] . '_' . $VARIABLE_DOC_LINKS[$name][0], true);
        $output .= htmlspecialchars(str_replace('_', ' ', $name));
        $output .= '</a>';
        $output .= '</span>';
    } else {
        $output .= htmlspecialchars(str_replace('_', ' ', $name));
    }
    $output .= '</div>' . '<div class="var-value value' . (PMA_isSuperuser() ? ' editable' : '') . '">&nbsp;' . formatVariable($name, $value) . '</div>' . '<div style="clear:both"></div>' . '</div>';
    if ($has_session_value) {
        $output .= '<div class="var-row' . ($odd_row ? ' odd' : ' even') . '">' . '<div class="var-name session">(' . __('Session value') . ')</div>' . '<div class="var-value value">&nbsp;' . formatVariable($name, $serverVarsSession[$name]) . '</div>' . '<div style="clear:both"></div>' . '</div>';
    }
    $odd_row = !$odd_row;
}
$output .= '</div>';
$response->addHtml($output);
/**
 * Format Variable
 *
 * @param string  $name  variable name
 * @param numeric $value variable value
 *
 * @return formatted string
 */
开发者ID:yxwzaxns,项目名称:sakura,代码行数:31,代码来源:server_variables.php

示例10: PMA_ServerStatusData

$scripts->addFile('jqplot/plugins/jqplot.cursor.js');
$scripts->addFile('jqplot/plugins/jqplot.byteFormatter.js');
$scripts->addFile('server_status_monitor.js');
$scripts->addFile('server_status_sorter.js');
/**
 * start output
 */
$ServerStatusData = new PMA_ServerStatusData();
/**
 * Define some data needed on the client side
 */
$input = '<input type="hidden" name="%s" value="%s" />';
$form = '<form id="js_data" class="hide">';
$form .= sprintf($input, 'server_time', microtime(true) * 1000);
$form .= sprintf($input, 'server_os', PHP_OS);
$form .= sprintf($input, 'is_superuser', PMA_isSuperuser());
$form .= sprintf($input, 'server_db_isLocal', $ServerStatusData->db_isLocal);
$form .= '</form>';
/**
 * Define some links used on client side
 */
$links = '<div id="profiling_docu" class="hide">';
$links .= PMA_Util::showMySQLDocu('general-thread-states', 'general-thread-states');
$links .= '</div>';
$links .= '<div id="explain_docu" class="hide">';
$links .= PMA_Util::showMySQLDocu('explain-output', 'explain-output');
$links .= '</div>';
/**
 * Output
 */
$response->addHTML('<div>');
开发者ID:fanscky,项目名称:HTPMS,代码行数:31,代码来源:server_status_monitor.php


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