make use of PMA_Message
This commit is contained in:
@@ -64,7 +64,7 @@ if (strlen($db) && (! empty($db_rename) || ! empty($db_copy))) {
|
|||||||
$local_query .= ';';
|
$local_query .= ';';
|
||||||
$sql_query = $local_query;
|
$sql_query = $local_query;
|
||||||
PMA_DBI_query($local_query);
|
PMA_DBI_query($local_query);
|
||||||
|
|
||||||
// rebuild the database list because PMA_Table::moveCopy
|
// rebuild the database list because PMA_Table::moveCopy
|
||||||
// checks in this list if the target db exists
|
// checks in this list if the target db exists
|
||||||
$GLOBALS['PMA_List_Database']->build();
|
$GLOBALS['PMA_List_Database']->build();
|
||||||
@@ -398,14 +398,14 @@ if (!$is_information_schema) {
|
|||||||
|
|
||||||
if ($num_tables > 0
|
if ($num_tables > 0
|
||||||
&& !$cfgRelation['allworks'] && $cfg['PmaNoRelation_DisableWarning'] == false) {
|
&& !$cfgRelation['allworks'] && $cfg['PmaNoRelation_DisableWarning'] == false) {
|
||||||
|
$message = PMA_Message::notice('strRelationNotWorking');
|
||||||
|
$message->addParam('<a href="' . $cfg['PmaAbsoluteUri'] . 'chk_rel.php?' . $url_query . '">');
|
||||||
|
$message->addParam('</a>');
|
||||||
/* Show error if user has configured something, notice elsewhere */
|
/* Show error if user has configured something, notice elsewhere */
|
||||||
if (!empty($cfg['Servers'][$server]['pmadb'])) {
|
if (!empty($cfg['Servers'][$server]['pmadb'])) {
|
||||||
echo '<div class="error"><h1>' . $strError . '</h1>';
|
$message->isError(true);
|
||||||
} else {
|
|
||||||
echo '<div class="notice">';
|
|
||||||
}
|
}
|
||||||
printf($strRelationNotWorking, '<a href="' . $cfg['PmaAbsoluteUri'] . 'chk_rel.php?' . $url_query . '">', '</a>');
|
$message->display();
|
||||||
echo '</div>';
|
|
||||||
} // end if
|
} // end if
|
||||||
} // end if (!$is_information_schema)
|
} // end if (!$is_information_schema)
|
||||||
|
|
||||||
|
@@ -49,10 +49,7 @@ if (!$cfg['ShowChgPassword']) {
|
|||||||
}
|
}
|
||||||
if ($cfg['Server']['auth_type'] == 'config' || !$cfg['ShowChgPassword']) {
|
if ($cfg['Server']['auth_type'] == 'config' || !$cfg['ShowChgPassword']) {
|
||||||
require_once './libraries/header.inc.php';
|
require_once './libraries/header.inc.php';
|
||||||
echo '<div class="error">' . "\n";
|
PMA_Message::error('strNoRights')->display();
|
||||||
echo '<h1>' . $GLOBALS['strError'] . '</h1>' . "\n";
|
|
||||||
echo PMA_sanitize($strNoRights);
|
|
||||||
echo '</div>';
|
|
||||||
require_once './libraries/footer.inc.php';
|
require_once './libraries/footer.inc.php';
|
||||||
} // end if
|
} // end if
|
||||||
|
|
||||||
@@ -63,19 +60,21 @@ if ($cfg['Server']['auth_type'] == 'config' || !$cfg['ShowChgPassword']) {
|
|||||||
*/
|
*/
|
||||||
if (isset($_REQUEST['nopass'])) {
|
if (isset($_REQUEST['nopass'])) {
|
||||||
// similar logic in server_privileges.php
|
// similar logic in server_privileges.php
|
||||||
$error_msg = '';
|
$_error = false;
|
||||||
|
|
||||||
if ($_REQUEST['nopass'] == '1') {
|
if ($_REQUEST['nopass'] == '1') {
|
||||||
$password = '';
|
$password = '';
|
||||||
} elseif (empty($_REQUEST['pma_pw']) || empty($_REQUEST['pma_pw2'])) {
|
} elseif (empty($_REQUEST['pma_pw']) || empty($_REQUEST['pma_pw2'])) {
|
||||||
$error_msg = $strPasswordEmpty;
|
$message = PMA_Message::error('strPasswordEmpty');
|
||||||
|
$_error = true;
|
||||||
} elseif ($_REQUEST['pma_pw'] != $_REQUEST['pma_pw2']) {
|
} elseif ($_REQUEST['pma_pw'] != $_REQUEST['pma_pw2']) {
|
||||||
$error_msg = $strPasswordNotSame;
|
$message = PMA_Message::error('strPasswordNotSame');
|
||||||
|
$_error = true;
|
||||||
} else {
|
} else {
|
||||||
$password = $_REQUEST['pma_pw'];
|
$password = $_REQUEST['pma_pw'];
|
||||||
}
|
}
|
||||||
|
|
||||||
if (empty($error_msg)) {
|
if (! $_error) {
|
||||||
|
|
||||||
// Defines the url to return to in case of error in the sql statement
|
// Defines the url to return to in case of error in the sql statement
|
||||||
$_url_params = array();
|
$_url_params = array();
|
||||||
@@ -128,11 +127,8 @@ require_once './libraries/header.inc.php';
|
|||||||
echo '<h1>' . $strChangePassword . '</h1>' . "\n\n";
|
echo '<h1>' . $strChangePassword . '</h1>' . "\n\n";
|
||||||
|
|
||||||
// Displays an error message if required
|
// Displays an error message if required
|
||||||
if (!empty($error_msg)) {
|
if (isset($message)) {
|
||||||
echo '<div class="error">' . "\n";
|
$message->display();
|
||||||
echo '<h1>' . $GLOBALS['strError'] . '</h1>' . "\n";
|
|
||||||
echo PMA_sanitize($error_msg);
|
|
||||||
echo '</div>';
|
|
||||||
}
|
}
|
||||||
|
|
||||||
require_once './libraries/display_change_password.lib.php';
|
require_once './libraries/display_change_password.lib.php';
|
||||||
|
Reference in New Issue
Block a user