本文整理汇总了PHP中PMA_getDataForChangeOrCopyUser函数的典型用法代码示例。如果您正苦于以下问题:PHP PMA_getDataForChangeOrCopyUser函数的具体用法?PHP PMA_getDataForChangeOrCopyUser怎么用?PHP PMA_getDataForChangeOrCopyUser使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了PMA_getDataForChangeOrCopyUser函数的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: testPMAGetDataForChangeOrCopyUser
/**
* Test for PMA_getDataForChangeOrCopyUser
*
* @return void
*/
public function testPMAGetDataForChangeOrCopyUser()
{
//$_REQUEST['change_copy'] not set
list($queries, $password) = PMA_getDataForChangeOrCopyUser();
$this->assertEquals(null, $queries);
$this->assertEquals(null, $queries);
//$_REQUEST['change_copy'] is set
$_REQUEST['change_copy'] = true;
$_REQUEST['old_username'] = 'PMA_old_username';
$_REQUEST['old_hostname'] = 'PMA_old_hostname';
list($queries, $password) = PMA_getDataForChangeOrCopyUser();
$this->assertEquals('pma_password', $password);
$this->assertEquals(array(), $queries);
unset($_REQUEST['change_copy']);
}
示例2: list
$response->addHTML(PMA_Message::error(__('No Privileges'))->getDisplay());
exit;
}
/**
* Checks if the user is using "Change Login Information / Copy User" dialog
* only to update the password
*/
if (isset($_REQUEST['change_copy']) && $username == $_REQUEST['old_username'] && $hostname == $_REQUEST['old_hostname']) {
$response->addHTML(PMA_Message::error(__('Username and hostname didn\'t change.'))->getDisplay());
$response->isSuccess(false);
exit;
}
/**
* Changes / copies a user, part I
*/
list($queries, $password) = PMA_getDataForChangeOrCopyUser();
/**
* Adds a user
* (Changes / copies a user, part II)
*/
list($ret_message, $ret_queries, $queries_for_display, $sql_query, $_add_user_error) = PMA_addUser(isset($dbname) ? $dbname : null, isset($username) ? $username : null, isset($hostname) ? $hostname : null, isset($password) ? $password : null, $cfgRelation['menuswork']);
//update the old variables
if (isset($ret_queries)) {
$queries = $ret_queries;
unset($ret_queries);
}
if (isset($ret_message)) {
$message = $ret_message;
unset($ret_message);
}
/**