$message->addParam('[em]some string[/em]');
/** * Get HTML snippet for display user overview page * * @param string $pmaThemeImage a image source link * @param string $text_dir text directory * * @return string $html_output */ function PMA_getHtmlForUserOverview($pmaThemeImage, $text_dir) { $html_output = '<h2>' . "\n" . Util::getIcon('b_usrlist.png') . __('User accounts overview') . "\n" . '</h2>' . "\n"; $password_column = 'Password'; if (Util::getServerType() == 'MySQL' && PMA_MYSQL_INT_VERSION >= 50706) { $password_column = 'authentication_string'; } // $sql_query is for the initial-filtered, // $sql_query_all is for counting the total no. of users $sql_query = $sql_query_all = 'SELECT *,' . " IF(`" . $password_column . "` = _latin1 '', 'N', 'Y') AS 'Password'" . ' FROM `mysql`.`user`'; $sql_query .= isset($_REQUEST['initial']) ? PMA_rangeOfUsers($_REQUEST['initial']) : ''; $sql_query .= ' ORDER BY `User` ASC, `Host` ASC;'; $sql_query_all .= ' ;'; $res = $GLOBALS['dbi']->tryQuery($sql_query, null, PMA\libraries\DatabaseInterface::QUERY_STORE); $res_all = $GLOBALS['dbi']->tryQuery($sql_query_all, null, PMA\libraries\DatabaseInterface::QUERY_STORE); if (!$res) { // the query failed! This may have two reasons: // - the user does not have enough privileges // - the privilege tables use a structure of an earlier version. // so let's try a more simple query $GLOBALS['dbi']->freeResult($res); $GLOBALS['dbi']->freeResult($res_all); $sql_query = 'SELECT * FROM `mysql`.`user`'; $res = $GLOBALS['dbi']->tryQuery($sql_query, null, PMA\libraries\DatabaseInterface::QUERY_STORE); if (!$res) { $html_output .= PMA_getHtmlForViewUsersError(); $html_output .= PMA_getAddUserHtmlFieldset(); } else { // This message is hardcoded because I will replace it by // a automatic repair feature soon. $raw = 'Your privilege table structure seems to be older than' . ' this MySQL version!<br />' . 'Please run the <code>mysql_upgrade</code> command' . '(<code>mysql_fix_privilege_tables</code> on older systems)' . ' that should be included in your MySQL server distribution' . ' to solve this problem!'; $html_output .= Message::rawError($raw)->getDisplay(); } $GLOBALS['dbi']->freeResult($res); } else { $db_rights = PMA_getDbRightsForUserOverview(); // for all initials, even non A-Z $array_initials = array(); foreach ($db_rights as $right) { foreach ($right as $account) { if (empty($account['User']) && $account['Host'] == 'localhost') { $html_output .= Message::notice(__('A user account allowing any user from localhost to ' . 'connect is present. This will prevent other users ' . 'from connecting if the host part of their account ' . 'allows a connection from any (%) host.') . Util::showMySQLDocu('problems-connecting'))->getDisplay(); break 2; } } } /** * Displays the initials * Also not necessary if there is less than 20 privileges */ if ($GLOBALS['dbi']->numRows($res_all) > 20) { $html_output .= PMA_getHtmlForInitials($array_initials); } /** * Display the user overview * (if less than 50 users, display them immediately) */ if (isset($_REQUEST['initial']) || isset($_REQUEST['showall']) || $GLOBALS['dbi']->numRows($res) < 50) { $html_output .= PMA_getUsersOverview($res, $db_rights, $pmaThemeImage, $text_dir); } else { $html_output .= PMA_getAddUserHtmlFieldset(); } // end if (display overview) if (!$GLOBALS['is_ajax_request'] || !empty($_REQUEST['ajax_page_request'])) { if (isset($GLOBALS['flush_priv']) && $GLOBALS['flush_priv']) { $flushnote = new Message(__('Note: phpMyAdmin gets the users\' privileges directly ' . 'from MySQL\'s privilege tables. The content of these ' . 'tables may differ from the privileges the server uses, ' . 'if they have been changed manually. In this case, ' . 'you should %sreload the privileges%s before you continue.'), Message::NOTICE); $flushLink = '<a href="server_privileges.php' . PMA_URL_getCommon(array('flush_privileges' => 1)) . '" id="reload_privileges_anchor">'; $flushnote->addParam($flushLink, false); $flushnote->addParam('</a>', false); } else { $flushnote = new Message(__('Note: phpMyAdmin gets the users\' privileges directly ' . 'from MySQL\'s privilege tables. The content of these ' . 'tables may differ from the privileges the server uses, ' . 'if they have been changed manually. In this case, ' . 'the privileges have to be reloaded but currently, you ' . 'don\'t have the RELOAD privilege.') . Util::showMySQLDocu('privileges-provided', false, 'priv_reload'), Message::NOTICE); } $html_output .= $flushnote->getDisplay(); } } return $html_output; }
/** * Prints Html For Export Options * * @param String $export_type Selected Export Type * * @return string */ function PMA_getHtmlForExportOptionsOutputFormat($export_type) { $html = '<li>'; $html .= '<label for="filename_template" class="desc">'; $html .= __('File name template:'); $trans = new Message(); $trans->addText(__('@SERVER@ will become the server name')); if ($export_type == 'database' || $export_type == 'table') { $trans->addText(__(', @DATABASE@ will become the database name')); if ($export_type == 'table') { $trans->addText(__(', @TABLE@ will become the table name')); } } $msg = new Message(__('This value is interpreted using %1$sstrftime%2$s, ' . 'so you can use time formatting strings. ' . 'Additionally the following transformations will happen: %3$s. ' . 'Other text will be kept as is. See the %4$sFAQ%5$s for details.')); $msg->addParamHtml('<a href="' . PMA_linkURL(PMA_getPHPDocLink('function.strftime.php')) . '" target="documentation" title="' . __('Documentation') . '">'); $msg->addParamHtml('</a>'); $msg->addParam($trans); $doc_url = PMA\libraries\Util::getDocuLink('faq', 'faq6-27'); $msg->addParamHtml('<a href="' . $doc_url . '" target="documentation">'); $msg->addParamHtml('</a>'); $html .= PMA\libraries\Util::showHint($msg); $html .= '</label>'; $html .= '<input type="text" name="filename_template" id="filename_template" '; $html .= ' value="'; if (isset($_GET['filename_template'])) { $html .= htmlspecialchars($_GET['filename_template']); } else { if ($export_type == 'database') { $html .= htmlspecialchars($GLOBALS['PMA_Config']->getUserValue('pma_db_filename_template', $GLOBALS['cfg']['Export']['file_template_database'])); } elseif ($export_type == 'table') { $html .= htmlspecialchars($GLOBALS['PMA_Config']->getUserValue('pma_table_filename_template', $GLOBALS['cfg']['Export']['file_template_table'])); } else { $html .= htmlspecialchars($GLOBALS['PMA_Config']->getUserValue('pma_server_filename_template', $GLOBALS['cfg']['Export']['file_template_server'])); } } $html .= '"'; $html .= '/>'; $html .= '<input type="checkbox" name="remember_template" '; $html .= 'id="checkbox_remember_template" '; $html .= PMA_exportCheckboxCheck('remember_file_template'); $html .= '/>'; $html .= '<label for="checkbox_remember_template">'; $html .= __('use this for future exports'); $html .= '</label>'; $html .= '</li>'; return $html; }