本文整理匯總了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);
}