Пример #1
0
        $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_getHtmlForDisplayUserOverviewPage($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');
        }
        $url_dbname = urlencode(str_replace(array('\\_', '\\%'), array('_', '%'), $_REQUEST['dbname']));
        $response->addHTML(PMA_getHtmlForDisplayUserProperties(isset($dbname_is_wildcard) ? $dbname_is_wildcard : '', $url_dbname, $username, $hostname, isset($dbname) ? $dbname : '', isset($tablename) ? $tablename : ''));
    }
}
if (isset($_REQUEST['viewing_mode']) && $_REQUEST['viewing_mode'] == 'server' && $GLOBALS['cfgRelation']['menuswork']) {
    $response->addHTML('</div>');
}
    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...
Пример #3
0
        // 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(
                $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...