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


PHP PMA_getDataForDBInfo函数代码示例

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


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

示例1: __

$strPrivDescReplClient = __('Allows the user to ask where the slaves / masters are.');
$strPrivDescReplSlave = __('Needed for the replication slaves.');
$strPrivDescSelect = __('Allows reading data.');
$strPrivDescShowDb = __('Gives access to the complete list of databases.');
$strPrivDescShowView = __('Allows performing SHOW CREATE VIEW queries.');
$strPrivDescShutdown = __('Allows shutting down the server.');
$strPrivDescSuper = __('Allows connecting, even if maximum number of connections is reached; ' . 'required for most administrative operations like setting global variables ' . 'or killing threads of other users.');
$strPrivDescTrigger = __('Allows creating and dropping triggers.');
$strPrivDescUpdate = __('Allows changing data.');
$strPrivDescUsage = __('No privileges.');
$_add_user_error = false;
/**
 * Get DB information: username, hostname, dbname,
 * tablename, db_and_table, dbname_is_wildcard
 */
list($username, $hostname, $dbname, $tablename, $db_and_table, $dbname_is_wildcard) = PMA_getDataForDBInfo();
/**
 * Checks if the user is allowed to do what he tries to...
 */
if (!$GLOBALS['is_superuser'] && !$GLOBALS['is_grantuser'] && !$GLOBALS['is_createuser']) {
    $response->addHTML(PMA_getHtmlForSubPageHeader('privileges', '', false));
    $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);
开发者ID:xtreme-jamil-shamy,项目名称:phpmyadmin-cf,代码行数:31,代码来源:server_privileges.php

示例2: testPMAGetDataForDBInfo

 /**
  * Test for PMA_getDataForDBInfo
  *
  * @return void
  */
 public function testPMAGetDataForDBInfo()
 {
     $_REQUEST['username'] = "PMA_username";
     $_REQUEST['hostname'] = "PMA_hostname";
     $_REQUEST['tablename'] = "PMA_tablename";
     $_REQUEST['dbname'] = "PMA_dbname";
     list($username, $hostname, $dbname, $tablename, $routinename, $db_and_table, $dbname_is_wildcard) = PMA_getDataForDBInfo();
     $this->assertEquals("PMA_username", $username);
     $this->assertEquals("PMA_hostname", $hostname);
     $this->assertEquals("PMA_dbname", $dbname);
     $this->assertEquals("PMA_tablename", $tablename);
     $this->assertEquals("`PMA_dbname`.`PMA_tablename`", $db_and_table);
     $this->assertEquals(true, $dbname_is_wildcard);
     //pre variable have been defined
     $_REQUEST['pred_tablename'] = "PMA_pred__tablename";
     $_REQUEST['pred_dbname'] = array("PMA_pred_dbname");
     list(, , $dbname, $tablename, $routinename, $db_and_table, $dbname_is_wildcard) = PMA_getDataForDBInfo();
     $this->assertEquals("PMA_pred_dbname", $dbname);
     $this->assertEquals("PMA_pred__tablename", $tablename);
     $this->assertEquals("`PMA_pred_dbname`.`PMA_pred__tablename`", $db_and_table);
     $this->assertEquals(true, $dbname_is_wildcard);
 }
开发者ID:netroby,项目名称:phpmyadmin,代码行数:27,代码来源:PMA_server_privileges_test.php

示例3: __

    . 'required for most administrative operations like setting global variables '
    . 'or killing threads of other users.'
);
$strPrivDescTrigger = __('Allows creating and dropping triggers.');
$strPrivDescUpdate = __('Allows changing data.');
$strPrivDescUsage = __('No privileges.');

$_add_user_error = false;
/**
 * Get DB information: username, hostname, dbname,
 * tablename, db_and_table, dbname_is_wildcard
 */
list(
    $username, $hostname, $dbname, $tablename, $routinename,
    $db_and_table, $dbname_is_wildcard
) = PMA_getDataForDBInfo();

/**
 * Checks if the user is allowed to do what he tries to...
 */
if (!$GLOBALS['is_superuser'] && !$GLOBALS['is_grantuser']
    && !$GLOBALS['is_createuser']
) {
    $response->addHTML(PMA_getHtmlForSubPageHeader('privileges', '', false));
    $response->addHTML(
        PMA\libraries\Message::error(__('No Privileges'))
            ->getDisplay()
    );
    exit;
}
开发者ID:nijel,项目名称:phpmyadmin,代码行数:30,代码来源:server_privileges.php


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