本文整理汇总了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)) {
示例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);
}
示例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);
}