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


PHP PMA_getGrants函数代码示例

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


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

示例1: __

        $title = __('Privileges');
        foreach ($_REQUEST['selected_usr'] as $export_user) {
            $export_username = substr($export_user, 0, strpos($export_user, '&'));
            $export_hostname = substr($export_user, strrpos($export_user, ';') + 1);
            $response .= '# '
                . sprintf(
                    __('Privileges for %s'),
                    '`' . htmlspecialchars($export_username) . '`@`' . htmlspecialchars($export_hostname) . '`'
                )
                . "\n\n";
            $response .= PMA_getGrants($export_username, $export_hostname) . "\n";
        }
    } else {
        // export privileges for a single user
        $title = __('User') . ' `' . htmlspecialchars($username) . '`@`' . htmlspecialchars($hostname) . '`';
        $response .= PMA_getGrants($username, $hostname);
    }
    // remove trailing whitespace
    $response = trim($response);

    $response .= '</textarea>';
    unset($username, $hostname, $grants, $one_grant);
    if ($GLOBALS['is_ajax_request']) {
        PMA_ajaxResponse($response, 1, array('title' => $title));
    } else {
        echo "<h2>$title</h2>$response";
    }
}

if (empty($_REQUEST['adduser']) && (! isset($checkprivs) || ! strlen($checkprivs))) {
    if (! isset($username)) {
开发者ID:nicokaiser,项目名称:phpmyadmin,代码行数:31,代码来源:server_privileges.php

示例2: PMA_getListForExportUserDefinition

/**
 * Get title and textarea for export user definition in Privileges
 *
 * @param string $username username
 * @param string $hostname host name
 *
 * @return array ($title, $export)
 */
function PMA_getListForExportUserDefinition($username, $hostname)
{
    $export = '<textarea class="export" cols="60" rows="15">';
    if (isset($_REQUEST['selected_usr'])) {
        // export privileges for selected users
        $title = __('Privileges');
        foreach ($_REQUEST['selected_usr'] as $export_user) {
            $export_username = mb_substr($export_user, 0, mb_strpos($export_user, '&'));
            $export_hostname = mb_substr($export_user, mb_strrpos($export_user, ';') + 1);
            $export .= '# ' . sprintf(__('Privileges for %s'), '`' . htmlspecialchars($export_username) . '`@`' . htmlspecialchars($export_hostname) . '`') . "\n\n";
            $export .= PMA_getGrants($export_username, $export_hostname) . "\n";
        }
    } else {
        // export privileges for a single user
        $title = __('User') . ' `' . htmlspecialchars($username) . '`@`' . htmlspecialchars($hostname) . '`';
        $export .= PMA_getGrants($username, $hostname);
    }
    // remove trailing whitespace
    $export = trim($export);
    $export .= '</textarea>';
    return array($title, $export);
}
开发者ID:siddhantsomani,项目名称:phpmyadmin,代码行数:30,代码来源:server_privileges.lib.php

示例3: PMA_getListForExportUserDefinition

/**
 * Get title and textarea for export user definition in Privileges
 *
 * @param string $username username
 * @param string $hostname host name
 *
 * @return array ($title, $export)
 */
function PMA_getListForExportUserDefinition($username, $hostname)
{
    $export = '<textarea class="export" cols="' . $GLOBALS['cfg']['TextareaCols'] . '" rows="' . $GLOBALS['cfg']['TextareaRows'] . '">';
    if (isset($_REQUEST['selected_usr'])) {
        // export privileges for selected users
        $title = __('Privileges');
        /** @var PMA_String $pmaString */
        $pmaString = $GLOBALS['PMA_String'];
        foreach ($_REQUEST['selected_usr'] as $export_user) {
            $export_username = $pmaString->substr($export_user, 0, $pmaString->strpos($export_user, '&'));
            $export_hostname = $pmaString->substr($export_user, $pmaString->strrpos($export_user, ';') + 1);
            $export .= '# ' . sprintf(__('Privileges for %s'), '`' . htmlspecialchars($export_username) . '`@`' . htmlspecialchars($export_hostname) . '`') . "\n\n";
            $export .= PMA_getGrants($export_username, $export_hostname) . "\n";
        }
    } else {
        // export privileges for a single user
        $title = __('User') . ' `' . htmlspecialchars($username) . '`@`' . htmlspecialchars($hostname) . '`';
        $export .= PMA_getGrants($username, $hostname);
    }
    // remove trailing whitespace
    $export = trim($export);
    $export .= '</textarea>';
    return array($title, $export);
}
开发者ID:FilipeRamosFernandes,项目名称:phpmyadmin,代码行数:32,代码来源:server_privileges.lib.php


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