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


PHP PMA_getHtmlForAddUser函数代码示例

本文整理汇总了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;
 }
开发者ID:netroby,项目名称:phpmyadmin,代码行数:29,代码来源:PMA_server_privileges_test.php

示例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
开发者ID:xtreme-jamil-shamy,项目名称:phpmyadmin-cf,代码行数:31,代码来源:server_privileges.php

示例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'])
        );
    }
开发者ID:nijel,项目名称:phpmyadmin,代码行数:30,代码来源:server_privileges.php

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

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

示例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;
    }
开发者ID:roccivic,项目名称:phpmyadmin,代码行数:69,代码来源:PMA_server_privileges_test.php

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

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


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