本文整理汇总了PHP中PMA_getHtmlForAddUser函数的典型用法代码示例。如果您正苦于以下问题:PHP PMA_getHtmlForAddUser函数的具体用法?PHP PMA_getHtmlForAddUser怎么用?PHP PMA_getHtmlForAddUser使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了PMA_getHtmlForAddUser函数的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: testPMAGetHtmlForAddUser
/**
* Test for PMA_getHtmlForAddUser
*
* @return void
* @group medium
*/
public function testPMAGetHtmlForAddUser()
{
$dbi_old = $GLOBALS['dbi'];
$dbi = $this->getMockBuilder('PMA\\libraries\\DatabaseInterface')->disableOriginalConstructor()->getMock();
$fields_info = array(array('COLUMN_NAME' => 'Host', 'CHARACTER_MAXIMUM_LENGTH' => 80), array('COLUMN_NAME' => 'User', 'CHARACTER_MAXIMUM_LENGTH' => 40));
$dbi->expects($this->any())->method('fetchResult')->will($this->returnValue($fields_info));
$GLOBALS['dbi'] = $dbi;
$dbname = "pma_dbname";
$html = PMA_getHtmlForAddUser($dbname);
//validate 1: PMA_URL_getHiddenInputs
$this->assertContains(PMA_URL_getHiddenInputs('', ''), $html);
//validate 2: PMA_getHtmlForLoginInformationFields
$this->assertContains(PMA_getHtmlForLoginInformationFields('new'), $html);
//validate 3: Database for user
$this->assertContains(__('Database for user'), $html);
$item = PMA\libraries\Util::getCheckbox('createdb-2', __('Grant all privileges on wildcard name (username\\_%).'), false, false, 'createdb-2');
$this->assertContains($item, $html);
//validate 4: PMA_getHtmlToDisplayPrivilegesTable
$this->assertContains(PMA_getHtmlToDisplayPrivilegesTable('*', '*', false), $html);
//validate 5: button
$this->assertContains(__('Go'), $html);
$GLOBALS['dbi'] = $dbi_old;
}
示例2: list
// export user definition
if (isset($_REQUEST['export']) || isset($_REQUEST['submit_mult']) && $_REQUEST['submit_mult'] == 'export') {
list($title, $export) = PMA_getListForExportUserDefinition(isset($username) ? $username : null, isset($hostname) ? $hostname : null);
unset($username, $hostname, $grants, $one_grant);
$response = PMA_Response::getInstance();
if ($GLOBALS['is_ajax_request']) {
$response->addJSON('message', $export);
$response->addJSON('title', $title);
exit;
} else {
$response->addHTML("<h2>{$title}</h2>{$export}");
}
}
if (isset($_REQUEST['adduser'])) {
// Add user
$response->addHTML(PMA_getHtmlForAddUser(isset($dbname) ? $dbname : ''));
} elseif (isset($_REQUEST['checkprivsdb'])) {
if (isset($_REQUEST['checkprivstable'])) {
// check the privileges for a particular table.
$response->addHTML(PMA_getHtmlForSpecificTablePrivileges($_REQUEST['checkprivsdb'], $_REQUEST['checkprivstable']));
} else {
// check the privileges for a particular database.
$response->addHTML(PMA_getHtmlForSpecificDbPrivileges($_REQUEST['checkprivsdb']));
}
} else {
if (!isset($username)) {
// No username is given --> display the overview
$response->addHTML(PMA_getHtmlForUserOverview($pmaThemeImage, $text_dir));
} else {
// A user was selected -> display the user's properties
// In an Ajax request, prevent cached values from showing
示例3: unset
unset($username, $hostname, $grants, $one_grant);
if ($response->isAjax()) {
$response->addJSON('message', $export);
$response->addJSON('title', $title);
exit;
} else {
$response->addHTML("<h2>$title</h2>$export");
}
}
if (isset($_REQUEST['adduser'])) {
// Add user
$response->addHTML(
PMA_getHtmlForAddUser((isset($dbname) ? $dbname : ''))
);
} elseif (isset($_REQUEST['checkprivsdb'])) {
if (isset($_REQUEST['checkprivstable'])) {
// check the privileges for a particular table.
$response->addHTML(
PMA_getHtmlForSpecificTablePrivileges(
$_REQUEST['checkprivsdb'], $_REQUEST['checkprivstable']
)
);
} else {
// check the privileges for a particular database.
$response->addHTML(
PMA_getHtmlForSpecificDbPrivileges($_REQUEST['checkprivsdb'])
);
}
示例4: header
header('Cache-Control: no-cache');
}
$url_dbname = urlencode(
str_replace(
array('\_', '\%'),
array('_', '%'), $_REQUEST['dbname']
)
);
$response->addHTML(
PMA_getHtmlForDisplayUserProperties(
$dbname_is_wildcard, $url_dbname, $random_n,
$username, $hostname, $link_edit, $link_revoke,
(isset($dbename) ? $dbname : ''),
(isset($tablename) ? $tablename : '')
)
);
}
} elseif (isset($_REQUEST['adduser'])) {
// Add user
$response->addHTML(
PMA_getHtmlForAddUser($random_n, $dbname)
);
} else {
// check the privileges for a particular database.
$response->addHTML(
PMA_getHtmlForSpecificDbPrivileges($link_edit, $conditional_class)
);
} // end if (empty($_REQUEST['adduser']) && empty($checkprivs))... elseif... else...
?>
示例5: testPMAGetHtmlForAddUser
/**
* Test for PMA_getHtmlForAddUser
*
* @return void
*/
public function testPMAGetHtmlForAddUser()
{
$dbi_old = $GLOBALS['dbi'];
$dbi = $this->getMockBuilder('PMA_DatabaseInterface')
->disableOriginalConstructor()
->getMock();
$fields_info = array(
"Host" => array(
"Field" => "host",
"Type" => "char(60)",
"Null" => "NO",
)
);
$dbi->expects($this->any())->method('getColumns')
->will($this->returnValue($fields_info));
$GLOBALS['dbi'] = $dbi;
$dbname = "pma_dbname";
$html = PMA_getHtmlForAddUser($dbname);
//validate 1: PMA_URL_getHiddenInputs
$this->assertContains(
PMA_URL_getHiddenInputs('', ''),
$html
);
//validate 2: PMA_getHtmlForDisplayLoginInformationFields
$this->assertContains(
PMA_getHtmlForDisplayLoginInformationFields('new'),
$html
);
//validate 3: Database for user
$this->assertContains(
__('Database for user'),
$html
);
$item = PMA_Util::getCheckbox(
'createdb-2',
__('Grant all privileges on wildcard name (username\\_%).'),
false, false
);
$this->assertContains(
$item,
$html
);
//validate 4: PMA_getHtmlToDisplayPrivilegesTable
$this->assertContains(
PMA_getHtmlToDisplayPrivilegesTable('*', '*', false),
$html
);
//validate 5: button
$this->assertContains(
__('Go'),
$html
);
$GLOBALS['dbi'] = $dbi_old;
}
示例6: urlencode
}
$url_dbname = urlencode(
str_replace(
array('\_', '\%'),
array('_', '%'), $_REQUEST['dbname']
)
);
$response->addHTML(
PMA_getHtmlForDisplayUserProperties(
((isset ($dbname_is_wildcard)) ? $dbname_is_wildcard : ''),
$url_dbname, $random_n,
$username, $hostname, $link_edit, $link_revoke,
(isset($dbname) ? $dbname : ''),
(isset($tablename) ? $tablename : '')
)
);
}
} elseif (isset($_REQUEST['adduser'])) {
// Add user
$response->addHTML(
PMA_getHtmlForAddUser($random_n, (isset($dbname) ? $dbname : ''))
);
} else {
// check the privileges for a particular database.
$response->addHTML(
PMA_getHtmlForSpecificDbPrivileges($link_edit, $conditional_class)
);
} // end if (empty($_REQUEST['adduser']) && empty($checkprivs))... elseif... else...
?>