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


PHP PMA_getHtmlForSpecificDbPrivileges函数代码示例

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


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

示例1: testPMAGetHtmlForSpecificDbPrivileges

 /**
  * Test for PMA_getHtmlForSpecificDbPrivileges
  *
  * @return void
  */
 public function testPMAGetHtmlForSpecificDbPrivileges()
 {
     $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;
     $db = "pma_dbname";
     $html = PMA_getHtmlForSpecificDbPrivileges($db);
     //validate 1: PMA_URL_getCommon
     $this->assertContains(PMA_URL_getCommon(array('db' => $db)), $html);
     //validate 2: htmlspecialchars
     $this->assertContains(htmlspecialchars($db), $html);
     //validate 3: items
     $this->assertContains(__('User'), $html);
     $this->assertContains(__('Host'), $html);
     $this->assertContains(__('Type'), $html);
     $this->assertContains(__('Privileges'), $html);
     $this->assertContains(__('Grant'), $html);
     $this->assertContains(__('Action'), $html);
     //_pgettext('Create new user', 'New')
     $this->assertContains(_pgettext('Create new user', 'New'), $html);
     $this->assertContains(PMA_URL_getCommon(array('checkprivsdb' => $db)), $html);
     $GLOBALS['dbi'] = $dbi_old;
 }
开发者ID:netroby,项目名称:phpmyadmin,代码行数:30,代码来源:PMA_server_privileges_test.php

示例2: elseif

        $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
        if ($GLOBALS['is_ajax_request'] == true) {
            header('Cache-Control: no-cache');
        }
        if (isset($dbname) && !is_array($dbname)) {
            $url_dbname = urlencode(str_replace(array('\\_', '\\%'), array('_', '%'), $_REQUEST['dbname']));
        }
        $response->addHTML(PMA_getHtmlForUserProperties(isset($dbname_is_wildcard) ? $dbname_is_wildcard : '', isset($url_dbname) ? $url_dbname : '', $username, $hostname, isset($dbname) ? $dbname : '', isset($tablename) ? $tablename : ''));
开发者ID:xtreme-jamil-shamy,项目名称:phpmyadmin-cf,代码行数:31,代码来源:server_privileges.php

示例3: PMA_getHtmlForAddUser

    // 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($dbname) && ! is_array($dbname)) {
        $url_dbname = urlencode(
            str_replace(
                array('\_', '\%'),
                array('_', '%'),
                $_REQUEST['dbname']
            )
        );
    }

    if (! isset($username)) {
        // No username is given --> display the overview
开发者ID:nijel,项目名称:phpmyadmin,代码行数:31,代码来源:server_privileges.php

示例4: unset

    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 (empty($_REQUEST['adduser']) && (!isset($_REQUEST['checkprivs']) || !strlen($_REQUEST['checkprivs']))) {
    if (!isset($username)) {
        // No username is given --> display the overview
        $response->addHTML(PMA_getHtmlForDisplayUserOverviewPage($link_edit, $pmaThemeImage, $text_dir, $conditional_class, $link_export));
    } else {
        // A user was selected -> display the user's properties
        // In an Ajax request, prevent cached values from showing
        if ($GLOBALS['is_ajax_request'] == true) {
            header('Cache-Control: no-cache');
        }
        $url_dbname = urlencode(str_replace(array('\\_', '\\%'), array('_', '%'), $_REQUEST['dbname']));
        $response->addHTML(PMA_getHtmlForDisplayUserProperties(isset($dbname_is_wildcard) ? $dbname_is_wildcard : '', $url_dbname, $username, $hostname, $link_edit, $link_revoke, isset($unescaped_db) ? $unescaped_db : '', isset($tablename) ? $tablename : ''));
    }
} elseif (isset($_REQUEST['adduser'])) {
    // Add user
    $response->addHTML(PMA_getHtmlForAddUser(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...
开发者ID:SashiAsakura,项目名称:AWS_QuikID_website,代码行数:31,代码来源:server_privileges.php

示例5: 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...

?>
开发者ID:rajatsinghal,项目名称:phpmyadmin,代码行数:30,代码来源:server_privileges.php

示例6: testPMAGetHtmlForSpecificDbPrivileges

    /**
     * Test for PMA_getHtmlForSpecificDbPrivileges
     *
     * @return void
     */
    public function testPMAGetHtmlForSpecificDbPrivileges()
    {
        $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;

        $db = "pma_dbname";

        $html = PMA_getHtmlForSpecificDbPrivileges($db);

        //validate 1: PMA_URL_getCommon
        $this->assertContains(
            PMA_URL_getCommon($db),
            $html
        );

        //validate 2: htmlspecialchars
        $this->assertContains(
            htmlspecialchars($db),
            $html
        );

        //validate 3: items
        $this->assertContains(
            __('User'),
            $html
        );
        $this->assertContains(
            __('Host'),
            $html
        );
        $this->assertContains(
            __('Type'),
            $html
        );
        $this->assertContains(
            __('Privileges'),
            $html
        );
        $this->assertContains(
            __('Grant'),
            $html
        );
        $this->assertContains(
            __('Action'),
            $html
        );

        //_pgettext('Create new user', 'New')
        $this->assertContains(
            _pgettext('Create new user', 'New'),
            $html
        );
        $this->assertContains(
            PMA_URL_getCommon(array('checkprivsdb' => $db)),
            $html
        );

        $GLOBALS['dbi'] = $dbi_old;
    }
开发者ID:roccivic,项目名称:phpmyadmin,代码行数:77,代码来源:PMA_server_privileges_test.php


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